{"version":3,"sources":["webpack:///./src/components/EmailImagesSidebar.vue?9b8f","webpack:///./node_modules/mobile-drag-drop/index.min.js","webpack:///./src/components/layout/MprViewerAnnotationDialog.vue?bec5","webpack:///./src/components/ImagePlaceholder.vue?5acf","webpack:///./src/components/hotkeys/HotkeyModal.vue?56c3","webpack:///./src/components/layout/ViewerLayoutSelector.vue?7d4a","webpack:///./src/router/layouts/Viewer.vue?f294","webpack:///./node_modules/cornerstone-math/dist/cornerstoneMath.js","webpack:///./src/components/layout/LayoutGridSelector.vue?97e1","webpack:///./src/router/views/RepositoryReview/ReviewViewer.vue?f490","webpack:///src/router/views/RepositoryReview/ReviewViewer.vue","webpack:///./src/router/views/RepositoryReview/ReviewViewer.vue?8721","webpack:///./src/router/views/RepositoryReview/ReviewViewer.vue","webpack:///./src/components/layout/ViewerAnnotationDialog.vue?1a46","webpack:///./src/components/layout/ViewerNavigation.vue?a32d","webpack:///./node_modules/intro.js/intro.js","webpack:///./src/components/ImageViewer.vue?a578","webpack:///./src/dialogs/AboutOmni.vue?13a4","webpack:///./src/components/HelpMenu.vue?8cee","webpack:///./src/dialogs/AboutOmni.vue?9709","webpack:///src/dialogs/AboutOmni.vue","webpack:///./src/dialogs/AboutOmni.vue?2ea2","webpack:///./src/dialogs/AboutOmni.vue","webpack:///./src/dialogs/AboutCommunity.vue?8f13","webpack:///src/dialogs/AboutCommunity.vue","webpack:///./src/dialogs/AboutCommunity.vue?18b7","webpack:///./src/dialogs/AboutCommunity.vue","webpack:///src/components/HelpMenu.vue","webpack:///./src/components/HelpMenu.vue?c903","webpack:///./src/components/HelpMenu.vue","webpack:///./src/components/Banner.vue?febe","webpack:///src/components/Banner.vue","webpack:///./src/components/Banner.vue?d050","webpack:///./src/components/Banner.vue","webpack:///./src/components/layout/ViewerLayoutSelector.vue?9d43","webpack:///./src/router/layouts/ViewerTour.js","webpack:///./src/router/views/RepositoryReview/ReviewViewer.vue?651b","webpack:///./src/components/CommunityUpsellPromo.vue?11f8","webpack:///src/components/CommunityUpsellPromo.vue","webpack:///./src/components/CommunityUpsellPromo.vue?281b","webpack:///./src/components/CommunityUpsellPromo.vue","webpack:///./src/components/layout/ViewerAnnotationDialog/AstCalibration.vue?509d","webpack:///./node_modules/mobile-drag-drop/scroll-behaviour.js","webpack:///./src/components/view/ViewerReportList.vue?cdee","webpack:///./src/components/layout/ViewerTools.vue?58ac","webpack:///./node_modules/core-js/modules/es.number.max-safe-integer.js","webpack:///./src/components/layout/LayoutGridSelector.vue?810e","webpack:///src/components/layout/LayoutGridSelector.vue","webpack:///./src/components/layout/LayoutGridSelector.vue?76a3","webpack:///./src/components/layout/LayoutGridSelector.vue","webpack:///./src/router/layouts/MprViewerTour.js","webpack:///./src/router/layouts/Viewer.vue?00a2","webpack:///./src/cornerstone/_shared/events.js","webpack:///./src/cornerstone/tools/util/triggerDoneModifying.js","webpack:///./src/cornerstone/tools/_shared/toolSelectedCallback.js","webpack:///./src/cornerstone/tools/util/handles.js","webpack:///./src/cornerstone/manipulators/moveNewHandle.js","webpack:///./src/cornerstone/manipulators/moveHandle.js","webpack:///./src/cornerstone/tools/AstAngle.js","webpack:///./src/cornerstone/tools/astCalibration/calculateLength.js","webpack:///./src/cornerstone/tools/AstCalibration.js","webpack:///./src/cornerstone/tools/AstText.js","webpack:///./src/cornerstone/tools/AstArrowAnnotate.js","webpack:///./src/cornerstone/tools/util/getImagePixelSpacing.ts","webpack:///./src/cornerstone/tools/AstRectangleRoi.js","webpack:///./src/cornerstone/tools/util/getROITextBoxCoords.js","webpack:///./src/cornerstone/tools/AstCircleRoi.js","webpack:///./src/cornerstone/tools/AstEllipticalRoi.js","webpack:///./src/utils/convertToVector3.ts","webpack:///./src/cornerstone/tools/AstCrossPoint.js","webpack:///./src/cornerstone/tools/AstHipDysplasia.js","webpack:///./src/cornerstone/tools/AstLengthAngle.js","webpack:///./src/cornerstone/tools/AstOrientationMarkers.js","webpack:///./src/cornerstone/tools/AstPennHip.js","webpack:///./src/cornerstone/tools/AstProbe.js","webpack:///./src/cornerstone/tools/AstTplo.js","webpack:///./src/cornerstone/tools/AstTta.js","webpack:///./src/cornerstone/manipulators/moveAndRotateHandles.js","webpack:///./src/cornerstone/tools/AstVertebralHeart.js","webpack:///./src/cornerstone/tools/AstEraser.js","webpack:///./src/cornerstone/tools/AstReferenceLines.js","webpack:///./src/cornerstone/tools/AstRotateTool.js","webpack:///./src/cornerstone/tools/index.js","webpack:///./src/mixins/fullscreen.js","webpack:///./src/components/layout/ViewerAnnotationDialog.vue?8fe6","webpack:///./src/components/layout/ViewerAnnotationDialogCheckbox.vue?04be","webpack:///src/components/layout/ViewerAnnotationDialogCheckbox.vue","webpack:///./src/components/layout/ViewerAnnotationDialogCheckbox.vue?9f42","webpack:///./src/components/layout/ViewerAnnotationDialogCheckbox.vue","webpack:///./src/components/layout/ViewerAnnotationDialog/AstCircleRoi.vue?14d7","webpack:///src/components/layout/ViewerAnnotationDialog/AstCircleRoi.vue","webpack:///./src/components/layout/ViewerAnnotationDialog/AstCircleRoi.vue?0b8a","webpack:///./src/components/layout/ViewerAnnotationDialog/AstCircleRoi.vue","webpack:///./src/components/layout/ViewerAnnotationDialog/AstCalibration.vue?1dc9","webpack:///src/components/layout/ViewerAnnotationDialog/AstCalibration.vue","webpack:///./src/components/layout/ViewerAnnotationDialog/AstCalibration.vue?1040","webpack:///./src/components/layout/ViewerAnnotationDialog/AstCalibration.vue","webpack:///./src/components/layout/ViewerAnnotationDialog.vue","webpack:///./src/components/layout/ViewerAnnotationDialog.vue?a80e","webpack:///./src/components/layout/ViewerAnnotationDialog.vue?5b79","webpack:///./src/components/layout/MprViewerAnnotationDialog.vue?2d3f","webpack:///./src/components/layout/ViewerAnnotationDialog/CircleAnnotationDialog.vue?816d","webpack:///src/components/layout/ViewerAnnotationDialog/CircleAnnotationDialog.vue","webpack:///./src/components/layout/ViewerAnnotationDialog/CircleAnnotationDialog.vue?407f","webpack:///./src/components/layout/ViewerAnnotationDialog/CircleAnnotationDialog.vue","webpack:///./src/components/layout/MprViewerAnnotationDialog.vue","webpack:///./src/components/layout/MprViewerAnnotationDialog.vue?b7c4","webpack:///./src/components/layout/MprViewerAnnotationDialog.vue?8332","webpack:///./src/components/hotkeys/HotkeyModal.vue?fc05","webpack:///src/components/hotkeys/HotkeyModal.vue","webpack:///./src/components/hotkeys/HotkeyModal.vue?3d98","webpack:///./src/components/hotkeys/HotkeyModal.vue","webpack:///./src/components/ImagePlaceholder.vue?d950","webpack:///src/components/ImagePlaceholder.vue","webpack:///./src/components/ImagePlaceholder.vue?e57f","webpack:///./src/components/ImagePlaceholder.vue","webpack:///./src/components/ImageViewer.vue?ede9","webpack:///./src/utils/shouldRenderWebGL.js","webpack:///src/components/layout/MprViewerTools.vue","webpack:///src/components/ImageViewer.vue","webpack:///./src/components/ImageViewer.vue?c5aa","webpack:///./src/components/ImageViewer.vue","webpack:///./src/components/layout/MprViewerLayoutSelector.vue?8e7a","webpack:///src/components/layout/MprViewerLayoutSelector.vue","webpack:///./src/components/layout/MprViewerLayoutSelector.vue?82ab","webpack:///./src/components/layout/MprViewerLayoutSelector.vue","webpack:///./src/components/layout/MprViewerTools.vue?4b44","webpack:///./src/components/layout/ViewerToolsMixin.js","webpack:///./src/components/layout/MprViewerTools.vue?54f7","webpack:///./src/components/layout/MprViewerTools.vue","webpack:///./src/components/layout/ViewerLayoutSelector.vue?de73","webpack:///src/components/layout/ViewerLayoutSelector.vue","webpack:///./src/components/layout/ViewerLayoutSelector.vue?3fd6","webpack:///./src/components/layout/ViewerLayoutSelector.vue","webpack:///./src/components/layout/ViewerNavigation.vue?1c63","webpack:///src/components/layout/ViewerNavigation.vue","webpack:///./src/components/layout/ViewerNavigation.vue?858e","webpack:///./src/components/layout/ViewerNavigation.vue","webpack:///./src/components/layout/ViewerStudy.vue?6a05","webpack:///./src/components/view/ViewerThumbnailList.vue?5a52","webpack:///src/components/view/ViewerThumbnailList.vue","webpack:///src/components/layout/ViewerTools.vue","webpack:///./src/components/view/ViewerThumbnailList.vue?ba5d","webpack:///./src/components/view/ViewerThumbnailList.vue","webpack:///./src/components/view/ViewerReportList.vue?6ee4","webpack:///./src/components/view/ViewerReportList.vue","webpack:///./src/components/view/ViewerReportList.vue?1f5f","webpack:///./src/components/view/ViewerReportList.vue?5d6e","webpack:///./src/components/layout/ViewerStudy.vue","webpack:///./src/components/layout/ViewerStudy.vue?1bbb","webpack:///./src/components/layout/ViewerStudy.vue?4ab8","webpack:///./src/components/layout/ViewerTools.vue?2a3a","webpack:///./src/components/layout/ViewerTools.vue?acb0","webpack:///./src/components/layout/ViewerTools.vue","webpack:///./src/components/EmailImagesSidebar.vue?6457","webpack:///src/components/EmailImagesSidebar.vue","webpack:///./src/components/EmailImagesSidebar.vue?d6c9","webpack:///./src/components/EmailImagesSidebar.vue","webpack:///./src/dialogs/MprDisabledDlg.vue?6ab3","webpack:///src/dialogs/MprDisabledDlg.vue","webpack:///./src/dialogs/MprDisabledDlg.vue?50a0","webpack:///./src/dialogs/MprDisabledDlg.vue","webpack:///./src/router/layouts/ViewerCineDialog.js","webpack:///./src/router/layouts/ViewerDragAndDrop.js","webpack:///src/router/layouts/Viewer.vue","webpack:///./src/router/layouts/Viewer.vue?1be8","webpack:///./src/router/layouts/Viewer.vue","webpack:///./src/dialogs/AboutCommunity.vue?6c18","webpack:///./src/components/Banner.vue?5a84","webpack:///./node_modules/hammerjs/hammer.js","webpack:///./src/components/view/ViewerThumbnailList.vue?5455","webpack:///./src/components/PersistentNavigationDrawer.vue?6b7b","webpack:///./src/router/layouts/Viewer.vue?22e9","webpack:///./src/utils/isObject.js","webpack:///./src/utils/debounce.js","webpack:///./src/utils/throttle.js","webpack:///./src/components/PersistentNavigationDrawer.vue?8df1","webpack:///src/components/PersistentNavigationDrawer.vue","webpack:///./src/components/PersistentNavigationDrawer.vue?ec0b","webpack:///./src/components/PersistentNavigationDrawer.vue","webpack:///./src/components/layout/ViewerStudy.vue?c345","webpack:///./src/components/layout/MprViewerLayoutSelector.vue?d082","webpack:///./src/dialogs/MprDisabledDlg.vue?802d"],"names":["a","b","exports","this","dragEvents","document","documentElement","draggable","touchEvents","userAgentSupportingNativeDnD","window","chrome","test","navigator","userAgent","A","Object","keys","forEach","c","defineProperty","get","addEventListener","d","B","forceApply","y","holdToDrag","h","w","e","z","f","J","g","target","getAttribute","parentNode","body","defaultActionOverride","defaultPrevented","passive","i","removeEventListener","j","length","reduce","k","tagName","l","changedTouches","identifier","m","Event","bubbles","cancelable","dataTransfer","relatedTarget","screenX","screenY","clientX","clientY","pageX","pageY","getBoundingClientRect","offsetX","left","offsetY","top","n","touches","push","x","o","nodeType","getComputedStyle","style","setProperty","getPropertyValue","getPropertyPriority","pointerEvents","removeAttribute","hasChildNodes","childNodes","p","cloneNode","position","zIndex","classList","add","G","I","q","E","map","replace","r","parseInt","offsetWidth","offsetHeight","s","visibility","display","H","parseFloat","transitionDuration","isNaN","scrollLeft","scrollTop","marginLeft","marginTop","transitionDelay","Math","round","setTimeout","t","C","D","indexOf","u","F","defaultView","dispatchEvent","remove","v","off","clearTimeout","bind","iterationInterval","prototype","K","dropEffect","L","M","N","dragImageOffset","dragImageCenterOnTouch","width","height","appendChild","O","setInterval","P","R","clearInterval","removeChild","dragStartConditionOverride","preventDefault","dragImageTranslateOverride","type","S","T","elementFromPoint","effectAllowed","contains","U","V","W","freeze","enumerable","configurable","setData","Error","getData","clearData","splice","setDragImage","set","polyfill","value","root","factory","module","modules","installedModules","__webpack_require__","moduleId","call","name","getter","__esModule","object","property","hasOwnProperty","clamp","degToRad","degrees","degreeToRadiansFactor","PI","radToDeg","radians","radianToDegreesFactor","sign","NaN","_quaternion","_quaternion2","_interopRequireDefault","_math","obj","default","Vector3","constructor","setX","setY","setZ","setComponent","index","getComponent","copy","undefined","console","warn","addVectors","addScalar","sub","subVectors","multiply","multiplyVectors","multiplyScalar","scalar","applyAxisAngle","quaternion","axis","angle","applyQuaternion","setFromAxisAngle","applyMatrix3","elements","applyMatrix4","applyProjection","qx","qy","qz","qw","ix","iy","iz","iw","transformDirection","normalize","divide","divideScalar","invScalar","min","max","clampScalar","minVal","maxVal","floor","ceil","roundToZero","negate","dot","lengthSq","sqrt","lengthManhattan","abs","setLength","oldLength","lerp","alpha","cross","crossVectors","ax","ay","az","bx","by","bz","projectOnVector","v1","vector","projectOnPlane","planeNormal","reflect","normal","angleTo","theta","acos","distanceTo","distanceToSquared","dx","dy","dz","setFromMatrixPosition","setFromMatrixScale","sx","sy","sz","setFromMatrixColumn","matrix","offset","me","equals","fromArray","array","toArray","clone","sqr","dist2","distanceToPointSquared","lineSegment","point","l2","start","end","pt","distanceToPoint","intersectLine","lineSegment1","lineSegment2","intersectionPoint","x1","y1","x2","y2","x3","y3","x4","y4","a1","a2","b1","b2","c1","c2","r1","r2","r3","r4","denom","num","Quaternion","halfAngle","sin","cos","multiplyQuaternions","qax","qay","qaz","qaw","qbx","qby","qbz","qbw","setFromRotationMatrix","te","m11","m12","m13","m21","m22","m23","m31","m32","m33","trace","_createClass","defineProperties","props","descriptor","writable","key","Constructor","protoProps","staticProps","_vector","_vector2","_classCallCheck","instance","TypeError","Line3","line","optionalTarget","result","delta","startP","startEnd","clampToLine","startEnd2","startEnd_startP","closestPointToPointParameter","da","db","dc","daCrossDb","dcCrossDb","intersection","distanceTest","distanceSq","Matrix4","n11","n12","n13","n14","n21","n22","n23","n24","n31","n32","n33","n34","n41","n42","n43","n44","Float32Array","makeRotationFromQuaternion","z2","xx","xy","xz","yy","yz","zz","wx","wy","wz","multiplyMatrices","ae","be","a11","a12","a13","a14","a21","a22","a23","a24","a31","a32","a33","a34","a41","a42","a43","a44","b11","b12","b13","b14","b21","b22","b23","b24","b31","b32","b33","b34","b41","b42","b43","b44","getInverse","throwOnInvertible","det","msg","identity","applyToVector3Array","makeTranslation","makeScale","Plane","constant","setComponents","setFromNormalAndCoplanarPoint","setFromCoplanarPoints","v2","plane","inverseNormalLength","distanceToSphere","sphere","center","radius","projectPoint","orthoPoint","perpendicularMagnitude","isIntersectionLine","startSign","endSign","direction","denominator","intersectPlane","targetPlane","origin","intersectionData","h1","h2","n1dotn2","coplanarPoint","translate","pageToPoint","subtract","lhs","rhs","distance","from","to","distanceSquared","insideRect","rect","findClosestPoint","sources","distances","minDistance","source","_lineSegment","_lineSegment2","rectToLineSegments","right","bottom","lineSegments","segment","rectToPoints","rectPoints","topLeft","bottomRight","doesIntersect","rect1","rect2","intersectLeftRight","intersectTopBottom","rect1Points","rect2Points","getIntersectionRect","intersectRect","_Line","_matrix","_plane","_point","_rect","render","this$1","_vm","_h","$createElement","_c","_self","attrs","Back","group","class","icon","action","$router","go","hidden","scopedSlots","_u","fn","staticStyle","_v","staticClass","proxy","staticRenderFns","components","ViewerLayout","AstButton","id","String","required","computed","_objectSpread","mapGetters","isRejected","activeImage","mounted","_this","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","Promise","all","getConsignerStudyViewerVmAsync","getHangingProtocols","getUserViewerSettings","stop","methods","mapActions","openRejection","_this2","_callee2","response","_context2","openPromptDlg","buttonLabel","title","concat","prompt","requireInput","sent","component","introJs","apply","arguments","VERSION","IntroJs","_targetElement","_introItems","_options","nextLabel","prevLabel","skipLabel","doneLabel","hidePrev","hideNext","tooltipPosition","tooltipClass","highlightClass","exitOnEsc","exitOnOverlayClick","showStepNumbers","keyboardNavigation","showButtons","showBullets","showProgress","scrollToElement","scrollTo","scrollPadding","overlayOpacity","positionPrecedence","disableInteraction","helperElementPadding","hintPosition","hintButtonLabel","hintAnimation","buttonClass","_introForElement","targetElm","allIntroSteps","querySelectorAll","introItems","steps","_forEach","step","currentItem","_cloneObject","element","querySelector","floatingElementQuery","createElement","className","elmsLength","currentElement","intro","nextStep","tempIntroItems","sort","_addOverlayLayer","_nextStep","DOMEvent","on","_onKeyDown","_onResize","refresh","code","which","charCode","keyCode","_previousStep","srcElement","match","_currentStep","_introCompleteCallback","_exitIntro","click","returnValue","temp","jQuery","_goToStep","_goToStepNumber","_currentStepNumber","_direction","item","continueStep","_introBeforeChangeCallback","_showElement","_refresh","_setHelperLayerPosition","oldHelperNumberLayer","oldArrowLayer","oldtooltipContainer","_placeTooltip","_reAlignHints","targetElement","force","continueExit","_introBeforeExitCallback","overlayLayers","overlayLayer","opacity","helperLayer","referenceLayer","disableInteractionLayer","floatingElement","_removeShowElement","fixParents","parent","_removeClass","_introExitCallback","tooltipLayer","arrowLayer","helperNumberLayer","hintMode","currentStepObj","tooltipOffset","targetOffset","windowSize","currentTooltipPosition","tooltipLayerStyleLeft","tooltipCssClass","setAttribute","_determineAutoPosition","_getOffset","_getWinSize","_addClass","tooltipLayerStyleRight","_checkLeft","tooltipLayerStyleLeftRight","_checkRight","desiredTooltipPosition","possiblePositions","slice","tooltipHeight","tooltipWidth","targetElementRect","calculatedPosition","_removeEntry","desiredAlignment","pos","hyphenIndex","substr","split","_determineAutoAlignment","offsetLeft","halfTooltipWidth","winWidth","screen","possibleAlignments","calculatedAlignment","stringArray","stringToRemove","elementPosition","widthHeightPadding","_isFixed","cssText","_disableInteraction","_setAnchorAsButton","anchor","tabIndex","_introChangeCallback","nextTooltipButton","prevTooltipButton","skipTooltipButton","scrollParent","self","oldHelperLayer","oldReferenceLayer","oldtooltipLayer","lastIntroItem","_getScrollParent","_scrollParentToElement","_lastShowElementTimer","innerHTML","_getProgress","focus","_scrollTo","tooltipTextLayer","bulletsLayer","progressLayer","buttonsLayer","ulContainer","anchorClick","goToStep","innerLi","anchorLink","onclick","progressBar","_introSkipCallback","_setShowElement","_introAfterChangeCallback","_elementInViewport","winHeight","clientHeight","scrollBy","elms","elm","parentElm","SVGElement","toLowerCase","currentElementPosition","_getPropValue","transform","arr","forEachFnc","completeFnc","len","_stamp","events_key","_id","listener","context","useCapture","handler","event","attachEvent","detachEvent","pre","classes","cls","classNameRegex","propName","propValue","currentStyle","nodeName","innerWidth","innerHeight","clientWidth","el","styleText","toString","_removeHintTooltip","tooltip","_populateHints","hints","hint","_addHints","_alignHintPosition","_hintQuerySelectorAll","selector","hintsWrapper","_hideHint","stepId","_hintCloseCallback","_hideHints","_showHints","_showHint","_removeHints","_removeHint","getHintClick","evt","stopPropagation","cancelBubble","_showHintDialog","hintDot","hintPulse","_hintsAddedCallback","iconWidth","iconHeight","hintElement","_hintClickCallback","removedStep","tooltipWrapper","closeButton","docEl","pageYOffset","pageXOffset","excludeStaticParent","overflowRegex","parentElement","overflow","overflowY","overflowX","offsetTop","currentStep","_mergeOptions","obj1","obj2","attrname","obj3","instances","version","setOption","option","setOptions","options","addStep","addSteps","goToStepNumber","previousStep","exit","onbeforechange","providedCallback","onchange","onafterchange","oncomplete","onhintsadded","onhintclick","onhintclose","onexit","onskip","onbeforeexit","addHints","hideHint","hideHints","showHint","showHints","removeHints","removeHint","showHintDialog","completeList","$event","close","_s","release","browser","os","AboutOmniDlg","DlgHeader","ModalWrapper","AstDataTable","data","config","created","detect","dlg","openAboutOmniDlg","open","AboutCommunityDlg","CommunityUpsellPromo","openAboutCommunityDlg","AstToolbarDropdown","items","Array","clinicAPI","mapState","claims","state","auth","iconName","label","importMachineName","canShow","activeClinicUrl","noAction","command","clinicCode","$store","getters","isAuthenticated","activeClinicCode","$route","query","openReportIssue","_toConsumableArray","isCommunityUser","openReleaseNotes","isRounded","_e","_t","learnMoreLink","learnMore","isClosable","Boolean","isVisible","bannerId","storage","getItem","$emit","setItem","flagKey","tryStartTour","_ref","shouldStartTour","t0","shouldOpenTour","startTour","omniDesktop","isConnected","store","windows","openStudiesInNewWindow","request","initialBodyStyle","getIcon","topNavigation","bottomNavigation","navigationElement","_b","$attrs","Banner","global","isTopLevelEl","getElementViewportOffset","clientLeft","clientTop","bounds","getElementViewportSize","size","getSetElementScroll","scroll","prop","isTopLevel","isScrollable","cs","scrollHeight","scrollWidth","findScrollableParent","determineScrollIntention","currentCoordinate","threshold","determineDynamicVelocity","scrollIntention","isScrollEndReached","scrollBounds","currentScrollOffset","maxScrollOffset","_scrollAnimationFrameId","_currentCoordinates","_hoveredElement","_scrollableParent","_translateDragImageFn","velocityFn","velocity","multiplier","easeInCubic","_scrollIntentions","horizontal","vertical","_dynamicVelocity","handleDragImageTranslateOverride","currentCoordinates","hoveredElement","translateDragImageFn","performScrollAnimation","updateScrollIntentions","scheduleScrollAnimation","cancelAnimationFrame","requestAnimationFrame","scrollAnimation","scrollDiffX","scrollDiffY","scrollableParent","scrollIntentions","dynamicVelocity","scrollableParentBounds","scrollX","scrollY","currentCoordinatesOffset","scrollBehaviourDragImageTranslateOverride","$","stat","nonConfigurable","nonWritable","MAX_SAFE_INTEGER","onHover","_l","row","col","maxColumns","disabled","isCellDisabled","hovered","hover","selected","onSelect","disabledOptions","maxRows","includes","toolbarLocation","toggleDrawer","activeSeries","isRepository","resizeCanvases","mq","medium","isPersistentDrawerOpen","mprActive","navPanelDraggedOver","nativeOn","onNavDrawerDragOver","onNavDrawerDragLeave","onNavDrawerDrop","allowRelatedStudies","isViewerLoading","relatedStudies","study","studyId","studies","isMultiplePatients","ref","canvas","openRelatedMenu","onCanvasDragOver","onCanvasDragEnter","onCanvasDragExit","onCanvasDragLeave","onCanvasDrop","onImageViewerMouseDown","setActiveCanvas","canvasIndex","canvasIsVisible","directives","rawName","dispatch","expression","refInFor","isActiveViewer","activeCanvasIndex","getCanvasSeries","activeStudySeries","findIndex","seriesId","settings","overlayText","isUnmatchedImageView","hideLoadingText","imageView","loadingText","activeCanvas","mprInitialSlice","mprInitialVoi","showBottomNavigation","isCineDialogOpen","showEmailImages","setMprActive","isDesktop","getPrimaryToolbarGroup","btn","hasNotification","settingsConfig","handleLayoutSelected","mprLoadingReason","checkAndLoadMpr","hasActiveSeries","isFullScreen","toggleFullScreen","helpItems","isModalDrawerOpen","commit","openAttachment","isDrawerOpen","saveMprImageAsync","printMprImageAsync","copyMprImageAsync","clearMprActiveAnnotations","mprActions","saveCanvasAsync","printCanvasAsync","copyCanvasAsync","syncClearAnnotations","actions","previewImageUrl","activeDicomTags","dicom","contextMenu","$refs","layoutContainer","switchSeries","isOpen","playClip","pauseClip","onFrameRateChange","goToImage","cineNextSeries","cinePreviousSeries","cinePlayer","hotkeysVisible","toggleHotkeyModal","MEASUREMENT_DONE_MODIFYING","triggerEvent","csTools","triggerDoneModifying","toolName","image","toolType","moveAnnotation","toolSelectedCallback","annotation","interactionType","UP_EVENT","changedEvent","_event$detail","detail","buttons","postClickEvent","toolState","getToolState","eventBus","post","ANNOTATION_CLICK","tool","_radii","mouse","displayRadius","hitRadius","precision","touch","precisionTools","initHandle","handle","coords","hasBoundingBox","pointNearHandle","radii","precisionHandlesEnabled","precisionEnabled","drag","originX","originY","originDragX","originDragY","handleLengthsAreValid","handles","middle","isValid","handleLengthIsValid","handleLengthTolerance","handleCanvas","pixelToCanvas","radiusType","setPrecisionMode","disablePrecisionForInactiveHandles","iteratePrecisionHandles","active","cornerstoneTools","entries","_ref2","_slicedToArray","handleType","handleValue","_typeof","EVENTS","removeToolState","anyHandlesOutsideImage","clipToBox","_moveEvents","MOUSE_MOVE","MOUSE_DRAG","TOUCH_DRAG","_moveEndEvents","MOUSE_UP","MOUSE_CLICK","TOUCH_END","TOUCH_PINCH","TAP","evtDetail","doneMovingCallback","assign","deleteIfHandleOutsideImage","preventHandleOutsideImage","isToolLocked","currentPoints","moveHandler","_moveHandler","moveEndHandler","_moveEndHandler","eventType","TOUCH_START","_stopImmediatePropagation","_evt$detail","page","targetLocation","pageToPixel","invalidated","constrainSquare","distanceDragged","isDifferentDirection","updateImage","MEASUREMENT_MODIFIED","modifiedEventData","measurementData","_evt$detail2","success","stopImmediatePropagation","external","_dragEvents","_upOrEndEvents","TOUCH_DRAG_END","TOUCH_PRESS","dragHandler","_dragHandler","upOrEndHandler","_upOrEndHandler","cornerstone","hasMoved","oppositeHandle","distanceFromOppositeHandle","nearHandle","handlePressed","BaseAnnotationTool","draw","drawHandles","drawJoinedLines","drawLinkedTextBox","getNewContext","setShadow","textBoxWidth","lineSegDistance","_csTools","angleCursor","AstAngle","_BaseAnnotationTool","configuration","defaultConfig","supportedInteractionTypes","shadow","shadowColor","shadowOffsetX","shadowOffsetY","svgCursor","initialConfiguration","_callSuper","_defineProperty","mergeOptions","preventNewMeasurement","_inherits","eventData","visible","color","highlight","textBox","movesIndependently","drawnIndependently","allowedOutsideImage","isMouse","toolData","moveHandle","enabledElement","_this$configuration","handleRadius","drawHandlesOnHover","currentTarget","canvasContext","lineWidth","toolStyle","getToolWidth","_loop","toolColors","getColorIfActive","handleStartCanvas","handleMiddleCanvas","handleOptions","drawHandlesIfActive","columnPixelSpacing","rowPixelSpacing","sideA","sideB","sideC","sideALength","sideBLength","sideCLength","pow","rAngle","formatNumber","textCoords","text","textBoxText","padding","textWidth","internal","getTransform","invert","transformPoint","textBoxAnchorPoints","suffix","str","fromCharCode","_this3","createNewMeasurement","addToolState","doneMovingEndHandleCallback","doneMovingMiddleHandleCallback","doneEvt","_measurementData$hand","moveNewHandle","colPixelSpacing","drawLine","AstCalibration","_eventData$currentPoi","newLength","_event$detail2","imagePlane","metaData","imageId","oldPixelSpacing","calculateLength","asterisImageId","broadcast","VUEX_ACTION","payload","csStore","tools","updateCachedStats","getEnabledElementsByImageId","filter","_event$detail3","toFixed","lineDash","drawTextBox","pointInsideBoundingBox","AstText","getTextCallback","cb","MEASUREMENT_COMPLETED","centering","boundingBox","cornerstoneMath","insideBoundingBox","drawArrow","AstArrowAnnotate","_ArrowAnnotateTool","changeTextCallback","renderDashed","getModule","handleEndCanvas","arrowFirst","textHeight","textStyle","getFontSize","midpoint","ArrowAnnotateTool","getPixelSpacing","isPixelSpacingDefined","rowImagePixelSpacing","colImagePixelSpacing","drawRect","getROITextBoxCoords","AstRectangleRoi","_RectangleRoiTool","showHounsfieldUnits","showMinMax","_getImagePixelSpacing","getImagePixelSpacing","seriesModule","modality","rectOptions","initialRotation","cachedStats","throttledUpdateCachedStats","defaultCoords","viewport","_findTextBoxAnchorPoints","textBoxContent","_createTextBoxContent","unit","_getUnit","RectangleRoiTool","_getRectangleImageCoordinates","startHandle","endHandle","_getRectangleImageCoo","_formatArea","area","hasPixelSpacing","isColorImage","mean","stdDev","meanStdDevSUV","textLines","otherLines","showStats","hasStandardUptakeValues","meanString","stdDevString","SUVtext","meanSuvString","stdDevSuvString","targetStringLength","measureText","minString","maxString","corners","_determineCorners","centerX","centerY","rotation","hflip","vflip","handlesLeftToRight","_compareX","handlesTopToBottom","_compareY","drawEllipse","pointInEllipse","calculateEllipseStatistics","calculateSUV","AstCircleRoi","maxClickDuration","isDragging","_currentPoints$image","startCanvas","endCanvas","minorEllipse","majorEllipse","centerCrossHairs","pointInMinorEllipse","pointInCenter","pointInMajorEllipse","createCircleFromDiameter","_createCircleFromDiameter","upEvent","handleDoneMove","handleDiameter","pixelSpacing","_objectWithoutProperties","_excluded","_drawCenter","_throttledUpdateCachedStats","_updateCachedStats","diameter","_getRadius","_createCircleFromDiameter2","existingCircle","imageBounds","_getImagePixelSpacing2","defaultDiameter","newCircle","_this4","abrupt","parseNumber","defaultValue","t1","CustomEvent","_x","_x2","_x3","_x4","_getImagePixelSpacing3","_excluded2","throttle","circleStatistics","_calculateCircleStatistics","_getCircleImageCoordi","_getCircleImageCoordinates","leftCanvas","topCanvas","widthCanvas","heightCanvas","xCenter","yCenter","plusSize","beginPath","moveTo","lineTo","closePath","stroke","_formatDiameter","circleCoordinates","pixels","getPixels","circleMeanStdDev","count","variance","AstEllipticalRoi","_EllipticalRoiTool","ellipseOptions","EllipticalRoiTool","_getEllipseImageCoord","_getEllipseImageCoordinates","convertToVector3","BaseTool","imagePointToPatientPoint","projectPatientPointToImagePlane","scrollToIndex","AstCrossPoint","_BaseTool","updatePoint","_updatePoint","clearPointsIfNotSynced","_clearPointsIfNotSynced","syncedId","postTouchStartCallback","onStart","touchDragCallback","onDrag","touchEndCallback","onEnd","postMouseDownCallback","mouseDragCallback","mouseUpCallback","mouseMoveCallback","NEW_IMAGE","setToolDisabled","enabledElements","isEnabled","hasLoadedImage","clearToolState","waitForElementToBeEnabled","waitForEnabledElementImageToLoad","_drawCrosshairs","consumeEvent","getActiveColor","sourceElement","sourceEnabledElement","getEnabledElement","sourceImageId","sourceImagePlane","rowCosines","columnCosines","imagePositionPatient","frameOfReferenceUID","sourceImagePoint","sourcePatientPoint","stackToolDataSource","isMissingStackData","seriesStack","bestImageIdIndex","targetTool","targetMeta","crossPoint","errorLoadingHandler","_imageId","_findBestImageIdIndex","imageIds","find","loadHandlerManager","getErrorLoadingHandler","_this5","sourceFrameOfReference","newImageIdIndex","Number","MAX_VALUE","sliceThickness","isLocalizerImage","imagePosition","column","targetPlanePosition","sourcePointPlanePosition","tolerance","drawCircle","AstHipDysplasia","defaultAngle","disabledCallback","_clearIncompleteToolData","passiveCallback","enabledCallback","isExistingInstance","isDrawingSecondCircle","_addCircleHandles","pointOnCircle","pointOnLine","centerPoint","outerPoint","maxDistance","pointDistance","haveLeftCircle","haveRightCircle","haveUpperRimHandles","haveTextBoxes","outer","inner","leftRadius","rightRadius","points","drawTextBoxes","textBoxes","textBoxOffset","correspondingHandle","getAngleFromPoints","ab","bc","ac","_addUpperRimHandles","_addTextBoxes","isToolInstance","isIncompleteDrawing","leftOuter","leftCenter","rightOuter","rightCenter","rightDrawnFirst","circleDistance","leftDistancePercent","rightDistancePercent","leftIntersection","rightIntersection","_rotatePoint","topRight","_addHandle","drawLink","AstLengthAngle","showAngles","goodEventData","hasStartAndEndHandles","validParameters","lineLengthTolerance","save","textBoxHandle","strokeStyle","rightmostHandle","lengthText","getLengthText","isNotDestroyedAngle","otherLine","getIntersection","angleTextBoxes","lineId","uuid","createAngleTextBox","isObtuseAngle","indexToRemove","getAngle","linkAnchors","getClosestHandlePair","_getAcuteObtuseCoords","getAcuteObtuseCoords","acute","obtuse","getMidpoint","textBoxColor","anchorCanvas","existingLineIds","restore","lineA","lineB","slopeA","getSlope","slopeB","atan","invalidLineHandles","pointPairs","closestPair","pointPair","_sort","_sort2","_sort3","_sort4","_sort5","angleA","angleB","_sort6","horizontalAcute","horizontalObtuse","atan2","pointA","pointB","AstOrientationMarkers","mixins","_forceImageUpdate","hasImageToUpdate","markers","getOrientationMarkers","getOrientationMarkerPositions","getToolColor","textWidths","drawAllMarkers","imagePlaneMetaData","rowString","getOrientationString","columnString","oppositeRowString","invertOrientationString","oppositeColumnString","isRotatedClockwise","orientationStrings","unshift","pop","shift","moveAllHandles","AstPennHip","returnShape","isInstanceUnfinished","startMovingHandles","movableHandles","startPoints","circle","pointNearTool","circleHandles","first","second","makeCircleMoveIndependently","indices","linkedLineHandle","circle1Outer","circle1Inner","circle2Outer","circle2Inner","firstRadius","secondRadius","firstRadiusPixels","secondRadiusPixels","haveFirstCircle","haveSecondCircle","femurRadius","rightEdgeOfFemur","distractionIndex","rightCircle","rightEdgeOfShape","AstProbe","defaultProps","_movingEventCallback","_endMovingEventCallback","mouseClickCallback","activeInstance","_clearAllPoints","columns","rows","drawProbe","toolCoords","storedPixels","getStoredPixels","sp","mo","slope","intercept","pixelPoint","currentImageIdIndex","AstTplo","isAddingTibialAxis","isAddingPlateau","startMovingHandle","addSingleHandle","referenceLine","_getReferenceLine","_getIntersection","_getCutRadius","haveTalusCircle","haveTibialAxis","havePlateau","drawTalusCircle","getTPA","getCutDiameter","tibialAxis","plateau","distanceA","getAspectDistance","distanceB","aspectA","aspectB","referenceSlope","cutRadius","AstTta","isAddingCircle","isAddingLigament","haveThirdCircle","haveLigament","drawNewCircle","rightVertical","verticalSlope","horizontalSlope","lowerHorizontal","leftVertical","leftMidpoint","midHorizontal","advanceLine","getActualLength","outerIndex","innerIndex","lineAStart","lineASlope","MOUSE","TOUCH","moveAndRotateHandlesMouse","moveAndRotateHandles","moveAndRotateHandlesTouch","upEvents","dragCallback","oppositeHandleIndeces","0","1","3","4","handleIndex","oppositeHandleIndex","angleDelta","_getRelativeAngle","startingPoint","otherHandle","newLocation","upCallback","endpoint","AstVertebralHeart","isAddingSecondLine","isAddingVertEdge","_addHeartLine","_addVertEdge","handleMove","isVhsTextbox","_handleDoneMove","promptForVertebrae","_promptForVertebrae","shapeHandles","heart1","heart2","vert","shape","_makeHandlesMoveAsGroup","pointNearVert","vertLines","_getVertLines","haveFirstLine","haveSecondLine","haveVertEdge","firstLength","secondLength","drawCenteredTextBox","getVhsText","getLength","drawAnchoredTextBox","long","short","vhs","placeAbove","verticalOffset","isIntersecting","snapToPerpendicular","lambda","gamma","_getCrossPoint","isHorizontal","snapToX","snapToY","isWithinBounds","yInBounds","xInBounds","getDistance","heartLengths","defaultHeight","topHandle","bottomHandle","_promptForVertebrae2","lengths","_lengths","longLength","shortLength","longToShortRatio","calculatedShortCount","t2","t3","indeces","getVertLine","edgeDeltaX","edgeDeltaY","lineDeltaY","lineDeltaX","originDeltaX","originDeltaY","AstEraser","preMouseDownCallback","_deleteAllNearbyTools","preTouchStartCallback","removeTool","_pointsNear","fromX","fromY","toX","toY","ReferenceLinesTool","renderer","renderActiveReferenceLine","synchronizationContext","_enabledCallback","_args","forceImageUpdate","referenceMetaData","viewer","activeImageMetadata","getSourceElements","setToPixelCoordinateSystem","referenceEnabledElement","referenceImageMetadata","targetImage","targetImagePlane","referenceImagePlane","targetNormal","referenceNormal","angleInRadians","calculateReferenceLine","setTransform","planePlaneIntersection","RotateTool","strategies","horizontalStrategy","verticalStrategy","defaultStrategy","roundAngles","flipHorizontal","flipVertical","rotateScale","rotationValue","_endMobileMovingEventCallback","firstTouchOnMobile","log","applyActiveStrategy","setViewport","initialPointX","client","currentPointX","_this$configuration2","initialPointY","currentPointY","AstReferenceLines","AstRotateTool","isFullScreenSupported","fullScreenProperties","fullScreenProperty","fullscreenEnabled","onResize","$once","exitFullScreen","enterFullScreen","enterMethods","method","exitMethods","toolInfo","setCircleDiameter","textboxes","textbox","canHideTextbox","domProps","composing","$set","getTextboxLabel","erase","model","callback","$$v","AstCheckbox","diameterInputValue","updateNewCircleDiameter","_k","onEnterKeydown","canSetDiameter","hasChangedDiameter","newCircleDiameter","$options","filters","watch","hasChangedLength","currentLength","updatenewLength","calibrate","canCalibrate","AstRadio","$nextTick","getSelection","lengthInput","select","immediate","beforeDestroy","AnnotationCheckbox","popper","angleTextboxes","settingsPanel","isLengthAnglesEnabled","isRelatedAngle","isTextbox","isArray","canEditTextbox","availableTools","alias","_a","$forceUpdate","deep","onAnnotationClick","ANNOTATIONS_CLEARED","onAnnotationRemoved","onKeydown","activeElement","destroyed","listenForAnnotationRemoved","destroy","small","positionDialog","referenceElement","createReferenceElement","createPopper","dialog","placement","modifiers","fallbackPlacements","boundary","altAxis","isAddingListener","toggleListener","csEvents","MEASUREMENT_REMOVED","join","newDiameter","getHandleCoords","xValues","yValues","_coords","regularHandles","handleToCanvasCoords","textBoxToCoords","TOOLS","CIRCLE_TOOL","ARROW_TOOL","TEXT_TOOL","statText","onEnter","formattedDiameter","setDiameter","componentRef","validateDiameter","worldDiameter","updateDiameter","CircleAnnotationDialog","Checkbox","consts","mpr","MPR_ANNOTATION_CLICK","MPR_ANNOTATION_REMOVED","MPR_ANNOTATIONS_CLEARED","$el","closeModal","keygroup","hotkey","_f","keyBinding","description","keyGroups","toUpperCase","showHotkeys","hotkeys","viewerHotkeys","hotkeyGroups","filtered","hotKeys","background","canvasColor","showOverlayText","compact","useCompactOverlay","imageOverlayInfo","zoom","seriesIndex","seriesTotal","imageIndex","series","images","fullName","simpleName","overlayInformation","lotNumber","chipId","sire","dam","institutionName","studyDate","forceUTC","acquisitionTime","patientName","patientId","ownerName","windowWidth","windowCenter","isLevelingAdjusted","activeDisplaySet","isInitializing","stackIndex","shouldRenderWebGL","isMobileOS","toolActivationDebounce","_cornerstone$EVENTS","IMAGE_RENDERED","_cornerstoneTools$EVE","STACK_SCROLL","TOOL_EVENTS","globalImageIdSpecificToolStateManager","disablePrecisionEvents","MOUSE_DOWN","MEASUREMENT_ADDED","modifiedAnnotationEvents","AstImageScroll","frameIndex","defaultViewport","isAnyImageLevelAdjusted","showViewportCacheMessage","showLoadingSpinner","updateDebounce","canvasColors","previousSeries","loadSeries","updateStackToolState","imageLoader","prefetch","applyCinePlayerSettings","opts","addListeners","domCanvas","vueCanvas","isPlaying","canvases","err","removeListeners","onNewImage","updateOverlayInformation","onStackScroll","onAnnotationModified","onDisablePrecision","_getEnabledElement","blacklist","_e$detail","getImageIdToolState","displayedArea","brhc","voi","_e$detail$image","some","updateCanvas","defaultVoi","isDicom","scaledDisplayValues","scaleJpegVoiToDicom","scale","initCanvasTools","disableWheelTools","updateActiveWheelTool","activeWheelTool","frameRate","initTools","loadingSpinnerDelay","cornerstoneImageId","cachedImage","getCornerstoneImageId","isArchived","firstScanPromise","dicomServiceData","firstStatusPromise","loadMetadata","cachedImages","removeImageLoadObject","refreshCanvas","glitchCanvas","seriesViewportCache","message","notificationType","currentState","getCornerstoneImageIdsForSeries","_this6","hide","layout","layoutSelected","setting","toggle","location","capitalize","AstToolbarButton","AstToolbarMenu","layouts","showImageOrientationMarkers","showAxis","isSyncWindowLevelsEnabled","showAxisOverlay","syncWindowLevels","mapMutations","setLayout","MPRKeys","SET_MPR_LAYOUT","hideDropdown","isLoading","showCompactToolbar","isGrouped","levels","itemsInGroup","dropdownLocation","activateTool","binding","activeBlendMethod","blendMethods","rotateItems","resetViewData","AstToolbar","isBurningAnnotations","ungroupedTools","groups","groupTools","toolbar","isToolbarOverflowing","fullToolbar","groupOrder","isHiddenForRepository","burnInAnnotations","finish","ViewerToolsMixin","activeTools","switchModeActive","volumeData","invertVolume","setSwitchModeActive","flipHActiveView","flipVActiveView","rotateActiveViewClockwise","rotateActiveViewCounterClockwise","BLEND_NONE","setBlendMode","BLEND_MIP","BLEND_MINIP","BLEND_AVG","blendMode","compactItems","updateToolBindings","buttonMask","whichToButtons","validButtons","setMprActiveToolAndBroadcast","updateMouseBinding","button","activeLayout","LayoutGridSelector","saveViewerSetting","isImageOrientationMarkersEnabled","isReferenceLineSynchronizationEnabled","canvasLayout","canvasesPerRow","numCanvases","debounceTimer","setMaxRowsAndColumns","minCanvasHeight","minCanvasWidth","overlayTextEnabled","imageOrientationMarkersEnabled","lengthAnglesEnabled","referenceLineSynchronizationEnabled","api","user","setUserSetting","JSON","stringify","hasMultipleImages","toggleCine","hangingProtocol","hasPreviousDisplaySet","setHangingProtocolDisplaySet","activeDisplaySetIndex","hasNextDisplaySet","hasPreviousSeries","hasNextSeries","hangingProtocols","isHangingProtocolLoading","showDropdownsBelow","hangingProtocolLabel","hangingProtocolOptions","protocol","setHangingProtocol","displaySets","switchDisplaySet","displaySet","allSeries","activeSeriesIndex","noHangingProtocol","inputClass","Hammer","TouchInput","recognizers","Swipe","DIRECTION_HORIZONTAL","hammertime","ev","velocityX","updateHangingProtocol","displaySetIndex","isCollapsed","studyDateTime","showTime","removeStudy","imageData","thumbnails","attachments","reports","gotoSignalPET","thumbnail","startLongPress","onDragStart","onDragEnd","findImageBackground","getCanvasColor","seriesNumber","doNothing","refreshSeriesProgress","throttledProgress","loadedImages","imageProgress","has","getElementById","percent","storageLocation","url","findThumbnailUrl","backgroundImage","startEvent","longPressTimer","startDragging","vibrate","cancelDragListeners","onTouchMove","moveEvent","isMoved","getTouch","isTrusted","reportId","_dndHandle","ghostImage","closest","report","date","isComplete","isVetCT","thirdPartyCaseLink","vetCTCaseStatus","consultantClinicCode","IDEXXAPI","downloadExternalReport","consultantReportId","isVetsChoice","openReportPdf","$IDEXXAPI","VetsChoice_ClinicCode","$VetsChoice_ClinicCode","tryOpenFromUrlQuery","found","providerClinicCode","clientClinicCode","consultations","getReportResult","reportBinaryString","pdfWindow","write","encodeURI","AstThumbnailList","AstAttachmentList","AstReportList","showHeading","showPatientName","hasSignalPETAttachment","imageViewId","SIGNALPET_IMAGEVIEW_ID","consultationRequest","show","getReports","params","studyData","getRelatedStudiesAndReports","toEmail","emailedReports","emailedReport","_iterator","_createForOfIteratorHelper","_step","done","getConsultantReport","consultantReport","consultant","$VetCTAPI","getThirdPartyRadiologyReport","vetCTCase","Message","Data","thirdPartyReportResult","_context3","getCase","_callee3","surgical","currentSyncMethod","syncItems","resetActiveCanvas","isStackScrollSynchronizationEnabled","isManualStackScrollSynchronizationEnabled","setStackSynchronizationMethodAndBroadcast","hasMultiImageSeries","deduplicateItems","each","mouseButtonMask","activeStudy","addItem","canAddSeries","sendEmail","removeItem","thumbUrl","countText","openEmailStudyDlg","then","catch","entireSeries","img","EmailItem","existingSeriesItems","reasonKeys","reasonKey","disabledReasons","warningKeys","launchMPR","hideWarningChecked","MprDisabledDlg","ModalDialog","minimumImages","mobile","edge","minimg","invalidmin","missing","orientation","spacing","derived","showMprDisabledDialog","preventDefaultAndStopPropagation","hoveredCanvasIndex","isEmail","draggingFromThumbnailList","types","parse","addProvider","metadataProvider","setToolColor","setBackgroundColor","shouldLoadLevelPresets","shouldLoadDicom","DesktopDownloader","AnnotationDialog","MprAnnotationDialog","AstHotkeyModal","AstImagePlaceholder","AstImageViewer","AstMprViewerLayoutSelector","AstMprViewerTools","AstToolbarBranding","AstViewerLayoutSelector","AstViewerNavigation","AstViewerStudy","AstViewerTools","EmailImagesSidebar","ModalDrawer","PersistentNavigationDrawer","UserMenu","HelpMenu","AstCineDialog","AstViewerAddRelatedStudy","AstViewerContextMenu","AstViewerToolHelp","ViewerActionsDrawer","DicomTagsDrawer","AstMprViewer","FullScreenMixin","primaryToolbarConfig","defaultPrimaryToolbar","Thumbnails","viewerHelpItems","mprHelpItems","startMprTour","openMPRPerformanceModal","about","eventStartX","eventStartY","eventStartTime","ui","studiesNotFound","toolManager","_this$activeStudy","large","primaryToolbar","viewerHasImages","viewerHasAttachments","firstPatientName","layoutPaneSize","findImageUrlFromImage","mprDisabledReasons","reasons","ipadSize","validateMPRImages","mprWarningReasons","warnings","numImages","_cornerstone$metaData","currentCount","oldCount","onInitialStudyLoadOrReload","viewerHasLoaded","setHotkeys","setMouseBindings","startImageViewerSync","isActive","setMPRHotkeys","setLevelPresets","updateDocumentTitle","globalToolSyncEnabled","addTools","setDefaultToolsActive","synchronizers","create","onCacheFull","decacheInactiveStudies","empty","toggleDicomTagsDrawer","openEmailAction","$api","cancelAllPendingRequests","removeTools","clearAnnotations","updateThumbnailProgress","viewerCineDialog","viewerDragAndDrop","patientInfo","titlePrefix","meta","omniOrCommunity","setInitialCanvasLayout","openInitialAttachment","_this$$route$query","sid","numSeries","sids","listToArray","attachment","isPrimaryViewer","isFirstPrimaryViewerWindow","fileExtension","toolbarGroup","toolClass","isCustom","CustomTools","instanceName","drawer","getActiveDomCanvas","activeVueCanvas","propsData","file","openAttachmentDlg","startContextMenuWatch","timeStamp","pointerType","isRightClickHandledByTool","tooMuchMovement","tooMuchTime","$ga","_cornerstone$getViewp","setLevels","scaledLevels","scaleDicomPresetToJpeg","dragTimeout","_this7","exportName","VENDOR_PREFIXES","TEST_ELEMENT","TYPE_FUNCTION","now","Date","setTimeoutContext","timeout","bindFn","invokeArrayArg","arg","iterator","deprecate","deprecationMessage","stack","output","nextKey","extend","dest","src","merge","inherit","child","base","properties","childP","baseP","_super","boolOrFn","val","args","ifUndefined","val1","val2","addEventListeners","splitStr","removeEventListeners","hasParent","node","inStr","trim","inArray","findByKey","uniqueArray","results","values","prefixed","prefix","camelProp","_uniqueId","uniqueId","getWindowForElement","doc","ownerDocument","parentWindow","MOBILE_REGEX","SUPPORT_TOUCH","SUPPORT_POINTER_EVENTS","SUPPORT_ONLY_TOUCH","INPUT_TYPE_TOUCH","INPUT_TYPE_PEN","INPUT_TYPE_MOUSE","INPUT_TYPE_KINECT","COMPUTE_INTERVAL","INPUT_START","INPUT_MOVE","INPUT_END","INPUT_CANCEL","DIRECTION_NONE","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DIRECTION_DOWN","DIRECTION_VERTICAL","DIRECTION_ALL","PROPS_XY","PROPS_CLIENT_XY","Input","manager","inputTarget","domHandler","enable","init","createInputInstance","Type","PointerEventInput","TouchMouseInput","MouseInput","inputHandler","input","pointersLen","pointers","changedPointersLen","changedPointers","isFirst","isFinal","session","computeInputData","emit","recognize","prevInput","pointersLength","firstInput","simpleCloneInputData","firstMultiple","offsetCenter","getCenter","deltaTime","computeDeltaXY","offsetDirection","getDirection","deltaX","deltaY","overallVelocity","getVelocity","overallVelocityX","overallVelocityY","getScale","getRotation","maxPointers","computeIntervalInputData","srcEvent","offsetDelta","prevDelta","velocityY","last","lastInterval","p1","p2","evEl","evTarget","evWin","MOUSE_INPUT_MAP","mousedown","mousemove","mouseup","MOUSE_ELEMENT_EVENTS","MOUSE_WINDOW_EVENTS","pressed","POINTER_INPUT_MAP","pointerdown","pointermove","pointerup","pointercancel","pointerout","IE10_POINTER_TYPE_ENUM","2","5","POINTER_ELEMENT_EVENTS","POINTER_WINDOW_EVENTS","MSPointerEvent","PointerEvent","removePointer","eventTypeNormalized","isTouch","storeIndex","pointerId","SINGLE_TOUCH_INPUT_MAP","touchstart","touchmove","touchend","touchcancel","SINGLE_TOUCH_TARGET_EVENTS","SINGLE_TOUCH_WINDOW_EVENTS","SingleTouchInput","started","normalizeSingleTouches","changed","TOUCH_INPUT_MAP","TOUCH_TARGET_EVENTS","targetIds","getTouches","allTouches","targetTouches","changedTargetTouches","DEDUP_TIMEOUT","DEDUP_DISTANCE","primaryTouch","lastTouches","recordTouches","setLastTouch","lastTouch","lts","removeLastTouch","isSyntheticEvent","inputEvent","inputData","sourceCapabilities","firesTouchEvents","PREFIXED_TOUCH_ACTION","NATIVE_TOUCH_ACTION","TOUCH_ACTION_COMPUTE","TOUCH_ACTION_AUTO","TOUCH_ACTION_MANIPULATION","TOUCH_ACTION_NONE","TOUCH_ACTION_PAN_X","TOUCH_ACTION_PAN_Y","TOUCH_ACTION_MAP","getTouchActionProps","TouchAction","cleanTouchActions","hasPanX","hasPanY","touchMap","cssSupports","CSS","supports","compute","update","touchAction","recognizer","getTouchAction","preventDefaults","prevented","hasNone","isTapPointer","isTapMovement","isTapTouchTime","preventSrc","STATE_POSSIBLE","STATE_BEGAN","STATE_CHANGED","STATE_ENDED","STATE_RECOGNIZED","STATE_CANCELLED","STATE_FAILED","Recognizer","defaults","simultaneous","requireFail","stateStr","directionStr","getRecognizerByNameIfManager","otherRecognizer","AttrRecognizer","PanRecognizer","pX","pY","PinchRecognizer","PressRecognizer","_timer","_input","RotateRecognizer","SwipeRecognizer","TapRecognizer","pTime","pCenter","preset","Manager","recognizeWith","dropRecognizeWith","requireFailure","dropRequireFailure","hasRequireFailures","canRecognizeWith","additionalEvent","tryEmit","canEmit","inputDataClone","reset","process","attrTest","optionPointers","isRecognized","directionTest","inOut","time","validPointers","validMovement","validTime","taps","interval","posThreshold","validTouchTime","failTimeout","validInterval","validMultiTap","tapCount","domEvents","cssProps","userSelect","touchSelect","touchCallout","contentZooming","userDrag","tapHighlightColor","STOP","FORCED_STOP","handlers","oldCssProps","toggleCssProps","triggerDomEvent","gestureEvent","createEvent","initEvent","gesture","stopped","curRecognizer","existing","events","Tap","Pan","Pinch","Rotate","Press","freeGlobal","isObject","debounce","func","wait","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","useRAF","invokeFunc","thisArg","startTimer","pendingFunc","cancelTimer","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","flush","pending","debounced","isInvoking","_len","_key"],"mappings":"0HAAA,W;;CCCC,SAASA,EAAEC,GAAwDA,EAAEC,GAArE,CAAoLC,GAAK,SAASH,GAAG,aAAa,SAASC,IAAI,IAAID,EAAE,CAACI,WAAW,gBAAgBC,SAASC,gBAAgBC,UAAU,cAAcF,SAASC,gBAAgBE,YAAY,iBAAiBH,SAASC,gBAAgBG,kCAA6B,GAAQR,IAAIS,OAAOC,QAAQ,UAAUC,KAAKC,UAAUC,WAAW,OAAOd,EAAES,+BAA+B,2BAA2BG,KAAKC,UAAUC,YAAYb,GAAGD,EAAEQ,aAAaO,GAAGC,OAAOC,KAAKjB,GAAGkB,SAAQ,SAASlB,OAAMA,EAAE,SAASmB,IAAI,IAAInB,GAAE,EAAG,IAAI,IAAIC,EAAEe,OAAOI,eAAe,GAAG,UAAU,CAACC,IAAI,WAAWrB,GAAE,KAAMU,OAAOY,iBAA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,GAEnDX,EAASC,EAAMC,EAAM,CAC1BO,UACAE,WACAN,QAASH,IAIEp4C,U,mCCrEf,IAAIl+B,EAAS,WAAa,IAAIE,EAAIlhB,KAASmhB,EAAGD,EAAIE,eAAmBC,EAAGH,EAAII,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACgB,YAAY,qBAAqB,CAAChB,EAAG,MAAM,CAACgB,YAAY,0BAA0B,CAACnB,EAAIqa,GAAG,YAAY,GAAGla,EAAG,MAAM,CAACgB,YAAY,4BAA4B,CAACnB,EAAIqa,GAAG,WAAW,MACpRhZ,EAAkB,GCWP,GACfxX,KAAA,8BCbmW,I,wBCQ/Vka,EAAY,eACd,EACAjE,EACAuB,GACA,EACA,KACA,WACA,MAIa,OAAA0C,E,kECnBf,W,gFCAA,W,yDCAA","file":"js/repositoryReviewViewer.5fd00e7962e1153326c8.bundle.js","sourcesContent":["export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EmailImagesSidebar.vue?vue&type=style&index=0&id=1d80bbc9&prod&lang=scss\"","/*! mobile-drag-drop 2.1.0 | Copyright (c) 2017 Tim Ruffles | MIT License */\n!function(a,b){\"object\"==typeof exports&&\"undefined\"!=typeof module?b(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],b):b(a.MobileDragDrop=a.MobileDragDrop||{})}(this,function(a){\"use strict\";function b(){var a={dragEvents:\"ondragstart\"in document.documentElement,draggable:\"draggable\"in document.documentElement,touchEvents:\"ontouchstart\"in document.documentElement,userAgentSupportingNativeDnD:void 0},b=!!window.chrome||/chrome/i.test(navigator.userAgent);return a.userAgentSupportingNativeDnD=!(/iPad|iPhone|iPod|Android/.test(navigator.userAgent)||b&&a.touchEvents),A&&Object.keys(a).forEach(function(a){}),a}function c(){var a=!1;try{var b=Object.defineProperty({},\"passive\",{get:function(){a=!0}});window.addEventListener(\"test\",null,b)}catch(a){}return a}function d(a){if(a&&Object.keys(a).forEach(function(b){B[b]=a[b]}),!B.forceApply){var d=b();if(d.userAgentSupportingNativeDnD&&d.draggable&&d.dragEvents)return!1}return y=c(),B.holdToDrag?h(\"touchstart\",w,!1):h(\"touchstart\",e,!1),!0}function e(a){if(!z){var b=f(a);if(b)try{z=new J(a,B,b,g)}catch(b){throw g(B,a,3),b}}}function f(a){var b=a.target;do if(b.draggable!==!1&&b.getAttribute&&\"true\"===b.getAttribute(\"draggable\"))return b;while((b=b.parentNode)&&b!==document.body)}function g(a,b,c){if(0===c&&a.defaultActionOverride)try{a.defaultActionOverride(b),b.defaultPrevented}catch(a){}z=null}function h(a,b,c){void 0===c&&(c=!0),document.addEventListener(a,b,!!y&&{passive:c})}function i(a,b){document.removeEventListener(a,b)}function j(a){return 0===a.length?0:a.reduce(function(a,b){return b+a},0)/a.length}function k(a){return a&&a.tagName}function l(a,b){for(var c=0;c<a.changedTouches.length;c++){var d=a.changedTouches[c];if(d.identifier===b)return!0}return!1}function m(a,b,c,d,e,f,g){void 0===g&&(g=null);var h=b.changedTouches[0],i=new Event(c,{bubbles:!0,cancelable:d});i.dataTransfer=f,i.relatedTarget=g,i.screenX=h.screenX,i.screenY=h.screenY,i.clientX=h.clientX,i.clientY=h.clientY,i.pageX=h.pageX,i.pageY=h.pageY;var j=a.getBoundingClientRect();return i.offsetX=i.clientX-j.left,i.offsetY=i.clientY-j.top,i}function n(a,b,c){for(var d=[],e=[],f=0;f<b.touches.length;f++){var g=b.touches[f];d.push(g[a+\"X\"]),e.push(g[a+\"Y\"])}c.x=j(d),c.y=j(e)}function o(a,b){if(1===a.nodeType){for(var c=getComputedStyle(a),d=0;d<c.length;d++){var e=c[d];b.style.setProperty(e,c.getPropertyValue(e),c.getPropertyPriority(e))}b.style.pointerEvents=\"none\",b.removeAttribute(\"id\"),b.removeAttribute(\"class\"),b.removeAttribute(\"draggable\")}if(a.hasChildNodes())for(var d=0;d<a.childNodes.length;d++)o(a.childNodes[d],b.childNodes[d])}function p(a){var b=a.cloneNode(!0);return o(a,b),b.style.position=\"absolute\",b.style.left=\"0px\",b.style.top=\"0px\",b.style.zIndex=\"999999\",b.classList.add(G),b.classList.add(I),b}function q(a){return E.map(function(b){var c=a.style[b+\"transform\"];return c&&\"none\"!==c?c.replace(/translate\\(\\D*\\d+[^,]*,\\D*\\d+[^,]*\\)\\s*/g,\"\"):\"\"})}function r(a,b,c,d,e){void 0===e&&(e=!0);var f=b.x,g=b.y;d&&(f+=d.x,g+=d.y),e&&(f-=parseInt(a.offsetWidth,10)/2,g-=parseInt(a.offsetHeight,10)/2);for(var h=\"translate3d(\"+f+\"px,\"+g+\"px, 0)\",i=0;i<E.length;i++){var j=E[i]+\"transform\";a.style[j]=h+\" \"+c[i]}}function s(a,b,c,d){var e=getComputedStyle(a);if(\"hidden\"===e.visibility||\"none\"===e.display)return void d();b.classList.add(H);var f=getComputedStyle(b),g=parseFloat(f.transitionDuration);if(isNaN(g)||0===g)return void d();var h=a.getBoundingClientRect(),i={x:h.left,y:h.top};i.x+=document.body.scrollLeft||document.documentElement.scrollLeft,i.y+=document.body.scrollTop||document.documentElement.scrollTop,i.x-=parseInt(e.marginLeft,10),i.y-=parseInt(e.marginTop,10);var j=parseFloat(f.transitionDelay),k=Math.round(1e3*(g+j));r(b,i,c,void 0,!1),setTimeout(d,k)}function t(a,b){return a?a===C[0]?D[0]:0===a.indexOf(C[1])||a===C[7]?D[1]:0===a.indexOf(C[4])?D[3]:a===C[6]?D[2]:D[1]:3===b.nodeType&&\"A\"===b.tagName?D[3]:D[1]}function u(a,b,c,d,e,f,g){if(void 0===f&&(f=!0),void 0===g&&(g=null),A){var h=F+\"debug\",i=F+\"event-target\",j=F+\"event-related-target\";b.classList.add(h),b.classList.add(i),g&&(g.classList.add(h),g.classList.add(j))}var k=m(b,c,a,f,document.defaultView,e,g),l=!b.dispatchEvent(k);return d.g=0,A&&(b.classList.remove(i),g&&g.classList.remove(j)),l}function v(a,b){if(!a||a===C[7])return b;if(b===D[1]){if(0===a.indexOf(D[1]))return D[1]}else if(b===D[3]){if(0===a.indexOf(D[3])||a.indexOf(\"Link\")>-1)return D[3]}else if(b===D[2]&&(0===a.indexOf(D[2])||a.indexOf(\"Move\")>-1))return D[2];return D[0]}function w(a){var b=a.target,c=function(){g.off(),h.off(),i.off(),e(a)},d=function(){g.off(),h.off(),i.off(),clearTimeout(f)},f=setTimeout(c,B.holdToDrag),g=x(b,\"touchend\",d,this),h=x(b,\"touchcancel\",d,this),i=x(window,\"scroll\",d,this)}function x(a,b,c,d){return d&&(c=c.bind(d)),a.addEventListener(b,c),{off:function(){return a.removeEventListener(b,c)}}}var y,z,A=!1,B={iterationInterval:150},C=[\"none\",\"copy\",\"copyLink\",\"copyMove\",\"link\",\"linkMove\",\"move\",\"all\"],D=[\"none\",\"copy\",\"move\",\"link\"],E=[\"\",\"-webkit-\"],F=\"dnd-poly-\",G=F+\"drag-image\",H=F+\"snapback\",I=F+\"icon\",J=function(){function a(a,b,c,d){this.h=a,this.i=b,this.j=c,this.k=d,this.l=0,this.m=null,this.o=null,this.p=a,this.q=a.changedTouches[0],this.s=this.t.bind(this),this.u=this.v.bind(this),h(\"touchmove\",this.s,!1),h(\"touchend\",this.u,!1),h(\"touchcancel\",this.u,!1)}return a.prototype.A=function(){var a=this;this.l=1,this.B=D[0],this.C={D:{},F:void 0,g:3,G:[]},this.H={x:null,y:null},this.I={x:null,y:null};var b=this.j;if(this.J=new K(this.C,function(c,d,e){b=c,\"number\"!=typeof d&&\"number\"!=typeof e||(a.K={x:d||0,y:e||0})}),this.C.g=2,this.J.dropEffect=D[0],u(\"dragstart\",this.j,this.p,this.C,this.J))return this.l=3,this.L(),!1;if(n(\"page\",this.p,this.I),this.M=p(b),this.N=q(this.M),!this.K)if(this.i.dragImageOffset)this.K={x:this.i.dragImageOffset.x,y:this.i.dragImageOffset.y};else if(this.i.dragImageCenterOnTouch){var c=getComputedStyle(b);this.K={x:0-parseInt(c.marginLeft,10),y:0-parseInt(c.marginTop,10)}}else{var d=b.getBoundingClientRect(),c=getComputedStyle(b);this.K={x:d.left-this.q.clientX-parseInt(c.marginLeft,10)+d.width/2,y:d.top-this.q.clientY-parseInt(c.marginTop,10)+d.height/2}}return r(this.M,this.I,this.N,this.K,this.i.dragImageCenterOnTouch),document.body.appendChild(this.M),this.O=setInterval(function(){a.P||(a.P=!0,a.R(),a.P=!1)},this.i.iterationInterval),!0},a.prototype.L=function(){this.O&&(clearInterval(this.O),this.O=null),i(\"touchmove\",this.s),i(\"touchend\",this.u),i(\"touchcancel\",this.u),this.M&&(this.M.parentNode.removeChild(this.M),this.M=null),this.k(this.i,this.p,this.l)},a.prototype.t=function(a){var b=this;if(l(a,this.q.identifier)!==!1){if(this.p=a,0===this.l){var c=void 0;if(this.i.dragStartConditionOverride)try{c=this.i.dragStartConditionOverride(a)}catch(a){c=!1}else c=1===a.touches.length;return c?void(this.A()===!0&&(this.h.preventDefault(),a.preventDefault())):void this.L()}if(a.preventDefault(),n(\"client\",a,this.H),n(\"page\",a,this.I),this.i.dragImageTranslateOverride)try{var d=!1;if(this.i.dragImageTranslateOverride(a,{x:this.H.x,y:this.H.y},this.m,function(a,c){b.M&&(d=!0,b.H.x+=a,b.H.y+=c,b.I.x+=a,b.I.y+=c,r(b.M,b.I,b.N,b.K,b.i.dragImageCenterOnTouch))}),d)return}catch(a){}r(this.M,this.I,this.N,this.K,this.i.dragImageCenterOnTouch)}},a.prototype.v=function(a){if(l(a,this.q.identifier)!==!1){if(this.i.dragImageTranslateOverride)try{this.i.dragImageTranslateOverride(void 0,void 0,void 0,function(){})}catch(a){}if(0===this.l)return void this.L();a.preventDefault(),this.l=\"touchcancel\"===a.type?3:2}},a.prototype.R=function(){var a=this;if(A)var b=F+\"debug\",c=F+\"immediate-user-selection\",d=F+\"current-drop-target\";var e=this.B;this.C.g=3,this.J.dropEffect=D[0];var f=u(\"drag\",this.j,this.p,this.C,this.J);if(f&&(this.B=D[0]),f||2===this.l||3===this.l){var g=this.S(this.l);return g?void s(this.j,this.M,this.N,function(){a.T()}):void this.T()}var h=document.elementFromPoint(this.H.x,this.H.y),i=this.o;h!==this.m&&h!==this.o&&(A&&(this.m&&this.m.classList.remove(c),h&&(h.classList.add(b),h.classList.add(c))),this.m=h,null!==this.o&&(this.C.g=3,this.J.dropEffect=D[0],u(\"dragexit\",this.o,this.p,this.C,this.J,!1)),null===this.m?this.o=this.m:(this.C.g=3,this.J.dropEffect=t(this.C.F,this.j),u(\"dragenter\",this.m,this.p,this.C,this.J)?(this.o=this.m,this.B=v(this.J.effectAllowed,this.J.dropEffect)):this.m!==document.body&&(this.o=document.body))),i!==this.o&&k(i)&&(A&&i.classList.remove(d),this.C.g=3,this.J.dropEffect=D[0],u(\"dragleave\",i,this.p,this.C,this.J,!1,this.o)),k(this.o)&&(A&&(this.o.classList.add(b),this.o.classList.add(d)),this.C.g=3,this.J.dropEffect=t(this.C.F,this.j),u(\"dragover\",this.o,this.p,this.C,this.J)===!1?this.B=D[0]:this.B=v(this.J.effectAllowed,this.J.dropEffect)),e!==this.B&&this.M.classList.remove(F+e);var j=F+this.B;this.M.classList.contains(j)===!1&&this.M.classList.add(j)},a.prototype.S=function(a){if(A){var b=F+\"immediate-user-selection\",c=F+\"current-drop-target\";this.o&&this.o.classList.remove(c),this.m&&this.m.classList.remove(b)}var d=this.B===D[0]||null===this.o||3===a;return d?k(this.o)&&(this.C.g=3,this.J.dropEffect=D[0],u(\"dragleave\",this.o,this.p,this.C,this.J,!1)):k(this.o)&&(this.C.g=1,this.J.dropEffect=this.B,u(\"drop\",this.o,this.p,this.C,this.J)===!0?this.B=this.J.dropEffect:this.B=D[0]),d},a.prototype.T=function(){this.C.g=3,this.J.dropEffect=this.B,u(\"dragend\",this.j,this.p,this.C,this.J,!1),this.l=2,this.L()},a}(),K=function(){function a(a,b){this.U=a,this.V=b,this.W=D[0]}return Object.defineProperty(a.prototype,\"types\",{get:function(){if(0!==this.U.g)return Object.freeze(this.U.G)},enumerable:!0,configurable:!0}),a.prototype.setData=function(a,b){if(2===this.U.g){if(a.indexOf(\" \")>-1)throw new Error(\"illegal arg: type contains space\");this.U.D[a]=b,this.U.G.indexOf(a)===-1&&this.U.G.push(a)}},a.prototype.getData=function(a){if(1===this.U.g||2===this.U.g)return this.U.D[a]||\"\"},a.prototype.clearData=function(a){if(2===this.U.g){if(a&&this.U.D[a]){delete this.U.D[a];var b=this.U.G.indexOf(a);return void(b>-1&&this.U.G.splice(b,1))}this.U.D={},this.U.G=[]}},a.prototype.setDragImage=function(a,b,c){2===this.U.g&&this.V(a,b,c)},Object.defineProperty(a.prototype,\"effectAllowed\",{get:function(){return this.U.F},set:function(a){2===this.U.g&&C.indexOf(a)>-1&&(this.U.F=a)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,\"dropEffect\",{get:function(){return this.W},set:function(a){0!==this.U.g&&C.indexOf(a)>-1&&(this.W=a)},enumerable:!0,configurable:!0}),a}();a.polyfill=d,Object.defineProperty(a,\"__esModule\",{value:!0})});\n//# sourceMappingURL=index.min.js.map","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprViewerAnnotationDialog.vue?vue&type=style&index=0&id=6a1265b4&prod&lang=scss&scoped=true\"","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImagePlaceholder.vue?vue&type=style&index=0&id=4ec63bbe&prod&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HotkeyModal.vue?vue&type=style&index=0&id=28ebfed9&prod&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerLayoutSelector.vue?vue&type=style&index=0&id=408da2f8&prod&lang=scss\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Viewer.vue?vue&type=style&index=0&id=576c527a&prod&lang=scss\"","/*! cornerstone-math - 0.1.6 - 2017-06-09 | (c) 2017 Chris Hafey | https://github.com/chafey/cornerstoneTools */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"cornerstoneMath\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"cornerstoneMath\"] = factory();\n\telse\n\t\troot[\"cornerstoneMath\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 9);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n// Based on THREE.JS\nfunction clamp(x, a, b) {\n  return x < a ? a : x > b ? b : x;\n}\n\nfunction degToRad(degrees) {\n  var degreeToRadiansFactor = Math.PI / 180;\n\n  return degrees * degreeToRadiansFactor;\n}\n\nfunction radToDeg(radians) {\n  var radianToDegreesFactor = 180 / Math.PI;\n\n  return radians * radianToDegreesFactor;\n}\n\n// Returns sign of number\nfunction sign(x) {\n  return typeof x === 'number' ? x ? x < 0 ? -1 : 1 : x === x ? 0 : NaN : NaN;\n}\n\nexports.clamp = clamp;\nexports.degToRad = degToRad;\nexports.radToDeg = radToDeg;\nexports.sign = sign;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _quaternion = __webpack_require__(3);\n\nvar _quaternion2 = _interopRequireDefault(_quaternion);\n\nvar _math = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Based on THREE.JS\nvar Vector3 = function Vector3(x, y, z) {\n\n  this.x = x || 0;\n  this.y = y || 0;\n  this.z = z || 0;\n};\n\nVector3.prototype = {\n\n  constructor: Vector3,\n\n  set: function set(x, y, z) {\n\n    this.x = x;\n    this.y = y;\n    this.z = z;\n\n    return this;\n  },\n  setX: function setX(x) {\n\n    this.x = x;\n\n    return this;\n  },\n  setY: function setY(y) {\n\n    this.y = y;\n\n    return this;\n  },\n  setZ: function setZ(z) {\n\n    this.z = z;\n\n    return this;\n  },\n  setComponent: function setComponent(index, value) {\n\n    switch (index) {\n\n      case 0:\n        this.x = value;break;\n      case 1:\n        this.y = value;break;\n      case 2:\n        this.z = value;break;\n      default:\n        throw new Error('index is out of range: ' + index);\n\n    }\n  },\n  getComponent: function getComponent(index) {\n\n    switch (index) {\n\n      case 0:\n        return this.x;\n      case 1:\n        return this.y;\n      case 2:\n        return this.z;\n      default:\n        throw new Error('index is out of range: ' + index);\n\n    }\n  },\n  copy: function copy(v) {\n\n    this.x = v.x;\n    this.y = v.y;\n    this.z = v.z;\n\n    return this;\n  },\n  add: function add(v, w) {\n\n    if (w !== undefined) {\n\n      console.warn('DEPRECATED: Vector3\\'s .add() now only accepts one argument. Use .addVectors( a, b ) instead.');\n\n      return this.addVectors(v, w);\n    }\n\n    this.x += v.x;\n    this.y += v.y;\n    this.z += v.z;\n\n    return this;\n  },\n  addScalar: function addScalar(s) {\n\n    this.x += s;\n    this.y += s;\n    this.z += s;\n\n    return this;\n  },\n  addVectors: function addVectors(a, b) {\n\n    this.x = a.x + b.x;\n    this.y = a.y + b.y;\n    this.z = a.z + b.z;\n\n    return this;\n  },\n  sub: function sub(v, w) {\n\n    if (w !== undefined) {\n\n      console.warn('DEPRECATED: Vector3\\'s .sub() now only accepts one argument. Use .subVectors( a, b ) instead.');\n\n      return this.subVectors(v, w);\n    }\n\n    this.x -= v.x;\n    this.y -= v.y;\n    this.z -= v.z;\n\n    return this;\n  },\n  subVectors: function subVectors(a, b) {\n\n    this.x = a.x - b.x;\n    this.y = a.y - b.y;\n    this.z = a.z - b.z;\n\n    return this;\n  },\n  multiply: function multiply(v, w) {\n\n    if (w !== undefined) {\n\n      console.warn('DEPRECATED: Vector3\\'s .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.');\n\n      return this.multiplyVectors(v, w);\n    }\n\n    this.x *= v.x;\n    this.y *= v.y;\n    this.z *= v.z;\n\n    return this;\n  },\n  multiplyScalar: function multiplyScalar(scalar) {\n\n    this.x *= scalar;\n    this.y *= scalar;\n    this.z *= scalar;\n\n    return this;\n  },\n  multiplyVectors: function multiplyVectors(a, b) {\n\n    this.x = a.x * b.x;\n    this.y = a.y * b.y;\n    this.z = a.z * b.z;\n\n    return this;\n  },\n\n\n  applyAxisAngle: function () {\n\n    var quaternion = void 0;\n\n    return function (axis, angle) {\n\n      if (quaternion === undefined) {\n        quaternion = new _quaternion2.default();\n      }\n\n      this.applyQuaternion(quaternion.setFromAxisAngle(axis, angle));\n\n      return this;\n    };\n  }(),\n\n  applyMatrix3: function applyMatrix3(m) {\n\n    var x = this.x;\n    var y = this.y;\n    var z = this.z;\n\n    var e = m.elements;\n\n    this.x = e[0] * x + e[3] * y + e[6] * z;\n    this.y = e[1] * x + e[4] * y + e[7] * z;\n    this.z = e[2] * x + e[5] * y + e[8] * z;\n\n    return this;\n  },\n  applyMatrix4: function applyMatrix4(m) {\n\n    // Input: THREE.Matrix4 affine matrix\n\n    var x = this.x,\n        y = this.y,\n        z = this.z;\n\n    var e = m.elements;\n\n    this.x = e[0] * x + e[4] * y + e[8] * z + e[12];\n    this.y = e[1] * x + e[5] * y + e[9] * z + e[13];\n    this.z = e[2] * x + e[6] * y + e[10] * z + e[14];\n\n    return this;\n  },\n  applyProjection: function applyProjection(m) {\n\n    // Input: THREE.Matrix4 projection matrix\n\n    var x = this.x,\n        y = this.y,\n        z = this.z;\n\n    var e = m.elements;\n    var d = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]); // Perspective divide\n\n    this.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * d;\n    this.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * d;\n    this.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * d;\n\n    return this;\n  },\n  applyQuaternion: function applyQuaternion(q) {\n\n    var x = this.x;\n    var y = this.y;\n    var z = this.z;\n\n    var qx = q.x;\n    var qy = q.y;\n    var qz = q.z;\n    var qw = q.w;\n\n    // Calculate quat * vector\n\n    var ix = qw * x + qy * z - qz * y;\n    var iy = qw * y + qz * x - qx * z;\n    var iz = qw * z + qx * y - qy * x;\n    var iw = -qx * x - qy * y - qz * z;\n\n    // Calculate result * inverse quat\n\n    this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n    this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n    this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\n    return this;\n  },\n  transformDirection: function transformDirection(m) {\n\n    // Input: THREE.Matrix4 affine matrix\n    // Vector interpreted as a direction\n\n    var x = this.x,\n        y = this.y,\n        z = this.z;\n\n    var e = m.elements;\n\n    this.x = e[0] * x + e[4] * y + e[8] * z;\n    this.y = e[1] * x + e[5] * y + e[9] * z;\n    this.z = e[2] * x + e[6] * y + e[10] * z;\n\n    this.normalize();\n\n    return this;\n  },\n  divide: function divide(v) {\n\n    this.x /= v.x;\n    this.y /= v.y;\n    this.z /= v.z;\n\n    return this;\n  },\n  divideScalar: function divideScalar(scalar) {\n\n    if (scalar !== 0) {\n\n      var invScalar = 1 / scalar;\n\n      this.x *= invScalar;\n      this.y *= invScalar;\n      this.z *= invScalar;\n    } else {\n\n      this.x = 0;\n      this.y = 0;\n      this.z = 0;\n    }\n\n    return this;\n  },\n  min: function min(v) {\n\n    if (this.x > v.x) {\n\n      this.x = v.x;\n    }\n\n    if (this.y > v.y) {\n\n      this.y = v.y;\n    }\n\n    if (this.z > v.z) {\n\n      this.z = v.z;\n    }\n\n    return this;\n  },\n  max: function max(v) {\n\n    if (this.x < v.x) {\n\n      this.x = v.x;\n    }\n\n    if (this.y < v.y) {\n\n      this.y = v.y;\n    }\n\n    if (this.z < v.z) {\n\n      this.z = v.z;\n    }\n\n    return this;\n  },\n  clamp: function clamp(min, max) {\n\n    // This function assumes min < max, if this assumption isn't true it will not operate correctly\n\n    if (this.x < min.x) {\n\n      this.x = min.x;\n    } else if (this.x > max.x) {\n\n      this.x = max.x;\n    }\n\n    if (this.y < min.y) {\n\n      this.y = min.y;\n    } else if (this.y > max.y) {\n\n      this.y = max.y;\n    }\n\n    if (this.z < min.z) {\n\n      this.z = min.z;\n    } else if (this.z > max.z) {\n\n      this.z = max.z;\n    }\n\n    return this;\n  },\n\n\n  clampScalar: function () {\n\n    var min = void 0,\n        max = void 0;\n\n    return function (minVal, maxVal) {\n\n      if (min === undefined) {\n\n        min = new Vector3();\n        max = new Vector3();\n      }\n\n      min.set(minVal, minVal, minVal);\n      max.set(maxVal, maxVal, maxVal);\n\n      return this.clamp(min, max);\n    };\n  }(),\n\n  floor: function floor() {\n\n    this.x = Math.floor(this.x);\n    this.y = Math.floor(this.y);\n    this.z = Math.floor(this.z);\n\n    return this;\n  },\n  ceil: function ceil() {\n\n    this.x = Math.ceil(this.x);\n    this.y = Math.ceil(this.y);\n    this.z = Math.ceil(this.z);\n\n    return this;\n  },\n  round: function round() {\n\n    this.x = Math.round(this.x);\n    this.y = Math.round(this.y);\n    this.z = Math.round(this.z);\n\n    return this;\n  },\n  roundToZero: function roundToZero() {\n\n    this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n    this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n    this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\n    return this;\n  },\n  negate: function negate() {\n\n    return this.multiplyScalar(-1);\n  },\n  dot: function dot(v) {\n\n    return this.x * v.x + this.y * v.y + this.z * v.z;\n  },\n  lengthSq: function lengthSq() {\n\n    return this.x * this.x + this.y * this.y + this.z * this.z;\n  },\n  length: function length() {\n\n    return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n  },\n  lengthManhattan: function lengthManhattan() {\n\n    return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n  },\n  normalize: function normalize() {\n\n    return this.divideScalar(this.length());\n  },\n  setLength: function setLength(l) {\n\n    var oldLength = this.length();\n\n    if (oldLength !== 0 && l !== oldLength) {\n\n      this.multiplyScalar(l / oldLength);\n    }\n\n    return this;\n  },\n  lerp: function lerp(v, alpha) {\n\n    this.x += (v.x - this.x) * alpha;\n    this.y += (v.y - this.y) * alpha;\n    this.z += (v.z - this.z) * alpha;\n\n    return this;\n  },\n  cross: function cross(v, w) {\n\n    if (w !== undefined) {\n\n      console.warn('DEPRECATED: Vector3\\'s .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.');\n\n      return this.crossVectors(v, w);\n    }\n\n    var x = this.x,\n        y = this.y,\n        z = this.z;\n\n    this.x = y * v.z - z * v.y;\n    this.y = z * v.x - x * v.z;\n    this.z = x * v.y - y * v.x;\n\n    return this;\n  },\n  crossVectors: function crossVectors(a, b) {\n\n    var ax = a.x,\n        ay = a.y,\n        az = a.z;\n    var bx = b.x,\n        by = b.y,\n        bz = b.z;\n\n    this.x = ay * bz - az * by;\n    this.y = az * bx - ax * bz;\n    this.z = ax * by - ay * bx;\n\n    return this;\n  },\n\n\n  projectOnVector: function () {\n\n    var v1 = void 0,\n        dot = void 0;\n\n    return function (vector) {\n\n      if (v1 === undefined) {\n        v1 = new Vector3();\n      }\n\n      v1.copy(vector).normalize();\n\n      dot = this.dot(v1);\n\n      return this.copy(v1).multiplyScalar(dot);\n    };\n  }(),\n\n  projectOnPlane: function () {\n\n    var v1 = void 0;\n\n    return function (planeNormal) {\n\n      if (v1 === undefined) {\n        v1 = new Vector3();\n      }\n\n      v1.copy(this).projectOnVector(planeNormal);\n\n      return this.sub(v1);\n    };\n  }(),\n\n  reflect: function () {\n\n    // Reflect incident vector off plane orthogonal to normal\n    // Normal is assumed to have unit length\n\n    var v1 = void 0;\n\n    return function (normal) {\n\n      if (v1 === undefined) {\n        v1 = new Vector3();\n      }\n\n      return this.sub(v1.copy(normal).multiplyScalar(2 * this.dot(normal)));\n    };\n  }(),\n\n  angleTo: function angleTo(v) {\n\n    var theta = this.dot(v) / (this.length() * v.length());\n\n    // Clamp, to handle numerical problems\n\n    return Math.acos((0, _math.clamp)(theta, -1, 1));\n  },\n  distanceTo: function distanceTo(v) {\n\n    return Math.sqrt(this.distanceToSquared(v));\n  },\n  distanceToSquared: function distanceToSquared(v) {\n\n    var dx = this.x - v.x;\n    var dy = this.y - v.y;\n    var dz = this.z - v.z;\n\n    return dx * dx + dy * dy + dz * dz;\n  },\n  setFromMatrixPosition: function setFromMatrixPosition(m) {\n\n    this.x = m.elements[12];\n    this.y = m.elements[13];\n    this.z = m.elements[14];\n\n    return this;\n  },\n  setFromMatrixScale: function setFromMatrixScale(m) {\n\n    var sx = this.set(m.elements[0], m.elements[1], m.elements[2]).length();\n    var sy = this.set(m.elements[4], m.elements[5], m.elements[6]).length();\n    var sz = this.set(m.elements[8], m.elements[9], m.elements[10]).length();\n\n    this.x = sx;\n    this.y = sy;\n    this.z = sz;\n\n    return this;\n  },\n  setFromMatrixColumn: function setFromMatrixColumn(index, matrix) {\n\n    var offset = index * 4;\n\n    var me = matrix.elements;\n\n    this.x = me[offset];\n    this.y = me[offset + 1];\n    this.z = me[offset + 2];\n\n    return this;\n  },\n  equals: function equals(v) {\n\n    return v.x === this.x && v.y === this.y && v.z === this.z;\n  },\n  fromArray: function fromArray(array) {\n\n    this.x = array[0];\n    this.y = array[1];\n    this.z = array[2];\n\n    return this;\n  },\n  toArray: function toArray() {\n\n    return [this.x, this.y, this.z];\n  },\n  clone: function clone() {\n\n    return new Vector3(this.x, this.y, this.z);\n  }\n};\n\nexports.default = Vector3;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _math = __webpack_require__(0);\n\n// Based on  http://stackoverflow.com/questions/849211/shortest-distance-between-a-point-and-a-line-segment\nfunction sqr(x) {\n  return x * x;\n}\n\nfunction dist2(v, w) {\n  return sqr(v.x - w.x) + sqr(v.y - w.y);\n}\n\nfunction distanceToPointSquared(lineSegment, point) {\n  var l2 = dist2(lineSegment.start, lineSegment.end);\n\n  if (l2 === 0) {\n    return dist2(point, lineSegment.start);\n  }\n  var t = ((point.x - lineSegment.start.x) * (lineSegment.end.x - lineSegment.start.x) + (point.y - lineSegment.start.y) * (lineSegment.end.y - lineSegment.start.y)) / l2;\n\n  if (t < 0) {\n    return dist2(point, lineSegment.start);\n  }\n  if (t > 1) {\n    return dist2(point, lineSegment.end);\n  }\n\n  var pt = {\n    x: lineSegment.start.x + t * (lineSegment.end.x - lineSegment.start.x),\n    y: lineSegment.start.y + t * (lineSegment.end.y - lineSegment.start.y)\n  };\n\n  return dist2(point, pt);\n}\n\nfunction distanceToPoint(lineSegment, point) {\n  return Math.sqrt(distanceToPointSquared(lineSegment, point));\n}\n\n// Returns intersection points of two lines\nfunction intersectLine(lineSegment1, lineSegment2) {\n  var intersectionPoint = {};\n\n  var x1 = lineSegment1.start.x,\n      y1 = lineSegment1.start.y,\n      x2 = lineSegment1.end.x,\n      y2 = lineSegment1.end.y,\n      x3 = lineSegment2.start.x,\n      y3 = lineSegment2.start.y,\n      x4 = lineSegment2.end.x,\n      y4 = lineSegment2.end.y;\n\n  var a1 = void 0,\n      a2 = void 0,\n      b1 = void 0,\n      b2 = void 0,\n      c1 = void 0,\n      c2 = void 0; // Coefficients of line equations\n  var r1 = void 0,\n      r2 = void 0,\n      r3 = void 0,\n      r4 = void 0; // Sign values\n\n  var denom = void 0,\n      num = void 0; // Intermediate values\n\n  // Compute a1, b1, c1, where line joining points 1 and 2 is \"a1 x  +  b1 y  +  c1  =  0\"\n  a1 = y2 - y1;\n  b1 = x1 - x2;\n  c1 = x2 * y1 - x1 * y2;\n\n  // Compute r3 and r4\n  r3 = a1 * x3 + b1 * y3 + c1;\n  r4 = a1 * x4 + b1 * y4 + c1;\n\n  /* Check signs of r3 and r4.  If both point 3 and point 4 lie on\n   * same side of line 1, the line segments do not intersect.\n   */\n\n  if (r3 !== 0 && r4 !== 0 && (0, _math.sign)(r3) === (0, _math.sign)(r4)) {\n    return;\n  }\n\n  /* Compute a2, b2, c2 */\n\n  a2 = y4 - y3;\n  b2 = x3 - x4;\n  c2 = x4 * y3 - x3 * y4;\n\n  /* Compute r1 and r2 */\n\n  r1 = a2 * x1 + b2 * y1 + c2;\n  r2 = a2 * x2 + b2 * y2 + c2;\n\n  /* Check signs of r1 and r2.  If both point 1 and point 2 lie\n   * on same side of second line segment, the line segments do\n   * not intersect.\n   */\n\n  if (r1 !== 0 && r2 !== 0 && (0, _math.sign)(r1) === (0, _math.sign)(r2)) {\n    return;\n  }\n\n  /* Line segments intersect: compute intersection point.\n   */\n\n  denom = a1 * b2 - a2 * b1;\n\n  /* The denom/2 is to get rounding instead of truncating.  It\n   * is added or subtracted to the numerator, depending upon the\n   * sign of the numerator.\n   */\n\n  num = b1 * c2 - b2 * c1;\n  var x = parseFloat(num / denom);\n\n  num = a2 * c1 - a1 * c2;\n  var y = parseFloat(num / denom);\n\n  intersectionPoint.x = x;\n  intersectionPoint.y = y;\n\n  return intersectionPoint;\n}\n\n// Module exports\nvar lineSegment = {\n  distanceToPoint: distanceToPoint,\n  intersectLine: intersectLine\n};\n\nexports.default = lineSegment;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar Quaternion = function Quaternion(x, y, z, w) {\n  this.x = x || 0;\n  this.y = y || 0;\n  this.z = z || 0;\n  this.w = w !== undefined ? w : 1;\n};\n\nQuaternion.prototype.setFromAxisAngle = function (axis, angle) {\n  var halfAngle = angle / 2,\n      s = Math.sin(halfAngle);\n\n  this.x = axis.x * s;\n  this.y = axis.y * s;\n  this.z = axis.z * s;\n  this.w = Math.cos(halfAngle);\n\n  return this;\n};\n\nQuaternion.prototype.multiplyQuaternions = function (a, b) {\n  var qax = a.x,\n      qay = a.y,\n      qaz = a.z,\n      qaw = a.w;\n  var qbx = b.x,\n      qby = b.y,\n      qbz = b.z,\n      qbw = b.w;\n\n  this.x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n  this.y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n  this.z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n  this.w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n  return this;\n};\n\nQuaternion.prototype.setFromRotationMatrix = function (m) {\n  var te = m.elements,\n      m11 = te[0],\n      m12 = te[4],\n      m13 = te[8],\n      m21 = te[1],\n      m22 = te[5],\n      m23 = te[9],\n      m31 = te[2],\n      m32 = te[6],\n      m33 = te[10],\n      trace = m11 + m22 + m33,\n      s = void 0;\n\n  if (trace > 0) {\n\n    s = 0.5 / Math.sqrt(trace + 1.0);\n\n    this.w = 0.25 / s;\n    this.x = (m32 - m23) * s;\n    this.y = (m13 - m31) * s;\n    this.z = (m21 - m12) * s;\n  } else if (m11 > m22 && m11 > m33) {\n\n    s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\n    this.w = (m32 - m23) / s;\n    this.x = 0.25 * s;\n    this.y = (m12 + m21) / s;\n    this.z = (m13 + m31) / s;\n  } else if (m22 > m33) {\n\n    s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\n    this.w = (m13 - m31) / s;\n    this.x = (m12 + m21) / s;\n    this.y = 0.25 * s;\n    this.z = (m23 + m32) / s;\n  } else {\n\n    s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\n    this.w = (m21 - m12) / s;\n    this.x = (m13 + m31) / s;\n    this.y = (m23 + m32) / s;\n    this.z = 0.25 * s;\n  }\n\n  return this;\n};\n\nexports.default = Quaternion;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _vector = __webpack_require__(1);\n\nvar _vector2 = _interopRequireDefault(_vector);\n\nvar _math = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// Copied from THREE.JS\n/**\n * @author bhouston / http://exocortex.com\n */\n\nvar Line3 = function () {\n  function Line3(start, end) {\n    _classCallCheck(this, Line3);\n\n    this.start = start !== undefined ? start : new _vector2.default();\n    this.end = end !== undefined ? end : new _vector2.default();\n  }\n\n  _createClass(Line3, [{\n    key: 'set',\n    value: function set(start, end) {\n\n      this.start.copy(start);\n      this.end.copy(end);\n\n      return this;\n    }\n  }, {\n    key: 'copy',\n    value: function copy(line) {\n\n      this.start.copy(line.start);\n      this.end.copy(line.end);\n\n      return this;\n    }\n  }, {\n    key: 'center',\n    value: function center(optionalTarget) {\n\n      var result = optionalTarget || new _vector2.default();\n\n      return result.addVectors(this.start, this.end).multiplyScalar(0.5);\n    }\n  }, {\n    key: 'delta',\n    value: function delta(optionalTarget) {\n\n      var result = optionalTarget || new _vector2.default();\n\n      return result.subVectors(this.end, this.start);\n    }\n  }, {\n    key: 'distanceSq',\n    value: function distanceSq() {\n\n      return this.start.distanceToSquared(this.end);\n    }\n  }, {\n    key: 'distance',\n    value: function distance() {\n\n      return this.start.distanceTo(this.end);\n    }\n  }, {\n    key: 'at',\n    value: function at(t, optionalTarget) {\n\n      var result = optionalTarget || new _vector2.default();\n\n      return this.delta(result).multiplyScalar(t).add(this.start);\n    }\n  }, {\n    key: 'closestPointToPointParameter',\n    value: function closestPointToPointParameter() {\n\n      var startP = new _vector2.default();\n      var startEnd = new _vector2.default();\n\n      return function (point, clampToLine) {\n\n        startP.subVectors(point, this.start);\n        startEnd.subVectors(this.end, this.start);\n\n        var startEnd2 = startEnd.dot(startEnd);\n        var startEnd_startP = startEnd.dot(startP);\n\n        var t = startEnd_startP / startEnd2;\n\n        if (clampToLine) {\n\n          t = (0, _math.clamp)(t, 0, 1);\n        }\n\n        return t;\n      };\n    }\n  }, {\n    key: 'closestPointToPoint',\n    value: function closestPointToPoint(point, clampToLine, optionalTarget) {\n\n      var t = this.closestPointToPointParameter(point, clampToLine);\n\n      var result = optionalTarget || new _vector2.default();\n\n      return this.delta(result).multiplyScalar(t).add(this.start);\n    }\n  }, {\n    key: 'applyMatrix4',\n    value: function applyMatrix4(matrix) {\n\n      this.start.applyMatrix4(matrix);\n      this.end.applyMatrix4(matrix);\n\n      return this;\n    }\n  }, {\n    key: 'equals',\n    value: function equals(line) {\n\n      return line.start.equals(this.start) && line.end.equals(this.end);\n    }\n  }, {\n    key: 'clone',\n    value: function clone() {\n\n      return new Line3().copy(this);\n    }\n  }, {\n    key: 'intersectLine',\n    value: function intersectLine(line) {\n      // http://stackoverflow.com/questions/2316490/the-algorithm-to-find-the-point-of-intersection-of-two-3d-line-segment/10288710#10288710\n      var da = this.end.clone().sub(this.start);\n      var db = line.end.clone().sub(line.start);\n      var dc = line.start.clone().sub(this.start);\n\n      var daCrossDb = da.clone().cross(db);\n      var dcCrossDb = dc.clone().cross(db);\n\n      if (dc.dot(da) === 0) {\n        // Lines are not coplanar, stop here\n        return;\n      }\n\n      var s = dcCrossDb.dot(daCrossDb) / daCrossDb.lengthSq();\n\n      // Make sure we have an intersection\n      if (s > 1.0 || isNaN(s)) {\n        return;\n      }\n\n      var intersection = this.start.clone().add(da.clone().multiplyScalar(s));\n      var distanceTest = intersection.clone().sub(line.start).lengthSq() + intersection.clone().sub(line.end).lengthSq();\n\n      if (distanceTest <= line.distanceSq()) {\n        return intersection;\n      }\n\n      return;\n    }\n  }]);\n\n  return Line3;\n}();\n\nexports.default = Line3;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _vector = __webpack_require__(1);\n\nvar _vector2 = _interopRequireDefault(_vector);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Based on THREE.JS\nvar Matrix4 = function Matrix4(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {\n  this.elements = new Float32Array(16);\n\n  // TODO: if n11 is undefined, then just set to identity, otherwise copy all other values into matrix\n  //   We should not support semi specification of Matrix4, it is just weird.\n\n  var te = this.elements;\n\n  te[0] = n11 !== undefined ? n11 : 1;te[4] = n12 || 0;te[8] = n13 || 0;te[12] = n14 || 0;\n  te[1] = n21 || 0;te[5] = n22 !== undefined ? n22 : 1;te[9] = n23 || 0;te[13] = n24 || 0;\n  te[2] = n31 || 0;te[6] = n32 || 0;te[10] = n33 !== undefined ? n33 : 1;te[14] = n34 || 0;\n  te[3] = n41 || 0;te[7] = n42 || 0;te[11] = n43 || 0;te[15] = n44 !== undefined ? n44 : 1;\n};\n\nMatrix4.prototype.makeRotationFromQuaternion = function (q) {\n  var te = this.elements;\n\n  var x = q.x,\n      y = q.y,\n      z = q.z,\n      w = q.w;\n  var x2 = x + x,\n      y2 = y + y,\n      z2 = z + z;\n  var xx = x * x2,\n      xy = x * y2,\n      xz = x * z2;\n  var yy = y * y2,\n      yz = y * z2,\n      zz = z * z2;\n  var wx = w * x2,\n      wy = w * y2,\n      wz = w * z2;\n\n  te[0] = 1 - (yy + zz);\n  te[4] = xy - wz;\n  te[8] = xz + wy;\n\n  te[1] = xy + wz;\n  te[5] = 1 - (xx + zz);\n  te[9] = yz - wx;\n\n  te[2] = xz - wy;\n  te[6] = yz + wx;\n  te[10] = 1 - (xx + yy);\n\n  // Last column\n  te[3] = 0;\n  te[7] = 0;\n  te[11] = 0;\n\n  // Bottom row\n  te[12] = 0;\n  te[13] = 0;\n  te[14] = 0;\n  te[15] = 1;\n\n  return this;\n};\n\nMatrix4.prototype.multiplyMatrices = function (a, b) {\n  var ae = a.elements;\n  var be = b.elements;\n  var te = this.elements;\n\n  var a11 = ae[0],\n      a12 = ae[4],\n      a13 = ae[8],\n      a14 = ae[12];\n  var a21 = ae[1],\n      a22 = ae[5],\n      a23 = ae[9],\n      a24 = ae[13];\n  var a31 = ae[2],\n      a32 = ae[6],\n      a33 = ae[10],\n      a34 = ae[14];\n  var a41 = ae[3],\n      a42 = ae[7],\n      a43 = ae[11],\n      a44 = ae[15];\n\n  var b11 = be[0],\n      b12 = be[4],\n      b13 = be[8],\n      b14 = be[12];\n  var b21 = be[1],\n      b22 = be[5],\n      b23 = be[9],\n      b24 = be[13];\n  var b31 = be[2],\n      b32 = be[6],\n      b33 = be[10],\n      b34 = be[14];\n  var b41 = be[3],\n      b42 = be[7],\n      b43 = be[11],\n      b44 = be[15];\n\n  te[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n  te[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n  te[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n  te[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\n  te[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n  te[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n  te[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n  te[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\n  te[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n  te[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n  te[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n  te[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\n  te[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n  te[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n  te[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n  te[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\n  return this;\n};\n\nMatrix4.prototype.multiply = function (m, n) {\n\n  if (n !== undefined) {\n\n    console.warn('DEPRECATED: Matrix4\\'s .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.');\n\n    return this.multiplyMatrices(m, n);\n  }\n\n  return this.multiplyMatrices(this, m);\n};\n\nMatrix4.prototype.getInverse = function (m, throwOnInvertible) {\n\n  // Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n  var te = this.elements;\n  var me = m.elements;\n\n  var n11 = me[0],\n      n12 = me[4],\n      n13 = me[8],\n      n14 = me[12];\n  var n21 = me[1],\n      n22 = me[5],\n      n23 = me[9],\n      n24 = me[13];\n  var n31 = me[2],\n      n32 = me[6],\n      n33 = me[10],\n      n34 = me[14];\n  var n41 = me[3],\n      n42 = me[7],\n      n43 = me[11],\n      n44 = me[15];\n\n  te[0] = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44;\n  te[4] = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44;\n  te[8] = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44;\n  te[12] = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n  te[1] = n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44;\n  te[5] = n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44;\n  te[9] = n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44;\n  te[13] = n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34;\n  te[2] = n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44;\n  te[6] = n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44;\n  te[10] = n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44;\n  te[14] = n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34;\n  te[3] = n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43;\n  te[7] = n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43;\n  te[11] = n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43;\n  te[15] = n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33;\n\n  var det = n11 * te[0] + n21 * te[4] + n31 * te[8] + n41 * te[12];\n\n  if (det === 0) {\n\n    var msg = 'Matrix4.getInverse(): can\\'t invert matrix, determinant is 0';\n\n    if (throwOnInvertible || false) {\n\n      throw new Error(msg);\n    } else {\n\n      console.warn(msg);\n    }\n\n    this.identity();\n\n    return this;\n  }\n\n  this.multiplyScalar(1 / det);\n\n  return this;\n};\n\nMatrix4.prototype.applyToVector3Array = function () {\n\n  var v1 = new _vector2.default();\n\n  return function (array, offset, length) {\n\n    if (offset === undefined) {\n      offset = 0;\n    }\n    if (length === undefined) {\n      length = array.length;\n    }\n\n    for (var i = 0, j = offset; i < length; i += 3, j += 3) {\n\n      v1.x = array[j];\n      v1.y = array[j + 1];\n      v1.z = array[j + 2];\n\n      v1.applyMatrix4(this);\n\n      array[j] = v1.x;\n      array[j + 1] = v1.y;\n      array[j + 2] = v1.z;\n    }\n\n    return array;\n  };\n};\n\nMatrix4.prototype.makeTranslation = function (x, y, z) {\n\n  this.set(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1);\n\n  return this;\n};\nMatrix4.prototype.multiplyScalar = function (s) {\n\n  var te = this.elements;\n\n  te[0] *= s;te[4] *= s;te[8] *= s;te[12] *= s;\n  te[1] *= s;te[5] *= s;te[9] *= s;te[13] *= s;\n  te[2] *= s;te[6] *= s;te[10] *= s;te[14] *= s;\n  te[3] *= s;te[7] *= s;te[11] *= s;te[15] *= s;\n\n  return this;\n};\nMatrix4.prototype.set = function (n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {\n\n  var te = this.elements;\n\n  te[0] = n11;te[4] = n12;te[8] = n13;te[12] = n14;\n  te[1] = n21;te[5] = n22;te[9] = n23;te[13] = n24;\n  te[2] = n31;te[6] = n32;te[10] = n33;te[14] = n34;\n  te[3] = n41;te[7] = n42;te[11] = n43;te[15] = n44;\n\n  return this;\n};\n\nMatrix4.prototype.makeScale = function (x, y, z) {\n\n  this.set(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);\n\n  return this;\n};\n\nexports.default = Matrix4;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _vector = __webpack_require__(1);\n\nvar _vector2 = _interopRequireDefault(_vector);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Copied from Three.JS\n/**\n * @author bhouston / http://exocortex.com\n */\n\nvar Plane = function Plane(normal, constant) {\n\n  this.normal = normal !== undefined ? normal : new _vector2.default(1, 0, 0);\n  this.constant = constant !== undefined ? constant : 0;\n};\n\nPlane.prototype = {\n\n  constructor: Plane,\n\n  set: function set(normal, constant) {\n\n    this.normal.copy(normal);\n    this.constant = constant;\n\n    return this;\n  },\n  setComponents: function setComponents(x, y, z, w) {\n\n    this.normal.set(x, y, z);\n    this.constant = w;\n\n    return this;\n  },\n  setFromNormalAndCoplanarPoint: function setFromNormalAndCoplanarPoint(normal, point) {\n\n    this.normal.copy(normal);\n    this.constant = -point.dot(this.normal); // Must be this.normal, not normal, as this.normal is normalized\n\n    return this;\n  },\n\n\n  setFromCoplanarPoints: function () {\n\n    var v1 = new _vector2.default();\n    var v2 = new _vector2.default();\n\n    return function (a, b, c) {\n\n      var normal = v1.subVectors(c, b).cross(v2.subVectors(a, b)).normalize();\n\n      // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n      this.setFromNormalAndCoplanarPoint(normal, a);\n\n      return this;\n    };\n  }(),\n\n  copy: function copy(plane) {\n\n    this.normal.copy(plane.normal);\n    this.constant = plane.constant;\n\n    return this;\n  },\n  normalize: function normalize() {\n\n    // Note: will lead to a divide by zero if the plane is invalid.\n\n    var inverseNormalLength = 1.0 / this.normal.length();\n\n    this.normal.multiplyScalar(inverseNormalLength);\n    this.constant *= inverseNormalLength;\n\n    return this;\n  },\n  negate: function negate() {\n\n    this.constant *= -1;\n    this.normal.negate();\n\n    return this;\n  },\n  distanceToPoint: function distanceToPoint(point) {\n\n    return this.normal.dot(point) + this.constant;\n  },\n  distanceToSphere: function distanceToSphere(sphere) {\n\n    return this.distanceToPoint(sphere.center) - sphere.radius;\n  },\n  projectPoint: function projectPoint(point, optionalTarget) {\n\n    return this.orthoPoint(point, optionalTarget).sub(point).negate();\n  },\n  orthoPoint: function orthoPoint(point, optionalTarget) {\n\n    var perpendicularMagnitude = this.distanceToPoint(point);\n\n    var result = optionalTarget || new _vector2.default();\n\n    return result.copy(this.normal).multiplyScalar(perpendicularMagnitude);\n  },\n  isIntersectionLine: function isIntersectionLine(line) {\n\n    // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\n    var startSign = this.distanceToPoint(line.start);\n    var endSign = this.distanceToPoint(line.end);\n\n    return startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;\n  },\n\n\n  intersectLine: function () {\n\n    var v1 = new _vector2.default();\n\n    return function (line, optionalTarget) {\n\n      var result = optionalTarget || new _vector2.default();\n\n      var direction = line.delta(v1);\n\n      var denominator = this.normal.dot(direction);\n\n      if (denominator === 0) {\n\n        // Line is coplanar, return origin\n        if (this.distanceToPoint(line.start) === 0) {\n\n          return result.copy(line.start);\n        }\n\n        // Unsure if this is the correct method to handle this case.\n        return undefined;\n      }\n\n      var t = -(line.start.dot(this.normal) + this.constant) / denominator;\n\n      if (t < 0 || t > 1) {\n\n        return undefined;\n      }\n\n      return result.copy(direction).multiplyScalar(t).add(line.start);\n    };\n  }(),\n\n  intersectPlane: function intersectPlane(targetPlane) {\n    // Returns the intersection line between two planes\n    var direction = this.normal.clone().cross(targetPlane.normal);\n    var origin = new _vector2.default();\n    var intersectionData = {\n      origin: origin,\n      direction: direction\n    };\n\n    // If the planes are parallel, return an empty vector for the\n    // Intersection line\n    if (this.normal.clone().cross(targetPlane.normal).length < 1e-10) {\n      intersectionData.direction = new _vector2.default();\n\n      return intersectionData;\n    }\n\n    var h1 = this.constant;\n    var h2 = targetPlane.constant;\n    var n1dotn2 = this.normal.clone().dot(targetPlane.normal);\n\n    var c1 = -(h1 - h2 * n1dotn2) / (1 - n1dotn2 * n1dotn2);\n    var c2 = -(h2 - h1 * n1dotn2) / (1 - n1dotn2 * n1dotn2);\n\n    intersectionData.origin = this.normal.clone().multiplyScalar(c1).add(targetPlane.normal.clone().multiplyScalar(c2));\n\n    return intersectionData;\n  },\n  coplanarPoint: function coplanarPoint(optionalTarget) {\n\n    var result = optionalTarget || new _vector2.default();\n\n    return result.copy(this.normal).multiplyScalar(-this.constant);\n  },\n  translate: function translate(offset) {\n\n    this.constant = this.constant - offset.dot(this.normal);\n\n    return this;\n  },\n  equals: function equals(plane) {\n\n    return plane.normal.equals(this.normal) && plane.constant === this.constant;\n  },\n  clone: function clone() {\n\n    return new Plane().copy(this);\n  }\n};\n\nexports.default = Plane;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nfunction pageToPoint(e) {\n  return {\n    x: e.pageX,\n    y: e.pageY\n  };\n}\n\nfunction subtract(lhs, rhs) {\n  return {\n    x: lhs.x - rhs.x,\n    y: lhs.y - rhs.y\n  };\n}\n\nfunction copy(point) {\n  return {\n    x: point.x,\n    y: point.y\n  };\n}\n\nfunction distance(from, to) {\n  return Math.sqrt(distanceSquared(from, to));\n}\n\nfunction distanceSquared(from, to) {\n  var delta = subtract(from, to);\n\n  return delta.x * delta.x + delta.y * delta.y;\n}\n\nfunction insideRect(point, rect) {\n  if (point.x < rect.left || point.x > rect.left + rect.width || point.y < rect.top || point.y > rect.top + rect.height) {\n    return false;\n  }\n\n  return true;\n}\n\n/**\n * Returns the closest source point to a target point\n * given an array of source points.\n *\n * @param sources An Array of source Points\n * @param target The target Point\n * @returns Point The closest point from the points array\n */\nfunction findClosestPoint(sources, target) {\n  var distances = [];\n  var minDistance = void 0;\n\n  sources.forEach(function (source, index) {\n    var d = distance(source, target);\n\n    distances.push(d);\n\n    if (index === 0) {\n      minDistance = d;\n    } else {\n      minDistance = Math.min(d, minDistance);\n    }\n  });\n\n  var index = distances.indexOf(minDistance);\n\n  return sources[index];\n}\n\nvar point = {\n  subtract: subtract,\n  copy: copy,\n  pageToPoint: pageToPoint,\n  distance: distance,\n  distanceSquared: distanceSquared,\n  insideRect: insideRect,\n  findClosestPoint: findClosestPoint\n};\n\nexports.default = point;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _lineSegment = __webpack_require__(2);\n\nvar _lineSegment2 = _interopRequireDefault(_lineSegment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction rectToLineSegments(rect) {\n  var top = {\n    start: {\n      x: rect.left,\n      y: rect.top\n    },\n    end: {\n      x: rect.left + rect.width,\n      y: rect.top\n\n    }\n  };\n  var right = {\n    start: {\n      x: rect.left + rect.width,\n      y: rect.top\n    },\n    end: {\n      x: rect.left + rect.width,\n      y: rect.top + rect.height\n\n    }\n  };\n  var bottom = {\n    start: {\n      x: rect.left + rect.width,\n      y: rect.top + rect.height\n    },\n    end: {\n      x: rect.left,\n      y: rect.top + rect.height\n\n    }\n  };\n  var left = {\n    start: {\n      x: rect.left,\n      y: rect.top + rect.height\n    },\n    end: {\n      x: rect.left,\n      y: rect.top\n\n    }\n  };\n  var lineSegments = [top, right, bottom, left];\n\n  return lineSegments;\n}\n\nfunction distanceToPoint(rect, point) {\n  var minDistance = 655535;\n  var lineSegments = rectToLineSegments(rect);\n\n  lineSegments.forEach(function (segment) {\n    var distance = _lineSegment2.default.distanceToPoint(segment, point);\n\n    if (distance < minDistance) {\n      minDistance = distance;\n    }\n  });\n\n  return minDistance;\n}\n\n// Returns top-left and bottom-right points of the rectangle\nfunction rectToPoints(rect) {\n  var rectPoints = {\n    topLeft: {\n      x: rect.left,\n      y: rect.top\n    },\n    bottomRight: {\n      x: rect.left + rect.width,\n      y: rect.top + rect.height\n    }\n  };\n\n  return rectPoints;\n}\n\n// Returns whether two non-rotated rectangles are intersected\nfunction doesIntersect(rect1, rect2) {\n  var intersectLeftRight = void 0;\n  var intersectTopBottom = void 0;\n\n  var rect1Points = rectToPoints(rect1);\n  var rect2Points = rectToPoints(rect2);\n\n  if (rect1.width >= 0) {\n    if (rect2.width >= 0) {\n      intersectLeftRight = !(rect1Points.bottomRight.x <= rect2Points.topLeft.x || rect2Points.bottomRight.x <= rect1Points.topLeft.x);\n    } else {\n      intersectLeftRight = !(rect1Points.bottomRight.x <= rect2Points.bottomRight.x || rect2Points.topLeft.x <= rect1Points.topLeft.x);\n    }\n  } else if (rect2.width >= 0) {\n    intersectLeftRight = !(rect1Points.topLeft.x <= rect2Points.topLeft.x || rect2Points.bottomRight.x <= rect1Points.bottomRight.x);\n  } else {\n    intersectLeftRight = !(rect1Points.topLeft.x <= rect2Points.bottomRight.x || rect2Points.topLeft.x <= rect1Points.bottomRight.x);\n  }\n\n  if (rect1.height >= 0) {\n    if (rect2.height >= 0) {\n      intersectTopBottom = !(rect1Points.bottomRight.y <= rect2Points.topLeft.y || rect2Points.bottomRight.y <= rect1Points.topLeft.y);\n    } else {\n      intersectTopBottom = !(rect1Points.bottomRight.y <= rect2Points.bottomRight.y || rect2Points.topLeft.y <= rect1Points.topLeft.y);\n    }\n  } else if (rect2.height >= 0) {\n    intersectTopBottom = !(rect1Points.topLeft.y <= rect2Points.topLeft.y || rect2Points.bottomRight.y <= rect1Points.bottomRight.y);\n  } else {\n    intersectTopBottom = !(rect1Points.topLeft.y <= rect2Points.bottomRight.y || rect2Points.top <= rect1Points.bottomRight.y);\n  }\n\n  return intersectLeftRight && intersectTopBottom;\n}\n\n// Returns intersection points of two non-rotated rectangles\nfunction getIntersectionRect(rect1, rect2) {\n  var intersectRect = {\n    topLeft: {},\n    bottomRight: {}\n  };\n\n  if (!doesIntersect(rect1, rect2)) {\n    return;\n  }\n\n  var rect1Points = rectToPoints(rect1);\n  var rect2Points = rectToPoints(rect2);\n\n  if (rect1.width >= 0) {\n    if (rect2.width >= 0) {\n      intersectRect.topLeft.x = Math.max(rect1Points.topLeft.x, rect2Points.topLeft.x);\n      intersectRect.bottomRight.x = Math.min(rect1Points.bottomRight.x, rect2Points.bottomRight.x);\n    } else {\n      intersectRect.topLeft.x = Math.max(rect1Points.topLeft.x, rect2Points.bottomRight.x);\n      intersectRect.bottomRight.x = Math.min(rect1Points.bottomRight.x, rect2Points.topLeft.x);\n    }\n  } else if (rect2.width >= 0) {\n    intersectRect.topLeft.x = Math.min(rect1Points.topLeft.x, rect2Points.bottomRight.x);\n    intersectRect.bottomRight.x = Math.max(rect1Points.bottomRight.x, rect2Points.topLeft.x);\n  } else {\n    intersectRect.topLeft.x = Math.min(rect1Points.topLeft.x, rect2Points.topLeft.x);\n    intersectRect.bottomRight.x = Math.max(rect1Points.bottomRight.x, rect2Points.bottomRight.x);\n  }\n\n  if (rect1.height >= 0) {\n    if (rect2.height >= 0) {\n      intersectRect.topLeft.y = Math.max(rect1Points.topLeft.y, rect2Points.topLeft.y);\n      intersectRect.bottomRight.y = Math.min(rect1Points.bottomRight.y, rect2Points.bottomRight.y);\n    } else {\n      intersectRect.topLeft.y = Math.max(rect1Points.topLeft.y, rect2Points.bottomRight.y);\n      intersectRect.bottomRight.y = Math.min(rect1Points.bottomRight.y, rect2Points.topLeft.y);\n    }\n  } else if (rect2.height >= 0) {\n    intersectRect.topLeft.y = Math.min(rect1Points.topLeft.y, rect2Points.bottomRight.y);\n    intersectRect.bottomRight.y = Math.max(rect1Points.bottomRight.y, rect2Points.topLeft.y);\n  } else {\n    intersectRect.topLeft.y = Math.min(rect1Points.topLeft.y, rect2Points.topLeft.y);\n    intersectRect.bottomRight.y = Math.max(rect1Points.bottomRight.y, rect2Points.bottomRight.y);\n  }\n\n  // Returns top-left and bottom-right points of intersected rectangle\n  return intersectRect;\n}\n\nvar rect = {\n  distanceToPoint: distanceToPoint,\n  getIntersectionRect: getIntersectionRect\n};\n\nexports.default = rect;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n         value: true\n});\n\nvar _Line = __webpack_require__(4);\n\nObject.defineProperty(exports, 'Line3', {\n         enumerable: true,\n         get: function get() {\n                  return _interopRequireDefault(_Line).default;\n         }\n});\n\nvar _lineSegment = __webpack_require__(2);\n\nObject.defineProperty(exports, 'lineSegment', {\n         enumerable: true,\n         get: function get() {\n                  return _interopRequireDefault(_lineSegment).default;\n         }\n});\n\nvar _math = __webpack_require__(0);\n\nObject.defineProperty(exports, 'clamp', {\n         enumerable: true,\n         get: function get() {\n                  return _math.clamp;\n         }\n});\nObject.defineProperty(exports, 'degToRad', {\n         enumerable: true,\n         get: function get() {\n                  return _math.degToRad;\n         }\n});\nObject.defineProperty(exports, 'radToDeg', {\n         enumerable: true,\n         get: function get() {\n                  return _math.radToDeg;\n         }\n});\nObject.defineProperty(exports, 'sign', {\n         enumerable: true,\n         get: function get() {\n                  return _math.sign;\n         }\n});\n\nvar _matrix = __webpack_require__(5);\n\nObject.defineProperty(exports, 'Matrix4', {\n         enumerable: true,\n         get: function get() {\n                  return _interopRequireDefault(_matrix).default;\n         }\n});\n\nvar _plane = __webpack_require__(6);\n\nObject.defineProperty(exports, 'Plane', {\n         enumerable: true,\n         get: function get() {\n                  return _interopRequireDefault(_plane).default;\n         }\n});\n\nvar _point = __webpack_require__(7);\n\nObject.defineProperty(exports, 'point', {\n         enumerable: true,\n         get: function get() {\n                  return _interopRequireDefault(_point).default;\n         }\n});\n\nvar _quaternion = __webpack_require__(3);\n\nObject.defineProperty(exports, 'quaternion', {\n         enumerable: true,\n         get: function get() {\n                  return _interopRequireDefault(_quaternion).default;\n         }\n});\n\nvar _rect = __webpack_require__(8);\n\nObject.defineProperty(exports, 'rect', {\n         enumerable: true,\n         get: function get() {\n                  return _interopRequireDefault(_rect).default;\n         }\n});\n\nvar _vector = __webpack_require__(1);\n\nObject.defineProperty(exports, 'Vector3', {\n         enumerable: true,\n         get: function get() {\n                  return _interopRequireDefault(_vector).default;\n         }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=cornerstoneMath.js.map","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LayoutGridSelector.vue?vue&type=style&index=0&id=77ea46e2&prod&lang=scss&scoped=true\"","var render = function () {\nvar this$1 = this;\nvar _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('viewer-layout',{attrs:{\"primary-toolbar-config\":{\n\t\tBack: {\n\t\t\tgroup: 'left',\n\t\t\tclass: 'back-btn',\n\t\t\ticon: 'arrow-left',\n\t\t\taction: function () { return this$1.$router.go(-1); },\n\t\t},\n\t},\"settings-config\":{\n\t\t'Intersecting Line Angles': {\n\t\t\thidden: true,\n\t\t},\n\t\t'Reference Lines': {\n\t\t\thidden: true,\n\t\t},\n\t}},scopedSlots:_vm._u([{key:\"right-drawer\",fn:function(){return [_c('section',{staticStyle:{\"padding\":\"12px\"}},[_c('h4',[_c('svg-icon',{attrs:{\"icon\":\"inbox-download\",\"fixed\":\"\"}}),_vm._v(\"\\n\\t\\t\\t\\tReview Images\\n\\t\\t\\t\")],1),_c('div',{staticClass:\"button-column\"},[_c('ast-button',[_vm._v(\"\\n\\t\\t\\t\\t\\tReject Image\\n\\t\\t\\t\\t\")]),_c('ast-button',[_vm._v(\"\\n\\t\\t\\t\\t\\tReject Study\\n\\t\\t\\t\\t\")]),_c('ast-button',[_vm._v(\"\\n\\t\\t\\t\\t\\tApprove\\n\\t\\t\\t\\t\")])],1)])]},proxy:true}])})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<viewer-layout\n\t\t:primary-toolbar-config=\"{\n\t\t\tBack: {\n\t\t\t\tgroup: 'left',\n\t\t\t\tclass: 'back-btn',\n\t\t\t\ticon: 'arrow-left',\n\t\t\t\taction: () => this.$router.go(-1),\n\t\t\t},\n\t\t}\"\n\t\t:settings-config=\"{\n\t\t\t'Intersecting Line Angles': {\n\t\t\t\thidden: true,\n\t\t\t},\n\t\t\t'Reference Lines': {\n\t\t\t\thidden: true,\n\t\t\t},\n\t\t}\"\n\t>\n\t\t<!-- <template #primary-buttons-right>\n\t\t\t<ast-toolbar-button\n\t\t\t\ticon=\"inbox-download\"\n\t\t\t\tlabel=\"Reject Image\"\n\t\t\t\tclass=\"label-right\"\n\t\t\t\t:class=\"isRejected && 'added-to-report'\"\n\t\t\t\t@click.native=\"openRejection\"\n\t\t\t/>\n\t\t</template> -->\n\t\t<template #right-drawer>\n\t\t\t<section style=\"padding: 12px;\">\n\t\t\t\t<h4>\n\t\t\t\t\t<svg-icon icon=\"inbox-download\" fixed />\n\t\t\t\t\tReview Images\n\t\t\t\t</h4>\n\t\t\t\t<div class=\"button-column\">\n\t\t\t\t\t<ast-button>\n\t\t\t\t\t\tReject Image\n\t\t\t\t\t</ast-button>\n\t\t\t\t\t<ast-button>\n\t\t\t\t\t\tReject Study\n\t\t\t\t\t</ast-button>\n\t\t\t\t\t<ast-button>\n\t\t\t\t\t\tApprove\n\t\t\t\t\t</ast-button>\n\t\t\t\t</div>\n\t\t\t</section>\n\t\t</template>\n\t</viewer-layout>\n</template>\n\n<script>\nimport { mapGetters, mapActions } from 'vuex'\nimport ViewerLayout from '@router/layouts/Viewer'\n// import AstToolbarButton from '@components/ToolbarButton.vue'\nimport AstButton from '@components/Button'\nimport { openPromptDlg } from '@/dialogs/TextPromptDlg.vue'\n\nexport default {\n\tname: 'ReviewViewer',\n\tcomponents: {\n\t\tViewerLayout,\n\t\tAstButton,\n\t\t// AstToolbarButton,\n\t},\n\tprops: {\n\t\tid: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tcomputed: {\n\t\t...mapGetters(['activeImage']),\n\t\tisRejected() {\n\t\t\treturn !this.activeImage || false\n\t\t},\n\t},\n\tasync mounted() {\n\t\tawait Promise.all([this.getConsignerStudyViewerVmAsync({ id: this.id }), this.getHangingProtocols()])\n\t\tawait this.getUserViewerSettings()\n\t},\n\tmethods: {\n\t\t...mapActions(['getConsignerStudyViewerVmAsync', 'getUserViewerSettings', 'getHangingProtocols']),\n\t\tasync openRejection() {\n\t\t\t// FIXME: needs to have both a Reject Active Image and Reject All Images\n\t\t\tconst response = await openPromptDlg({\n\t\t\t\tbuttonLabel: 'Reject',\n\t\t\t\ttitle: `Reject Images for ${this.translate('consignerStudy')} 0000`,\n\t\t\t\tprompt: 'Provide a reason for rejecting this images',\n\t\t\t\trequireInput: true,\n\t\t\t})\n\t\t\tif (response) {\n\t\t\t\tthis.$router.go(-1)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\nh4 {\n\twidth: 176px;\n\ttext-transform: uppercase;\n\tletter-spacing: 0.05em;\n\tfont-weight: normal;\n\tmargin-bottom: 1em;\n}\n.button-column {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n</style>\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReviewViewer.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReviewViewer.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ReviewViewer.vue?vue&type=template&id=0ccc0afe&scoped=true\"\nimport script from \"./ReviewViewer.vue?vue&type=script&lang=js\"\nexport * from \"./ReviewViewer.vue?vue&type=script&lang=js\"\nimport style0 from \"./ReviewViewer.vue?vue&type=style&index=0&id=0ccc0afe&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"0ccc0afe\",\n  null\n  \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerAnnotationDialog.vue?vue&type=style&index=0&id=7d21e374&prod&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerNavigation.vue?vue&type=style&index=0&id=11c5467c&prod&lang=scss&scoped=true\"","/**\n * Intro.js v2.9.3\n * https://github.com/usablica/intro.js\n *\n * Copyright (C) 2017 Afshin Mehrabani (@afshinmeh)\n */\n\n(function(f) {\n    if (typeof exports === \"object\" && typeof module !== \"undefined\") {\n        module.exports = f();\n        // deprecated function\n        // @since 2.8.0\n        module.exports.introJs = function () {\n          console.warn('Deprecated: please use require(\"intro.js\") directly, instead of the introJs method of the function');\n          // introJs()\n          return f().apply(this, arguments);\n        };\n    } else if (typeof define === \"function\" && define.amd) {\n        define([], f);\n    } else {\n        var g;\n        if (typeof window !== \"undefined\") {\n            g = window;\n        } else if (typeof global !== \"undefined\") {\n            g = global;\n        } else if (typeof self !== \"undefined\") {\n            g = self;\n        } else {\n            g = this;\n        }\n        g.introJs = f();\n    }\n})(function () {\n  //Default config/variables\n  var VERSION = '2.9.3';\n\n  /**\n   * IntroJs main class\n   *\n   * @class IntroJs\n   */\n  function IntroJs(obj) {\n    this._targetElement = obj;\n    this._introItems = [];\n\n    this._options = {\n      /* Next button label in tooltip box */\n      nextLabel: 'Next &rarr;',\n      /* Previous button label in tooltip box */\n      prevLabel: '&larr; Back',\n      /* Skip button label in tooltip box */\n      skipLabel: 'Skip',\n      /* Done button label in tooltip box */\n      doneLabel: 'Done',\n      /* Hide previous button in the first step? Otherwise, it will be disabled button. */\n      hidePrev: false,\n      /* Hide next button in the last step? Otherwise, it will be disabled button. */\n      hideNext: false,\n      /* Default tooltip box position */\n      tooltipPosition: 'bottom',\n      /* Next CSS class for tooltip boxes */\n      tooltipClass: '',\n      /* CSS class that is added to the helperLayer */\n      highlightClass: '',\n      /* Close introduction when pressing Escape button? */\n      exitOnEsc: true,\n      /* Close introduction when clicking on overlay layer? */\n      exitOnOverlayClick: true,\n      /* Show step numbers in introduction? */\n      showStepNumbers: true,\n      /* Let user use keyboard to navigate the tour? */\n      keyboardNavigation: true,\n      /* Show tour control buttons? */\n      showButtons: true,\n      /* Show tour bullets? */\n      showBullets: true,\n      /* Show tour progress? */\n      showProgress: false,\n      /* Scroll to highlighted element? */\n      scrollToElement: true,\n      /*\n       * Should we scroll the tooltip or target element?\n       *\n       * Options are: 'element' or 'tooltip'\n       */\n      scrollTo: 'element',\n      /* Padding to add after scrolling when element is not in the viewport (in pixels) */\n      scrollPadding: 30,\n      /* Set the overlay opacity */\n      overlayOpacity: 0.8,\n      /* Precedence of positions, when auto is enabled */\n      positionPrecedence: [\"bottom\", \"top\", \"right\", \"left\"],\n      /* Disable an interaction with element? */\n      disableInteraction: false,\n      /* Set how much padding to be used around helper element */\n      helperElementPadding: 10,\n      /* Default hint position */\n      hintPosition: 'top-middle',\n      /* Hint button label */\n      hintButtonLabel: 'Got it',\n      /* Adding animation to hints? */\n      hintAnimation: true,\n      /* additional classes to put on the buttons */\n      buttonClass: \"introjs-button\"\n    };\n  }\n\n  /**\n   * Initiate a new introduction/guide from an element in the page\n   *\n   * @api private\n   * @method _introForElement\n   * @param {Object} targetElm\n   * @param {String} group\n   * @returns {Boolean} Success or not?\n   */\n  function _introForElement(targetElm, group) {\n    var allIntroSteps = targetElm.querySelectorAll(\"*[data-intro]\"),\n        introItems = [];\n\n    if (this._options.steps) {\n      //use steps passed programmatically\n      _forEach(this._options.steps, function (step) {\n        var currentItem = _cloneObject(step);\n\n        //set the step\n        currentItem.step = introItems.length + 1;\n\n        //use querySelector function only when developer used CSS selector\n        if (typeof (currentItem.element) === 'string') {\n          //grab the element with given selector from the page\n          currentItem.element = document.querySelector(currentItem.element);\n        }\n\n        //intro without element\n        if (typeof (currentItem.element) === 'undefined' || currentItem.element === null) {\n          var floatingElementQuery = document.querySelector(\".introjsFloatingElement\");\n\n          if (floatingElementQuery === null) {\n            floatingElementQuery = document.createElement('div');\n            floatingElementQuery.className = 'introjsFloatingElement';\n\n            document.body.appendChild(floatingElementQuery);\n          }\n\n          currentItem.element  = floatingElementQuery;\n          currentItem.position = 'floating';\n        }\n\n        currentItem.scrollTo = currentItem.scrollTo || this._options.scrollTo;\n\n        if (typeof (currentItem.disableInteraction) === 'undefined') {\n          currentItem.disableInteraction = this._options.disableInteraction;\n        }\n\n        if (currentItem.element !== null) {\n          introItems.push(currentItem);\n        }        \n      }.bind(this));\n\n    } else {\n      //use steps from data-* annotations\n      var elmsLength = allIntroSteps.length;\n      var disableInteraction;\n      \n      //if there's no element to intro\n      if (elmsLength < 1) {\n        return false;\n      }\n\n      _forEach(allIntroSteps, function (currentElement) {\n        \n        // PR #80\n        // start intro for groups of elements\n        if (group && (currentElement.getAttribute(\"data-intro-group\") !== group)) {\n          return;\n        }\n\n        // skip hidden elements\n        if (currentElement.style.display === 'none') {\n          return;\n        }\n\n        var step = parseInt(currentElement.getAttribute('data-step'), 10);\n\n        if (typeof (currentElement.getAttribute('data-disable-interaction')) !== 'undefined') {\n          disableInteraction = !!currentElement.getAttribute('data-disable-interaction');\n        } else {\n          disableInteraction = this._options.disableInteraction;\n        }\n\n        if (step > 0) {\n          introItems[step - 1] = {\n            element: currentElement,\n            intro: currentElement.getAttribute('data-intro'),\n            step: parseInt(currentElement.getAttribute('data-step'), 10),\n            tooltipClass: currentElement.getAttribute('data-tooltipclass'),\n            highlightClass: currentElement.getAttribute('data-highlightclass'),\n            position: currentElement.getAttribute('data-position') || this._options.tooltipPosition,\n            scrollTo: currentElement.getAttribute('data-scrollto') || this._options.scrollTo,\n            disableInteraction: disableInteraction\n          };\n        }\n      }.bind(this));\n\n      //next add intro items without data-step\n      //todo: we need a cleanup here, two loops are redundant\n      var nextStep = 0;\n\n      _forEach(allIntroSteps, function (currentElement) {\n        \n        // PR #80\n        // start intro for groups of elements\n        if (group && (currentElement.getAttribute(\"data-intro-group\") !== group)) {\n          return;\n        }\n        \n        if (currentElement.getAttribute('data-step') === null) {\n\n          while (true) {\n            if (typeof introItems[nextStep] === 'undefined') {\n              break;\n            } else {\n              nextStep++;\n            }\n          } \n\n          if (typeof (currentElement.getAttribute('data-disable-interaction')) !== 'undefined') {\n            disableInteraction = !!currentElement.getAttribute('data-disable-interaction');\n          } else {\n            disableInteraction = this._options.disableInteraction;\n          }\n\n          introItems[nextStep] = {\n            element: currentElement,\n            intro: currentElement.getAttribute('data-intro'),\n            step: nextStep + 1,\n            tooltipClass: currentElement.getAttribute('data-tooltipclass'),\n            highlightClass: currentElement.getAttribute('data-highlightclass'),\n            position: currentElement.getAttribute('data-position') || this._options.tooltipPosition,\n            scrollTo: currentElement.getAttribute('data-scrollto') || this._options.scrollTo,\n            disableInteraction: disableInteraction\n          };\n        }\n      }.bind(this));\n    }\n\n    //removing undefined/null elements\n    var tempIntroItems = [];\n    for (var z = 0; z < introItems.length; z++) {\n      if (introItems[z]) {\n        // copy non-falsy values to the end of the array\n        tempIntroItems.push(introItems[z]);  \n      } \n    }\n\n    introItems = tempIntroItems;\n\n    //Ok, sort all items with given steps\n    introItems.sort(function (a, b) {\n      return a.step - b.step;\n    });\n\n    //set it to the introJs object\n    this._introItems = introItems;\n\n    //add overlay layer to the page\n    if(_addOverlayLayer.call(this, targetElm)) {\n      //then, start the show\n      _nextStep.call(this);\n\n      if (this._options.keyboardNavigation) {\n        DOMEvent.on(window, 'keydown', _onKeyDown, this, true);\n      }\n      //for window resize\n      DOMEvent.on(window, 'resize', _onResize, this, true);\n    }\n    return false;\n  }\n\n  function _onResize () {\n    this.refresh.call(this);\n  }\n\n  /**\n  * on keyCode:\n  * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n  * This feature has been removed from the Web standards.\n  * Though some browsers may still support it, it is in\n  * the process of being dropped.\n  * Instead, you should use KeyboardEvent.code,\n  * if it's implemented.\n  *\n  * jQuery's approach is to test for\n  *   (1) e.which, then\n  *   (2) e.charCode, then\n  *   (3) e.keyCode\n  * https://github.com/jquery/jquery/blob/a6b0705294d336ae2f63f7276de0da1195495363/src/event.js#L638\n  *\n  * @param type var\n  * @return type\n  */\n  function _onKeyDown (e) {\n    var code = (e.code === null) ? e.which : e.code;\n\n    // if code/e.which is null\n    if (code === null) {\n      code = (e.charCode === null) ? e.keyCode : e.charCode;\n    }\n    \n    if ((code === 'Escape' || code === 27) && this._options.exitOnEsc === true) {\n      //escape key pressed, exit the intro\n      //check if exit callback is defined\n      _exitIntro.call(this, this._targetElement);\n    } else if (code === 'ArrowLeft' || code === 37) {\n      //left arrow\n      _previousStep.call(this);\n    } else if (code === 'ArrowRight' || code === 39) {\n      //right arrow\n      _nextStep.call(this);\n    } else if (code === 'Enter' || code === 13) {\n      //srcElement === ie\n      var target = e.target || e.srcElement;\n      if (target && target.className.match('introjs-prevbutton')) {\n        //user hit enter while focusing on previous button\n        _previousStep.call(this);\n      } else if (target && target.className.match('introjs-skipbutton')) {\n        //user hit enter while focusing on skip button\n        if (this._introItems.length - 1 === this._currentStep && typeof (this._introCompleteCallback) === 'function') {\n            this._introCompleteCallback.call(this);\n        }\n\n        _exitIntro.call(this, this._targetElement);\n      } else if (target && target.getAttribute('data-stepnumber')) {\n        // user hit enter while focusing on step bullet\n        target.click();\n      } else {\n        //default behavior for responding to enter\n        _nextStep.call(this);\n      }\n\n      //prevent default behaviour on hitting Enter, to prevent steps being skipped in some browsers\n      if(e.preventDefault) {\n        e.preventDefault();\n      } else {\n        e.returnValue = false;\n      }\n    }\n  }\n\n /*\n   * makes a copy of the object\n   * @api private\n   * @method _cloneObject\n  */\n  function _cloneObject(object) {\n      if (object === null || typeof (object) !== 'object' || typeof (object.nodeType) !== 'undefined') {\n        return object;\n      }\n      var temp = {};\n      for (var key in object) {\n        if (typeof(window.jQuery) !== 'undefined' && object[key] instanceof window.jQuery) {\n          temp[key] = object[key];\n        } else {\n          temp[key] = _cloneObject(object[key]);\n        }\n      }\n      return temp;\n  }\n  /**\n   * Go to specific step of introduction\n   *\n   * @api private\n   * @method _goToStep\n   */\n  function _goToStep(step) {\n    //because steps starts with zero\n    this._currentStep = step - 2;\n    if (typeof (this._introItems) !== 'undefined') {\n      _nextStep.call(this);\n    }\n  }\n\n  /**\n   * Go to the specific step of introduction with the explicit [data-step] number\n   *\n   * @api private\n   * @method _goToStepNumber\n   */\n  function _goToStepNumber(step) {\n    this._currentStepNumber = step;\n    if (typeof (this._introItems) !== 'undefined') {\n      _nextStep.call(this);\n    }\n  }\n\n  /**\n   * Go to next step on intro\n   *\n   * @api private\n   * @method _nextStep\n   */\n  function _nextStep() {\n    this._direction = 'forward';\n\n    if (typeof (this._currentStepNumber) !== 'undefined') {\n      _forEach(this._introItems, function (item, i) {\n        if( item.step === this._currentStepNumber ) {\n          this._currentStep = i - 1;\n          this._currentStepNumber = undefined;\n        }\n      }.bind(this));\n    }\n\n    if (typeof (this._currentStep) === 'undefined') {\n      this._currentStep = 0;\n    } else {\n      ++this._currentStep;\n    }\n\n    var nextStep = this._introItems[this._currentStep];\n    var continueStep = true;\n\n    if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n      continueStep = this._introBeforeChangeCallback.call(this, nextStep.element);\n    }\n\n    // if `onbeforechange` returned `false`, stop displaying the element\n    if (continueStep === false) {\n      --this._currentStep;\n      return false;\n    }\n\n    if ((this._introItems.length) <= this._currentStep) {\n      //end of the intro\n      //check if any callback is defined\n      if (typeof (this._introCompleteCallback) === 'function') {\n        this._introCompleteCallback.call(this);\n      }\n      _exitIntro.call(this, this._targetElement);\n      return;\n    }\n\n    _showElement.call(this, nextStep);\n  }\n\n  /**\n   * Go to previous step on intro\n   *\n   * @api private\n   * @method _previousStep\n   */\n  function _previousStep() {\n    this._direction = 'backward';\n\n    if (this._currentStep === 0) {\n      return false;\n    }\n\n    --this._currentStep;\n\n    var nextStep = this._introItems[this._currentStep];\n    var continueStep = true;\n\n    if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n      continueStep = this._introBeforeChangeCallback.call(this, nextStep.element);\n    }\n\n    // if `onbeforechange` returned `false`, stop displaying the element\n    if (continueStep === false) {\n      ++this._currentStep;\n      return false;\n    }\n\n    _showElement.call(this, nextStep);\n  }\n\n  /**\n   * Update placement of the intro objects on the screen\n   * @api private\n   */\n  function _refresh() {\n    // re-align intros\n    _setHelperLayerPosition.call(this, document.querySelector('.introjs-helperLayer'));\n    _setHelperLayerPosition.call(this, document.querySelector('.introjs-tooltipReferenceLayer'));\n    _setHelperLayerPosition.call(this, document.querySelector('.introjs-disableInteraction'));\n\n    // re-align tooltip\n    if(this._currentStep !== undefined && this._currentStep !== null) {\n      var oldHelperNumberLayer = document.querySelector('.introjs-helperNumberLayer'),\n        oldArrowLayer        = document.querySelector('.introjs-arrow'),\n        oldtooltipContainer  = document.querySelector('.introjs-tooltip');\n      _placeTooltip.call(this, this._introItems[this._currentStep].element, oldtooltipContainer, oldArrowLayer, oldHelperNumberLayer);\n    }\n\n    //re-align hints\n    _reAlignHints.call(this);\n    return this;\n  }\n\n  /**\n   * Exit from intro\n   *\n   * @api private\n   * @method _exitIntro\n   * @param {Object} targetElement\n   * @param {Boolean} force - Setting to `true` will skip the result of beforeExit callback\n   */\n  function _exitIntro(targetElement, force) {\n    var continueExit = true;\n\n    // calling onbeforeexit callback\n    //\n    // If this callback return `false`, it would halt the process\n    if (this._introBeforeExitCallback !== undefined) {\n      continueExit = this._introBeforeExitCallback.call(this);\n    }\n\n    // skip this check if `force` parameter is `true`\n    // otherwise, if `onbeforeexit` returned `false`, don't exit the intro\n    if (!force && continueExit === false) return;\n\n    //remove overlay layers from the page\n    var overlayLayers = targetElement.querySelectorAll('.introjs-overlay');\n\n    if (overlayLayers && overlayLayers.length) {\n      _forEach(overlayLayers, function (overlayLayer) {\n        overlayLayer.style.opacity = 0;\n        window.setTimeout(function () {\n          if (this.parentNode) {\n            this.parentNode.removeChild(this);\n          }\n        }.bind(overlayLayer), 500);\n      }.bind(this));\n    }\n\n    //remove all helper layers\n    var helperLayer = targetElement.querySelector('.introjs-helperLayer');\n    if (helperLayer) {\n      helperLayer.parentNode.removeChild(helperLayer);\n    }\n\n    var referenceLayer = targetElement.querySelector('.introjs-tooltipReferenceLayer');\n    if (referenceLayer) {\n      referenceLayer.parentNode.removeChild(referenceLayer);\n    }\n\n    //remove disableInteractionLayer\n    var disableInteractionLayer = targetElement.querySelector('.introjs-disableInteraction');\n    if (disableInteractionLayer) {\n      disableInteractionLayer.parentNode.removeChild(disableInteractionLayer);\n    }\n\n    //remove intro floating element\n    var floatingElement = document.querySelector('.introjsFloatingElement');\n    if (floatingElement) {\n      floatingElement.parentNode.removeChild(floatingElement);\n    }\n\n    _removeShowElement();\n\n    //remove `introjs-fixParent` class from the elements\n    var fixParents = document.querySelectorAll('.introjs-fixParent');\n    _forEach(fixParents, function (parent) {\n      _removeClass(parent, /introjs-fixParent/g);\n    });\n\n    //clean listeners\n    DOMEvent.off(window, 'keydown', _onKeyDown, this, true);\n    DOMEvent.off(window, 'resize', _onResize, this, true);\n\n    //check if any callback is defined\n    if (this._introExitCallback !== undefined) {\n      this._introExitCallback.call(this);\n    }\n\n    //set the step to zero\n    this._currentStep = undefined;\n  }\n\n  /**\n   * Render tooltip box in the page\n   *\n   * @api private\n   * @method _placeTooltip\n   * @param {HTMLElement} targetElement\n   * @param {HTMLElement} tooltipLayer\n   * @param {HTMLElement} arrowLayer\n   * @param {HTMLElement} helperNumberLayer\n   * @param {Boolean} hintMode\n   */\n  function _placeTooltip(targetElement, tooltipLayer, arrowLayer, helperNumberLayer, hintMode) {\n    var tooltipCssClass = '',\n        currentStepObj,\n        tooltipOffset,\n        targetOffset,\n        windowSize,\n        currentTooltipPosition;\n\n    hintMode = hintMode || false;\n\n    //reset the old style\n    tooltipLayer.style.top        = null;\n    tooltipLayer.style.right      = null;\n    tooltipLayer.style.bottom     = null;\n    tooltipLayer.style.left       = null;\n    tooltipLayer.style.marginLeft = null;\n    tooltipLayer.style.marginTop  = null;\n\n    arrowLayer.style.display = 'inherit';\n\n    if (typeof(helperNumberLayer) !== 'undefined' && helperNumberLayer !== null) {\n      helperNumberLayer.style.top  = null;\n      helperNumberLayer.style.left = null;\n    }\n\n    //prevent error when `this._currentStep` is undefined\n    if (!this._introItems[this._currentStep]) return;\n\n    //if we have a custom css class for each step\n    currentStepObj = this._introItems[this._currentStep];\n    if (typeof (currentStepObj.tooltipClass) === 'string') {\n      tooltipCssClass = currentStepObj.tooltipClass;\n    } else {\n      tooltipCssClass = this._options.tooltipClass;\n    }\n\n    tooltipLayer.className = ('introjs-tooltip ' + tooltipCssClass).replace(/^\\s+|\\s+$/g, '');\n    tooltipLayer.setAttribute('role', 'dialog');\n\n    currentTooltipPosition = this._introItems[this._currentStep].position;\n\n    // Floating is always valid, no point in calculating\n    if (currentTooltipPosition !== \"floating\") { \n      currentTooltipPosition = _determineAutoPosition.call(this, targetElement, tooltipLayer, currentTooltipPosition);\n    }\n\n    var tooltipLayerStyleLeft;\n    targetOffset  = _getOffset(targetElement);\n    tooltipOffset = _getOffset(tooltipLayer);\n    windowSize    = _getWinSize();\n\n    _addClass(tooltipLayer, 'introjs-' + currentTooltipPosition);\n\n    switch (currentTooltipPosition) {\n      case 'top-right-aligned':\n        arrowLayer.className      = 'introjs-arrow bottom-right';\n\n        var tooltipLayerStyleRight = 0;\n        _checkLeft(targetOffset, tooltipLayerStyleRight, tooltipOffset, tooltipLayer);\n        tooltipLayer.style.bottom    = (targetOffset.height +  20) + 'px';\n        break;\n\n      case 'top-middle-aligned':\n        arrowLayer.className      = 'introjs-arrow bottom-middle';\n\n        var tooltipLayerStyleLeftRight = targetOffset.width / 2 - tooltipOffset.width / 2;\n\n        // a fix for middle aligned hints\n        if (hintMode) {\n          tooltipLayerStyleLeftRight += 5;\n        }\n\n        if (_checkLeft(targetOffset, tooltipLayerStyleLeftRight, tooltipOffset, tooltipLayer)) {\n          tooltipLayer.style.right = null;\n          _checkRight(targetOffset, tooltipLayerStyleLeftRight, tooltipOffset, windowSize, tooltipLayer);\n        }\n        tooltipLayer.style.bottom = (targetOffset.height + 20) + 'px';\n        break;\n\n      case 'top-left-aligned':\n      // top-left-aligned is the same as the default top\n      case 'top':\n        arrowLayer.className = 'introjs-arrow bottom';\n\n        tooltipLayerStyleLeft = (hintMode) ? 0 : 15;\n\n        _checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer);\n        tooltipLayer.style.bottom = (targetOffset.height +  20) + 'px';\n        break;\n      case 'right':\n        tooltipLayer.style.left = (targetOffset.width + 20) + 'px';\n        if (targetOffset.top + tooltipOffset.height > windowSize.height) {\n          // In this case, right would have fallen below the bottom of the screen.\n          // Modify so that the bottom of the tooltip connects with the target\n          arrowLayer.className = \"introjs-arrow left-bottom\";\n          tooltipLayer.style.top = \"-\" + (tooltipOffset.height - targetOffset.height - 20) + \"px\";\n        } else {\n          arrowLayer.className = 'introjs-arrow left';\n        }\n        break;\n      case 'left':\n        if (!hintMode && this._options.showStepNumbers === true) {\n          tooltipLayer.style.top = '15px';\n        }\n\n        if (targetOffset.top + tooltipOffset.height > windowSize.height) {\n          // In this case, left would have fallen below the bottom of the screen.\n          // Modify so that the bottom of the tooltip connects with the target\n          tooltipLayer.style.top = \"-\" + (tooltipOffset.height - targetOffset.height - 20) + \"px\";\n          arrowLayer.className = 'introjs-arrow right-bottom';\n        } else {\n          arrowLayer.className = 'introjs-arrow right';\n        }\n        tooltipLayer.style.right = (targetOffset.width + 20) + 'px';\n\n        break;\n      case 'floating':\n        arrowLayer.style.display = 'none';\n\n        //we have to adjust the top and left of layer manually for intro items without element\n        tooltipLayer.style.left   = '50%';\n        tooltipLayer.style.top    = '50%';\n        tooltipLayer.style.marginLeft = '-' + (tooltipOffset.width / 2)  + 'px';\n        tooltipLayer.style.marginTop  = '-' + (tooltipOffset.height / 2) + 'px';\n\n        if (typeof(helperNumberLayer) !== 'undefined' && helperNumberLayer !== null) {\n          helperNumberLayer.style.left = '-' + ((tooltipOffset.width / 2) + 18) + 'px';\n          helperNumberLayer.style.top  = '-' + ((tooltipOffset.height / 2) + 18) + 'px';\n        }\n\n        break;\n      case 'bottom-right-aligned':\n        arrowLayer.className      = 'introjs-arrow top-right';\n\n        tooltipLayerStyleRight = 0;\n        _checkLeft(targetOffset, tooltipLayerStyleRight, tooltipOffset, tooltipLayer);\n        tooltipLayer.style.top    = (targetOffset.height +  20) + 'px';\n        break;\n\n      case 'bottom-middle-aligned':\n        arrowLayer.className      = 'introjs-arrow top-middle';\n\n        tooltipLayerStyleLeftRight = targetOffset.width / 2 - tooltipOffset.width / 2;\n\n        // a fix for middle aligned hints\n        if (hintMode) {\n          tooltipLayerStyleLeftRight += 5;\n        }\n\n        if (_checkLeft(targetOffset, tooltipLayerStyleLeftRight, tooltipOffset, tooltipLayer)) {\n          tooltipLayer.style.right = null;\n          _checkRight(targetOffset, tooltipLayerStyleLeftRight, tooltipOffset, windowSize, tooltipLayer);\n        }\n        tooltipLayer.style.top = (targetOffset.height + 20) + 'px';\n        break;\n\n      // case 'bottom-left-aligned':\n      // Bottom-left-aligned is the same as the default bottom\n      // case 'bottom':\n      // Bottom going to follow the default behavior\n      default:\n        arrowLayer.className = 'introjs-arrow top';\n\n        tooltipLayerStyleLeft = 0;\n        _checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer);\n        tooltipLayer.style.top    = (targetOffset.height +  20) + 'px';\n    }\n  }\n\n  /**\n   * Set tooltip left so it doesn't go off the right side of the window\n   *\n   * @return boolean true, if tooltipLayerStyleLeft is ok.  false, otherwise.\n   */\n  function _checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer) {\n    if (targetOffset.left + tooltipLayerStyleLeft + tooltipOffset.width > windowSize.width) {\n      // off the right side of the window\n      tooltipLayer.style.left = (windowSize.width - tooltipOffset.width - targetOffset.left) + 'px';\n      return false;\n    }\n    tooltipLayer.style.left = tooltipLayerStyleLeft + 'px';\n    return true;\n  }\n\n  /**\n   * Set tooltip right so it doesn't go off the left side of the window\n   *\n   * @return boolean true, if tooltipLayerStyleRight is ok.  false, otherwise.\n   */\n  function _checkLeft(targetOffset, tooltipLayerStyleRight, tooltipOffset, tooltipLayer) {\n    if (targetOffset.left + targetOffset.width - tooltipLayerStyleRight - tooltipOffset.width < 0) {\n      // off the left side of the window\n      tooltipLayer.style.left = (-targetOffset.left) + 'px';\n      return false;\n    }\n    tooltipLayer.style.right = tooltipLayerStyleRight + 'px';\n    return true;\n  }\n\n  /**\n   * Determines the position of the tooltip based on the position precedence and availability\n   * of screen space.\n   *\n   * @param {Object}    targetElement\n   * @param {Object}    tooltipLayer\n   * @param {String}    desiredTooltipPosition\n   * @return {String}   calculatedPosition\n   */\n  function _determineAutoPosition(targetElement, tooltipLayer, desiredTooltipPosition) {\n\n    // Take a clone of position precedence. These will be the available\n    var possiblePositions = this._options.positionPrecedence.slice();\n\n    var windowSize = _getWinSize();\n    var tooltipHeight = _getOffset(tooltipLayer).height + 10;\n    var tooltipWidth = _getOffset(tooltipLayer).width + 20;\n    var targetElementRect = targetElement.getBoundingClientRect();\n\n    // If we check all the possible areas, and there are no valid places for the tooltip, the element\n    // must take up most of the screen real estate. Show the tooltip floating in the middle of the screen.\n    var calculatedPosition = \"floating\";\n\n    /*\n    * auto determine position \n    */\n\n    // Check for space below\n    if (targetElementRect.bottom + tooltipHeight + tooltipHeight > windowSize.height) {\n      _removeEntry(possiblePositions, \"bottom\");\n    }\n\n    // Check for space above\n    if (targetElementRect.top - tooltipHeight < 0) {\n      _removeEntry(possiblePositions, \"top\");\n    }\n\n    // Check for space to the right\n    if (targetElementRect.right + tooltipWidth > windowSize.width) {\n      _removeEntry(possiblePositions, \"right\");\n    }\n\n    // Check for space to the left\n    if (targetElementRect.left - tooltipWidth < 0) {\n      _removeEntry(possiblePositions, \"left\");\n    }\n\n    // @var {String}  ex: 'right-aligned'\n    var desiredAlignment = (function (pos) {\n      var hyphenIndex = pos.indexOf('-');\n      if (hyphenIndex !== -1) {\n        // has alignment\n        return pos.substr(hyphenIndex);\n      }\n      return '';\n    })(desiredTooltipPosition || '');\n\n    // strip alignment from position\n    if (desiredTooltipPosition) {\n      // ex: \"bottom-right-aligned\"\n      // should return 'bottom'\n      desiredTooltipPosition = desiredTooltipPosition.split('-')[0];\n    }\n\n    if (possiblePositions.length) {\n      if (desiredTooltipPosition !== \"auto\" &&\n          possiblePositions.indexOf(desiredTooltipPosition) > -1) {\n        // If the requested position is in the list, choose that\n        calculatedPosition = desiredTooltipPosition;\n      } else {\n        // Pick the first valid position, in order\n        calculatedPosition = possiblePositions[0];\n      }\n    }\n\n    // only top and bottom positions have optional alignments\n    if (['top', 'bottom'].indexOf(calculatedPosition) !== -1) {\n      calculatedPosition += _determineAutoAlignment(targetElementRect.left, tooltipWidth, windowSize, desiredAlignment);\n    }\n\n    return calculatedPosition;\n  }\n\n  /**\n  * auto-determine alignment\n  * @param {Integer}  offsetLeft\n  * @param {Integer}  tooltipWidth\n  * @param {Object}   windowSize\n  * @param {String}   desiredAlignment\n  * @return {String}  calculatedAlignment\n  */\n  function _determineAutoAlignment (offsetLeft, tooltipWidth, windowSize, desiredAlignment) {\n    var halfTooltipWidth = tooltipWidth / 2,\n      winWidth = Math.min(windowSize.width, window.screen.width),\n      possibleAlignments = ['-left-aligned', '-middle-aligned', '-right-aligned'],\n      calculatedAlignment = '';\n    \n    // valid left must be at least a tooltipWidth\n    // away from right side\n    if (winWidth - offsetLeft < tooltipWidth) {\n      _removeEntry(possibleAlignments, '-left-aligned');\n    }\n\n    // valid middle must be at least half \n    // width away from both sides\n    if (offsetLeft < halfTooltipWidth || \n      winWidth - offsetLeft < halfTooltipWidth) {\n      _removeEntry(possibleAlignments, '-middle-aligned');\n    }\n\n    // valid right must be at least a tooltipWidth\n    // width away from left side\n    if (offsetLeft < tooltipWidth) {\n      _removeEntry(possibleAlignments, '-right-aligned');\n    }\n\n    if (possibleAlignments.length) {\n      if (possibleAlignments.indexOf(desiredAlignment) !== -1) {\n        // the desired alignment is valid\n        calculatedAlignment = desiredAlignment;\n      } else {\n        // pick the first valid position, in order\n        calculatedAlignment = possibleAlignments[0];\n      }\n    } else {\n      // if screen width is too small \n      // for ANY alignment, middle is \n      // probably the best for visibility\n      calculatedAlignment = '-middle-aligned';\n    }\n\n    return calculatedAlignment;\n  }\n\n  /**\n   * Remove an entry from a string array if it's there, does nothing if it isn't there.\n   *\n   * @param {Array} stringArray\n   * @param {String} stringToRemove\n   */\n  function _removeEntry(stringArray, stringToRemove) {\n    if (stringArray.indexOf(stringToRemove) > -1) {\n      stringArray.splice(stringArray.indexOf(stringToRemove), 1);\n    }\n  }\n\n  /**\n   * Update the position of the helper layer on the screen\n   *\n   * @api private\n   * @method _setHelperLayerPosition\n   * @param {Object} helperLayer\n   */\n  function _setHelperLayerPosition(helperLayer) {\n    if (helperLayer) {\n      //prevent error when `this._currentStep` in undefined\n      if (!this._introItems[this._currentStep]) return;\n\n      var currentElement  = this._introItems[this._currentStep],\n          elementPosition = _getOffset(currentElement.element),\n          widthHeightPadding = this._options.helperElementPadding;\n\n      // If the target element is fixed, the tooltip should be fixed as well.\n      // Otherwise, remove a fixed class that may be left over from the previous\n      // step.\n      if (_isFixed(currentElement.element)) {\n        _addClass(helperLayer, 'introjs-fixedTooltip');\n      } else {\n        _removeClass(helperLayer, 'introjs-fixedTooltip');\n      }\n\n      if (currentElement.position === 'floating') {\n        widthHeightPadding = 0;\n      }\n\n      //set new position to helper layer\n      helperLayer.style.cssText = 'width: ' + (elementPosition.width  + widthHeightPadding)  + 'px; ' +\n                                        'height:' + (elementPosition.height + widthHeightPadding)  + 'px; ' +\n                                        'top:'    + (elementPosition.top    - widthHeightPadding / 2)   + 'px;' +\n                                        'left: '  + (elementPosition.left   - widthHeightPadding / 2)   + 'px;';\n\n    }\n  }\n\n  /**\n   * Add disableinteraction layer and adjust the size and position of the layer\n   *\n   * @api private\n   * @method _disableInteraction\n   */\n  function _disableInteraction() {\n    var disableInteractionLayer = document.querySelector('.introjs-disableInteraction');\n\n    if (disableInteractionLayer === null) {\n      disableInteractionLayer = document.createElement('div');\n      disableInteractionLayer.className = 'introjs-disableInteraction';\n      this._targetElement.appendChild(disableInteractionLayer);\n    }\n\n    _setHelperLayerPosition.call(this, disableInteractionLayer);\n  }\n\n  /**\n   * Setting anchors to behave like buttons\n   *\n   * @api private\n   * @method _setAnchorAsButton\n   */\n  function _setAnchorAsButton(anchor){\n    anchor.setAttribute('role', 'button');\n    anchor.tabIndex = 0;\n  }\n\n  /**\n   * Show an element on the page\n   *\n   * @api private\n   * @method _showElement\n   * @param {Object} targetElement\n   */\n  function _showElement(targetElement) {\n    if (typeof (this._introChangeCallback) !== 'undefined') {\n      this._introChangeCallback.call(this, targetElement.element);\n    }\n\n    var self = this,\n        oldHelperLayer = document.querySelector('.introjs-helperLayer'),\n        oldReferenceLayer = document.querySelector('.introjs-tooltipReferenceLayer'),\n        highlightClass = 'introjs-helperLayer',\n        nextTooltipButton,\n        prevTooltipButton,\n        skipTooltipButton,\n        scrollParent;\n\n    //check for a current step highlight class\n    if (typeof (targetElement.highlightClass) === 'string') {\n      highlightClass += (' ' + targetElement.highlightClass);\n    }\n    //check for options highlight class\n    if (typeof (this._options.highlightClass) === 'string') {\n      highlightClass += (' ' + this._options.highlightClass);\n    }\n\n    if (oldHelperLayer !== null) {\n      var oldHelperNumberLayer = oldReferenceLayer.querySelector('.introjs-helperNumberLayer'),\n          oldtooltipLayer      = oldReferenceLayer.querySelector('.introjs-tooltiptext'),\n          oldArrowLayer        = oldReferenceLayer.querySelector('.introjs-arrow'),\n          oldtooltipContainer  = oldReferenceLayer.querySelector('.introjs-tooltip');\n          \n      skipTooltipButton    = oldReferenceLayer.querySelector('.introjs-skipbutton');\n      prevTooltipButton    = oldReferenceLayer.querySelector('.introjs-prevbutton');\n      nextTooltipButton    = oldReferenceLayer.querySelector('.introjs-nextbutton');\n\n      //update or reset the helper highlight class\n      oldHelperLayer.className = highlightClass;\n      //hide the tooltip\n      oldtooltipContainer.style.opacity = 0;\n      oldtooltipContainer.style.display = \"none\";\n\n      if (oldHelperNumberLayer !== null) {\n        var lastIntroItem = this._introItems[(targetElement.step - 2 >= 0 ? targetElement.step - 2 : 0)];\n\n        if (lastIntroItem !== null && (this._direction === 'forward' && lastIntroItem.position === 'floating') || (this._direction === 'backward' && targetElement.position === 'floating')) {\n          oldHelperNumberLayer.style.opacity = 0;\n        }\n      }\n\n      // scroll to element\n      scrollParent = _getScrollParent( targetElement.element );\n\n      if (scrollParent !== document.body) {\n        // target is within a scrollable element\n        _scrollParentToElement(scrollParent, targetElement.element);\n      }\n\n      // set new position to helper layer\n      _setHelperLayerPosition.call(self, oldHelperLayer);\n      _setHelperLayerPosition.call(self, oldReferenceLayer);\n\n      //remove `introjs-fixParent` class from the elements\n      var fixParents = document.querySelectorAll('.introjs-fixParent');\n      _forEach(fixParents, function (parent) {\n        _removeClass(parent, /introjs-fixParent/g);\n      });\n      \n      //remove old classes if the element still exist\n      _removeShowElement();\n\n      //we should wait until the CSS3 transition is competed (it's 0.3 sec) to prevent incorrect `height` and `width` calculation\n      if (self._lastShowElementTimer) {\n        window.clearTimeout(self._lastShowElementTimer);\n      }\n\n      self._lastShowElementTimer = window.setTimeout(function() {\n        //set current step to the label\n        if (oldHelperNumberLayer !== null) {\n          oldHelperNumberLayer.innerHTML = targetElement.step;\n        }\n        //set current tooltip text\n        oldtooltipLayer.innerHTML = targetElement.intro;\n        //set the tooltip position\n        oldtooltipContainer.style.display = \"block\";\n        _placeTooltip.call(self, targetElement.element, oldtooltipContainer, oldArrowLayer, oldHelperNumberLayer);\n\n        //change active bullet\n        if (self._options.showBullets) {\n            oldReferenceLayer.querySelector('.introjs-bullets li > a.active').className = '';\n            oldReferenceLayer.querySelector('.introjs-bullets li > a[data-stepnumber=\"' + targetElement.step + '\"]').className = 'active';\n        }\n        oldReferenceLayer.querySelector('.introjs-progress .introjs-progressbar').style.cssText = 'width:' + _getProgress.call(self) + '%;';\n        oldReferenceLayer.querySelector('.introjs-progress .introjs-progressbar').setAttribute('aria-valuenow', _getProgress.call(self));\n\n        //show the tooltip\n        oldtooltipContainer.style.opacity = 1;\n        if (oldHelperNumberLayer) oldHelperNumberLayer.style.opacity = 1;\n\n        //reset button focus\n        if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton !== null && /introjs-donebutton/gi.test(skipTooltipButton.className)) {\n          // skip button is now \"done\" button\n          skipTooltipButton.focus();\n        } else if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n          //still in the tour, focus on next\n          nextTooltipButton.focus();\n        }\n\n        // change the scroll of the window, if needed\n        _scrollTo.call(self, targetElement.scrollTo, targetElement, oldtooltipLayer);\n      }, 350);\n\n      // end of old element if-else condition\n    } else {\n      var helperLayer       = document.createElement('div'),\n          referenceLayer    = document.createElement('div'),\n          arrowLayer        = document.createElement('div'),\n          tooltipLayer      = document.createElement('div'),\n          tooltipTextLayer  = document.createElement('div'),\n          bulletsLayer      = document.createElement('div'),\n          progressLayer     = document.createElement('div'),\n          buttonsLayer      = document.createElement('div');\n\n      helperLayer.className = highlightClass;\n      referenceLayer.className = 'introjs-tooltipReferenceLayer';\n\n      // scroll to element\n      scrollParent = _getScrollParent( targetElement.element );\n\n      if (scrollParent !== document.body) {\n        // target is within a scrollable element\n        _scrollParentToElement(scrollParent, targetElement.element);\n      }\n\n      //set new position to helper layer\n      _setHelperLayerPosition.call(self, helperLayer);\n      _setHelperLayerPosition.call(self, referenceLayer);\n\n      //add helper layer to target element\n      this._targetElement.appendChild(helperLayer);\n      this._targetElement.appendChild(referenceLayer);\n\n      arrowLayer.className = 'introjs-arrow';\n\n      tooltipTextLayer.className = 'introjs-tooltiptext';\n      tooltipTextLayer.innerHTML = targetElement.intro;\n\n      bulletsLayer.className = 'introjs-bullets';\n\n      if (this._options.showBullets === false) {\n        bulletsLayer.style.display = 'none';\n      }\n\n      var ulContainer = document.createElement('ul');\n      ulContainer.setAttribute('role', 'tablist');\n\n      var anchorClick = function () {\n          self.goToStep(this.getAttribute('data-stepnumber'));\n      };\n\n      _forEach(this._introItems, function (item, i) {\n        var innerLi    = document.createElement('li');\n        var anchorLink = document.createElement('a');\n        \n        innerLi.setAttribute('role', 'presentation');\n        anchorLink.setAttribute('role', 'tab');\n\n        anchorLink.onclick = anchorClick;\n\n        if (i === (targetElement.step-1)) {\n          anchorLink.className = 'active';\n        } \n\n        _setAnchorAsButton(anchorLink);\n        anchorLink.innerHTML = \"&nbsp;\";\n        anchorLink.setAttribute('data-stepnumber', item.step);\n\n        innerLi.appendChild(anchorLink);\n        ulContainer.appendChild(innerLi);\n      });\n\n      bulletsLayer.appendChild(ulContainer);\n\n      progressLayer.className = 'introjs-progress';\n\n      if (this._options.showProgress === false) {\n        progressLayer.style.display = 'none';\n      }\n      var progressBar = document.createElement('div');\n      progressBar.className = 'introjs-progressbar';\n      progressBar.setAttribute('role', 'progress');\n      progressBar.setAttribute('aria-valuemin', 0);\n      progressBar.setAttribute('aria-valuemax', 100);\n      progressBar.setAttribute('aria-valuenow', _getProgress.call(this));\n      progressBar.style.cssText = 'width:' + _getProgress.call(this) + '%;';\n\n      progressLayer.appendChild(progressBar);\n\n      buttonsLayer.className = 'introjs-tooltipbuttons';\n      if (this._options.showButtons === false) {\n        buttonsLayer.style.display = 'none';\n      }\n\n      tooltipLayer.className = 'introjs-tooltip';\n      tooltipLayer.appendChild(tooltipTextLayer);\n      tooltipLayer.appendChild(bulletsLayer);\n      tooltipLayer.appendChild(progressLayer);\n\n      //add helper layer number\n      var helperNumberLayer = document.createElement('span');\n      if (this._options.showStepNumbers === true) {\n        helperNumberLayer.className = 'introjs-helperNumberLayer';\n        helperNumberLayer.innerHTML = targetElement.step;\n        referenceLayer.appendChild(helperNumberLayer);\n      }\n\n      tooltipLayer.appendChild(arrowLayer);\n      referenceLayer.appendChild(tooltipLayer);\n\n      //next button\n      nextTooltipButton = document.createElement('a');\n\n      nextTooltipButton.onclick = function() {\n        if (self._introItems.length - 1 !== self._currentStep) {\n          _nextStep.call(self);\n        }\n      };\n\n      _setAnchorAsButton(nextTooltipButton);\n      nextTooltipButton.innerHTML = this._options.nextLabel;\n\n      //previous button\n      prevTooltipButton = document.createElement('a');\n\n      prevTooltipButton.onclick = function() {\n        if (self._currentStep !== 0) {\n          _previousStep.call(self);\n        }\n      };\n\n      _setAnchorAsButton(prevTooltipButton);\n      prevTooltipButton.innerHTML = this._options.prevLabel;\n\n      //skip button\n      skipTooltipButton = document.createElement('a');\n      skipTooltipButton.className = this._options.buttonClass + ' introjs-skipbutton ';\n      _setAnchorAsButton(skipTooltipButton);\n      skipTooltipButton.innerHTML = this._options.skipLabel;\n\n      skipTooltipButton.onclick = function() {\n        if (self._introItems.length - 1 === self._currentStep && typeof (self._introCompleteCallback) === 'function') {\n          self._introCompleteCallback.call(self);\n        }\n\n        if (self._introItems.length - 1 !== self._currentStep && typeof (self._introExitCallback) === 'function') {\n          self._introExitCallback.call(self);\n        }\n\n        if (typeof(self._introSkipCallback) === 'function') {\n          self._introSkipCallback.call(self);\n        }\n\n        _exitIntro.call(self, self._targetElement);\n      };\n\n      buttonsLayer.appendChild(skipTooltipButton);\n\n      //in order to prevent displaying next/previous button always\n      if (this._introItems.length > 1) {\n        buttonsLayer.appendChild(prevTooltipButton);\n        buttonsLayer.appendChild(nextTooltipButton);\n      }\n\n      tooltipLayer.appendChild(buttonsLayer);\n\n      //set proper position\n      _placeTooltip.call(self, targetElement.element, tooltipLayer, arrowLayer, helperNumberLayer);\n\n      // change the scroll of the window, if needed\n      _scrollTo.call(this, targetElement.scrollTo, targetElement, tooltipLayer);\n\n      //end of new element if-else condition\n    }\n\n    // removing previous disable interaction layer\n    var disableInteractionLayer = self._targetElement.querySelector('.introjs-disableInteraction');\n    if (disableInteractionLayer) {\n      disableInteractionLayer.parentNode.removeChild(disableInteractionLayer);\n    }\n\n    //disable interaction\n    if (targetElement.disableInteraction) {\n      _disableInteraction.call(self);\n    }\n\n    // when it's the first step of tour\n    if (this._currentStep === 0 && this._introItems.length > 1) {\n      if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton !== null) {\n        skipTooltipButton.className = this._options.buttonClass + ' introjs-skipbutton';\n      }\n      if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n        nextTooltipButton.className = this._options.buttonClass + ' introjs-nextbutton';\n      }\n\n      if (this._options.hidePrev === true) {\n        if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n          prevTooltipButton.className = this._options.buttonClass + ' introjs-prevbutton introjs-hidden';\n        }\n        if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n          _addClass(nextTooltipButton, 'introjs-fullbutton');\n        }\n      } else {\n        if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n          prevTooltipButton.className = this._options.buttonClass + ' introjs-prevbutton introjs-disabled';\n        }\n      }\n\n      if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton !== null) {\n        skipTooltipButton.innerHTML = this._options.skipLabel;\n      }\n    } else if (this._introItems.length - 1 === this._currentStep || this._introItems.length === 1) {\n      // last step of tour\n      if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton !== null) {\n        skipTooltipButton.innerHTML = this._options.doneLabel;\n        // adding donebutton class in addition to skipbutton\n        _addClass(skipTooltipButton, 'introjs-donebutton');\n      }\n      if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n        prevTooltipButton.className = this._options.buttonClass + ' introjs-prevbutton';\n      }\n\n      if (this._options.hideNext === true) {\n        if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n          nextTooltipButton.className = this._options.buttonClass + ' introjs-nextbutton introjs-hidden';\n        }\n        if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n          _addClass(prevTooltipButton, 'introjs-fullbutton');\n        }\n      } else {\n        if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n          nextTooltipButton.className = this._options.buttonClass + ' introjs-nextbutton introjs-disabled';\n        }\n      }\n    } else {\n      // steps between start and end\n      if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton !== null) {\n        skipTooltipButton.className = this._options.buttonClass + ' introjs-skipbutton';\n      }\n      if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n        prevTooltipButton.className = this._options.buttonClass + ' introjs-prevbutton';\n      }\n      if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n        nextTooltipButton.className = this._options.buttonClass + ' introjs-nextbutton';\n      }\n      if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton !== null) {\n        skipTooltipButton.innerHTML = this._options.skipLabel;\n      }\n    }\n\n    prevTooltipButton.setAttribute('role', 'button');\n    nextTooltipButton.setAttribute('role', 'button');\n    skipTooltipButton.setAttribute('role', 'button');\n\n    //Set focus on \"next\" button, so that hitting Enter always moves you onto the next step\n    if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n      nextTooltipButton.focus();\n    }\n\n    _setShowElement(targetElement);\n\n    if (typeof (this._introAfterChangeCallback) !== 'undefined') {\n      this._introAfterChangeCallback.call(this, targetElement.element);\n    }\n  }\n\n  /**\n   * To change the scroll of `window` after highlighting an element\n   *\n   * @api private\n   * @method _scrollTo\n   * @param {String} scrollTo\n   * @param {Object} targetElement\n   * @param {Object} tooltipLayer\n   */\n  function _scrollTo(scrollTo, targetElement, tooltipLayer) {\n    if (scrollTo === 'off') return;  \n    var rect;\n\n    if (!this._options.scrollToElement) return;\n\n    if (scrollTo === 'tooltip') {\n      rect = tooltipLayer.getBoundingClientRect();\n    } else {\n      rect = targetElement.element.getBoundingClientRect();\n    }\n\n    if (!_elementInViewport(targetElement.element)) {\n      var winHeight = _getWinSize().height;\n      var top = rect.bottom - (rect.bottom - rect.top);\n\n      // TODO (afshinm): do we need scroll padding now?\n      // I have changed the scroll option and now it scrolls the window to\n      // the center of the target element or tooltip.\n\n      if (top < 0 || targetElement.element.clientHeight > winHeight) {\n        window.scrollBy(0, rect.top - ((winHeight / 2) -  (rect.height / 2)) - this._options.scrollPadding); // 30px padding from edge to look nice\n\n      //Scroll down\n      } else {\n        window.scrollBy(0, rect.top - ((winHeight / 2) -  (rect.height / 2)) + this._options.scrollPadding); // 30px padding from edge to look nice\n      }\n    }\n  }\n\n  /**\n   * To remove all show element(s)\n   *\n   * @api private\n   * @method _removeShowElement\n   */\n  function _removeShowElement() {\n    var elms = document.querySelectorAll('.introjs-showElement');\n\n    _forEach(elms, function (elm) {\n      _removeClass(elm, /introjs-[a-zA-Z]+/g);\n    });\n  }\n\n  /**\n   * To set the show element\n   * This function set a relative (in most cases) position and changes the z-index\n   *\n   * @api private\n   * @method _setShowElement\n   * @param {Object} targetElement\n   */\n  function _setShowElement(targetElement) {\n    var parentElm;\n    // we need to add this show element class to the parent of SVG elements\n    // because the SVG elements can't have independent z-index\n    if (targetElement.element instanceof SVGElement) {\n      parentElm = targetElement.element.parentNode;\n\n      while (targetElement.element.parentNode !== null) {\n        if (!parentElm.tagName || parentElm.tagName.toLowerCase() === 'body') break;\n\n        if (parentElm.tagName.toLowerCase() === 'svg') {\n          _addClass(parentElm, 'introjs-showElement introjs-relativePosition');\n        }\n\n        parentElm = parentElm.parentNode;\n      }\n    }\n\n    _addClass(targetElement.element, 'introjs-showElement');\n\n    var currentElementPosition = _getPropValue(targetElement.element, 'position');\n    if (currentElementPosition !== 'absolute' &&\n        currentElementPosition !== 'relative' &&\n        currentElementPosition !== 'fixed') {\n      //change to new intro item\n      _addClass(targetElement.element, 'introjs-relativePosition');\n    }\n\n    parentElm = targetElement.element.parentNode;\n    while (parentElm !== null) {\n      if (!parentElm.tagName || parentElm.tagName.toLowerCase() === 'body') break;\n\n      //fix The Stacking Context problem.\n      //More detail: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context\n      var zIndex = _getPropValue(parentElm, 'z-index');\n      var opacity = parseFloat(_getPropValue(parentElm, 'opacity'));\n      var transform = _getPropValue(parentElm, 'transform') || _getPropValue(parentElm, '-webkit-transform') || _getPropValue(parentElm, '-moz-transform') || _getPropValue(parentElm, '-ms-transform') || _getPropValue(parentElm, '-o-transform');\n      if (/[0-9]+/.test(zIndex) || opacity < 1 || (transform !== 'none' && transform !== undefined)) {\n        _addClass(parentElm, 'introjs-fixParent');\n      }\n\n      parentElm = parentElm.parentNode;\n    }\n  }\n\n  /**\n  * Iterates arrays\n  *\n  * @param {Array} arr\n  * @param {Function} forEachFnc\n  * @param {Function} completeFnc\n  * @return {Null}\n  */\n  function _forEach(arr, forEachFnc, completeFnc) {\n    // in case arr is an empty query selector node list\n    if (arr) {\n      for (var i = 0, len = arr.length; i < len; i++) {\n        forEachFnc(arr[i], i);\n      }\n    }\n\n    if (typeof(completeFnc) === 'function') {\n      completeFnc();\n    }\n  }\n\n  /**\n  * Mark any object with an incrementing number\n  * used for keeping track of objects\n  *\n  * @param Object obj   Any object or DOM Element\n  * @param String key\n  * @return Object\n  */\n  var _stamp = (function () {\n    var keys = {};\n    return function stamp (obj, key) {\n      \n      // get group key\n      key = key || 'introjs-stamp';\n\n      // each group increments from 0\n      keys[key] = keys[key] || 0;\n\n      // stamp only once per object\n      if (obj[key] === undefined) {\n        // increment key for each new object\n        obj[key] = keys[key]++;\n      }\n\n      return obj[key];\n    };\n  })();\n\n  /**\n  * DOMEvent Handles all DOM events\n  *\n  * methods:\n  *\n  * on - add event handler\n  * off - remove event\n  */\n  var DOMEvent = (function () {\n    function DOMEvent () {\n      var events_key = 'introjs_event';\n      \n      /**\n      * Gets a unique ID for an event listener\n      *\n      * @param Object obj\n      * @param String type        event type\n      * @param Function listener\n      * @param Object context\n      * @return String\n      */\n      this._id = function (obj, type, listener, context) {\n        return type + _stamp(listener) + (context ? '_' + _stamp(context) : '');\n      };\n\n      /**\n      * Adds event listener\n      *\n      * @param Object obj\n      * @param String type        event type\n      * @param Function listener\n      * @param Object context\n      * @param Boolean useCapture\n      * @return null\n      */\n      this.on = function (obj, type, listener, context, useCapture) {\n        var id = this._id.apply(this, arguments),\n            handler = function (e) {\n              return listener.call(context || obj, e || window.event);\n            };\n\n        if ('addEventListener' in obj) {\n          obj.addEventListener(type, handler, useCapture);\n        } else if ('attachEvent' in obj) {\n          obj.attachEvent('on' + type, handler);\n        }\n\n        obj[events_key] = obj[events_key] || {};\n        obj[events_key][id] = handler;\n      };\n\n      /**\n      * Removes event listener\n      *\n      * @param Object obj\n      * @param String type        event type\n      * @param Function listener\n      * @param Object context\n      * @param Boolean useCapture\n      * @return null\n      */\n      this.off = function (obj, type, listener, context, useCapture) {\n        var id = this._id.apply(this, arguments),\n            handler = obj[events_key] && obj[events_key][id];\n\n        if (!handler) {\n          return;\n        }\n\n        if ('removeEventListener' in obj) {\n          obj.removeEventListener(type, handler, useCapture);\n        } else if ('detachEvent' in obj) {\n          obj.detachEvent('on' + type, handler);\n        }\n\n        obj[events_key][id] = null;\n      };\n    }\n\n    return new DOMEvent();\n  })();\n\n  /**\n   * Append a class to an element\n   *\n   * @api private\n   * @method _addClass\n   * @param {Object} element\n   * @param {String} className\n   * @returns null\n   */\n  function _addClass(element, className) {\n    if (element instanceof SVGElement) {\n      // svg\n      var pre = element.getAttribute('class') || '';\n\n      element.setAttribute('class', pre + ' ' + className);\n    } else {\n      if (element.classList !== undefined) {\n        // check for modern classList property\n        var classes = className.split(' ');\n        _forEach(classes, function (cls) {\n          element.classList.add( cls );\n        });\n      } else if (!element.className.match( className )) {\n        // check if element doesn't already have className\n        element.className += ' ' + className;\n      }\n    }\n  }\n\n  /**\n   * Remove a class from an element\n   *\n   * @api private\n   * @method _removeClass\n   * @param {Object} element\n   * @param {RegExp|String} classNameRegex can be regex or string\n   * @returns null\n   */\n  function _removeClass(element, classNameRegex) {\n    if (element instanceof SVGElement) {\n      var pre = element.getAttribute('class') || '';\n\n      element.setAttribute('class', pre.replace(classNameRegex, '').replace(/^\\s+|\\s+$/g, ''));\n    } else {\n      element.className = element.className.replace(classNameRegex, '').replace(/^\\s+|\\s+$/g, '');\n    }\n  }\n\n  /**\n   * Get an element CSS property on the page\n   * Thanks to JavaScript Kit: http://www.javascriptkit.com/dhtmltutors/dhtmlcascade4.shtml\n   *\n   * @api private\n   * @method _getPropValue\n   * @param {Object} element\n   * @param {String} propName\n   * @returns Element's property value\n   */\n  function _getPropValue (element, propName) {\n    var propValue = '';\n    if (element.currentStyle) { //IE\n      propValue = element.currentStyle[propName];\n    } else if (document.defaultView && document.defaultView.getComputedStyle) { //Others\n      propValue = document.defaultView.getComputedStyle(element, null).getPropertyValue(propName);\n    }\n\n    //Prevent exception in IE\n    if (propValue && propValue.toLowerCase) {\n      return propValue.toLowerCase();\n    } else {\n      return propValue;\n    }\n  }\n\n  /**\n   * Checks to see if target element (or parents) position is fixed or not\n   *\n   * @api private\n   * @method _isFixed\n   * @param {Object} element\n   * @returns Boolean\n   */\n  function _isFixed (element) {\n    var p = element.parentNode;\n\n    if (!p || p.nodeName === 'HTML') {\n      return false;\n    }\n\n    if (_getPropValue(element, 'position') === 'fixed') {\n      return true;\n    }\n\n    return _isFixed(p);\n  }\n\n  /**\n   * Provides a cross-browser way to get the screen dimensions\n   * via: http://stackoverflow.com/questions/5864467/internet-explorer-innerheight\n   *\n   * @api private\n   * @method _getWinSize\n   * @returns {Object} width and height attributes\n   */\n  function _getWinSize() {\n    if (window.innerWidth !== undefined) {\n      return { width: window.innerWidth, height: window.innerHeight };\n    } else {\n      var D = document.documentElement;\n      return { width: D.clientWidth, height: D.clientHeight };\n    }\n  }\n\n  /**\n   * Check to see if the element is in the viewport or not\n   * http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport\n   *\n   * @api private\n   * @method _elementInViewport\n   * @param {Object} el\n   */\n  function _elementInViewport(el) {\n    var rect = el.getBoundingClientRect();\n\n    return (\n      rect.top >= 0 &&\n      rect.left >= 0 &&\n      (rect.bottom+80) <= window.innerHeight && // add 80 to get the text right\n      rect.right <= window.innerWidth\n    );\n  }\n\n  /**\n   * Add overlay layer to the page\n   *\n   * @api private\n   * @method _addOverlayLayer\n   * @param {Object} targetElm\n   */\n  function _addOverlayLayer(targetElm) {\n    var overlayLayer = document.createElement('div'),\n        styleText = '',\n        self = this;\n\n    //set css class name\n    overlayLayer.className = 'introjs-overlay';\n\n    //check if the target element is body, we should calculate the size of overlay layer in a better way\n    if (!targetElm.tagName || targetElm.tagName.toLowerCase() === 'body') {\n      styleText += 'top: 0;bottom: 0; left: 0;right: 0;position: fixed;';\n      overlayLayer.style.cssText = styleText;\n    } else {\n      //set overlay layer position\n      var elementPosition = _getOffset(targetElm);\n      if (elementPosition) {\n        styleText += 'width: ' + elementPosition.width + 'px; height:' + elementPosition.height + 'px; top:' + elementPosition.top + 'px;left: ' + elementPosition.left + 'px;';\n        overlayLayer.style.cssText = styleText;\n      }\n    }\n\n    targetElm.appendChild(overlayLayer);\n\n    overlayLayer.onclick = function() {\n      if (self._options.exitOnOverlayClick === true) {\n        _exitIntro.call(self, targetElm);\n      }\n    };\n\n    window.setTimeout(function() {\n      styleText += 'opacity: ' + self._options.overlayOpacity.toString() + ';';\n      overlayLayer.style.cssText = styleText;\n    }, 10);\n\n    return true;\n  }\n\n  /**\n   * Removes open hint (tooltip hint)\n   *\n   * @api private\n   * @method _removeHintTooltip\n   */\n  function _removeHintTooltip() {\n    var tooltip = document.querySelector('.introjs-hintReference');\n\n    if (tooltip) {\n      var step = tooltip.getAttribute('data-step');\n      tooltip.parentNode.removeChild(tooltip);\n      return step;\n    }\n  }\n\n  /**\n   * Start parsing hint items\n   *\n   * @api private\n   * @param {Object} targetElm\n   * @method _startHint\n   */\n  function _populateHints(targetElm) {\n\n    this._introItems = [];\n\n    if (this._options.hints) {\n      _forEach(this._options.hints, function (hint) {\n        var currentItem = _cloneObject(hint);\n\n        if (typeof(currentItem.element) === 'string') {\n          //grab the element with given selector from the page\n          currentItem.element = document.querySelector(currentItem.element);\n        }\n\n        currentItem.hintPosition = currentItem.hintPosition || this._options.hintPosition;\n        currentItem.hintAnimation = currentItem.hintAnimation || this._options.hintAnimation;\n\n        if (currentItem.element !== null) {\n          this._introItems.push(currentItem);\n        }\n      }.bind(this));\n    } else {\n      var hints = targetElm.querySelectorAll('*[data-hint]');\n\n      if (!hints || !hints.length) {\n        return false;\n      }\n\n      //first add intro items with data-step\n      _forEach(hints, function (currentElement) {\n        // hint animation\n        var hintAnimation = currentElement.getAttribute('data-hintanimation');\n\n        if (hintAnimation) {\n          hintAnimation = (hintAnimation === 'true');\n        } else {\n          hintAnimation = this._options.hintAnimation;\n        }\n\n        this._introItems.push({\n          element: currentElement,\n          hint: currentElement.getAttribute('data-hint'),\n          hintPosition: currentElement.getAttribute('data-hintposition') || this._options.hintPosition,\n          hintAnimation: hintAnimation,\n          tooltipClass: currentElement.getAttribute('data-tooltipclass'),\n          position: currentElement.getAttribute('data-position') || this._options.tooltipPosition\n        });\n      }.bind(this));\n    }\n\n    _addHints.call(this);\n\n    /* \n    todo:\n    these events should be removed at some point \n    */\n    DOMEvent.on(document, 'click', _removeHintTooltip, this, false);\n    DOMEvent.on(window, 'resize', _reAlignHints, this, true);\n  }\n\n  /**\n   * Re-aligns all hint elements\n   *\n   * @api private\n   * @method _reAlignHints\n   */\n  function _reAlignHints() {\n    _forEach(this._introItems, function (item) {\n      if (typeof(item.targetElement) === 'undefined') {\n        return;\n      }\n\n      _alignHintPosition.call(this, item.hintPosition, item.element, item.targetElement);\n    }.bind(this));\n  }\n\n  /**\n  * Get a queryselector within the hint wrapper\n  *\n  * @param {String} selector\n  * @return {NodeList|Array}\n  */\n  function _hintQuerySelectorAll(selector) {\n    var hintsWrapper = document.querySelector('.introjs-hints');\n    return (hintsWrapper) ? hintsWrapper.querySelectorAll(selector) : [];\n  }\n\n  /**\n   * Hide a hint\n   *\n   * @api private\n   * @method _hideHint\n   */\n  function _hideHint(stepId) {\n    var hint = _hintQuerySelectorAll('.introjs-hint[data-step=\"' + stepId + '\"]')[0];\n    \n    _removeHintTooltip.call(this);\n\n    if (hint) {\n      _addClass(hint, 'introjs-hidehint');\n    }\n\n    // call the callback function (if any)\n    if (typeof (this._hintCloseCallback) !== 'undefined') {\n      this._hintCloseCallback.call(this, stepId);\n    }\n  }\n\n  /**\n   * Hide all hints\n   *\n   * @api private\n   * @method _hideHints\n   */\n  function _hideHints() {\n    var hints = _hintQuerySelectorAll('.introjs-hint');\n\n    _forEach(hints, function (hint) {\n      _hideHint.call(this, hint.getAttribute('data-step'));\n    }.bind(this));\n  }\n\n  /**\n   * Show all hints\n   *\n   * @api private\n   * @method _showHints\n   */\n  function _showHints() {\n    var hints = _hintQuerySelectorAll('.introjs-hint');\n\n    if (hints && hints.length) {\n      _forEach(hints, function (hint) {\n        _showHint.call(this, hint.getAttribute('data-step'));\n      }.bind(this));\n    } else {\n      _populateHints.call(this, this._targetElement);\n    }\n  }\n\n  /**\n   * Show a hint\n   *\n   * @api private\n   * @method _showHint\n   */\n  function _showHint(stepId) {\n    var hint = _hintQuerySelectorAll('.introjs-hint[data-step=\"' + stepId + '\"]')[0];\n\n    if (hint) {\n      _removeClass(hint, /introjs-hidehint/g);\n    }\n  }\n\n  /**\n   * Removes all hint elements on the page\n   * Useful when you want to destroy the elements and add them again (e.g. a modal or popup)\n   *\n   * @api private\n   * @method _removeHints\n   */\n  function _removeHints() {\n    var hints = _hintQuerySelectorAll('.introjs-hint');\n\n    _forEach(hints, function (hint) {\n      _removeHint.call(this, hint.getAttribute('data-step'));\n    }.bind(this));\n  }\n\n  /**\n   * Remove one single hint element from the page\n   * Useful when you want to destroy the element and add them again (e.g. a modal or popup)\n   * Use removeHints if you want to remove all elements.\n   *\n   * @api private\n   * @method _removeHint\n   */\n  function _removeHint(stepId) {\n    var hint = _hintQuerySelectorAll('.introjs-hint[data-step=\"' + stepId + '\"]')[0];\n\n    if (hint) {\n      hint.parentNode.removeChild(hint);\n    }\n  }\n\n  /**\n   * Add all available hints to the page\n   *\n   * @api private\n   * @method _addHints\n   */\n  function _addHints() {\n    var self = this;\n\n    var hintsWrapper = document.querySelector('.introjs-hints');\n\n    if (hintsWrapper === null) {\n      hintsWrapper = document.createElement('div');\n      hintsWrapper.className = 'introjs-hints';\n    }\n\n    /**\n    * Returns an event handler unique to the hint iteration\n    * \n    * @param {Integer} i\n    * @return {Function}\n    */\n    var getHintClick = function (i) {\n      return function(e) {\n        var evt = e ? e : window.event;\n        \n        if (evt.stopPropagation) {\n          evt.stopPropagation();\n        }\n\n        if (evt.cancelBubble !== null) {\n          evt.cancelBubble = true;\n        }\n\n        _showHintDialog.call(self, i);\n      };\n    };\n\n    _forEach(this._introItems, function(item, i) {\n      // avoid append a hint twice\n      if (document.querySelector('.introjs-hint[data-step=\"' + i + '\"]')) {\n        return;\n      }\n\n      var hint = document.createElement('a');\n      _setAnchorAsButton(hint);\n\n      hint.onclick = getHintClick(i);\n\n      hint.className = 'introjs-hint';\n\n      if (!item.hintAnimation) {\n        _addClass(hint, 'introjs-hint-no-anim');\n      }\n\n      // hint's position should be fixed if the target element's position is fixed\n      if (_isFixed(item.element)) {\n        _addClass(hint, 'introjs-fixedhint');\n      }\n\n      var hintDot = document.createElement('div');\n      hintDot.className = 'introjs-hint-dot';\n      var hintPulse = document.createElement('div');\n      hintPulse.className = 'introjs-hint-pulse';\n\n      hint.appendChild(hintDot);\n      hint.appendChild(hintPulse);\n      hint.setAttribute('data-step', i);\n\n      // we swap the hint element with target element\n      // because _setHelperLayerPosition uses `element` property\n      item.targetElement = item.element;\n      item.element = hint;\n\n      // align the hint position\n      _alignHintPosition.call(this, item.hintPosition, hint, item.targetElement);\n\n      hintsWrapper.appendChild(hint);\n    }.bind(this));\n\n    // adding the hints wrapper\n    document.body.appendChild(hintsWrapper);\n\n    // call the callback function (if any)\n    if (typeof (this._hintsAddedCallback) !== 'undefined') {\n      this._hintsAddedCallback.call(this);\n    }\n  }\n\n  /**\n   * Aligns hint position\n   *\n   * @api private\n   * @method _alignHintPosition\n   * @param {String} position\n   * @param {Object} hint\n   * @param {Object} element\n   */\n  function _alignHintPosition(position, hint, element) {\n    // get/calculate offset of target element\n    var offset = _getOffset.call(this, element);\n    var iconWidth = 20;\n    var iconHeight = 20;\n\n    // align the hint element\n    switch (position) {\n      default:\n      case 'top-left':\n        hint.style.left = offset.left + 'px';\n        hint.style.top = offset.top + 'px';\n        break;\n      case 'top-right':\n        hint.style.left = (offset.left + offset.width - iconWidth) + 'px';\n        hint.style.top = offset.top + 'px';\n        break;\n      case 'bottom-left':\n        hint.style.left = offset.left + 'px';\n        hint.style.top = (offset.top + offset.height - iconHeight) + 'px';\n        break;\n      case 'bottom-right':\n        hint.style.left = (offset.left + offset.width - iconWidth) + 'px';\n        hint.style.top = (offset.top + offset.height - iconHeight) + 'px';\n        break;\n      case 'middle-left':\n        hint.style.left = offset.left + 'px';\n        hint.style.top = (offset.top + (offset.height - iconHeight) / 2) + 'px';\n        break;\n      case 'middle-right':\n        hint.style.left = (offset.left + offset.width - iconWidth) + 'px';\n        hint.style.top = (offset.top + (offset.height - iconHeight) / 2) + 'px';\n        break;\n      case 'middle-middle':\n        hint.style.left = (offset.left + (offset.width - iconWidth) / 2) + 'px';\n        hint.style.top = (offset.top + (offset.height - iconHeight) / 2) + 'px';\n        break;\n      case 'bottom-middle':\n        hint.style.left = (offset.left + (offset.width - iconWidth) / 2) + 'px';\n        hint.style.top = (offset.top + offset.height - iconHeight) + 'px';\n        break;\n      case 'top-middle':\n        hint.style.left = (offset.left + (offset.width - iconWidth) / 2) + 'px';\n        hint.style.top = offset.top + 'px';\n        break;\n    }\n  }\n\n  /**\n   * Triggers when user clicks on the hint element\n   *\n   * @api private\n   * @method _showHintDialog\n   * @param {Number} stepId\n   */\n  function _showHintDialog(stepId) {\n    var hintElement = document.querySelector('.introjs-hint[data-step=\"' + stepId + '\"]');\n    var item = this._introItems[stepId];\n\n    // call the callback function (if any)\n    if (typeof (this._hintClickCallback) !== 'undefined') {\n      this._hintClickCallback.call(this, hintElement, item, stepId);\n    }\n\n    // remove all open tooltips\n    var removedStep = _removeHintTooltip.call(this);\n\n    // to toggle the tooltip\n    if (parseInt(removedStep, 10) === stepId) {\n      return;\n    }\n\n    var tooltipLayer = document.createElement('div');\n    var tooltipTextLayer = document.createElement('div');\n    var arrowLayer = document.createElement('div');\n    var referenceLayer = document.createElement('div');\n\n    tooltipLayer.className = 'introjs-tooltip';\n\n    tooltipLayer.onclick = function (e) {\n      //IE9 & Other Browsers\n      if (e.stopPropagation) {\n        e.stopPropagation();\n      }\n      //IE8 and Lower\n      else {\n        e.cancelBubble = true;\n      }\n    };\n\n    tooltipTextLayer.className = 'introjs-tooltiptext';\n\n    var tooltipWrapper = document.createElement('p');\n    tooltipWrapper.innerHTML = item.hint;\n\n    var closeButton = document.createElement('a');\n    closeButton.className = this._options.buttonClass;\n    closeButton.setAttribute('role', 'button');\n    closeButton.innerHTML = this._options.hintButtonLabel;\n    closeButton.onclick = _hideHint.bind(this, stepId);\n\n    tooltipTextLayer.appendChild(tooltipWrapper);\n    tooltipTextLayer.appendChild(closeButton);\n\n    arrowLayer.className = 'introjs-arrow';\n    tooltipLayer.appendChild(arrowLayer);\n\n    tooltipLayer.appendChild(tooltipTextLayer);\n\n    // set current step for _placeTooltip function\n    this._currentStep = hintElement.getAttribute('data-step');\n\n    // align reference layer position\n    referenceLayer.className = 'introjs-tooltipReferenceLayer introjs-hintReference';\n    referenceLayer.setAttribute('data-step', hintElement.getAttribute('data-step'));\n    _setHelperLayerPosition.call(this, referenceLayer);\n\n    referenceLayer.appendChild(tooltipLayer);\n    document.body.appendChild(referenceLayer);\n\n    //set proper position\n    _placeTooltip.call(this, hintElement, tooltipLayer, arrowLayer, null, true);\n  }\n\n  /**\n   * Get an element position on the page\n   * Thanks to `meouw`: http://stackoverflow.com/a/442474/375966\n   *\n   * @api private\n   * @method _getOffset\n   * @param {Object} element\n   * @returns Element's position info\n   */\n  function _getOffset(element) {\n    var body = document.body;\n    var docEl = document.documentElement;\n    var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;\n    var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;\n    var x = element.getBoundingClientRect();\n    return {\n      top: x.top + scrollTop,\n      width: x.width,\n      height: x.height,\n      left: x.left + scrollLeft\n    };\n  }\n\n  /**\n  * Find the nearest scrollable parent\n  * copied from https://stackoverflow.com/questions/35939886/find-first-scrollable-parent\n  *\n  * @param Element element\n  * @return Element\n  */\n  function _getScrollParent(element) {\n    var style = window.getComputedStyle(element);\n    var excludeStaticParent = (style.position === \"absolute\");\n    var overflowRegex = /(auto|scroll)/;\n\n    if (style.position === \"fixed\") return document.body;\n    \n    for (var parent = element; (parent = parent.parentElement);) {\n      style = window.getComputedStyle(parent);\n      if (excludeStaticParent && style.position === \"static\") {\n        continue;\n      }\n      if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) return parent;\n    }\n\n    return document.body;\n  }\n\n  /**\n  * scroll a scrollable element to a child element\n  *\n  * @param Element parent\n  * @param Element element\n  * @return Null\n  */\n  function _scrollParentToElement (parent, element) {\n    parent.scrollTop = element.offsetTop - parent.offsetTop;\n  }\n\n  /**\n   * Gets the current progress percentage\n   *\n   * @api private\n   * @method _getProgress\n   * @returns current progress percentage\n   */\n  function _getProgress() {\n    // Steps are 0 indexed\n    var currentStep = parseInt((this._currentStep + 1), 10);\n    return ((currentStep / this._introItems.length) * 100);\n  }\n\n  /**\n   * Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1\n   * via: http://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically\n   *\n   * @param obj1\n   * @param obj2\n   * @returns obj3 a new object based on obj1 and obj2\n   */\n  function _mergeOptions(obj1,obj2) {\n    var obj3 = {},\n      attrname;\n    for (attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n    for (attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n    return obj3;\n  }\n\n  var introJs = function (targetElm) {\n    var instance;\n\n    if (typeof (targetElm) === 'object') {\n      //Ok, create a new instance\n      instance = new IntroJs(targetElm);\n\n    } else if (typeof (targetElm) === 'string') {\n      //select the target element with query selector\n      var targetElement = document.querySelector(targetElm);\n\n      if (targetElement) {\n        instance = new IntroJs(targetElement);\n      } else {\n        throw new Error('There is no element with given selector.');\n      }\n    } else {\n      instance = new IntroJs(document.body);\n    }\n    // add instance to list of _instances\n    // passing group to _stamp to increment\n    // from 0 onward somewhat reliably\n    introJs.instances[ _stamp(instance, 'introjs-instance') ] = instance;\n\n    return instance;\n  };\n\n  /**\n   * Current IntroJs version\n   *\n   * @property version\n   * @type String\n   */\n  introJs.version = VERSION;\n\n  /**\n  * key-val object helper for introJs instances\n  *\n  * @property instances\n  * @type Object\n  */\n  introJs.instances = {};\n\n  //Prototype\n  introJs.fn = IntroJs.prototype = {\n    clone: function () {\n      return new IntroJs(this);\n    },\n    setOption: function(option, value) {\n      this._options[option] = value;\n      return this;\n    },\n    setOptions: function(options) {\n      this._options = _mergeOptions(this._options, options);\n      return this;\n    },\n    start: function (group) {\n      _introForElement.call(this, this._targetElement, group);\n      return this;\n    },\n    goToStep: function(step) {\n      _goToStep.call(this, step);\n      return this;\n    },\n    addStep: function(options) {\n      if (!this._options.steps) {\n        this._options.steps = [];\n      }\n\n      this._options.steps.push(options);\n\n      return this;\n    },\n    addSteps: function(steps) {\n      if (!steps.length) return;\n\n      for(var index = 0; index < steps.length; index++) {\n        this.addStep(steps[index]);\n      }\n\n      return this;\n    },\n    goToStepNumber: function(step) {\n      _goToStepNumber.call(this, step);\n\n      return this;\n    },\n    nextStep: function() {\n      _nextStep.call(this);\n      return this;\n    },\n    previousStep: function() {\n      _previousStep.call(this);\n      return this;\n    },\n    exit: function(force) {\n      _exitIntro.call(this, this._targetElement, force);\n      return this;\n    },\n    refresh: function() {\n      _refresh.call(this);\n      return this;\n    },\n    onbeforechange: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._introBeforeChangeCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onbeforechange was not a function');\n      }\n      return this;\n    },\n    onchange: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._introChangeCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onchange was not a function.');\n      }\n      return this;\n    },\n    onafterchange: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._introAfterChangeCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onafterchange was not a function');\n      }\n      return this;\n    },\n    oncomplete: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._introCompleteCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for oncomplete was not a function.');\n      }\n      return this;\n    },\n    onhintsadded: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._hintsAddedCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onhintsadded was not a function.');\n      }\n      return this;\n    },\n    onhintclick: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._hintClickCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onhintclick was not a function.');\n      }\n      return this;\n    },\n    onhintclose: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._hintCloseCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onhintclose was not a function.');\n      }\n      return this;\n    },\n    onexit: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._introExitCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onexit was not a function.');\n      }\n      return this;\n    },\n    onskip: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._introSkipCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onskip was not a function.');\n      }\n      return this;\n    },\n    onbeforeexit: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._introBeforeExitCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onbeforeexit was not a function.');\n      }\n      return this;\n    },\n    addHints: function() {\n      _populateHints.call(this, this._targetElement);\n      return this;\n    },\n    hideHint: function (stepId) {\n      _hideHint.call(this, stepId);\n      return this;\n    },\n    hideHints: function () {\n      _hideHints.call(this);\n      return this;\n    },\n    showHint: function (stepId) {\n      _showHint.call(this, stepId);\n      return this;\n    },\n    showHints: function () {\n      _showHints.call(this);\n      return this;\n    },\n    removeHints: function () {\n      _removeHints.call(this);\n      return this;\n    },\n    removeHint: function (stepId) {\n      _removeHint.call(this, stepId);\n      return this;\n    },\n    showHintDialog: function (stepId) {\n      _showHintDialog.call(this, stepId);\n      return this;\n    }\n  };\n\n  return introJs;\n});\n","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImageViewer.vue?vue&type=style&index=0&id=396a52cf&prod&lang=scss&scoped=true\"","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AboutOmni.vue?vue&type=style&index=0&id=15595f87&prod&lang=scss&scoped=true\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('ast-toolbar-dropdown',{staticClass:\"help-btn\",attrs:{\"icon\":\"help-circle\",\"title\":\"Help\",\"items\":_vm.completeList}})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('modal-wrapper',{on:{\"close\":function($event){return _vm.close()}}},[_c('div',{staticClass:\"dialog\",staticStyle:{\"width\":\"400px\"}},[_c('dlg-header',{attrs:{\"title\":\"About Omni\"},on:{\"close\":_vm.close}}),_c('div',{staticStyle:{\"padding\":\"16px\"}},[_c('p',{staticStyle:{\"margin-bottom\":\"35px\"}},[_vm._v(\"\\n\\t\\t\\t\\tKeystone Omni is a modern progressive web application (PWA). Below is a brief summary of\\n\\t\\t\\t\\tinformation that may be helpful for diagnostic purposes:\\n\\t\\t\\t\")]),_c('ast-data-table',{attrs:{\"is-hoverable\":false,\"is-striped\":true,\"is-condensed\":true}},[_c('tbody',[_c('tr',[_c('td',{staticClass:\"title-row\",attrs:{\"colspan\":\"2\"}},[_vm._v(\"Omni\")])]),_c('tr',[_c('td',[_vm._v(\"Release:\")]),_c('td',[_vm._v(_vm._s(_vm.release))])]),_c('tr',[_c('td',{staticClass:\"title-row\",attrs:{\"colspan\":\"2\"}},[_vm._v(\"Browser\")])]),_c('tr',[_c('td',[_vm._v(\"Name:\")]),_c('td',[_vm._v(_vm._s(_vm.browser.name))])]),_c('tr',[_c('td',[_vm._v(\"Version:\")]),_c('td',[_vm._v(_vm._s(_vm.browser.version))])]),_c('tr',[_c('td',[_vm._v(\"OS:\")]),_c('td',[_vm._v(_vm._s(_vm.browser.os))])])])])],1)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<modal-wrapper @close=\"close()\">\n\t\t<div class=\"dialog\" style=\"width:400px\">\n\t\t\t<dlg-header title=\"About Omni\" @close=\"close\" />\n\t\t\t<div style=\"padding: 16px;\">\n\t\t\t\t<p style=\"margin-bottom: 35px;\">\n\t\t\t\t\tKeystone Omni is a modern progressive web application (PWA). Below is a brief summary of\n\t\t\t\t\tinformation that may be helpful for diagnostic purposes:\n\t\t\t\t</p>\n\n\t\t\t\t<ast-data-table :is-hoverable=\"false\" :is-striped=\"true\" :is-condensed=\"true\">\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=\"2\" class=\"title-row\">Omni</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Release:</td>\n\t\t\t\t\t\t\t<td>{{ release }}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=\"2\" class=\"title-row\">Browser</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Name:</td>\n\t\t\t\t\t\t\t<td>{{ browser.name }}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Version:</td>\n\t\t\t\t\t\t\t<td>{{ browser.version }}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>OS:</td>\n\t\t\t\t\t\t\t<td>{{ browser.os }}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</ast-data-table>\n\t\t\t</div>\n\t\t</div>\n\t</modal-wrapper>\n</template>\n\n<script>\nimport { detect } from 'detect-browser'\nimport AstDataTable from '@components/DataTable'\nimport DlgHeader from '@components/DlgHeader.vue'\nimport ModalWrapper from '@components/ModalWrapper.vue'\nimport { dlg } from '@utils/dlgUtils'\n\nconst AboutOmniDlg = {\n\tname: 'AboutOmni',\n\tcomponents: {\n\t\tDlgHeader,\n\t\tModalWrapper,\n\t\tAstDataTable,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\trelease: window.config.release,\n\t\t\t// browser.name\n\t\t\t// browser.version\n\t\t\t// browser.os\n\t\t\tbrowser: {},\n\t\t}\n\t},\n\tcreated() {\n\t\tconst browser = detect()\n\t\tif (browser) {\n\t\t\tthis.browser = browser\n\t\t}\n\t},\n\tmethods: {\n\t\tclose() {\n\t\t\tdlg.close(this)\n\t\t},\n\t},\n}\n\nexport default AboutOmniDlg\n\nexport function openAboutOmniDlg() {\n\treturn dlg.open(AboutOmniDlg)\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '~@styles/_vars.scss';\n\n.dialog {\n\tpadding: 0;\n}\n\n.title-row {\n\tbackground-color: var(--card-header-info-bg) !important;\n\tcolor: var(--card-header-info-color) !important;\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AboutOmni.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AboutOmni.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./AboutOmni.vue?vue&type=template&id=15595f87&scoped=true\"\nimport script from \"./AboutOmni.vue?vue&type=script&lang=js\"\nexport * from \"./AboutOmni.vue?vue&type=script&lang=js\"\nimport style0 from \"./AboutOmni.vue?vue&type=style&index=0&id=15595f87&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"15595f87\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('modal-wrapper',{on:{\"close\":function($event){return _vm.close()}}},[_c('div',{staticClass:\"dialog\",staticStyle:{\"width\":\"400px\"}},[_c('dlg-header',{attrs:{\"title\":\"About Community\"},on:{\"close\":_vm.close}}),_c('div',{staticStyle:{\"padding\":\"16px\"}},[_c('p',{staticStyle:{\"margin-bottom\":\"35px\"}},[_vm._v(\"\\n\\t\\t\\t\\tAsteris Community is a modern progressive web application (PWA). Below is a brief summary\\n\\t\\t\\t\\tof information that may be helpful for diagnostic purposes:\\n\\t\\t\\t\")]),_c('ast-data-table',{attrs:{\"is-hoverable\":false,\"is-striped\":true,\"is-condensed\":true}},[_c('tbody',[_c('tr',[_c('td',{staticClass:\"title-row\",attrs:{\"colspan\":\"2\"}},[_vm._v(\"Community\")])]),_c('tr',[_c('td',[_vm._v(\"Release:\")]),_c('td',[_vm._v(_vm._s(_vm.release))])]),_c('tr',[_c('td',{staticClass:\"title-row\",attrs:{\"colspan\":\"2\"}},[_vm._v(\"Browser\")])]),_c('tr',[_c('td',[_vm._v(\"Name:\")]),_c('td',[_vm._v(_vm._s(_vm.browser.name))])]),_c('tr',[_c('td',[_vm._v(\"Version:\")]),_c('td',[_vm._v(_vm._s(_vm.browser.version))])]),_c('tr',[_c('td',[_vm._v(\"OS:\")]),_c('td',[_vm._v(_vm._s(_vm.browser.os))])])])])],1),_c('community-upsell-promo')],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<modal-wrapper @close=\"close()\">\n\t\t<div class=\"dialog\" style=\"width:400px\">\n\t\t\t<dlg-header title=\"About Community\" @close=\"close\" />\n\t\t\t<div style=\"padding: 16px;\">\n\t\t\t\t<p style=\"margin-bottom: 35px;\">\n\t\t\t\t\tAsteris Community is a modern progressive web application (PWA). Below is a brief summary\n\t\t\t\t\tof information that may be helpful for diagnostic purposes:\n\t\t\t\t</p>\n\n\t\t\t\t<ast-data-table :is-hoverable=\"false\" :is-striped=\"true\" :is-condensed=\"true\">\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=\"2\" class=\"title-row\">Community</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Release:</td>\n\t\t\t\t\t\t\t<td>{{ release }}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=\"2\" class=\"title-row\">Browser</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Name:</td>\n\t\t\t\t\t\t\t<td>{{ browser.name }}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Version:</td>\n\t\t\t\t\t\t\t<td>{{ browser.version }}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>OS:</td>\n\t\t\t\t\t\t\t<td>{{ browser.os }}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</ast-data-table>\n\t\t\t</div>\n\t\t\t<community-upsell-promo />\n\t\t</div>\n\t</modal-wrapper>\n</template>\n\n<script>\nimport { detect } from 'detect-browser'\nimport AstDataTable from '@components/DataTable'\nimport CommunityUpsellPromo from '@components/CommunityUpsellPromo'\nimport DlgHeader from '@components/DlgHeader.vue'\nimport ModalWrapper from '@components/ModalWrapper.vue'\nimport { dlg } from '@utils/dlgUtils'\n\nconst AboutCommunityDlg = {\n\tname: 'AboutCommunity',\n\tcomponents: {\n\t\tAstDataTable,\n\t\tCommunityUpsellPromo,\n\t\tDlgHeader,\n\t\tModalWrapper,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\trelease: window.config.release,\n\t\t\t// browser.name\n\t\t\t// browser.version\n\t\t\t// browser.os\n\t\t\tbrowser: {},\n\t\t}\n\t},\n\tcreated() {\n\t\tconst browser = detect()\n\t\tif (browser) {\n\t\t\tthis.browser = browser\n\t\t}\n\t},\n\tmethods: {\n\t\tclose() {\n\t\t\tdlg.close(this)\n\t\t},\n\t},\n}\n\nexport default AboutCommunityDlg\n\nexport function openAboutCommunityDlg() {\n\treturn dlg.open(AboutCommunityDlg)\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '~@styles/_vars.scss';\n\n.dialog {\n\tpadding: 0;\n}\n\n.title-row {\n\tbackground: var(--card-header-info-bg) !important;\n\tcolor: var(--card-header-info-color) !important;\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AboutCommunity.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AboutCommunity.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./AboutCommunity.vue?vue&type=template&id=d816edec&scoped=true\"\nimport script from \"./AboutCommunity.vue?vue&type=script&lang=js\"\nexport * from \"./AboutCommunity.vue?vue&type=script&lang=js\"\nimport style0 from \"./AboutCommunity.vue?vue&type=style&index=0&id=d816edec&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"d816edec\",\n  null\n  \n)\n\nexport default component.exports","<template>\n\t<ast-toolbar-dropdown class=\"help-btn\" icon=\"help-circle\" title=\"Help\" :items=\"completeList\" />\n</template>\n\n<script>\nimport AstToolbarDropdown from '@components/ToolbarDropdown.vue'\nimport { mapState } from 'vuex'\nimport { openReportIssue } from '@dialogs/ReportIssue.vue'\nimport { openAboutOmniDlg } from '@dialogs/AboutOmni.vue'\nimport { openAboutCommunityDlg } from '@dialogs/AboutCommunity.vue'\nimport { openReleaseNotes } from '@dialogs/ReleaseNotes.vue'\nimport { clinicAPI } from '@services/clinicAPI'\n\nexport default {\n\tname: 'HelpMenu',\n\tcomponents: { AstToolbarDropdown },\n\tprops: {\n\t\titems: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tclinicAPI,\n\t\t}\n\t},\n\tcomputed: {\n\t\t...mapState({\n\t\t\tclaims: state => state.auth.claims,\n\t\t}),\n\t\tcompleteList() {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ticonName: 'server-network',\n\t\t\t\t\tlabel: `Connection: Keystone (${this.clinicAPI.importMachineName})`,\n\t\t\t\t\tcanShow: () => this.clinicAPI.activeClinicUrl,\n\t\t\t\t\tnoAction: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'cloud',\n\t\t\t\t\tlabel: 'Connection: Cloud',\n\t\t\t\t\tcanShow: () => !this.clinicAPI.activeClinicUrl,\n\t\t\t\t\tnoAction: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'exclamation-triangle',\n\t\t\t\t\tlabel: 'Report Issue',\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\tconst clinicCode = this.$store.getters.isAuthenticated\n\t\t\t\t\t\t\t? this.claims.activeClinicCode\n\t\t\t\t\t\t\t: this.$route.query.clinicCode\n\t\t\t\t\t\topenReportIssue({ clinicCode })\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...this.items,\n\t\t\t\t{\n\t\t\t\t\ticonName: 'book',\n\t\t\t\t\tlabel: 'User Guide',\n\t\t\t\t\tcanShow: () => this.claims.isCommunityUser,\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\twindow.open('https://www.manula.com/manuals/asteris/asteris-keystone-community-user-guide/1/en/topic/about')\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'star',\n\t\t\t\t\tlabel: \"What's New\",\n\t\t\t\t\tcommand: () => openReleaseNotes('ALL'),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'info-circle',\n\t\t\t\t\tlabel: 'About Omni',\n\t\t\t\t\tcanShow: () => !this.claims.isCommunityUser,\n\t\t\t\t\tcommand: () => openAboutOmniDlg(),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'info-circle',\n\t\t\t\t\tlabel: 'About Community',\n\t\t\t\t\tcanShow: () => this.claims.isCommunityUser,\n\t\t\t\t\tcommand: () => openAboutCommunityDlg(),\n\t\t\t\t},\n\t\t\t]\n\t\t},\n\t},\n}\n</script>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HelpMenu.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HelpMenu.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./HelpMenu.vue?vue&type=template&id=cb46a3ca\"\nimport script from \"./HelpMenu.vue?vue&type=script&lang=js\"\nexport * from \"./HelpMenu.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\"}},[(_vm.isVisible)?_c('div',[_c('div',{staticClass:\"banner\",class:[{ 'is-rounded': _vm.isRounded }, (\"banner-\" + _vm.type)]},[(_vm.isClosable)?_c('span',{staticClass:\"close-button\",on:{\"click\":_vm.close}},[_vm._v(\"×\")]):_vm._e(),_c('svg-icon',{attrs:{\"icon\":\"info-circle\"}}),_c('div',{staticClass:\"content\"},[_c('div',{staticClass:\"message\"},[_vm._t(\"default\",[_vm._v(\"Insert banner message here\")])],2),_vm._t(\"learn-more\",[_c('a',{staticClass:\"learn-more\",attrs:{\"href\":_vm.learnMoreLink,\"target\":\"hidden-iframe\"},on:{\"click\":_vm.learnMore}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\tLearn more.\\n\\t\\t\\t\\t\\t\")])])],2)],1)]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<transition name=\"fade\">\n\t\t<!--Wrapper div for inline content-->\n\t\t<div v-if=\"isVisible\">\n\t\t\t<div class=\"banner\" :class=\"[{ 'is-rounded': isRounded }, `banner-${type}`]\">\n\t\t\t\t<span v-if=\"isClosable\" class=\"close-button\" @click=\"close\">&times;</span>\n\t\t\t\t<svg-icon icon=\"info-circle\" />\n\t\t\t\t<div class=\"content\">\n\t\t\t\t\t<div class=\"message\">\n\t\t\t\t\t\t<slot>Insert banner message here</slot>\n\t\t\t\t\t</div>\n\t\t\t\t\t<slot name=\"learn-more\">\n\t\t\t\t\t\t<a class=\"learn-more\" :href=\"learnMoreLink\" target=\"hidden-iframe\" @click=\"learnMore\">\n\t\t\t\t\t\t\tLearn more.\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</transition>\n</template>\n\n<script>\nimport storage from '@services/storage'\n\nexport default {\n\tname: 'Banner',\n\tprops: {\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'default',\n\t\t},\n\t\tlearnMoreLink: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\tisClosable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tisRounded: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tisVisible: true,\n\t\t}\n\t},\n\tcomputed: {\n\t\tbannerId() {\n\t\t\treturn this.id && `${this.id}-banner`\n\t\t},\n\t},\n\tcreated() {\n\t\t// Don't open this banner if any banner with this id was already closed\n\t\tif (this.isClosable && storage.getItem(this.bannerId)) {\n\t\t\tthis.close()\n\t\t}\n\t},\n\tmethods: {\n\t\tlearnMore(e) {\n\t\t\tthis.$emit('learn-more')\n\t\t\tif (!this.learnMoreLink) {\n\t\t\t\te.preventDefault()\n\t\t\t}\n\t\t},\n\t\tclose() {\n\t\t\tthis.isVisible = false\n\t\t\t// Don't open this banner again if id is assigned\n\t\t\tif (this.id) {\n\t\t\t\tstorage.setItem(this.bannerId, true)\n\t\t\t}\n\t\t\tthis.$emit('close')\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.banner {\n\tposition: relative;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n\tflex-wrap: nowrap;\n\tcolor: var(--secondary-label);\n\tbackground: var(--secondary-bg);\n\tborder-width: 1px 0 0 0;\n\tborder-style: solid;\n\tborder-color: var(--divider);\n\tpadding: 6px 16px 16px 16px;\n\n\t&.banner-info {\n\t\tcolor: var(--banner-info-color);\n\t\tbackground: var(--banner-info-bg);\n\t\tborder-color: var(--banner-info-border);\n\t}\n\n\t&.is-rounded {\n\t\tborder-width: 1px;\n\t\tborder-radius: 5px;\n\t}\n\n\t.icon {\n\t\tfont-size: 1.4em;\n\t\tmargin-top: 8px;\n\t\tmargin-right: 10px;\n\t}\n\n\t.content {\n\t\tflex-grow: 1;\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t}\n\n\t.message {\n\t\tmargin-top: 10px;\n\t\tmargin-right: 10px;\n\t}\n\n\t.learn-more {\n\t\tdisplay: inline-block;\n\t\tcolor: inherit;\n\t\ttext-decoration: underline;\n\t\tmargin-top: 10px;\n\t\tmargin-right: 10px;\n\t}\n\n\t.close-button {\n\t\tposition: absolute;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\ttop: 2px;\n\t\tright: 7px;\n\t\tfont-weight: bold;\n\t\tcursor: pointer;\n\t\t&:hover {\n\t\t\topacity: 0.5;\n\t\t}\n\t}\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Banner.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Banner.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Banner.vue?vue&type=template&id=0abe1cff&scoped=true\"\nimport script from \"./Banner.vue?vue&type=script&lang=js\"\nexport * from \"./Banner.vue?vue&type=script&lang=js\"\nimport style0 from \"./Banner.vue?vue&type=style&index=0&id=0abe1cff&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"0abe1cff\",\n  null\n  \n)\n\nexport default component.exports","// extracted by mini-css-extract-plugin\nmodule.exports = {\"small\":\"640px\",\"medium\":\"800px\",\"large\":\"1024px\",\"xLarge\":\"1280px\"};","import introJs from 'intro.js'\nimport storage from '@services/storage'\nimport { omniDesktop } from '@/electron/omniDesktop'\nimport store from '@store'\n\nconst flagKey = 'intro-new'\n\nconst tryStartTour = async function() {\n\t// Don't auto-start if cookie or localStorage item is set\n\tconst shouldStartTour = !storage.getItem(flagKey) && (await shouldOpenTour())\n\tif (shouldStartTour) {\n\t\tstartTour()\n\t}\n}\n\nfunction shouldOpenTour() {\n\treturn (\n\t\t!omniDesktop.isConnected ||\n\t\t!store.state.windows.openStudiesInNewWindow ||\n\t\tomniDesktop.request('isFirstPrimaryViewerWindow')\n\t)\n}\n\nexport const getIcon = icon =>\n\t`<i class=\"icon icon-inline\" style=\"margin:0 2px\"><svg width=\"20\" height=\"20\"><use xlink:href=\"#${icon}\" /></svg></i>`\n\nlet initialBodyStyle\n\nconst startTour = function() {\n\tconst topNavigation = document.querySelector('.top-navigation')\n\tconst bottomNavigation = document.querySelector('.bottom-navigation')\n\tlet navigationElement = bottomNavigation\n\tif (topNavigation && (!bottomNavigation || !bottomNavigation.clientWidth)) {\n\t\tnavigationElement = topNavigation\n\t}\n\n\tconst intro = introJs()\n\tintro\n\t\t.setOptions({\n\t\t\texitOnEsc: true,\n\t\t\texitOnOverlayClick: false,\n\t\t\tshowStepNumbers: false,\n\t\t\tshowBullets: false,\n\t\t\tshowProgress: true,\n\t\t\tscrollToElement: false,\n\t\t\toverlayOpacity: 0.75,\n\t\t\tdisableInteraction: false,\n\t\t\tsteps: [\n\t\t\t\t// Welcome\n\t\t\t\t{\n\t\t\t\t\telement: null,\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Welcome to the Keystone Omni viewer!</h4>\n\t\t\t\t\t\t<p>Select <b>Next</b> for an overview of the viewer's features.</p>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t\t// Viewer\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.layout-pane-container'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Image Viewer</h4>\n\t\t\t\t\t\t<p>This pane shows the active image, and allows you to interact using your mouse or touch device.</p>\n\t\t\t\t\t\t<p>Go ahead! Try tapping, clicking, or dragging the image.</p>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t\t// Thumbnail navigation\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.navigation-drawer'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Navigation</h4>\n\t\t\t\t\t\t<p>You can jump to a specific image in the study by clicking its thumbnail.</p>\n\t\t\t\t\t\t<p>A green bar at the bottom of a thumbnail indicates the progress as it loads images into memory for fast and easy viewing.</p>\n\t\t\t\t\t\t<p>Click the menu icon ${getIcon('menu')} to show or hide this pane.</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'right',\n\t\t\t\t},\n\t\t\t\t// Series navigation\n\t\t\t\t{\n\t\t\t\t\telement: navigationElement,\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Navigation - Part 2</h4>\n\t\t\t\t\t\t<p>You can also move through the the series in a study using the ${getIcon('skip-previous')} and ${getIcon(\n\t\t\t\t\t\t'skip-next'\n\t\t\t\t\t)} navigation buttons.</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'top',\n\t\t\t\t},\n\t\t\t\t// Viewer tools\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.tools'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Image Tools</h4>\n\t\t\t\t\t\t<p>The <b>toolbar</b> offers quick access to commonly used tools.</p>\n\t\t\t\t\t\t<p><b>Select</b> a tool to assign that tool to whichever mouse button you used to click.</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'bottom',\n\t\t\t\t},\n\t\t\t\t// Settings / Help\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.btn-help'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Farewell Notes</h4>\n\t\t\t\t\t\t<p>Open the Help menu ${getIcon('help-circle')} if you want to see this walkthrough again.</p>\n\t\t\t\t\t\t<p>Open the viewer layout menu ${getIcon(\n\t\t\t\t\t\t\t'layout'\n\t\t\t\t\t\t)} to change the image layout or access advanced settings and features.</p>\n\t\t\t\t\t\t<p><b>Most importantly...</b> Have fun! Play around, and don't be afraid to ask questions.</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'bottom',\n\t\t\t\t},\n\t\t\t],\n\t\t})\n\t\t.onbeforechange(function() {\n\t\t\tinitialBodyStyle = initialBodyStyle || document.body.style // store initial body style\n\t\t\tdocument.body.style.overflow = 'hidden' // prevent tooltip layer from creating scrollbars\n\t\t})\n\t\t.onexit(function() {\n\t\t\tdocument.body.style.overflow = initialBodyStyle // restore initial body style\n\t\t\tstorage.setItem(flagKey, true)\n\t\t})\n\tintro.start()\n}\n\nexport { tryStartTour, startTour }\n","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReviewViewer.vue?vue&type=style&index=0&id=0ccc0afe&prod&lang=scss&scoped=true\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.$store.getters.isCommunityUser)?_c('banner',_vm._b({attrs:{\"id\":\"community-upsell\",\"learn-more-link\":\"mailto:sales@asteris.com?subject=Community user interested in other Asteris Apps\"}},'banner',_vm.$attrs,false),[_vm._v(\"\\n\\tAsteris has other apps that can help you manage your images.\\n\")]):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<banner\n\t\tv-if=\"$store.getters.isCommunityUser\"\n\t\tid=\"community-upsell\"\n\t\tv-bind=\"$attrs\"\n\t\tlearn-more-link=\"mailto:sales@asteris.com?subject=Community user interested in other Asteris Apps\"\n\t>\n\t\tAsteris has other apps that can help you manage your images.\n\t</banner>\n</template>\n\n<script>\nimport Banner from './Banner.vue'\n\nexport default {\n\tname: 'CommunityUpsellPromo',\n\tcomponents: {\n\t\tBanner,\n\t},\n}\n</script>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommunityUpsellPromo.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommunityUpsellPromo.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./CommunityUpsellPromo.vue?vue&type=template&id=06c41108\"\nimport script from \"./CommunityUpsellPromo.vue?vue&type=script&lang=js\"\nexport * from \"./CommunityUpsellPromo.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AstCalibration.vue?vue&type=style&index=0&id=e4ba6302&prod&lang=scss\"","(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n    typeof define === 'function' && define.amd ? define(['exports'], factory) :\n    (factory((global.MobileDragDrop = global.MobileDragDrop || {})));\n}(this, (function (exports) { 'use strict';\n\n    function isTopLevelEl(el) {\n        return (el === document.body || el === document.documentElement);\n    }\n    function getElementViewportOffset(el, axis) {\n        var offset;\n        if (isTopLevelEl(el)) {\n            offset = (axis === 0) ? el.clientLeft : el.clientTop;\n        }\n        else {\n            var bounds = el.getBoundingClientRect();\n            offset = (axis === 0) ? bounds.left : bounds.top;\n        }\n        return offset;\n    }\n    function getElementViewportSize(el, axis) {\n        var size;\n        if (isTopLevelEl(el)) {\n            size = (axis === 0) ? window.innerWidth : window.innerHeight;\n        }\n        else {\n            size = (axis === 0) ? el.clientWidth : el.clientHeight;\n        }\n        return size;\n    }\n    function getSetElementScroll(el, axis, scroll) {\n        var prop = (axis === 0) ? \"scrollLeft\" : \"scrollTop\";\n        var isTopLevel = isTopLevelEl(el);\n        if (arguments.length === 2) {\n            if (isTopLevel) {\n                return document.body[prop] || document.documentElement[prop];\n            }\n            return el[prop];\n        }\n        if (isTopLevel) {\n            document.documentElement[prop] += scroll;\n            document.body[prop] += scroll;\n        }\n        else {\n            el[prop] += scroll;\n        }\n    }\n    function isScrollable(el) {\n        var cs = getComputedStyle(el);\n        if (el.scrollHeight > el.clientHeight && (cs.overflowY === \"scroll\" || cs.overflowY === \"auto\")) {\n            return true;\n        }\n        if (el.scrollWidth > el.clientWidth && (cs.overflowX === \"scroll\" || cs.overflowX === \"auto\")) {\n            return true;\n        }\n        return false;\n    }\n    function findScrollableParent(el) {\n        do {\n            if (!el) {\n                return undefined;\n            }\n            if (isScrollable(el)) {\n                return el;\n            }\n            if (el === document.documentElement) {\n                return null;\n            }\n        } while (el = el.parentNode);\n        return null;\n    }\n    function determineScrollIntention(currentCoordinate, size, threshold) {\n        if (currentCoordinate < threshold) {\n            return -1;\n        }\n        else if (size - currentCoordinate < threshold) {\n            return 1;\n        }\n        return 0;\n    }\n    function determineDynamicVelocity(scrollIntention, currentCoordinate, size, threshold) {\n        if (scrollIntention === -1) {\n            return Math.abs(currentCoordinate - threshold);\n        }\n        else if (scrollIntention === 1) {\n            return Math.abs(size - currentCoordinate - threshold);\n        }\n        return 0;\n    }\n    function isScrollEndReached(axis, scrollIntention, scrollBounds) {\n        var currentScrollOffset = (axis === 0) ? (scrollBounds.scrollX) : (scrollBounds.scrollY);\n        if (scrollIntention === 1) {\n            var maxScrollOffset = (axis === 0) ? (scrollBounds.scrollWidth - scrollBounds.width) : (scrollBounds.scrollHeight -\n                scrollBounds.height);\n            return currentScrollOffset >= maxScrollOffset;\n        }\n        else if (scrollIntention === -1) {\n            return (currentScrollOffset <= 0);\n        }\n        return true;\n    }\n    var _options = {\n        threshold: 75,\n        velocityFn: function (velocity, threshold) {\n            var multiplier = velocity / threshold;\n            var easeInCubic = multiplier * multiplier * multiplier;\n            return easeInCubic * threshold;\n        }\n    };\n    var _scrollIntentions = {\n        horizontal: 0,\n        vertical: 0\n    };\n    var _dynamicVelocity = {\n        x: 0,\n        y: 0\n    };\n    var _scrollAnimationFrameId;\n    var _currentCoordinates;\n    var _hoveredElement;\n    var _scrollableParent;\n    var _translateDragImageFn;\n    function handleDragImageTranslateOverride(event, currentCoordinates, hoveredElement, translateDragImageFn) {\n        _currentCoordinates = currentCoordinates;\n        _translateDragImageFn = translateDragImageFn;\n        if (_hoveredElement !== hoveredElement) {\n            _hoveredElement = hoveredElement;\n            _scrollableParent = findScrollableParent(_hoveredElement);\n        }\n        var performScrollAnimation = updateScrollIntentions(_currentCoordinates, _scrollableParent, _options.threshold, _scrollIntentions, _dynamicVelocity);\n        if (performScrollAnimation) {\n            scheduleScrollAnimation();\n        }\n        else if (!!_scrollAnimationFrameId) {\n            window.cancelAnimationFrame(_scrollAnimationFrameId);\n            _scrollAnimationFrameId = null;\n        }\n    }\n    function scheduleScrollAnimation() {\n        if (!!_scrollAnimationFrameId) {\n            return;\n        }\n        _scrollAnimationFrameId = window.requestAnimationFrame(scrollAnimation);\n    }\n    function scrollAnimation() {\n        var scrollDiffX = 0, scrollDiffY = 0, isTopLevel = isTopLevelEl(_scrollableParent);\n        if (_scrollIntentions.horizontal !== 0) {\n            scrollDiffX = Math.round(_options.velocityFn(_dynamicVelocity.x, _options.threshold) * _scrollIntentions.horizontal);\n            getSetElementScroll(_scrollableParent, 0, scrollDiffX);\n        }\n        if (_scrollIntentions.vertical !== 0) {\n            scrollDiffY = Math.round(_options.velocityFn(_dynamicVelocity.y, _options.threshold) * _scrollIntentions.vertical);\n            getSetElementScroll(_scrollableParent, 1, scrollDiffY);\n        }\n        if (isTopLevel) {\n            _translateDragImageFn(scrollDiffX, scrollDiffY);\n        }\n        else {\n            _translateDragImageFn(0, 0);\n        }\n        _scrollAnimationFrameId = null;\n        if (updateScrollIntentions(_currentCoordinates, _scrollableParent, _options.threshold, _scrollIntentions, _dynamicVelocity)) {\n            scheduleScrollAnimation();\n        }\n    }\n    function updateScrollIntentions(currentCoordinates, scrollableParent, threshold, scrollIntentions, dynamicVelocity) {\n        if (!currentCoordinates || !scrollableParent) {\n            return false;\n        }\n        var scrollableParentBounds = {\n            x: getElementViewportOffset(scrollableParent, 0),\n            y: getElementViewportOffset(scrollableParent, 1),\n            width: getElementViewportSize(scrollableParent, 0),\n            height: getElementViewportSize(scrollableParent, 1),\n            scrollX: getSetElementScroll(scrollableParent, 0),\n            scrollY: getSetElementScroll(scrollableParent, 1),\n            scrollWidth: scrollableParent.scrollWidth,\n            scrollHeight: scrollableParent.scrollHeight\n        };\n        var currentCoordinatesOffset = {\n            x: currentCoordinates.x - scrollableParentBounds.x,\n            y: currentCoordinates.y - scrollableParentBounds.y\n        };\n        scrollIntentions.horizontal = determineScrollIntention(currentCoordinatesOffset.x, scrollableParentBounds.width, threshold);\n        scrollIntentions.vertical = determineScrollIntention(currentCoordinatesOffset.y, scrollableParentBounds.height, threshold);\n        if (scrollIntentions.horizontal && isScrollEndReached(0, scrollIntentions.horizontal, scrollableParentBounds)) {\n            scrollIntentions.horizontal = 0;\n        }\n        else if (scrollIntentions.horizontal) {\n            dynamicVelocity.x = determineDynamicVelocity(scrollIntentions.horizontal, currentCoordinatesOffset.x, scrollableParentBounds.width, threshold);\n        }\n        if (scrollIntentions.vertical && isScrollEndReached(1, scrollIntentions.vertical, scrollableParentBounds)) {\n            scrollIntentions.vertical = 0;\n        }\n        else if (scrollIntentions.vertical) {\n            dynamicVelocity.y = determineDynamicVelocity(scrollIntentions.vertical, currentCoordinatesOffset.y, scrollableParentBounds.height, threshold);\n        }\n        return !!(scrollIntentions.horizontal || scrollIntentions.vertical);\n    }\n    var scrollBehaviourDragImageTranslateOverride = handleDragImageTranslateOverride;\n\n    exports.scrollBehaviourDragImageTranslateOverride = scrollBehaviourDragImageTranslateOverride;\n\n    Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n//# sourceMappingURL=scroll-behaviour.js.map","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerReportList.vue?vue&type=style&index=0&id=c152e392&prod&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerTools.vue?vue&type=style&index=0&id=3c1cc306&prod&lang=scss\"","'use strict';\nvar $ = require('../internals/export');\n\n// `Number.MAX_SAFE_INTEGER` constant\n// https://tc39.es/ecma262/#sec-number.max_safe_integer\n$({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, {\n  MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF\n});\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"layout-grid\",on:{\"mouseleave\":function($event){return _vm.onHover(0, 0)}}},[_vm._l((_vm.maxRows),function(row){return _vm._l((_vm.maxColumns),function(col){return _c('div',{key:(row - 1) * _vm.maxColumns + col,staticClass:\"cell\",class:{\n\t\t\t\tdisabled: _vm.isCellDisabled(row, col),\n\t\t\t\thovered: _vm.hover.r >= row && _vm.hover.c >= col,\n\t\t\t\tselected: _vm.value.r >= row && _vm.value.c >= col,\n\t\t\t},on:{\"mouseover\":function($event){$event.stopPropagation();return _vm.onHover(row, col)},\"click\":function($event){return _vm.onSelect(row, col)}}})})})],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<div class=\"layout-grid\" @mouseleave=\"onHover(0, 0)\">\n\t\t<template v-for=\"row in maxRows\">\n\t\t\t<div\n\t\t\t\tv-for=\"col in maxColumns\"\n\t\t\t\t:key=\"(row - 1) * maxColumns + col\"\n\t\t\t\tclass=\"cell\"\n\t\t\t\t:class=\"{\n\t\t\t\t\tdisabled: isCellDisabled(row, col),\n\t\t\t\t\thovered: hover.r >= row && hover.c >= col,\n\t\t\t\t\tselected: value.r >= row && value.c >= col,\n\t\t\t\t}\"\n\t\t\t\t@mouseover.stop=\"onHover(row, col)\"\n\t\t\t\t@click=\"onSelect(row, col)\"\n\t\t\t></div>\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nconst disabledOptions = ['4x6']\n\nexport default {\n\tname: 'LayoutGridSelector',\n\tprops: {\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ r: 1, c: 1 }),\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\thover: { r: 0, c: 0 },\n\t\t}\n\t},\n\tcreated() {\n\t\t// Static\n\t\tthis.maxRows = 4\n\t\tthis.maxColumns = 6\n\t},\n\tmethods: {\n\t\tisCellDisabled(row, col) {\n\t\t\tif (disabledOptions.includes(`${row}x${col}`)) return true\n\t\t\treturn false\n\t\t},\n\t\tonHover(r, c) {\n\t\t\tthis.hover = { r, c }\n\t\t},\n\t\tonSelect(r, c) {\n\t\t\tthis.$emit('input', { r, c })\n\t\t\tthis.hover = { r: 0, c: 0 }\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.layout-grid {\n\tdisplay: inline-grid;\n\tgrid: repeat(4, 24px) / repeat(6, 24px);\n\tgrid-gap: 2px;\n\tmargin: 0 auto;\n}\n.cell {\n\tborder: 1px solid var(--secondary-label);\n\tcursor: pointer;\n\theight: 100%;\n\t&.disabled {\n\t\tborder-color: var(--tertiary-border);\n\t\tbackground-color: var(--primary-bg);\n\t\tpointer-events: none;\n\t}\n\t&.hovered {\n\t\tborder-color: var(--button-primary-bg);\n\t\tborder-width: 2px;\n\t}\n\t&.selected {\n\t\tborder-color: var(--button-primary-bg);\n\t\tbackground-color: var(--button-primary-bg-hover);\n\t}\n\t&.selected.hovered {\n\t\tbackground-color: var(--primary-toolbar-logo);\n\t}\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LayoutGridSelector.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LayoutGridSelector.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./LayoutGridSelector.vue?vue&type=template&id=77ea46e2&scoped=true\"\nimport script from \"./LayoutGridSelector.vue?vue&type=script&lang=js\"\nexport * from \"./LayoutGridSelector.vue?vue&type=script&lang=js\"\nimport style0 from \"./LayoutGridSelector.vue?vue&type=style&index=0&id=77ea46e2&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"77ea46e2\",\n  null\n  \n)\n\nexport default component.exports","import introJs from 'intro.js'\nimport { getIcon } from './ViewerTour'\nimport storage from '@services/storage'\n\nconst flagKey = 'mpr-intro-new'\nlet initialBodyStyle\n\nconst tryStartTour = function() {\n\t// Don't auto-start if flag is set\n\tif (!storage.getItem(flagKey)) {\n\t\tstartTour()\n\t}\n}\n\nconst startTour = function() {\n\tconst intro = introJs()\n\tintro\n\t\t.setOptions({\n\t\t\texitOnEsc: true,\n\t\t\texitOnOverlayClick: false,\n\t\t\tshowStepNumbers: false,\n\t\t\tshowBullets: false,\n\t\t\tshowProgress: true,\n\t\t\tscrollToElement: false,\n\t\t\toverlayOpacity: 0.75,\n\t\t\tdisableInteraction: false,\n\t\t\tsteps: [\n\t\t\t\t// Welcome\n\t\t\t\t{\n\t\t\t\t\telement: null,\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Welcome to the Multi-Planar Reconstruction viewer!</h4>\n\t\t\t\t\t\t<p>Select <b>Next</b> for an overview of the viewer's features.</p>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t\t// Viewer\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.viewer2d.active'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Image Views</h4>\n\t\t\t\t\t\t<p>MPR constructs an image volume with 3 orthogonal views.</p>\n\t\t\t\t\t\t<p>This view matches the DICOM series. The colored border denotes it as the active view.</p>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t\t// Dot indicator\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.viewColor'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Dot Indicator</h4>\n\t\t\t\t\t\t<p>The colored indicator helps associate this view with the same-colored axis in the other two views.</p>\n\t\t\t\t\t\t<p><b>Click</b> it to toggle the fullscreen layout for this particular view.</p>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t\t// Axis rotation\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.rotateCursor.y-top'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Axis Rotation</h4>\n\t\t\t\t\t\t<p><b>Drag</b> the circular handle to rotate the axis for its associated view (purple axis will rotate view with purple dot indicator).</p>\n\t\t\t\t\t\t<h4>Advanced Usage</h4>\n\t\t\t\t\t\t<p><b>DblClick</b> resets the axes to their default orientation\n\t\t\t\t\t\t<p><b>Shift</b>+<b>Drag</b> to rotate a single axis. Relative angles will be preserved when rotating normally.</p>\n\t\t\t\t\t\t<p><b>Shift</b>+<b>DblClick</b> re-orthogonalizes the axes if an axis was rotated individually.</p>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t\t// Slice thickness\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.thicknessCursor.y-top'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Slick Thickness</h4>\n\t\t\t\t\t\t<p><b>Drag</b> the square handles to adjust the slice thickness for its associated view.</p>\n\t\t\t\t\t\t<p>That view will display the thickness amount (mm) in the bottom left corner.</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'right',\n\t\t\t\t},\n\t\t\t\t// Layout selector\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.btn-select-layout'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Select Layout & Settings</h4>\n\t\t\t\t\t\t<p><b>Click</b> the layout & settings button ${getIcon(\n\t\t\t\t\t\t\t'layout'\n\t\t\t\t\t\t)} to select a different view layout or toggle various overlay, axis and window level settings.</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'bottom',\n\t\t\t\t},\n\t\t\t\t// Viewer tools\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.viewer-toolbar-container'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Image Tools</h4>\n\t\t\t\t\t\t<p>The <b>MPR Viewer Toolbar</b> provides most of the same tools provided by the image viewer.</p>\n\t\t\t\t\t\t<p><b>Select</b> a tool to assign that tool to whichever mouse button you used to click.</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'bottom',\n\t\t\t\t},\n\t\t\t\t// Rotate slice plane tool\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.btn-rotate-slice-plane'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Rotate Slice Plane Tool</h4>\n\t\t\t\t\t\t<p><b>Click</b> and <b>Drag</b> to rotate the active view’s slice plane, horizontal rotation and vertical rotation.</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'bottom',\n\t\t\t\t},\n\t\t\t\t// Blend mode selection tools\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.btn-maximum-intensity-projection'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Blend Modes</h4>\n\t\t\t\t\t\t<p>Select the intensity projection / blend mode used to interpolate the slice thicknesses.</p>\n\t\t\t\t\t\t<p>Defaults to MIP (Maximum Intensity Projection)</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'bottom',\n\t\t\t\t},\n\t\t\t\t// Switch tool\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.btn-switch-views'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Switch Tool</h4>\n\t\t\t\t\t\t<p><b>Click</b> to switch the position of the active view with another view.</p>\n\t\t\t\t\t\t<h4>Keyboard Shorcut</h4>\n\t\t\t\t\t\t<p>Hold <b>Option (Mac)</b> or <b>Alt (Win)</b> and <b>Click</b> to perform the same action.</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'bottom',\n\t\t\t\t},\n\t\t\t\t// Settings / Help\n\t\t\t\t{\n\t\t\t\t\telement: document.querySelector('.btn-help'),\n\t\t\t\t\tintro: `\n\t\t\t\t\t\t<h4>Farewell Notes</h4>\n\t\t\t\t\t\t<p>Open the Help menu ${getIcon('help-circle')} if you want to see this walkthrough again.</p>\n\t\t\t\t\t\t<p><b>Most importantly...</b> Have fun! Play around, and don't be afraid to ask questions.</p>\n\t\t\t\t\t`,\n\t\t\t\t\tposition: 'bottom',\n\t\t\t\t},\n\t\t\t],\n\t\t})\n\t\t.onbeforechange(function() {\n\t\t\tinitialBodyStyle = initialBodyStyle || document.body.style // store initial body style\n\t\t\tdocument.body.style.overflow = 'hidden' // prevent tooltip layer from creating scrollbars\n\t\t})\n\t\t.onexit(function() {\n\t\t\tdocument.body.style.overflow = initialBodyStyle // restore initial body style\n\t\t\tstorage.setItem(flagKey, true)\n\t\t})\n\tintro.start()\n}\n\nexport { tryStartTour, startTour }\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('main',{staticClass:\"viewer-layout\"},[_c('desktop-downloader'),(_vm.toolbarLocation === 'bottom')?[(_vm.mprActive)?_c('ast-mpr-viewer-tools',{attrs:{\"toolbar-location\":_vm.toolbarLocation},on:{\"toggle-drawer\":_vm.toggleDrawer}}):_c('ast-viewer-tools',{attrs:{\"active-series\":_vm.activeSeries,\"active-image\":_vm.activeImage,\"is-repository\":_vm.isRepository,\"toolbar-location\":_vm.toolbarLocation},on:{\"toggle-drawer\":_vm.toggleDrawer}})]:_vm._e(),_c('div',{staticClass:\"viewer-content\"},[_c('transition',{attrs:{\"name\":\"reveal-right\"},on:{\"after-enter\":_vm.resizeCanvases,\"after-leave\":_vm.resizeCanvases}},[(_vm.mq.medium && _vm.isPersistentDrawerOpen && !_vm.mprActive)?_c('persistent-navigation-drawer',{staticClass:\"navigation-drawer\",class:{ 'dragged-over': _vm.navPanelDraggedOver },on:{\"transition\":_vm.resizeCanvases},nativeOn:{\"dragover\":function($event){return _vm.onNavDrawerDragOver($event)},\"dragleave\":function($event){return _vm.onNavDrawerDragLeave($event)},\"drop\":function($event){return _vm.onNavDrawerDrop($event)}}},[(_vm.allowRelatedStudies && !_vm.isViewerLoading)?_c('ast-viewer-add-related-study',{attrs:{\"related-studies\":_vm.relatedStudies}}):_vm._e(),_c('div',{staticClass:\"study-container\"},[_c('transition-group',{attrs:{\"name\":\"fade\"}},_vm._l((_vm.studies),function(study){return _c('ast-viewer-study',{key:study.studyId,attrs:{\"study\":study,\"show-heading\":_vm.studies.length > 1,\"show-patient-name\":_vm.isMultiplePatients,\"clinic-code\":_vm.clinicCode}})}),1)],1)],1):_vm._e()],1),(_vm.toolbarLocation === 'left')?[(_vm.mprActive)?_c('ast-mpr-viewer-tools',{attrs:{\"toolbar-location\":_vm.toolbarLocation},on:{\"toggle-drawer\":_vm.toggleDrawer}}):_c('ast-viewer-tools',{attrs:{\"active-series\":_vm.activeSeries,\"active-image\":_vm.activeImage,\"is-repository\":_vm.isRepository,\"toolbar-location\":_vm.toolbarLocation},on:{\"toggle-drawer\":_vm.toggleDrawer}})]:_vm._e(),_c('div',{staticClass:\"page-wrapper\"},[(!_vm.mprActive)?_c('div',{ref:\"layoutContainer\",staticClass:\"layout-pane-container\"},[_vm._l((_vm.visibleCanvases),function(canvas){return _c('div',{key:canvas.index,staticClass:\"layout-pane\",style:(_vm.layoutPaneSize),on:{\"contextmenu\":_vm.openRelatedMenu,\"dragover\":function($event){return _vm.onCanvasDragOver(canvas.index, $event)},\"dragenter\":_vm.onCanvasDragEnter,\"dragexit\":_vm.onCanvasDragExit,\"dragleave\":_vm.onCanvasDragLeave,\"drop\":_vm.onCanvasDrop,\"mousedown\":function($event){return _vm.onImageViewerMouseDown($event, canvas.index)},\"touchstart\":function($event){return _vm.setActiveCanvas({ canvasIndex: canvas.index })},\"wheel\":function($event){return _vm.setActiveCanvas({ canvasIndex: canvas.index })}}},[[(_vm.canvasIsVisible(canvas))?_c('ast-image-viewer',_vm._b({directives:[{name:\"dblclick\",rawName:\"v-dblclick\",value:(function () { return _vm.$store.dispatch('resetLevels'); }),expression:\"() => $store.dispatch('resetLevels')\"}],key:canvas.index,ref:\"canvases\",refInFor:true,class:{ isActiveViewer: _vm.activeCanvasIndex == canvas.index },attrs:{\"is-repository\":_vm.isRepository,\"series\":_vm.getCanvasSeries(canvas),\"series-index\":_vm.activeStudySeries.findIndex(function (x) { return x.seriesId == canvas.seriesId; }),\"series-total\":_vm.activeStudySeries.length,\"show-overlay-text\":_vm.settings.overlayText}},'ast-image-viewer',canvas,false)):(_vm.isUnmatchedImageView(canvas) || _vm.hideLoadingText)?_c('ast-image-placeholder',{key:canvas.index,class:{ isActiveViewer: _vm.activeCanvasIndex == canvas.index },attrs:{\"index\":canvas.index}},[(_vm.studies.length && _vm.isUnmatchedImageView(canvas))?[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(canvas.imageView.name)+\" is not available\\n\\t\\t\\t\\t\\t\\t\\t\\t\")]:_vm._e()],2):_vm._e()]],2)}),(_vm.loadingText)?_c('transition',{attrs:{\"name\":\"fade\"}},[_c('h1',{staticClass:\"loading-text\"},[_vm._v(_vm._s(_vm.loadingText))])]):_vm._e()],2):_vm._e(),(_vm.mprActive)?_c('ast-mpr-viewer',_vm._b({attrs:{\"series\":_vm.getCanvasSeries(_vm.activeCanvas),\"initial-slice\":_vm.mprInitialSlice,\"initial-voi\":_vm.mprInitialVoi}},'ast-mpr-viewer',_vm.activeCanvas,false)):_vm._e(),(!_vm.mprActive && _vm.showBottomNavigation)?_c('ast-toolbar',{staticClass:\"bottom-navigation\"},[_c('ast-viewer-navigation',{attrs:{\"active-series\":_vm.activeSeries,\"all-series\":_vm.activeStudySeries,\"show-dropdowns-below\":false},on:{\"toggle-cine\":function($event){_vm.isCineDialogOpen = !_vm.isCineDialogOpen}}})],1):_vm._e()],1),(_vm.toolbarLocation === 'right')?[(_vm.mprActive)?_c('ast-mpr-viewer-tools',{attrs:{\"toolbar-location\":_vm.toolbarLocation},on:{\"toggle-drawer\":_vm.toggleDrawer}}):_c('ast-viewer-tools',{attrs:{\"active-series\":_vm.activeSeries,\"active-image\":_vm.activeImage,\"is-repository\":_vm.isRepository,\"toolbar-location\":_vm.toolbarLocation},on:{\"toggle-drawer\":_vm.toggleDrawer}})]:_vm._e(),_c('persistent-navigation-drawer',{staticClass:\"tool-help-drawer\"},[_vm._t(\"right-drawer\",[_c('ast-viewer-tool-help',{on:{\"transition\":_vm.resizeCanvases}})])],2),(_vm.showEmailImages)?_c('email-images-sidebar',{on:{\"close\":function($event){_vm.showEmailImages = false}}}):_vm._e()],2),(_vm.toolbarLocation === 'top')?[(_vm.mprActive)?_c('ast-mpr-viewer-tools',{attrs:{\"toolbar-location\":_vm.toolbarLocation},on:{\"toggle-drawer\":_vm.toggleDrawer}}):_c('ast-viewer-tools',{attrs:{\"active-series\":_vm.activeSeries,\"active-image\":_vm.activeImage,\"is-repository\":_vm.isRepository,\"toolbar-location\":_vm.toolbarLocation},on:{\"toggle-drawer\":_vm.toggleDrawer}})]:_vm._e(),_c('ast-toolbar',{attrs:{\"is-primary\":true}},[(!_vm.mprActive)?_c('div',{staticClass:\"left\"},[(!_vm.isDesktop)?_c('ast-toolbar-branding'):_vm._e(),_vm._t(\"primary-buttons-left\"),_vm._l((_vm.getPrimaryToolbarGroup('left')),function(btn,title){return _c('ast-toolbar-button',{key:title,class:btn.class,attrs:{\"icon\":btn.icon,\"title\":title,\"label\":btn.label,\"has-notification\":btn.hasNotification},nativeOn:{\"click\":function($event){return btn.action()}}})}),_c('ast-viewer-layout-selector',{attrs:{\"settings-config\":_vm.settingsConfig},on:{\"layout-selected\":_vm.handleLayoutSelected},scopedSlots:_vm._u([{key:\"mpr\",fn:function(){return [(!_vm.isRepository)?_c('ul',[_c('li',{class:{ disabled: !!_vm.mprLoadingReason },staticStyle:{\"display\":\"flex\",\"flex-direction\":\"row\",\"align-items\":\"flex-start\",\"max-width\":\"250px\"},on:{\"mousedown\":function($event){$event.stopPropagation();return _vm.checkAndLoadMpr($event)}}},[(_vm.hasActiveSeries && !!_vm.mprLoadingReason)?_c('svg-icon',{staticClass:\"no-disable\",attrs:{\"icon\":\"spinner-circle-thick\",\"spin\":\"\"}}):_c('svg-icon',{attrs:{\"icon\":\"layout-mpr-3x1\",\"fixed\":\"\",\"inline\":\"\"}}),_c('span',{staticStyle:{\"white-space\":\"normal\",\"text-overflow\":\"initial\",\"flex-grow\":\"1\",\"margin-left\":\"4px\"}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm.mprLoadingReason || 'View MPR')+\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\")])],1)]):_vm._e()]},proxy:true}],null,false,2026806100)}),(_vm.isFullScreenSupported)?_c('ast-toolbar-button',{attrs:{\"icon\":_vm.isFullScreen ? 'fullscreen-exit-alt' : 'fullscreen-alt',\"title\":_vm.isFullScreen ? 'Exit Full Screen' : 'Full Screen'},nativeOn:{\"click\":function($event){return _vm.toggleFullScreen($event)}}}):_vm._e()],2):_c('div',{staticClass:\"left\"},[_c('ast-toolbar-branding'),_c('ast-toolbar-button',{staticClass:\"back-btn\",attrs:{\"label\":\"Exit MPR\",\"icon\":\"arrow-left\"},nativeOn:{\"click\":function($event){return (function () { return _vm.setMprActive(false); })($event)}}}),_c('ast-mpr-viewer-layout-selector')],1),(!_vm.mprActive && !_vm.showBottomNavigation)?_c('ast-viewer-navigation',{staticClass:\"top-navigation\",attrs:{\"active-series\":_vm.activeSeries,\"all-series\":_vm.activeStudySeries},on:{\"toggle-cine\":function($event){_vm.isCineDialogOpen = !_vm.isCineDialogOpen}}}):_vm._e(),_c('div',{staticClass:\"right\"},[_vm._t(\"primary-buttons-right\"),_c('help-menu',{attrs:{\"items\":_vm.helpItems}}),_c('user-menu'),_vm._l((_vm.getPrimaryToolbarGroup('right')),function(btn,title){return _c('ast-toolbar-button',{key:title,class:btn.class,attrs:{\"icon\":btn.icon,\"title\":title,\"label\":btn.label,\"has-notification\":btn.hasNotification},nativeOn:{\"click\":function($event){return btn.action()}}})})],2)],1),(!_vm.mq.medium && _vm.isModalDrawerOpen)?_c('modal-drawer',{staticClass:\"navigation-drawer\",on:{\"close\":function($event){return _vm.$store.commit('TOGGLE_MODAL_DRAWER', false)}}},[(_vm.allowRelatedStudies && !_vm.isViewerLoading)?_c('ast-viewer-add-related-study',{attrs:{\"related-studies\":_vm.relatedStudies}}):_vm._e(),_c('div',{staticClass:\"study-container\"},[_c('transition-group',{attrs:{\"name\":\"fade\"}},_vm._l((_vm.studies),function(study){return _c('ast-viewer-study',{key:study.studyId,attrs:{\"study\":study,\"show-heading\":_vm.studies.length > 1,\"show-patient-name\":_vm.isMultiplePatients},on:{\"drag-thumbnail\":function($event){return _vm.$store.commit('TOGGLE_MODAL_DRAWER', false)},\"openattachment\":_vm.openAttachment}})}),1)],1)],1):_vm._e(),_vm._t(\"dialogs\"),_vm._t(\"panels\"),(_vm.isDrawerOpen.mprActions)?_c('viewer-actions-drawer',{on:{\"save\":_vm.saveMprImageAsync,\"print\":_vm.printMprImageAsync,\"copy\":_vm.copyMprImageAsync,\"clear-annotations\":function () { return _vm.clearMprActiveAnnotations(); },\"burn-in-annotations\":function($event){return _vm.$emit('burn-in-annotations', $event)},\"close\":function($event){_vm.isDrawerOpen.mprActions = false}}}):_vm._e(),(_vm.isDrawerOpen.actions)?_c('viewer-actions-drawer',{on:{\"save\":_vm.saveCanvasAsync,\"print\":_vm.printCanvasAsync,\"copy\":_vm.copyCanvasAsync,\"show-email-images\":function($event){_vm.showEmailImages = true},\"clear-annotations\":function () { return _vm.syncClearAnnotations({ activeImage: _vm.activeImage, activeSeries: _vm.activeSeries }); },\"burn-in-annotations\":function($event){return _vm.$emit('burn-in-annotations', $event)},\"download-study\":function($event){return _vm.$emit('download-study')},\"download-dicom-images\":function($event){return _vm.$emit('download-dicom-images')},\"download-jpeg-images\":function($event){return _vm.$emit('download-jpeg-images')},\"import-into-keystone\":function($event){return _vm.$emit('import-into-keystone')},\"close\":function($event){_vm.isDrawerOpen.actions = false}}}):_vm._e(),(_vm.isDrawerOpen.dicom)?_c('dicom-tags-drawer',{attrs:{\"preview-image-url\":_vm.previewImageUrl,\"dicom-tags\":_vm.activeDicomTags,\"canvas\":_vm.activeCanvas},on:{\"close\":function($event){_vm.isDrawerOpen.dicom = false}}}):_vm._e(),(_vm.contextMenu.isOpen)?_c('ast-viewer-context-menu',{attrs:{\"top\":_vm.contextMenu.top,\"left\":_vm.contextMenu.left,\"active-series\":_vm.activeSeries,\"allow-related-studies\":_vm.allowRelatedStudies,\"related-studies\":_vm.relatedStudies,\"mpr-title\":_vm.mprLoadingReason || 'View MPR',\"mpr-loading\":!!_vm.mprLoadingReason,\"container-ref\":_vm.$refs.layoutContainer},on:{\"select\":_vm.switchSeries,\"view-mpr\":function($event){return _vm.checkAndLoadMpr()},\"close\":function($event){_vm.contextMenu.isOpen = false}}}):_vm._e(),(_vm.isCineDialogOpen)?_c('ast-cine-dialog',_vm._b({attrs:{\"is-open\":_vm.isCineDialogOpen},on:{\"play-clip\":_vm.playClip,\"pause-clip\":_vm.pauseClip,\"framerate-change\":_vm.onFrameRateChange,\"goto-image\":_vm.goToImage,\"goto-next-series\":_vm.cineNextSeries,\"goto-previous-series\":_vm.cinePreviousSeries}},'ast-cine-dialog',_vm.activeCanvas.cinePlayer,false)):_vm._e(),(_vm.mprActive)?_c('mpr-annotation-dialog'):_c('annotation-dialog'),_c('ast-hotkey-modal',{attrs:{\"show-hotkeys\":_vm.hotkeysVisible},on:{\"close\":_vm.toggleHotkeyModal}})],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export const MEASUREMENT_DONE_MODIFYING = 'measurementdonemodifying'\n\nexport default {\n\tMEASUREMENT_DONE_MODIFYING,\n}\n","import { import as csTools } from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { MEASUREMENT_DONE_MODIFYING } from '@/cornerstone/_shared/events'\n\nconst triggerEvent = csTools('util/triggerEvent')\n\nexport default function triggerDoneModifying(toolName, element, image) {\n\ttriggerEvent(element, MEASUREMENT_DONE_MODIFYING, {\n\t\ttoolName,\n\t\ttoolType: toolName, // Deprecation notice: toolType will be replaced by toolName\n\t\telement,\n\t\timage,\n\t})\n}\n","import { getToolState, import as csTools } from 'cornerstone-tools'\nimport { eventBus } from '@services/eventBus'\nimport triggerDoneModifying from '../util/triggerDoneModifying'\n\nconst moveAnnotation = csTools('manipulators/moveAnnotation')\n\nexport default function toolSelectedCallback(event, annotation, interactionType = 'mouse') {\n\tmoveAnnotation(event, this, annotation, interactionType)\n\tconst UP_EVENT = interactionType === 'mouse' ? 'mouseup' : 'touchend'\n\n\t// Notify once we're done moving the tool, regardless of click vs drag\n\t// Do this before the right click check to be notified whenever moveAnnotation happens\n\tconst changedEvent = evt => {\n\t\tconst { element, image } = event.detail\n\t\ttriggerDoneModifying(this.name, element, image)\n\t\tevent.detail.element.removeEventListener(UP_EVENT, changedEvent)\n\t}\n\tevent.detail.element.addEventListener(UP_EVENT, changedEvent)\n\n\tif (event.detail.buttons === 2) return\n\n\t// wait 180ms for mouseup/touchend, indicating a click rather than a drag\n\tconst postClickEvent = () => {\n\t\tconst toolState = getToolState(event.detail.element, this.name)\n\t\teventBus.post(eventBus.type.ANNOTATION_CLICK, {\n\t\t\ttool: this,\n\t\t\ttoolState,\n\t\t\tannotation,\n\t\t\tevent,\n\t\t})\n\t}\n\tevent.detail.element.addEventListener(UP_EVENT, postClickEvent)\n\tsetTimeout(() => {\n\t\tevent.detail.element.removeEventListener(UP_EVENT, postClickEvent)\n\t}, 180)\n}\n","import * as cornerstoneTools from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { pixelToCanvas } from 'cornerstone-core/dist/cornerstone.js'\nimport { point } from 'cornerstone-math'\n\nexport const _radii = {\n\tmouse: {\n\t\tdefault: {\n\t\t\tdisplayRadius: 6,\n\t\t\thitRadius: 15,\n\t\t},\n\t\tprecision: {\n\t\t\tdisplayRadius: 50,\n\t\t\thitRadius: 54,\n\t\t},\n\t},\n\ttouch: {\n\t\tdefault: {\n\t\t\tdisplayRadius: 6,\n\t\t\thitRadius: 25,\n\t\t},\n\t\tprecision: {\n\t\t\tdisplayRadius: 50,\n\t\t\thitRadius: 56,\n\t\t},\n\t},\n}\n\nexport const precisionTools = [\n\t'AstCalibration',\n\t'AstLengthAngle',\n\t'AstRectangleRoi',\n\t'AstAngle',\n\t'AstVertebralHeart',\n\t'AstTplo',\n\t'AstTta',\n\t'AstHipDysplasia',\n\t'AstPennHip',\n]\n\nexport function initHandle(handle, coords, interactionType, options = {}) {\n\tif (handle.hasBoundingBox) return\n\tif (!handle.pointNearHandle) {\n\t\thandle.pointNearHandle = pointNearHandle\n\t}\n\tif (!handle.radii) {\n\t\thandle.radii = _radii[interactionType]\n\t}\n\tif (!handle.radius) {\n\t\thandle.radius = handle.radii.default.displayRadius\n\t}\n\tif (options.precisionHandlesEnabled) {\n\t\thandle.precisionEnabled = true\n\t}\n\tif (coords) {\n\t\thandle.drag = {\n\t\t\toriginX: handle.x,\n\t\t\toriginY: handle.y,\n\t\t\toriginDragX: coords.x,\n\t\t\toriginDragY: coords.y,\n\t\t}\n\t}\n}\n\nexport function handleLengthsAreValid(handles) {\n\tconst { start, middle, end } = handles\n\tlet isValid = true\n\tif (start && middle) {\n\t\tisValid = handleLengthIsValid(start, middle)\n\t} else if (start && end) {\n\t\tisValid = handleLengthIsValid(start, end)\n\t}\n\treturn isValid\n}\n\nexport function handleLengthIsValid(from, to) {\n\tconst handleLengthTolerance = 0.8\n\treturn !(from && to && point.distance(from, to) <= handleLengthTolerance)\n}\n\nexport function pointNearHandle(el, handle, coords) {\n\tconst handleCanvas = pixelToCanvas(el, handle)\n\tconst distance = point.distance(handleCanvas, coords)\n\tconst radiusType = handle.precision ? 'precision' : 'default'\n\tconst radius = handle.radii[radiusType].hitRadius\n\treturn distance < radius\n}\n\nexport function setPrecisionMode(handle, precision) {\n\tif (!handle.precisionEnabled) return\n\thandle.precision = !!precision\n\tconst radiusType = handle.precision ? 'precision' : 'default'\n\thandle.radius = handle.radii[radiusType].displayRadius\n}\n\nexport function disablePrecisionForInactiveHandles(element) {\n\titeratePrecisionHandles(element, handle => {\n\t\tif (handle.active || !handle.precision) return\n\t\tsetPrecisionMode(handle, false)\n\t})\n}\n\nexport function iteratePrecisionHandles(element, fn) {\n\tprecisionTools.forEach(tool => {\n\t\tconst state = cornerstoneTools.getToolState(element, tool)\n\t\tif (!state || !state.data) return\n\t\tstate.data.forEach(data => {\n\t\t\tconst { handles } = data\n\t\t\tif (!handles) return\n\t\t\tObject.entries(handles).forEach(([handleType, handleValue]) => {\n\t\t\t\tif (typeof handleValue !== 'object') return\n\t\t\t\thandleValue.type = handleType\n\t\t\t\tfn(handleValue, tool)\n\t\t\t})\n\t\t})\n\t})\n}\n","import { updateImage, pageToPixel } from 'cornerstone-core/dist/cornerstone.js'\nimport * as cornerstoneTools from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { initHandle, handleLengthsAreValid, disablePrecisionForInactiveHandles } from '@/cornerstone/tools/util/handles'\nimport triggerDoneModifying from '../tools/util/triggerDoneModifying'\n\nconst { EVENTS, removeToolState, import: csTools, store } = cornerstoneTools\nconst anyHandlesOutsideImage = csTools('manipulators/anyHandlesOutsideImage')\nconst clipToBox = csTools('util/clipToBox')\nconst triggerEvent = csTools('util/triggerEvent')\nconst state = store.state\n\nconst _moveEvents = {\n\tmouse: [EVENTS.MOUSE_MOVE, EVENTS.MOUSE_DRAG],\n\ttouch: [EVENTS.TOUCH_DRAG],\n}\n\nconst _moveEndEvents = {\n\tmouse: [EVENTS.MOUSE_UP, EVENTS.MOUSE_CLICK],\n\ttouch: [EVENTS.TOUCH_END, EVENTS.TOUCH_PINCH, EVENTS.TAP],\n}\n\n/**\n * Move a new handle\n * @public\n * @method moveNewHandle\n * @memberof Manipulators\n *\n * @param {*} evtDetail\n * @param {*} toolName\n * @param {*} annotation\n * @param {*} handle\n * @param {*} [options={}]\n * @param {Boolean}  [options.deleteIfHandleOutsideImage]\n * @param {Boolean}  [options.preventHandleOutsideImage]\n * @param {*} [interactionType=mouse]\n * @param {function} [doneMovingCallback]\n * @returns {undefined}\n */\nexport default function(\n\tevtDetail,\n\ttoolName,\n\tannotation,\n\thandle,\n\toptions,\n\tinteractionType = 'mouse',\n\tdoneMovingCallback\n) {\n\t// Use global defaults, unless overidden by provided options\n\toptions = Object.assign(\n\t\t{\n\t\t\tdeleteIfHandleOutsideImage: state.deleteIfHandleOutsideImage,\n\t\t\tpreventHandleOutsideImage: state.preventHandleOutsideImage,\n\t\t},\n\t\toptions\n\t)\n\n\tannotation.active = true\n\thandle.active = true\n\tstate.isToolLocked = true\n\n\tconst { element, currentPoints } = evtDetail\n\tconst coords = currentPoints.image\n\tinitHandle(handle, coords, interactionType, options)\n\tdisablePrecisionForInactiveHandles(element)\n\n\tconst moveHandler = _moveHandler.bind(this, toolName, annotation, handle, options, interactionType)\n\t// So we don't need to inline the entire `moveEndEventHandler` function\n\tconst moveEndHandler = evt => {\n\t\t_moveEndHandler(\n\t\t\ttoolName,\n\t\t\tannotation,\n\t\t\thandle,\n\t\t\toptions,\n\t\t\tinteractionType,\n\t\t\t{\n\t\t\t\tmoveHandler,\n\t\t\t\tmoveEndHandler,\n\t\t\t},\n\t\t\tevt,\n\t\t\tdoneMovingCallback\n\t\t)\n\t}\n\n\t// Add event listeners\n\t_moveEvents[interactionType].forEach(eventType => {\n\t\telement.addEventListener(eventType, moveHandler)\n\t})\n\t_moveEndEvents[interactionType].forEach(eventType => {\n\t\telement.addEventListener(eventType, moveEndHandler)\n\t})\n\telement.addEventListener(EVENTS.TOUCH_START, _stopImmediatePropagation)\n}\n\nfunction _moveHandler(toolName, annotation, handle, options, interactionType, evt) {\n\tconst { currentPoints, image, element } = evt.detail\n\tconst page = currentPoints.page\n\tconst targetLocation = pageToPixel(element, page.x, page.y)\n\n\tannotation.invalidated = true\n\thandle.active = true\n\n\tconst drag = handle.drag\n\tif (drag) {\n\t\thandle.x = drag.originX + currentPoints.image.x - drag.originDragX\n\t\thandle.y = drag.originY + currentPoints.image.y - drag.originDragY\n\t\tif (options.constrainSquare) {\n\t\t\tconst distanceDragged = {\n\t\t\t\tx: currentPoints.image.x - drag.originX,\n\t\t\t\ty: currentPoints.image.y - drag.originY,\n\t\t\t}\n\t\t\tconst isDifferentDirection =\n\t\t\t\t(distanceDragged.x < 0 && distanceDragged.y > 0) || (distanceDragged.x > 0 && distanceDragged.y < 0)\n\n\t\t\tif (Math.abs(distanceDragged.x) > Math.abs(distanceDragged.y)) {\n\t\t\t\thandle.y = isDifferentDirection ? drag.originY - distanceDragged.x : drag.originY + distanceDragged.x\n\t\t\t} else {\n\t\t\t\thandle.x = isDifferentDirection ? drag.originX - distanceDragged.y : drag.originX + distanceDragged.y\n\t\t\t}\n\t\t}\n\t} else {\n\t\thandle.x = targetLocation.x\n\t\thandle.y = targetLocation.y\n\t}\n\n\tif (options && options.preventHandleOutsideImage) {\n\t\tclipToBox(handle, image)\n\t}\n\n\tupdateImage(element)\n\n\tconst eventType = EVENTS.MEASUREMENT_MODIFIED\n\tconst modifiedEventData = {\n\t\ttoolName,\n\t\telement,\n\t\tmeasurementData: annotation,\n\t}\n\n\ttriggerEvent(element, eventType, modifiedEventData)\n}\n\nfunction _moveEndHandler(\n\ttoolName,\n\tannotation,\n\thandle,\n\toptions,\n\tinteractionType,\n\t{ moveHandler, moveEndHandler },\n\tevt,\n\tdoneMovingCallback\n) {\n\tconst { element, image } = evt.detail\n\n\t// \"Release\" the handle\n\tannotation.active = false\n\tannotation.invalidated = true\n\thandle.active = false\n\tstate.isToolLocked = false\n\n\tlet success = true\n\n\t// Remove event listeners\n\t_moveEvents[interactionType].forEach(eventType => {\n\t\telement.removeEventListener(eventType, moveHandler)\n\t})\n\t_moveEndEvents[interactionType].forEach(eventType => {\n\t\telement.removeEventListener(eventType, moveEndHandler)\n\t})\n\telement.removeEventListener(EVENTS.TOUCH_START, _stopImmediatePropagation)\n\n\tif (options.preventHandleOutsideImage) {\n\t\tclipToBox(handle, evt.detail.image)\n\t}\n\n\t// Delete the tool data if any handle is outside the image\n\tif (options.deleteIfHandleOutsideImage && anyHandlesOutsideImage(evt.detail, annotation.handles)) {\n\t\tremoveToolState(element, toolName, annotation)\n\t\tsuccess = false\n\t}\n\n\t// Delete the tool data if handle lengths are invalid\n\tif (!handleLengthsAreValid(annotation.handles)) {\n\t\tremoveToolState(element, toolName, annotation)\n\t\tsuccess = false\n\t}\n\n\t// Update Image\n\tupdateImage(element)\n\ttriggerDoneModifying(toolName, element, evt.detail.image)\n\n\tif (typeof doneMovingCallback === 'function') {\n\t\tdoneMovingCallback(evt, success)\n\t}\n}\n\n/**\n * Stop the CornerstoneToolsTouchStart event from\n * Becoming a CornerstoneToolsTouchStartActive event when\n * MoveNewHandle ends\n *\n * @private\n * @function _stopImmediatePropagation\n *\n * @param {*} evt\n * @returns {Boolean} false\n */\nfunction _stopImmediatePropagation(evt) {\n\tevt.stopImmediatePropagation()\n\n\treturn false\n}\n","import * as cornerstoneTools from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport {\n\tinitHandle,\n\tsetPrecisionMode,\n\thandleLengthsAreValid,\n\tdisablePrecisionForInactiveHandles,\n} from '@/cornerstone/tools/util/handles'\nimport triggerDoneModifying from '../tools/util/triggerDoneModifying'\n\nconst { EVENTS, external, removeToolState, import: csTools, store } = cornerstoneTools\nconst anyHandlesOutsideImage = csTools('manipulators/anyHandlesOutsideImage')\nconst clipToBox = csTools('util/clipToBox')\nconst triggerEvent = csTools('util/triggerEvent')\nconst state = store.state\n\nconst _dragEvents = {\n\tmouse: [EVENTS.MOUSE_DRAG],\n\ttouch: [EVENTS.TOUCH_DRAG],\n}\n\nconst _upOrEndEvents = {\n\tmouse: [EVENTS.MOUSE_UP, EVENTS.MOUSE_CLICK],\n\ttouch: [EVENTS.TOUCH_END, EVENTS.TOUCH_DRAG_END, EVENTS.TOUCH_PINCH, EVENTS.TOUCH_PRESS, EVENTS.TAP],\n}\n\n/**\n * Move the provided handle\n *\n * @public\n * @method moveHandle\n * @memberof Manipulators\n *\n * @param {*} evtDetail\n * @param {*} toolName\n * @param {*} annotation\n * @param {*} handle\n * @param {*} [options={}]\n * @param {Boolean}  [options.deleteIfHandleOutsideImage]\n * @param {Boolean}  [options.preventHandleOutsideImage]\n * @param {*} [interactionType=mouse]\n * @param {function} [doneMovingCallback]\n * @returns {undefined}\n */\nexport default function(\n\tevtDetail,\n\ttoolName,\n\tannotation,\n\thandle,\n\toptions = {},\n\tinteractionType = 'mouse',\n\tdoneMovingCallback\n) {\n\t// Use global defaults, unless overidden by provided options\n\toptions = Object.assign(\n\t\t{\n\t\t\tdeleteIfHandleOutsideImage: state.deleteIfHandleOutsideImage,\n\t\t\tpreventHandleOutsideImage: state.preventHandleOutsideImage,\n\t\t},\n\t\toptions\n\t)\n\n\tconst dragHandler = _dragHandler.bind(this, toolName, annotation, handle, options, interactionType)\n\t// So we don't need to inline the entire `upOrEndHandler` function\n\tconst upOrEndHandler = evt => {\n\t\t_upOrEndHandler(\n\t\t\ttoolName,\n\t\t\tevtDetail,\n\t\t\tannotation,\n\t\t\thandle,\n\t\t\toptions,\n\t\t\tinteractionType,\n\t\t\t{\n\t\t\t\tdragHandler,\n\t\t\t\tupOrEndHandler,\n\t\t\t},\n\t\t\tevt,\n\t\t\tdoneMovingCallback\n\t\t)\n\t}\n\n\thandle.active = true\n\tannotation.active = true\n\tstate.isToolLocked = true\n\n\tconst { element, currentPoints } = evtDetail\n\tconst coords = currentPoints.image\n\tinitHandle(handle, coords, interactionType, options)\n\tdisablePrecisionForInactiveHandles(element)\n\n\t// Add Event Listeners\n\t_dragEvents[interactionType].forEach(eventType => {\n\t\telement.addEventListener(eventType, dragHandler)\n\t})\n\t_upOrEndEvents[interactionType].forEach(eventType => {\n\t\telement.addEventListener(eventType, upOrEndHandler)\n\t})\n}\n\nfunction _dragHandler(toolName, annotation, handle, options, interactionType, evt) {\n\tconst { image, currentPoints, element } = evt.detail\n\tconst page = currentPoints.page\n\tconst targetLocation = external.cornerstone.pageToPixel(element, page.x, page.y)\n\n\thandle.active = true\n\thandle.hasMoved = true\n\n\tconst drag = handle.drag\n\tif (drag) {\n\t\thandle.x = drag.originX + currentPoints.image.x - drag.originDragX\n\t\thandle.y = drag.originY + currentPoints.image.y - drag.originDragY\n\t\tif (options.constrainSquare) {\n\t\t\tlet oppositeHandle\n\t\t\tif (Math.abs(annotation.handles.start.x - handle.x) > Math.abs(annotation.handles.end.x - handle.x)) {\n\t\t\t\toppositeHandle = annotation.handles.start\n\t\t\t} else {\n\t\t\t\toppositeHandle = annotation.handles.end\n\t\t\t}\n\t\t\tconst distanceFromOppositeHandle = {\n\t\t\t\tx: handle.x - oppositeHandle.x,\n\t\t\t\ty: handle.y - oppositeHandle.y,\n\t\t\t}\n\t\t\tconst isDifferentDirection =\n\t\t\t\t(distanceFromOppositeHandle.x < 0 && distanceFromOppositeHandle.y > 0) ||\n\t\t\t\t(distanceFromOppositeHandle.x > 0 && distanceFromOppositeHandle.y < 0)\n\t\t\tif (Math.abs(distanceFromOppositeHandle.x) > Math.abs(distanceFromOppositeHandle.y)) {\n\t\t\t\thandle.y = isDifferentDirection\n\t\t\t\t\t? oppositeHandle.y - distanceFromOppositeHandle.x\n\t\t\t\t\t: oppositeHandle.y + distanceFromOppositeHandle.x\n\t\t\t} else {\n\t\t\t\thandle.x = isDifferentDirection\n\t\t\t\t\t? oppositeHandle.x - distanceFromOppositeHandle.y\n\t\t\t\t\t: oppositeHandle.x + distanceFromOppositeHandle.y\n\t\t\t}\n\t\t}\n\t} else {\n\t\thandle.x = targetLocation.x\n\t\thandle.y = targetLocation.y\n\t}\n\n\t// TODO: A way to not flip this for textboxes on annotations\n\tannotation.invalidated = true\n\n\tif (options.preventHandleOutsideImage) {\n\t\tclipToBox(handle, image)\n\t}\n\n\texternal.cornerstone.updateImage(element)\n\n\tconst eventType = EVENTS.MEASUREMENT_MODIFIED\n\tconst modifiedEventData = {\n\t\ttoolName,\n\t\telement,\n\t\tmeasurementData: annotation,\n\t}\n\n\ttriggerEvent(element, eventType, modifiedEventData)\n}\n\nfunction _upOrEndHandler(\n\ttoolName,\n\tevtDetail,\n\tannotation,\n\thandle,\n\toptions = {},\n\tinteractionType,\n\t{ dragHandler, upOrEndHandler },\n\tevt,\n\tdoneMovingCallback\n) {\n\tconst image = evtDetail.currentPoints.image\n\tconst { element, currentPoints } = evt.detail\n\tconst coords = currentPoints.canvas\n\tconst nearHandle = handle.pointNearHandle && handle.pointNearHandle(element, handle, coords)\n\tif (nearHandle && (evt.type === EVENTS.MOUSE_CLICK || evt.type === EVENTS.TOUCH_END)) {\n\t\t// Toggle precision mode for handle on click or tap\n\t\tsetPrecisionMode(handle, !handle.precision)\n\t}\n\n\thandle.active = false\n\tannotation.active = false\n\n\t// TODO: A way to not flip this for textboxes on annotations\n\tannotation.invalidated = true\n\tstate.isToolLocked = false\n\n\t// Remove Event Listeners\n\t_dragEvents[interactionType].forEach(eventType => {\n\t\telement.removeEventListener(eventType, dragHandler)\n\t})\n\t_upOrEndEvents[interactionType].forEach(eventType => {\n\t\telement.removeEventListener(eventType, upOrEndHandler)\n\t})\n\n\t// Delete the tool data if any handle is outside the image\n\tif (options.deleteIfHandleOutsideImage && anyHandlesOutsideImage(evtDetail, annotation.handles)) {\n\t\tremoveToolState(element, toolName, annotation)\n\t}\n\n\t// Delete the tool data if handle lengths are invalid\n\tif (!handleLengthsAreValid(annotation.handles)) {\n\t\tremoveToolState(element, toolName, annotation)\n\t}\n\n\t// TODO: What dark magic makes us want to handle TOUCH_PRESS differently?\n\tif (evt.type === EVENTS.TOUCH_PRESS) {\n\t\tevt.detail.handlePressed = annotation\n\t\thandle.x = image.x // Original Event\n\t\thandle.y = image.y\n\t}\n\n\texternal.cornerstone.updateImage(element)\n\ttriggerDoneModifying(toolName, element, evt.detail.image)\n\n\tif (typeof doneMovingCallback === 'function') {\n\t\tdoneMovingCallback()\n\t}\n}\n","import {\n\texternal,\n\taddToolState,\n\tgetToolState,\n\timport as csTools,\n\ttoolColors,\n\ttoolStyle,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\n\nimport toolSelectedCallback from './_shared/toolSelectedCallback.js'\n\n// Manipulators\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport moveHandle from '@/cornerstone/manipulators/moveHandle'\n\n// Handle helpers\nimport { initHandle } from './util/handles'\nimport { formatNumber } from '@utils/numberUtils'\nimport round from 'lodash/round'\n\nconst BaseAnnotationTool = csTools('base/BaseAnnotationTool')\n\n// Drawing\nconst draw = csTools('drawing/draw')\nconst drawHandles = csTools('drawing/drawHandles')\nconst drawJoinedLines = csTools('drawing/drawJoinedLines')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\nconst getNewContext = csTools('drawing/getNewContext')\nconst setShadow = csTools('drawing/setShadow')\nconst textBoxWidth = csTools('drawing/textBoxWidth')\n\n// Utils\nconst lineSegDistance = csTools('util/lineSegDistance')\n\n// Cursors\nconst { angleCursor } = csTools('tools/cursors')\n\n/**\n * @public\n * @class AstAngle\n * @memberof Tools.Annotation\n * @classdesc Create and position an angle by placing three consecutive points.\n * @extends Tools.Base.BaseAnnotationTool\n * @hideconstructor\n *\n * @param {ToolConfiguration} [props={}]\n */\nexport default class AstAngle extends BaseAnnotationTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstAngle',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tprecisionHandlesEnabled: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t},\n\t\t\tsvgCursor: angleCursor,\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\t\tsuper(initialConfiguration)\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\t\tthis.preventNewMeasurement = false\n\t}\n\n\t// custom toolSelectedCallback for opening annotation dialog\n\ttoolSelectedCallback = toolSelectedCallback.bind(this)\n\n\t// No stats to cache when moving, but CS complains otherwise\n\tupdateCachedStats() {}\n\n\tcreateNewMeasurement(eventData) {\n\t\t// Create the measurement data for this tool with the end handle activated\n\t\treturn {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tcolor: undefined,\n\t\t\thandles: {\n\t\t\t\tstart: {\n\t\t\t\t\tx: eventData.currentPoints.image.x,\n\t\t\t\t\ty: eventData.currentPoints.image.y,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: false,\n\t\t\t\t},\n\t\t\t\tmiddle: {\n\t\t\t\t\tx: eventData.currentPoints.image.x,\n\t\t\t\t\ty: eventData.currentPoints.image.y,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: true,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\tx: eventData.currentPoints.image.x,\n\t\t\t\t\ty: eventData.currentPoints.image.y,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: false,\n\t\t\t\t},\n\t\t\t\ttextBox: {\n\t\t\t\t\tactive: false,\n\t\t\t\t\thasMoved: false,\n\t\t\t\t\tmovesIndependently: false,\n\t\t\t\t\tdrawnIndependently: true,\n\t\t\t\t\tallowedOutsideImage: true,\n\t\t\t\t\thasBoundingBox: true,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\tpointNearTool(element, data, coords, isMouse = true) {\n\t\tif (data.visible === false) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst distance = isMouse ? 15 : 25\n\t\treturn (\n\t\t\tlineSegDistance(element, data.handles.start, data.handles.middle, coords) < distance ||\n\t\t\tlineSegDistance(element, data.handles.middle, data.handles.end, coords) < distance\n\t\t)\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tmoveHandle(evt.detail, this.name, toolData, handle, this.options, interactionType)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\trenderToolData(evt) {\n\t\tconst eventData = evt.detail\n\t\tconst enabledElement = eventData.enabledElement\n\t\tconst { handleRadius, drawHandlesOnHover } = this.configuration\n\t\t// If we have no toolData for this element, return immediately as there is nothing to do\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\n\t\tif (!toolData || !toolData.data || !toolData.data.length) return\n\n\t\t// We have tool data for this element - iterate over each one and draw it\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\n\t\tconst lineWidth = toolStyle.getToolWidth()\n\n\t\tfor (let i = 0; i < toolData.data.length; i++) {\n\t\t\tconst data = toolData.data[i]\n\n\t\t\tif (data.visible === false) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tdraw(context, context => {\n\t\t\t\tsetShadow(context, this.configuration)\n\n\t\t\t\t// Differentiate the color of activation tool\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\n\t\t\t\tconst handleStartCanvas = external.cornerstone.pixelToCanvas(eventData.element, data.handles.start)\n\t\t\t\tconst handleMiddleCanvas = external.cornerstone.pixelToCanvas(eventData.element, data.handles.middle)\n\t\t\t\thandleMiddleCanvas.radius = data.handles.middle.radius || 6\n\n\t\t\t\tdrawJoinedLines(context, eventData.element, data.handles.start, [data.handles.middle, data.handles.end], {\n\t\t\t\t\tcolor,\n\t\t\t\t})\n\n\t\t\t\t// Draw the handles\n\t\t\t\tconst handleOptions = {\n\t\t\t\t\tcolor,\n\t\t\t\t\thandleRadius,\n\t\t\t\t\tdrawHandlesIfActive: drawHandlesOnHover,\n\t\t\t\t}\n\n\t\t\t\tdrawHandles(context, eventData, data.handles, handleOptions)\n\n\t\t\t\t// Default to isotropic pixel size, update suffix to reflect this\n\t\t\t\tconst columnPixelSpacing = eventData.image.columnPixelSpacing || 1\n\t\t\t\tconst rowPixelSpacing = eventData.image.rowPixelSpacing || 1\n\n\t\t\t\tconst sideA = {\n\t\t\t\t\tx: (data.handles.middle.x - data.handles.start.x) * columnPixelSpacing,\n\t\t\t\t\ty: (data.handles.middle.y - data.handles.start.y) * rowPixelSpacing,\n\t\t\t\t}\n\n\t\t\t\tconst sideB = {\n\t\t\t\t\tx: (data.handles.end.x - data.handles.middle.x) * columnPixelSpacing,\n\t\t\t\t\ty: (data.handles.end.y - data.handles.middle.y) * rowPixelSpacing,\n\t\t\t\t}\n\n\t\t\t\tconst sideC = {\n\t\t\t\t\tx: (data.handles.end.x - data.handles.start.x) * columnPixelSpacing,\n\t\t\t\t\ty: (data.handles.end.y - data.handles.start.y) * rowPixelSpacing,\n\t\t\t\t}\n\n\t\t\t\tconst sideALength = length(sideA)\n\t\t\t\tconst sideBLength = length(sideB)\n\t\t\t\tconst sideCLength = length(sideC)\n\n\t\t\t\t// Cosine law\n\t\t\t\tlet angle = Math.acos(\n\t\t\t\t\t(Math.pow(sideALength, 2) + Math.pow(sideBLength, 2) - Math.pow(sideCLength, 2)) /\n\t\t\t\t\t\t(2 * sideALength * sideBLength)\n\t\t\t\t)\n\n\t\t\t\tangle *= 180 / Math.PI\n\n\t\t\t\tdata.rAngle = formatNumber(round(angle, 2) || '')\n\n\t\t\t\tif (data.rAngle) {\n\t\t\t\t\tconst text = textBoxText(data, eventData.image.rowPixelSpacing, eventData.image.columnPixelSpacing)\n\n\t\t\t\t\tconst distance = handleMiddleCanvas.radius + 10\n\n\t\t\t\t\tlet textCoords\n\n\t\t\t\t\tif (!data.handles.textBox.hasMoved) {\n\t\t\t\t\t\ttextCoords = {\n\t\t\t\t\t\t\tx: handleMiddleCanvas.x,\n\t\t\t\t\t\t\ty: handleMiddleCanvas.y,\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst padding = 5\n\t\t\t\t\t\tconst textWidth = textBoxWidth(context, text, padding)\n\n\t\t\t\t\t\tif (handleMiddleCanvas.x < handleStartCanvas.x) {\n\t\t\t\t\t\t\ttextCoords.x -= distance + textWidth\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttextCoords.x += distance\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst transform = external.cornerstone.internal.getTransform(enabledElement)\n\n\t\t\t\t\t\ttransform.invert()\n\n\t\t\t\t\t\tconst coords = transform.transformPoint(textCoords.x, textCoords.y)\n\n\t\t\t\t\t\tdata.handles.textBox.x = coords.x\n\t\t\t\t\t\tdata.handles.textBox.y = coords.y\n\t\t\t\t\t}\n\t\t\t\t\tif (!data.handles.textBox.hidden) {\n\t\t\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\teventData.element,\n\t\t\t\t\t\t\tdata.handles.textBox,\n\t\t\t\t\t\t\ttext,\n\t\t\t\t\t\t\tdata.handles,\n\t\t\t\t\t\t\ttextBoxAnchorPoints,\n\t\t\t\t\t\t\tcolor,\n\t\t\t\t\t\t\tlineWidth,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tfunction textBoxText(data, rowPixelSpacing, columnPixelSpacing) {\n\t\t\tconst suffix = !rowPixelSpacing || !columnPixelSpacing ? ' (isotropic)' : ''\n\t\t\tconst str = '00B0' // Degrees symbol\n\n\t\t\treturn data.rAngle.toString() + String.fromCharCode(parseInt(str, 16)) + suffix\n\t\t}\n\n\t\tfunction textBoxAnchorPoints(handles) {\n\t\t\treturn [handles.start, handles.middle, handles.end]\n\t\t}\n\t}\n\n\taddNewMeasurement(evt, interactionType) {\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\n\t\tconst eventData = evt.detail\n\t\tconst element = evt.detail.element\n\t\tconst measurementData = this.createNewMeasurement(eventData)\n\n\t\tif (!measurementData) return\n\n\t\tinitHandle(measurementData.handles.start, null, interactionType, this.options)\n\t\tinitHandle(measurementData.handles.middle, null, interactionType, this.options)\n\t\tinitHandle(measurementData.handles.end, null, interactionType, this.options)\n\n\t\t// Associate this data with this imageId so we can render it and manipulate it\n\t\taddToolState(element, this.name, measurementData)\n\n\t\texternal.cornerstone.updateImage(element)\n\n\t\tconst doneMovingEndHandleCallback = () => {\n\t\t\tmeasurementData.active = false\n\t\t\tthis.preventNewMeasurement = false\n\t\t\texternal.cornerstone.updateImage(element)\n\t\t}\n\n\t\tconst doneMovingMiddleHandleCallback = doneEvt => {\n\t\t\t// Prevents if the user clicks instead of move the angle points\n\t\t\tif (doneEvt.type !== 'cornerstonetoolsmouseup' && doneEvt.type !== 'cornerstonetoolstouchend') return\n\n\t\t\tmeasurementData.active = false\n\t\t\tconst { middle, end } = measurementData.handles\n\t\t\tend.active = true\n\t\t\tend.x = middle.x\n\t\t\tend.y = middle.y\n\t\t\tif (interactionType === 'touch') {\n\t\t\t\tend.x += 50\n\t\t\t\tend.y += 50\n\t\t\t} else {\n\t\t\t\tmoveNewHandle(\n\t\t\t\t\tdoneEvt.detail,\n\t\t\t\t\tthis.name,\n\t\t\t\t\tmeasurementData,\n\t\t\t\t\tmeasurementData.handles.end,\n\t\t\t\t\tthis.options,\n\t\t\t\t\tinteractionType,\n\t\t\t\t\tdoneMovingEndHandleCallback\n\t\t\t\t)\n\t\t\t}\n\t\t\texternal.cornerstone.updateImage(element)\n\t\t}\n\n\t\t// Step 1, create start and second middle\n\t\tmoveNewHandle(\n\t\t\teventData,\n\t\t\tthis.name,\n\t\t\tmeasurementData,\n\t\t\tmeasurementData.handles.middle,\n\t\t\tthis.options,\n\t\t\tinteractionType,\n\t\t\tdoneMovingMiddleHandleCallback\n\t\t)\n\t}\n}\n\nfunction length(vector) {\n\treturn Math.sqrt(Math.pow(vector.x, 2) + Math.pow(vector.y, 2))\n}\n","/**\n * @typedef Point\n * @prop {number} x\n * @prop {number} y\n */\n\n/**\n * Finds the distance between two points\n *\n * @private\n * @function calculateLength\n *\n * @param {Object} data\n * @param {Point} data.start\n * @param {Point} data.end\n * @param {number} [colPixelSpacing=1]\n * @param {number} [rowPixelSpacing=1]\n * @returns {number} - The calculated distance\n */\nexport default function(\n  { start, end },\n  colPixelSpacing = 1,\n  rowPixelSpacing = 1\n) {\n  const dx = (end.x - start.x) * colPixelSpacing\n  const dy = (end.y - start.y) * rowPixelSpacing\n\n  return Math.sqrt(dx * dx + dy * dy)\n}\n","/* eslint-disable curly, capitalized-comments, newline-before-return, newline-after-var, object-property-newline */\nimport { metaData, updateImage, getEnabledElementsByImageId } from 'cornerstone-core/dist/cornerstone.js'\nimport { eventBus } from '@services/eventBus'\nimport {\n\taddToolState,\n\tgetToolState,\n\timport as csTools,\n\tremoveToolState,\n\ttoolColors,\n\tstore as csStore,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\n\nimport calculateLength from './astCalibration/calculateLength.js'\nimport store from '@store/'\nimport toolSelectedCallback from './_shared/toolSelectedCallback.js'\n\n// Manipulators\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport moveHandle from '@/cornerstone/manipulators/moveHandle'\nimport { initHandle } from './util/handles'\n\nconst BaseAnnotationTool = csTools('base/BaseAnnotationTool')\n\n// Drawing\nconst draw = csTools('drawing/draw')\nconst drawHandles = csTools('drawing/drawHandles')\nconst drawLine = csTools('drawing/drawLine')\nconst setShadow = csTools('drawing/setShadow')\nconst getNewContext = csTools('drawing/getNewContext')\nconst lineSegDistance = csTools('util/lineSegDistance')\n\n/**\n * @public\n * @class AstCalibration\n * @memberof Tools.Custom\n *\n * @classdesc Tool for measuring distances.\n * @extends Tools.Base.BaseAnnotationTool\n */\nexport default class AstCalibration extends BaseAnnotationTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstCalibration',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tprecisionHandlesEnabled: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t\tdrawHandlesOnHover: false,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\n\t\tsuper(initialConfiguration)\n\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\t}\n\n\t// custom toolSelectedCallback for opening annotation dialog\n\ttoolSelectedCallback = toolSelectedCallback.bind(this)\n\n\tcreateNewMeasurement(eventData) {\n\t\tconst { x, y } = eventData.currentPoints.image\n\t\treturn {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tcolor: undefined,\n\t\t\thandles: {\n\t\t\t\tstart: {\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: false,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: true,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\taddNewMeasurement(event, interactionType) {\n\t\tconst { element, image } = event.detail\n\t\tconst toolState = getToolState(element, this.name)\n\t\tif (toolState && toolState.data && toolState.data.length) return // prevent multiple calibration annotations\n\t\tconst annotation = this.createNewMeasurement(event.detail)\n\n\t\taddToolState(element, this.name, annotation)\n\t\tupdateImage(element)\n\n\t\tconst doneMovingCallback = () => {\n\t\t\teventBus.post(eventBus.type.ANNOTATION_CLICK, {\n\t\t\t\ttool: this,\n\t\t\t\ttoolState,\n\t\t\t\tannotation,\n\t\t\t\tevent,\n\t\t\t})\n\t\t\tannotation.active = false\n\t\t}\n\n\t\tinitHandle(annotation.handles.start, null, interactionType, this.options)\n\t\tmoveNewHandle(\n\t\t\tevent.detail,\n\t\t\tthis.name,\n\t\t\tannotation,\n\t\t\tannotation.handles.end,\n\t\t\tthis.options,\n\t\t\tinteractionType,\n\t\t\tdoneMovingCallback\n\t\t)\n\t}\n\n\tcalibrate(event, annotation, newLength) {\n\t\tconst { image, element } = event.detail\n\t\tconst imagePlane = metaData.get('imagePlaneModule', image.imageId)\n\t\tconst rowPixelSpacing = (imagePlane ? imagePlane.rowPixelSpacing : image.rowPixelSpacing) || 1\n\t\tconst colPixelSpacing = (imagePlane ? imagePlane.columnPixelSpacing : image.columnPixelSpacing) || 1\n\t\tconst oldPixelSpacing = {\n\t\t\tcolPixelSpacing,\n\t\t\trowPixelSpacing,\n\t\t}\n\t\tconst oldLength = calculateLength(annotation.handles, colPixelSpacing, rowPixelSpacing)\n\t\tstore.dispatch('updateCalibration', { imageId: image.asterisImageId, oldLength, oldPixelSpacing, newLength })\n\t\teventBus.broadcast(eventBus.type.VUEX_ACTION, {\n\t\t\ttype: 'calibrateFromExternalImage',\n\t\t\tpayload: {\n\t\t\t\timageId: image.asterisImageId,\n\t\t\t\toldLength,\n\t\t\t\toldPixelSpacing,\n\t\t\t\tnewLength,\n\t\t\t},\n\t\t})\n\t\tremoveToolState(element, this.name, annotation)\n\n\t\t// Force cached stats update for all tool data\n\t\tcsStore.state.tools.forEach(tool => {\n\t\t\tconst toolState = getToolState(element, tool.name)\n\t\t\tif (toolState && toolState.data && tool.updateCachedStats) {\n\t\t\t\ttoolState.data.forEach(d => {\n\t\t\t\t\ttool.updateCachedStats(image, element, d)\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t\tupdateImage(element)\n\t\t// NOTE: Could potentially remove the filter and the above `updateImage` call,\n\t\t// but this way we're guaranteed to update the current canvas element, should something strange happen upstream\n\t\tgetEnabledElementsByImageId(image.imageId)\n\t\t\t.filter(enabledElement => enabledElement.element !== element)\n\t\t\t.forEach(enabledElement => {\n\t\t\t\tupdateImage(enabledElement.element)\n\t\t\t})\n\t}\n\n\tpointNearTool(element, data, coords) {\n\t\treturn lineSegDistance(element, data.handles.start, data.handles.end, coords) < 25\n\t}\n\n\thandleSelectedCallback(evt, annotation, handle, interactionType = 'mouse') {\n\t\tconst { element, image } = event.detail\n\t\tconst toolState = getToolState(element, this.name)\n\t\tconst doneMovingCallback = () => {\n\t\t\tconst imagePlane = metaData.get('imagePlaneModule', image.imageId)\n\t\t\tconst rowPixelSpacing = (imagePlane ? imagePlane.rowPixelSpacing : image.rowPixelSpacing) || 1\n\t\t\tconst colPixelSpacing = (imagePlane ? imagePlane.columnPixelSpacing : image.columnPixelSpacing) || 1\n\t\t\tannotation.length = calculateLength(annotation.handles, colPixelSpacing, rowPixelSpacing).toFixed(2)\n\t\t}\n\t\tmoveHandle(evt.detail, this.name, annotation, handle, this.options, interactionType, doneMovingCallback)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\trenderToolData(evt) {\n\t\tconst eventData = evt.detail\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\t\tif (!toolData) return\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\t\tconst { element, image } = eventData\n\t\tconst config = this.configuration\n\t\tfor (let i = 0; i < toolData.data.length; i++) {\n\t\t\tconst data = toolData.data[i]\n\t\t\tif (data.visible === false) continue\n\n\t\t\t// update length\n\t\t\tconst imagePlane = metaData.get('imagePlaneModule', image.imageId)\n\t\t\tconst rowPixelSpacing = (imagePlane ? imagePlane.rowPixelSpacing : image.rowPixelSpacing) || 1\n\t\t\tconst colPixelSpacing = (imagePlane ? imagePlane.columnPixelSpacing : image.columnPixelSpacing) || 1\n\t\t\tdata.length = calculateLength(data.handles, colPixelSpacing, rowPixelSpacing).toFixed(2)\n\n\t\t\tdraw(context, context => {\n\t\t\t\tsetShadow(context, config)\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tdrawLine(context, element, data.handles.start, data.handles.end, {\n\t\t\t\t\tcolor,\n\t\t\t\t\tlineDash: [5, 5],\n\t\t\t\t})\n\t\t\t\tconst handleOptions = {\n\t\t\t\t\tcolor,\n\t\t\t\t\tdrawHandlesIfActive: config && config.drawHandlesOnHover,\n\t\t\t\t}\n\t\t\t\tdrawHandles(context, eventData, data.handles, handleOptions)\n\t\t\t})\n\t\t}\n\t}\n}\n","import {\n\texternal,\n\timport as csTools,\n\tgetToolState,\n\ttoolColors,\n\taddToolState,\n\tremoveToolState,\n\tEVENTS,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { openPromptDlg } from '@dialogs/TextPromptDlg'\nimport toolSelectedCallback from './_shared/toolSelectedCallback.js'\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport triggerDoneModifying from './util/triggerDoneModifying.js'\n\nconst BaseAnnotationTool = csTools('base/BaseAnnotationTool')\nconst triggerEvent = csTools('util/triggerEvent')\nconst getNewContext = csTools('drawing/getNewContext')\nconst draw = csTools('drawing/draw')\nconst setShadow = csTools('drawing/setShadow')\nconst drawTextBox = csTools('drawing/drawTextBox')\nconst pointInsideBoundingBox = csTools('util/pointInsideBoundingBox')\n\nexport default class AstText extends BaseAnnotationTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstText',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\tconfiguration: {\n\t\t\t\tasync getTextCallback(cb) {\n\t\t\t\t\tconst text = await openPromptDlg({\n\t\t\t\t\t\ttitle: 'New Text Annotation',\n\t\t\t\t\t\tprompt: 'Enter your annotation text:',\n\t\t\t\t\t\trequireInput: true,\n\t\t\t\t\t})\n\t\t\t\t\tcb(text)\n\t\t\t\t},\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t},\n\t\t}\n\t\tsuper(configuration, defaultConfig)\n\t}\n\n\t// custom toolSelectedCallback for opening annotation dialog\n\ttoolSelectedCallback = toolSelectedCallback.bind(this)\n\n\tcreateNewMeasurement(e) {\n\t\treturn {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tcolor: undefined,\n\t\t\ttext: '...',\n\t\t\thandles: {\n\t\t\t\tend: {\n\t\t\t\t\tx: e.detail.currentPoints.image.x,\n\t\t\t\t\ty: e.detail.currentPoints.image.y,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: true,\n\t\t\t\t\thasBoundingBox: true,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\taddNewMeasurement(e, interactionType) {\n\t\tconst element = e.detail.element\n\t\tconst measurementData = this.createNewMeasurement(e)\n\n\t\taddToolState(element, this.name, measurementData)\n\t\texternal.cornerstone.updateImage(element)\n\n\t\tmoveNewHandle(\n\t\t\te.detail,\n\t\t\tthis.name,\n\t\t\tmeasurementData,\n\t\t\tmeasurementData.handles.end,\n\t\t\tthis.options,\n\t\t\tinteractionType,\n\t\t\t(e, success) => {\n\t\t\t\tif (!success) {\n\t\t\t\t\tremoveToolState(element, this.name, measurementData)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.configuration.getTextCallback(text => {\n\t\t\t\t\tif (!text) {\n\t\t\t\t\t\tremoveToolState(element, this.name, measurementData)\n\t\t\t\t\t\texternal.cornerstone.updateImage(element)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tmeasurementData.text = text\n\t\t\t\t\tmeasurementData.active = false\n\t\t\t\t\texternal.cornerstone.updateImage(element)\n\t\t\t\t\ttriggerDoneModifying(this.name, element, e.detail.image)\n\t\t\t\t}, e.detail)\n\t\t\t\texternal.cornerstone.updateImage(element)\n\n\t\t\t\tconst modifiedEventData = {\n\t\t\t\t\ttoolName: this.name,\n\t\t\t\t\ttoolType: this.name, // Deprecation notice: toolType will be replaced by toolName\n\t\t\t\t\telement,\n\t\t\t\t\tmeasurementData,\n\t\t\t\t}\n\t\t\t\ttriggerEvent(element, EVENTS.MEASUREMENT_COMPLETED, modifiedEventData)\n\t\t\t}\n\t\t)\n\t}\n\n\tupdateCachedStats() {}\n\n\trenderToolData(e) {\n\t\tconst toolData = getToolState(e.detail.element, this.name)\n\t\tif (!toolData) return\n\n\t\tconst canvas = e.detail.canvasContext.canvas\n\t\tconst context = getNewContext(canvas)\n\n\t\tfor (let i = 0; i < toolData.data.length; i++) {\n\t\t\tconst data = toolData.data[i]\n\t\t\tif (data.visible === false) continue\n\n\t\t\tdraw(context, context => {\n\t\t\t\tsetShadow(context, this.configuration)\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tconst textCoords = external.cornerstone.pixelToCanvas(e.detail.element, data.handles.end)\n\t\t\t\tconst options = {\n\t\t\t\t\tcentering: {\n\t\t\t\t\t\tx: true,\n\t\t\t\t\t\ty: true,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t\tdata.handles.end.boundingBox = drawTextBox(\n\t\t\t\t\tcontext,\n\t\t\t\t\tdata.text || ' ',\n\t\t\t\t\ttextCoords.x,\n\t\t\t\t\ttextCoords.y - 10,\n\t\t\t\t\tcolor,\n\t\t\t\t\toptions\n\t\t\t\t)\n\t\t\t})\n\t\t}\n\t}\n\n\thandleSelectedCallback(e, toolData, handle, interactionType = 'mouse') {\n\t\t// open annotation dialog when textbox is clicked\n\t\tthis.toolSelectedCallback(e, toolData, interactionType)\n\t}\n\n\tpointNearTool(element, data, coords) {\n\t\tif (data.visible === false) return false\n\t\tif (!data.handles.end.boundingBox) return false\n\n\t\tconst distanceToPoint = external.cornerstoneMath.rect.distanceToPoint(data.handles.end.boundingBox, coords)\n\t\tconst insideBoundingBox = pointInsideBoundingBox(data.handles.end, coords)\n\t\treturn distanceToPoint < 10 || insideBoundingBox\n\t}\n}\n","import {\n\tArrowAnnotateTool,\n\texternal,\n\taddToolState,\n\tremoveToolState,\n\tEVENTS,\n\timport as csTools,\n\tgetToolState,\n\ttoolStyle,\n\tgetModule,\n\ttextStyle,\n\ttoolColors,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { openPromptDlg } from '@dialogs/TextPromptDlg'\nimport toolSelectedCallback from './_shared/toolSelectedCallback.js'\n\n// Manipulators\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport moveHandle from '@/cornerstone/manipulators/moveHandle'\nimport triggerDoneModifying from './util/triggerDoneModifying.js'\n\nconst triggerEvent = csTools('util/triggerEvent')\nconst getNewContext = csTools('drawing/getNewContext')\nconst draw = csTools('drawing/draw')\nconst setShadow = csTools('drawing/setShadow')\nconst drawArrow = csTools('drawing/drawArrow')\nconst textBoxWidth = csTools('drawing/textBoxWidth')\nconst drawHandles = csTools('drawing/drawHandles')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\n\nexport default class AstArrowAnnotate extends ArrowAnnotateTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstArrowAnnotate',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tprecisionHandlesEnabled: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tchangeTextCallback: () => {},\n\t\t\t\tasync getTextCallback(cb) {\n\t\t\t\t\tconst text = await openPromptDlg({\n\t\t\t\t\t\ttitle: 'New Arrow Annotation',\n\t\t\t\t\t\tprompt: 'Enter your annotation text (optional):',\n\t\t\t\t\t\trequireInput: false,\n\t\t\t\t\t})\n\t\t\t\t\tcb(text)\n\t\t\t\t},\n\t\t\t\tdrawHandlesOnHover: true,\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\t\tsuper(initialConfiguration)\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\t}\n\n\t// custom toolSelectedCallback for opening annotation dialog\n\ttoolSelectedCallback = toolSelectedCallback.bind(this)\n\n\taddNewMeasurement(evt, interactionType) {\n\t\tconst element = evt.detail.element\n\t\tconst measurementData = this.createNewMeasurement(evt)\n\n\t\t// Associate this data with this imageId so we can render it and manipulate it\n\t\taddToolState(element, this.name, measurementData)\n\t\texternal.cornerstone.updateImage(element)\n\n\t\tmoveNewHandle(\n\t\t\tevt.detail,\n\t\t\tthis.name,\n\t\t\tmeasurementData,\n\t\t\tmeasurementData.handles.end,\n\t\t\tthis.options,\n\t\t\tinteractionType,\n\t\t\t(evt, success) => {\n\t\t\t\tif (success) {\n\t\t\t\t\tif (measurementData.text === undefined) {\n\t\t\t\t\t\tthis.configuration.getTextCallback(text => {\n\t\t\t\t\t\t\tif (text) {\n\t\t\t\t\t\t\t\tmeasurementData.text = text\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmeasurementData.active = false\n\t\t\t\t\t\t\texternal.cornerstone.updateImage(element)\n\t\t\t\t\t\t\ttriggerDoneModifying(this.name, element, evt.detail.image)\n\t\t\t\t\t\t}, evt.detail)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tremoveToolState(element, this.name, measurementData)\n\t\t\t\t}\n\n\t\t\t\texternal.cornerstone.updateImage(element)\n\n\t\t\t\tconst modifiedEventData = {\n\t\t\t\t\ttoolName: this.name,\n\t\t\t\t\ttoolType: this.name, // Deprecation notice: toolType will be replaced by toolName\n\t\t\t\t\telement,\n\t\t\t\t\tmeasurementData,\n\t\t\t\t}\n\n\t\t\t\ttriggerEvent(element, EVENTS.MEASUREMENT_COMPLETED, modifiedEventData)\n\t\t\t}\n\t\t)\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tmoveHandle(evt.detail, this.name, toolData, handle, this.options, interactionType)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\trenderToolData(evt) {\n\t\tconst { element, enabledElement } = evt.detail\n\t\tconst { handleRadius, drawHandlesOnHover, renderDashed } = this.configuration\n\n\t\t// If we have no toolData for this element, return immediately as there is nothing to do\n\t\tconst toolData = getToolState(element, this.name)\n\n\t\tif (!toolData) {\n\t\t\treturn\n\t\t}\n\n\t\t// We have tool data for this element - iterate over each one and draw it\n\t\tconst canvas = evt.detail.canvasContext.canvas\n\t\tconst context = getNewContext(canvas)\n\n\t\tconst lineWidth = toolStyle.getToolWidth()\n\n\t\tlet lineDash\n\t\tif (renderDashed) {\n\t\t\tlineDash = getModule('globalConfiguration').configuration.lineDash\n\t\t}\n\n\t\tfor (let i = 0; i < toolData.data.length; i++) {\n\t\t\tconst data = toolData.data[i]\n\n\t\t\tif (data.visible === false) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tdraw(context, context => {\n\t\t\t\tsetShadow(context, this.configuration)\n\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\n\t\t\t\t// Draw the arrow\n\t\t\t\tconst handleStartCanvas = external.cornerstone.pixelToCanvas(element, data.handles.start)\n\t\t\t\tconst handleEndCanvas = external.cornerstone.pixelToCanvas(element, data.handles.end)\n\n\t\t\t\t// Config.arrowFirst = false;\n\t\t\t\tif (this.configuration.arrowFirst) {\n\t\t\t\t\tdrawArrow(context, handleEndCanvas, handleStartCanvas, color, lineWidth, lineDash)\n\t\t\t\t} else {\n\t\t\t\t\tdrawArrow(context, handleStartCanvas, handleEndCanvas, color, lineWidth, lineDash)\n\t\t\t\t}\n\n\t\t\t\tconst handleOptions = {\n\t\t\t\t\tcolor,\n\t\t\t\t\thandleRadius,\n\t\t\t\t\tdrawHandlesIfActive: drawHandlesOnHover,\n\t\t\t\t}\n\n\t\t\t\tif (this.configuration.drawHandles) {\n\t\t\t\t\tdrawHandles(context, evt.detail, data.handles, handleOptions)\n\t\t\t\t}\n\n\t\t\t\tconst text = textBoxText(data)\n\n\t\t\t\t// Draw the text\n\t\t\t\tif (text && text !== '') {\n\t\t\t\t\t// Calculate the text coordinates.\n\t\t\t\t\tconst padding = 5\n\t\t\t\t\tconst textWidth = textBoxWidth(context, text, padding)\n\t\t\t\t\tconst textHeight = textStyle.getFontSize() + 10\n\n\t\t\t\t\tlet distance = Math.max(textWidth, textHeight) / 2 + 5\n\n\t\t\t\t\tif (handleEndCanvas.x < handleStartCanvas.x) {\n\t\t\t\t\t\tdistance = -distance\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!data.handles.textBox.hasMoved) {\n\t\t\t\t\t\tlet textCoords\n\n\t\t\t\t\t\tif (this.configuration.arrowFirst) {\n\t\t\t\t\t\t\ttextCoords = {\n\t\t\t\t\t\t\t\tx: handleEndCanvas.x - textWidth / 2 + distance,\n\t\t\t\t\t\t\t\ty: handleEndCanvas.y - textHeight / 2,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// If the arrow is at the End position, the text should\n\t\t\t\t\t\t\t// Be placed near the Start position\n\t\t\t\t\t\t\ttextCoords = {\n\t\t\t\t\t\t\t\tx: handleStartCanvas.x - textWidth / 2 - distance,\n\t\t\t\t\t\t\t\ty: handleStartCanvas.y - textHeight / 2,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst transform = external.cornerstone.internal.getTransform(enabledElement)\n\n\t\t\t\t\t\ttransform.invert()\n\n\t\t\t\t\t\tconst coords = transform.transformPoint(textCoords.x, textCoords.y)\n\n\t\t\t\t\t\tdata.handles.textBox.x = coords.x\n\t\t\t\t\t\tdata.handles.textBox.y = coords.y\n\t\t\t\t\t}\n\t\t\t\t\tif (!data.handles.textBox.hidden) {\n\t\t\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\tdata.handles.textBox,\n\t\t\t\t\t\t\ttext,\n\t\t\t\t\t\t\tdata.handles,\n\t\t\t\t\t\t\ttextBoxAnchorPoints,\n\t\t\t\t\t\t\tcolor,\n\t\t\t\t\t\t\tlineWidth,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tfunction textBoxText(data) {\n\t\t\treturn data.text\n\t\t}\n\n\t\tfunction textBoxAnchorPoints(handles) {\n\t\t\tconst midpoint = {\n\t\t\t\tx: (handles.start.x + handles.end.x) / 2,\n\t\t\t\ty: (handles.start.y + handles.end.y) / 2,\n\t\t\t}\n\n\t\t\treturn [handles.start, midpoint, handles.end]\n\t\t}\n\t}\n}\n","import { metaData } from 'cornerstone-core/dist/cornerstone.js'\n\nexport default function getPixelSpacing(image: any) {\n\tlet { rowPixelSpacing, columnPixelSpacing } = image || {}\n\tlet isPixelSpacingDefined = true\n\tconst imagePlane = metaData.get('imagePlaneModule', image.imageId)\n\tif (imagePlane) {\n\t\trowPixelSpacing = imagePlane.rowPixelSpacing || imagePlane.rowImagePixelSpacing\n\t\tcolumnPixelSpacing = imagePlane.columnPixelSpacing || imagePlane.colImagePixelSpacing\n\t\tisPixelSpacingDefined = imagePlane.isPixelSpacingDefined\n\t}\n\tif (rowPixelSpacing == null || columnPixelSpacing == null) {\n\t\trowPixelSpacing = 1\n\t\tcolumnPixelSpacing = 1\n\t\tisPixelSpacingDefined = false\n\t}\n\treturn {\n\t\trowPixelSpacing,\n\t\tcolumnPixelSpacing,\n\t\tisPixelSpacingDefined,\n\t}\n}\n","import {\n\tRectangleRoiTool,\n\texternal,\n\taddToolState,\n\timport as csTools,\n\tgetToolState,\n\ttoolStyle,\n\tgetModule,\n\ttoolColors,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\n\n// Manipulators\nimport moveHandle from '@/cornerstone/manipulators/moveHandle'\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport toolSelectedCallback from './_shared/toolSelectedCallback.js'\n\n// Handle helpers\nimport { initHandle } from './util/handles'\nimport getImagePixelSpacing from './util/getImagePixelSpacing'\nimport { formatNumber } from '@utils/numberUtils'\nimport round from 'lodash/round'\n\nconst getNewContext = csTools('drawing/getNewContext')\nconst draw = csTools('drawing/draw')\nconst setShadow = csTools('drawing/setShadow')\nconst drawRect = csTools('drawing/drawRect')\nconst drawHandles = csTools('drawing/drawHandles')\nconst getROITextBoxCoords = csTools('util/getROITextBoxCoords')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\nconst calculateSUV = csTools('util/calculateSUV')\n\nexport default class AstRectangleRoi extends RectangleRoiTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstRectangleRoi',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tprecisionHandlesEnabled: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t\tdrawHandles: true,\n\t\t\t\tshowHounsfieldUnits: true,\n\t\t\t\tshowMinMax: true,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\t\tsuper(initialConfiguration)\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\t}\n\n\t// custom toolSelectedCallback for opening annotation dialog\n\ttoolSelectedCallback = toolSelectedCallback.bind(this)\n\n\taddNewMeasurement(evt, interactionType) {\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\t\tconst eventData = evt.detail\n\t\tconst element = eventData.element\n\t\tconst measurementData = this.createNewMeasurement(eventData)\n\n\t\tif (!measurementData) {\n\t\t\treturn\n\t\t}\n\n\t\t// Associate this data with this imageId so we can render it and manipulate it\n\t\taddToolState(element, this.name, measurementData)\n\n\t\texternal.cornerstone.updateImage(element)\n\n\t\tinitHandle(measurementData.handles.start, null, interactionType, this.options)\n\t\tmoveNewHandle(eventData, this.name, measurementData, measurementData.handles.end, this.options, interactionType)\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tmoveHandle(evt.detail, this.name, toolData, handle, this.options, interactionType)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\trenderToolData(evt) {\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\n\t\tif (!toolData) {\n\t\t\treturn\n\t\t}\n\n\t\tconst eventData = evt.detail\n\t\tconst { image, element } = eventData\n\t\tconst lineWidth = toolStyle.getToolWidth()\n\t\tconst lineDash = getModule('globalConfiguration').configuration.lineDash\n\t\tconst { handleRadius, drawHandlesOnHover, renderDashed } = this.configuration\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\t\tconst { rowPixelSpacing, columnPixelSpacing, isPixelSpacingDefined } = getImagePixelSpacing(image)\n\n\t\t// Meta\n\t\tconst seriesModule = external.cornerstone.metaData.get('series', image.imageId) || {}\n\n\t\t// Pixel Spacing\n\t\tconst modality = seriesModule.modality\n\n\t\tdraw(context, context => {\n\t\t\t// If we have tool data for this element - iterate over each set and draw it\n\t\t\tfor (let i = 0; i < toolData.data.length; i++) {\n\t\t\t\tconst data = toolData.data[i]\n\n\t\t\t\tif (data.visible === false) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Configure\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tconst handleOptions = {\n\t\t\t\t\tcolor,\n\t\t\t\t\thandleRadius,\n\t\t\t\t\tdrawHandlesIfActive: drawHandlesOnHover,\n\t\t\t\t}\n\n\t\t\t\tsetShadow(context, this.configuration)\n\n\t\t\t\tconst rectOptions = { color }\n\n\t\t\t\tif (renderDashed) {\n\t\t\t\t\trectOptions.lineDash = lineDash\n\t\t\t\t}\n\n\t\t\t\t// Draw\n\t\t\t\tdrawRect(\n\t\t\t\t\tcontext,\n\t\t\t\t\telement,\n\t\t\t\t\tdata.handles.start,\n\t\t\t\t\tdata.handles.end,\n\t\t\t\t\trectOptions,\n\t\t\t\t\t'pixel',\n\t\t\t\t\tdata.handles.initialRotation\n\t\t\t\t)\n\n\t\t\t\tif (this.configuration.drawHandles) {\n\t\t\t\t\tdrawHandles(context, eventData, data.handles, handleOptions)\n\t\t\t\t}\n\n\t\t\t\t// Update textbox stats\n\t\t\t\tif (data.invalidated === true) {\n\t\t\t\t\tif (data.cachedStats) {\n\t\t\t\t\t\tthis.throttledUpdateCachedStats(image, element, data)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.updateCachedStats(image, element, data)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Default to textbox on right side of ROI\n\t\t\t\tif (!data.handles.textBox.hasMoved) {\n\t\t\t\t\tconst defaultCoords = getROITextBoxCoords(eventData.viewport, data.handles)\n\n\t\t\t\t\tObject.assign(data.handles.textBox, defaultCoords)\n\t\t\t\t}\n\n\t\t\t\tconst textBoxAnchorPoints = handles => _findTextBoxAnchorPoints(handles.start, handles.end)\n\t\t\t\tconst textBoxContent = _createTextBoxContent(\n\t\t\t\t\tcontext,\n\t\t\t\t\timage.color,\n\t\t\t\t\tdata.cachedStats,\n\t\t\t\t\tmodality,\n\t\t\t\t\tisPixelSpacingDefined,\n\t\t\t\t\tthis.configuration\n\t\t\t\t)\n\t\t\t\tdata.handles.textBox.text = textBoxContent\n\n\t\t\t\tdata.unit = _getUnit(modality, this.configuration.showHounsfieldUnits)\n\n\t\t\t\tif (!data.handles.textBox.hidden) {\n\t\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tdata.handles.textBox,\n\t\t\t\t\t\ttextBoxContent,\n\t\t\t\t\t\tdata.handles,\n\t\t\t\t\t\ttextBoxAnchorPoints,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tlineWidth,\n\t\t\t\t\t\t10,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\n/**\n * TODO: This is the same method (+ GetPixels) for the other ROIs\n * TODO: The pixel filtering is the unique bit\n *\n * @param {*} startHandle\n * @param {*} endHandle\n * @returns {{ left: number, top: number, width: number, height: number}}\n */\nfunction _getRectangleImageCoordinates(startHandle, endHandle) {\n\treturn {\n\t\tleft: Math.min(startHandle.x, endHandle.x),\n\t\ttop: Math.min(startHandle.y, endHandle.y),\n\t\twidth: Math.abs(startHandle.x - endHandle.x),\n\t\theight: Math.abs(startHandle.y - endHandle.y),\n\t}\n}\n\n/**\n *\n *\n * @param {*} image\n * @param {*} element\n * @param {*} handles\n * @param {*} modality\n * @param {*} pixelSpacing\n * @returns {Object} The Stats object\n */\nfunction _calculateStats(image, element, handles, modality, pixelSpacing) {\n\t// Retrieve the bounds of the rectangle in image coordinates\n\tconst roiCoordinates = _getRectangleImageCoordinates(handles.start, handles.end)\n\n\t// Retrieve the array of pixels that the rectangle bounds cover\n\tconst pixels = external.cornerstone.getPixels(\n\t\telement,\n\t\troiCoordinates.left,\n\t\troiCoordinates.top,\n\t\troiCoordinates.width,\n\t\troiCoordinates.height\n\t)\n\n\t// Calculate the mean & standard deviation from the pixels and the rectangle details\n\tconst roiMeanStdDev = _calculateRectangleStats(pixels, roiCoordinates)\n\n\tlet meanStdDevSUV\n\n\tif (modality === 'PT') {\n\t\tmeanStdDevSUV = {\n\t\t\tmean: calculateSUV(image, roiMeanStdDev.mean, true) || 0,\n\t\t\tstdDev: calculateSUV(image, roiMeanStdDev.stdDev, true) || 0,\n\t\t}\n\t}\n\n\t// Calculate the image area from the rectangle dimensions and pixel spacing\n\tconst area =\n\t\troiCoordinates.width *\n\t\t(pixelSpacing.colPixelSpacing || 1) *\n\t\t(roiCoordinates.height * (pixelSpacing.rowPixelSpacing || 1))\n\n\treturn {\n\t\tarea: area || 0,\n\t\tcount: roiMeanStdDev.count || 0,\n\t\tmean: roiMeanStdDev.mean || 0,\n\t\tvariance: roiMeanStdDev.variance || 0,\n\t\tstdDev: roiMeanStdDev.stdDev || 0,\n\t\tmin: roiMeanStdDev.min || 0,\n\t\tmax: roiMeanStdDev.max || 0,\n\t\tmeanStdDevSUV,\n\t}\n}\n\n/**\n *\n *\n * @param {*} sp\n * @param {*} rectangle\n * @returns {{ count, number, mean: number,  variance: number,  stdDev: number,  min: number,  max: number }}\n */\nfunction _calculateRectangleStats(sp, rectangle) {\n\tlet sum = 0\n\tlet sumSquared = 0\n\tlet count = 0\n\tlet index = 0\n\tlet min = sp ? sp[0] : null\n\tlet max = sp ? sp[0] : null\n\n\tfor (let y = rectangle.top; y < rectangle.top + rectangle.height; y++) {\n\t\tfor (let x = rectangle.left; x < rectangle.left + rectangle.width; x++) {\n\t\t\tsum += sp[index]\n\t\t\tsumSquared += sp[index] * sp[index]\n\t\t\tmin = Math.min(min, sp[index])\n\t\t\tmax = Math.max(max, sp[index])\n\t\t\tcount++ // TODO: Wouldn't this just be sp.length?\n\t\t\tindex++\n\t\t}\n\t}\n\n\tif (count === 0) {\n\t\treturn {\n\t\t\tcount,\n\t\t\tmean: 0.0,\n\t\t\tvariance: 0.0,\n\t\t\tstdDev: 0.0,\n\t\t\tmin: 0.0,\n\t\t\tmax: 0.0,\n\t\t}\n\t}\n\n\tconst mean = sum / count\n\tconst variance = sumSquared / count - mean * mean\n\n\treturn {\n\t\tcount,\n\t\tmean,\n\t\tvariance,\n\t\tstdDev: Math.sqrt(variance),\n\t\tmin,\n\t\tmax,\n\t}\n}\n\n/**\n *\n *\n * @param {*} startHandle\n * @param {*} endHandle\n * @returns {Array.<{x: number, y: number}>}\n */\nfunction _findTextBoxAnchorPoints(startHandle, endHandle) {\n\tconst { left, top, width, height } = _getRectangleImageCoordinates(startHandle, endHandle)\n\n\treturn [\n\t\t{\n\t\t\t// Top middle point of rectangle\n\t\t\tx: left + width / 2,\n\t\t\ty: top,\n\t\t},\n\t\t{\n\t\t\t// Left middle point of rectangle\n\t\t\tx: left,\n\t\t\ty: top + height / 2,\n\t\t},\n\t\t{\n\t\t\t// Bottom middle point of rectangle\n\t\t\tx: left + width / 2,\n\t\t\ty: top + height,\n\t\t},\n\t\t{\n\t\t\t// Right middle point of rectangle\n\t\t\tx: left + width,\n\t\t\ty: top + height / 2,\n\t\t},\n\t]\n}\n\n/**\n *\n *\n * @param {*} area\n * @param {*} hasPixelSpacing\n * @returns {string} The formatted label for showing area\n */\nfunction _formatArea(area, hasPixelSpacing) {\n\t// This uses Char code 178 for a superscript 2\n\tconst suffix = hasPixelSpacing ? ` mm${String.fromCharCode(178)}` : ` px${String.fromCharCode(178)}`\n\n\treturn `Area: ${formatNumber(round(area, 2))}${suffix}`\n}\n\nfunction _getUnit(modality, showHounsfieldUnits) {\n\treturn modality === 'CT' && showHounsfieldUnits !== false ? 'HU' : ''\n}\n\n/**\n * TODO: This is identical to EllipticalROI's same fn\n * TODO: We may want to make this a utility for ROIs with these values?\n *\n * @param {*} context\n * @param {*} isColorImage\n * @param {*} { area, mean, stdDev, min, max, meanStdDevSUV }\n * @param {*} modality\n * @param {*} hasPixelSpacing\n * @param {*} [options={}]\n * @returns {string[]}\n */\nfunction _createTextBoxContent(\n\tcontext,\n\tisColorImage,\n\t{ area, mean, stdDev, min, max, meanStdDevSUV } = {},\n\tmodality,\n\thasPixelSpacing,\n\toptions = {}\n) {\n\tconst showMinMax = options.showMinMax || false\n\tconst textLines = []\n\n\tconst otherLines = []\n\n\tconst showStats = !isColorImage && ['PT', 'CT'].includes(modality)\n\n\tif (showStats) {\n\t\tconst hasStandardUptakeValues = meanStdDevSUV && meanStdDevSUV.mean !== 0\n\t\tconst unit = _getUnit(modality, options.showHounsfieldUnits)\n\n\t\tlet meanString = `Mean: ${formatNumber(round(mean, 2))} ${unit}`\n\t\tconst stdDevString = `Std Dev: ${formatNumber(round(stdDev, 2))} ${unit}`\n\n\t\t// If this image has SUV values to display, concatenate them to the text line\n\t\tif (hasStandardUptakeValues) {\n\t\t\tconst SUVtext = ' SUV: '\n\n\t\t\tconst meanSuvString = `${SUVtext}${formatNumber(round(meanStdDevSUV.mean, 2))}`\n\t\t\tconst stdDevSuvString = `${SUVtext}${formatNumber(round(meanStdDevSUV.stdDev, 2))}`\n\n\t\t\tconst targetStringLength = Math.floor(context.measureText(`${stdDevString}     `).width)\n\n\t\t\twhile (context.measureText(meanString).width < targetStringLength) {\n\t\t\t\tmeanString += ' '\n\t\t\t}\n\n\t\t\totherLines.push(`${meanString}${meanSuvString}`)\n\t\t\totherLines.push(`${stdDevString}     ${stdDevSuvString}`)\n\t\t} else {\n\t\t\totherLines.push(`${meanString}     ${stdDevString}`)\n\t\t}\n\n\t\tif (showMinMax) {\n\t\t\tlet minString = `Min: ${formatNumber(min)} ${unit}`\n\t\t\tconst maxString = `Max: ${formatNumber(max)} ${unit}`\n\t\t\tconst targetStringLength = hasStandardUptakeValues\n\t\t\t\t? Math.floor(context.measureText(`${stdDevString}     `).width)\n\t\t\t\t: Math.floor(context.measureText(`${meanString}     `).width)\n\n\t\t\twhile (context.measureText(minString).width < targetStringLength) {\n\t\t\t\tminString += ' '\n\t\t\t}\n\n\t\t\totherLines.push(`${minString}${maxString}`)\n\t\t}\n\t}\n\n\ttextLines.push(_formatArea(area, hasPixelSpacing))\n\totherLines.forEach(x => textLines.push(x))\n\n\treturn textLines\n}\n","// TODO: get rid of this in favor of lib export once we upgrade to cornerstone-tools >= v.4.6.0\n// https://github.com/cornerstonejs/cornerstoneTools/pull/1099\n\n/**\n * Determine the coordinates that will place the textbox to the right of the\n * annotation, taking rotation, hflip, and vflip into account.\n *\n * @param {Object} viewport - The object that stores rotation, hflip, and vflip.\n * @param {Object} handles - The handles of the annotation.\n * @returns {Object} - The coordinates for default placement of the textbox\n */\nexport default function getROITextBoxCoords(viewport, handles) {\n\tconst corners = _determineCorners(handles)\n\tconst centerX = (corners.left.x + corners.right.x) / 2\n\tconst centerY = (corners.top.y + corners.bottom.y) / 2\n\tconst textBox = {}\n\n\tif (viewport.rotation >= 0 && viewport.rotation < 90) {\n\t\ttextBox.x = viewport.hflip ? corners.left.x : corners.right.x\n\t\ttextBox.y = centerY\n\t}\n\tif (viewport.rotation >= 90 && viewport.rotation < 180) {\n\t\ttextBox.x = centerX\n\t\ttextBox.y = viewport.vflip ? corners.bottom.y : corners.top.y\n\t}\n\tif (viewport.rotation >= 180 && viewport.rotation < 270) {\n\t\ttextBox.x = viewport.hflip ? corners.right.x : corners.left.x\n\t\ttextBox.y = centerY\n\t}\n\tif (viewport.rotation >= 270 && viewport.rotation < 360) {\n\t\ttextBox.x = centerX\n\t\ttextBox.y = viewport.vflip ? corners.top.y : corners.bottom.y\n\t}\n\n\treturn textBox\n}\n\n/**\n * Determine the handles that have the min/max x and y values.\n *\n * @param {Object} handles - The handles of the annotation.\n * @returns {Object} - The top, left, bottom, and right handles\n */\nfunction _determineCorners(handles) {\n\tconst handlesLeftToRight = [handles.start, handles.end].sort(_compareX)\n\tconst handlesTopToBottom = [handles.start, handles.end].sort(_compareY)\n\tconst left = handlesLeftToRight[0]\n\tconst right = handlesLeftToRight[handlesLeftToRight.length - 1]\n\tconst top = handlesTopToBottom[0]\n\tconst bottom = handlesTopToBottom[handlesTopToBottom.length - 1]\n\n\treturn {\n\t\ttop,\n\t\tleft,\n\t\tbottom,\n\t\tright,\n\t}\n\n\tfunction _compareX(a, b) {\n\t\treturn a.x < b.x ? -1 : 1\n\t}\n\tfunction _compareY(a, b) {\n\t\treturn a.y < b.y ? -1 : 1\n\t}\n}\n","/* eslint-disable curly, capitalized-comments, newline-before-return, newline-after-var, object-property-newline */\nimport { updateImage, metaData, pixelToCanvas, getPixels } from 'cornerstone-core/dist/cornerstone.js'\nimport {\n\taddToolState,\n\tgetToolState,\n\timport as csTools,\n\tremoveToolState,\n\tstore,\n\ttoolColors,\n\ttoolStyle,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { point } from 'cornerstone-math/dist/cornerstoneMath.js'\n\n//\nimport throttle from '@/utils/throttle.js'\nimport { formatNumber, parseNumber } from '@utils/numberUtils'\nimport { openPromptDlg } from '@dialogs/TextPromptDlg'\n\nimport toolSelectedCallback from './_shared/toolSelectedCallback.js'\n\n// Manipulators\nimport moveHandle from './../manipulators/moveHandle.js'\nimport moveNewHandle from './../manipulators/moveNewHandle.js'\nimport getROITextBoxCoords from './util/getROITextBoxCoords.js'\n\n// Handle helpers\nimport { initHandle } from './util/handles.js'\nimport getImagePixelSpacing from './util/getImagePixelSpacing'\nimport { eventBus } from '@services/eventBus'\nimport round from 'lodash/round'\nimport triggerDoneModifying from './util/triggerDoneModifying.js'\n\nconst BaseAnnotationTool = csTools('base/BaseAnnotationTool')\n\n// Drawing\nconst draw = csTools('drawing/draw')\nconst drawEllipse = csTools('drawing/drawEllipse')\nconst drawHandles = csTools('drawing/drawHandles')\nconst getNewContext = csTools('drawing/getNewContext')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\nconst setShadow = csTools('drawing/setShadow')\n\n// Util\nconst { pointInEllipse, calculateEllipseStatistics } = csTools('util/ellipseUtils')\nconst calculateSUV = csTools('util/calculateSUV')\n\n/**\n * @export @public @class\n * @name AstCircleRoi\n * @classdesc\n * @extends BaseAnnotationTool\n */\nexport default class AstCircleRoi extends BaseAnnotationTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstCircleRoi',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t\tdrawHandlesOnHover: false,\n\t\t\t\tmaxClickDuration: 150,\n\t\t\t\tshowHounsfieldUnits: true,\n\t\t\t\tshowMinMax: true,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\n\t\tsuper(initialConfiguration)\n\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\t\tthis.isDragging = true\n\t}\n\n\t// custom toolSelectedCallback for opening annotation dialog\n\ttoolSelectedCallback = toolSelectedCallback.bind(this)\n\n\t/**\n\t * Create the measurement data for this tool with the end handle activated\n\t *\n\t * @param {*} eventData\n\t * @returns\n\t */\n\tcreateNewMeasurement({ currentPoints, element }) {\n\t\tconst { x, y } = currentPoints.image\n\t\treturn {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tinvalidated: true,\n\t\t\thandles: {\n\t\t\t\tstart: {\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: false,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: true,\n\t\t\t\t},\n\t\t\t\ttextBox: {\n\t\t\t\t\tactive: false,\n\t\t\t\t\thasMoved: false,\n\t\t\t\t\tmovesIndependently: false,\n\t\t\t\t\tdrawnIndependently: true,\n\t\t\t\t\tallowedOutsideImage: true,\n\t\t\t\t\thasBoundingBox: true,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {HTMLElement} element\n\t * @param {*} data\n\t * @param {*} coords\n\t * @returns {boolean}\n\t */\n\tpointNearTool(element, data, coords, isMouse = true) {\n\t\tconst distance = isMouse ? 15 : 25\n\t\tconst startCanvas = pixelToCanvas(element, data.handles.start)\n\t\tconst endCanvas = pixelToCanvas(element, data.handles.end)\n\n\t\tconst minorEllipse = {\n\t\t\tleft: Math.min(startCanvas.x, endCanvas.x) + distance / 2,\n\t\t\ttop: Math.min(startCanvas.y, endCanvas.y) + distance / 2,\n\t\t\twidth: Math.abs(startCanvas.x - endCanvas.x) - distance,\n\t\t\theight: Math.abs(startCanvas.y - endCanvas.y) - distance,\n\t\t}\n\n\t\tconst majorEllipse = {\n\t\t\tleft: Math.min(startCanvas.x, endCanvas.x) - distance / 2,\n\t\t\ttop: Math.min(startCanvas.y, endCanvas.y) - distance / 2,\n\t\t\twidth: Math.abs(startCanvas.x - endCanvas.x) + distance,\n\t\t\theight: Math.abs(startCanvas.y - endCanvas.y) + distance,\n\t\t}\n\n\t\tconst centerCrossHairs = {\n\t\t\tleft: startCanvas.x + (endCanvas.x - startCanvas.x) / 2 - distance,\n\t\t\ttop: startCanvas.y + (endCanvas.y - startCanvas.y) / 2 - distance,\n\t\t\twidth: distance * 2,\n\t\t\theight: distance * 2,\n\t\t}\n\n\t\tconst pointInMinorEllipse = pointInEllipse(minorEllipse, coords)\n\t\tconst pointInCenter = pointInEllipse(centerCrossHairs, coords)\n\t\tconst pointInMajorEllipse = pointInEllipse(majorEllipse, coords)\n\n\t\tif ((pointInMajorEllipse && !pointInMinorEllipse) || pointInCenter) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\taddNewMeasurement(evt, interactionType = 'mouse') {\n\t\tconst isMouse = interactionType === 'mouse'\n\t\tconst eventData = evt.detail\n\t\tconst element = eventData.element\n\t\tconst measurementData = this.createNewMeasurement(eventData)\n\n\t\tif (!measurementData) {\n\t\t\treturn\n\t\t}\n\n\t\tinitHandle(measurementData.handles.start, null, interactionType, this.options)\n\t\tinitHandle(measurementData.handles.end, null, interactionType, this.options)\n\n\t\t// Drag handle if we haven't released in `maxClickDuration`\n\t\tconst createCircleFromDiameter = this._createCircleFromDiameter.bind(this, eventData, element, null, null)\n\t\tconst upEvent = isMouse ? 'mouseup' : 'touchend'\n\t\tconst handleDoneMove = () => {\n\t\t\tstore.state.isToolLocked = false\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\telement.removeEventListener(upEvent, createCircleFromDiameter)\n\t\t\tif (this.isDragging) {\n\t\t\t\t// Associate this data with this imageId so we can render it and manipulate it\n\t\t\t\taddToolState(element, this.name, measurementData)\n\t\t\t\tupdateImage(element)\n\n\t\t\t\tstore.state.isToolLocked = true\n\t\t\t\tmoveNewHandle(\n\t\t\t\t\teventData,\n\t\t\t\t\tthis.name,\n\t\t\t\t\tmeasurementData,\n\t\t\t\t\tmeasurementData.handles.end,\n\t\t\t\t\t{ constrainSquare: true },\n\t\t\t\t\tinteractionType,\n\t\t\t\t\thandleDoneMove\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\thandleDoneMove()\n\t\t\t}\n\t\t}, this.configuration.maxClickDuration)\n\n\t\tthis.isDragging = true\n\t\telement.addEventListener(upEvent, createCircleFromDiameter)\n\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tstore.state.isToolLocked = true\n\t\ttoolData.active = true\n\t\tconst eventData = evt.detail\n\n\t\t// Move handle\n\t\tconst handleDoneMove = () => {\n\t\t\tstore.state.isToolLocked = false\n\t\t}\n\n\t\tmoveHandle(\n\t\t\teventData,\n\t\t\tthis.name,\n\t\t\ttoolData,\n\t\t\thandle,\n\t\t\t{ constrainSquare: handle !== toolData.handles.textBox },\n\t\t\tinteractionType,\n\t\t\thandleDoneMove\n\t\t)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} evt\n\t * @returns\n\t */\n\trenderToolData(evt) {\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\n\t\t// If we have no toolData for this element, return immediately as there is nothing to do\n\t\tif (!toolData || !toolData.data || !toolData.data.length) {\n\t\t\treturn\n\t\t}\n\n\t\tconst eventData = evt.detail\n\t\tconst { image, element } = eventData\n\t\tconst lineWidth = toolStyle.getToolWidth()\n\t\tconst { handleDiameter, drawHandlesOnHover } = this.configuration\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\n\t\t// Meta\n\t\tconst seriesModule = metaData.get('series', image.imageId) || {}\n\n\t\t// Pixel Spacing\n\t\tconst modality = seriesModule.modality\n\n\t\tconst { isPixelSpacingDefined, ...pixelSpacing } = getImagePixelSpacing(image)\n\n\t\tdraw(context, context => {\n\t\t\t// If we have tool data for this element - iterate over each set and draw it\n\t\t\tfor (let i = 0; i < toolData.data.length; i++) {\n\t\t\t\tconst data = toolData.data[i]\n\n\t\t\t\t// Configure\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tconst handleOptions = {\n\t\t\t\t\tcolor,\n\t\t\t\t\thandleDiameter,\n\t\t\t\t\tdrawHandlesIfActive: drawHandlesOnHover,\n\t\t\t\t}\n\n\t\t\t\tsetShadow(context, this.configuration)\n\n\t\t\t\t// Draw ellipse, center, and handles\n\t\t\t\tdrawEllipse(context, element, data.handles.start, data.handles.end, {\n\t\t\t\t\tcolor,\n\t\t\t\t})\n\t\t\t\t_drawCenter(context, element, data.handles.start, data.handles.end)\n\t\t\t\tdrawHandles(context, eventData, data.handles, handleOptions)\n\n\t\t\t\t// Update textbox stats\n\t\t\t\tif (data.invalidated === true) {\n\t\t\t\t\tif (data.cachedStats) {\n\t\t\t\t\t\t_throttledUpdateCachedStats(image, element, data, modality, pixelSpacing)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_updateCachedStats(image, element, data, modality, pixelSpacing)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Default position to right most side of circle\n\t\t\t\tif (!data.handles.textBox.hasMoved) {\n\t\t\t\t\tconst defaultCoords = getROITextBoxCoords(eventData.viewport, data.handles)\n\t\t\t\t\tObject.assign(data.handles.textBox, defaultCoords)\n\t\t\t\t}\n\n\t\t\t\tif (!data.cachedStats.diameter)\n\t\t\t\t\tdata.cachedStats.diameter = _getRadius(data.handles, pixelSpacing.rowPixelSpacing) * 2\n\n\t\t\t\tconst textBoxAnchorPoints = handles => {\n\t\t\t\t\treturn _findTextBoxAnchorPoints(handles.start, handles.end)\n\t\t\t\t}\n\t\t\t\tconst textBoxContent = _createTextBoxContent(\n\t\t\t\t\tcontext,\n\t\t\t\t\timage.color,\n\t\t\t\t\tdata.cachedStats,\n\t\t\t\t\tmodality,\n\t\t\t\t\tisPixelSpacingDefined,\n\t\t\t\t\tthis.configuration\n\t\t\t\t)\n\t\t\t\tdata.handles.textBox.text = textBoxContent\n\n\t\t\t\t// If the textbox has moved, it will use `textBoxAnchorPoints` to\n\t\t\t\t// find the best location to link the textbox to the annotation\n\t\t\t\tif (!data.handles.textBox.hidden) {\n\t\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tdata.handles.textBox,\n\t\t\t\t\t\ttextBoxContent,\n\t\t\t\t\t\tdata.handles,\n\t\t\t\t\t\ttextBoxAnchorPoints,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tlineWidth,\n\t\t\t\t\t\t10,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tasync _createCircleFromDiameter(eventData, element, existingCircle, diameter) {\n\t\t/* eslint-disable no-alert */\n\t\tthis.isDragging = false\n\t\t// do not prompt if click was outside image\n\t\tconst imageBounds = {\n\t\t\tleft: 0,\n\t\t\ttop: 0,\n\t\t\twidth: eventData.image.width,\n\t\t\theight: eventData.image.height,\n\t\t}\n\t\tif (!point.insideRect(eventData.currentPoints.image, imageBounds)) return\n\n\t\tconst { rowPixelSpacing, columnPixelSpacing, isPixelSpacingDefined } = getImagePixelSpacing(eventData.image)\n\n\t\tconst defaultDiameter =\n\t\t\texistingCircle && existingCircle.cachedStats && existingCircle.cachedStats.diameter\n\t\t\t\t? round(existingCircle.cachedStats.diameter, 2)\n\t\t\t\t: ''\n\t\tif (!diameter) {\n\t\t\tconst unit = isPixelSpacingDefined ? 'mm' : 'px'\n\t\t\tdiameter = parseNumber(\n\t\t\t\tawait openPromptDlg({\n\t\t\t\t\ttitle: 'New Circle',\n\t\t\t\t\tprompt: `Enter circle diameter [${unit}]:`,\n\t\t\t\t\tdefaultValue: formatNumber(defaultDiameter),\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\t\tif (!diameter) return\n\t\tlet origin = eventData.currentPoints && eventData.currentPoints.image\n\n\t\tif (existingCircle) {\n\t\t\tconst start = existingCircle.handles.start\n\t\t\tconst end = existingCircle.handles.end\n\n\t\t\torigin = {\n\t\t\t\tx: (end.x - start.x) / 2 + start.x,\n\t\t\t\ty: (end.y - start.y) / 2 + start.y,\n\t\t\t}\n\t\t}\n\n\t\tconst pixelSpacing = columnPixelSpacing || rowPixelSpacing\n\t\tif (pixelSpacing) {\n\t\t\tdiameter /= pixelSpacing\n\t\t}\n\t\tlet newCircle = this.createNewMeasurement(eventData)\n\t\tconst radius = diameter / 2\n\t\tnewCircle.handles.start.x = origin.x - radius\n\t\tnewCircle.handles.start.y = origin.y - radius\n\t\tnewCircle.handles.end.x = origin.x + radius\n\t\tnewCircle.handles.end.y = origin.y + radius\n\t\tnewCircle.handles.end.active = false\n\n\t\t/* Create and render new circle */\n\t\taddToolState(element, this.name, newCircle)\n\t\tremoveToolState(element, this.name, existingCircle)\n\t\tupdateImage(element)\n\n\t\t// Simulate tool selected to refresh annotation dialog\n\t\tsetTimeout(() => {\n\t\t\tconst event = new CustomEvent('circlecreatedfromdiameter', {\n\t\t\t\tdetail: eventData,\n\t\t\t})\n\t\t\tconst toolState = getToolState(eventData.element, this.name)\n\t\t\tconst annotation = toolState.data[toolState.data.length - 1]\n\t\t\teventBus.post(eventBus.type.ANNOTATION_CLICK, {\n\t\t\t\ttool: this,\n\t\t\t\ttoolState,\n\t\t\t\tannotation,\n\t\t\t\tevent,\n\t\t\t})\n\t\t\ttriggerDoneModifying(this.name, element, eventData.image)\n\t\t}, 50) // Generous delay for cached stats\n\t}\n\n\tupdateCachedStats(image, element, data) {\n\t\t// Meta\n\t\tconst seriesModule = metaData.get('series', image.imageId) || {}\n\t\t// Pixel Spacing\n\t\tconst modality = seriesModule.modality\n\t\t// const data = toolData.data[i]\n\t\tconst { isPixelSpacingDefined, ...pixelSpacing } = getImagePixelSpacing(image)\n\t\t_updateCachedStats(image, element, data, modality, pixelSpacing)\n\t}\n}\n\n/**\n *\n */\nconst _throttledUpdateCachedStats = throttle(_updateCachedStats, 110)\n\n/**\n *\n *\n * @param {*} image\n * @param {*} element\n * @param {*} data\n * @param {*} pixelSpacing\n */\nfunction _updateCachedStats(image, element, data, modality, pixelSpacing) {\n\tconst circleStatistics = _calculateCircleStatistics(\n\t\timage,\n\t\telement,\n\t\tdata.handles,\n\t\tmodality,\n\t\tpixelSpacing.rowPixelSpacing\n\t)\n\tdata.cachedStats = circleStatistics\n}\n\nfunction _findTextBoxAnchorPoints(startHandle, endHandle) {\n\tconst { left, top, width, height } = _getCircleImageCoordinates(startHandle, endHandle)\n\n\treturn [\n\t\t{\n\t\t\t// Top middle point of ellipse\n\t\t\tx: left + width / 2,\n\t\t\ty: top,\n\t\t},\n\t\t{\n\t\t\t// Left middle point of ellipse\n\t\t\tx: left,\n\t\t\ty: top + height / 2,\n\t\t},\n\t\t{\n\t\t\t// Bottom middle point of ellipse\n\t\t\tx: left + width / 2,\n\t\t\ty: top + height,\n\t\t},\n\t\t{\n\t\t\t// Right middle point of ellipse\n\t\t\tx: left + width,\n\t\t\ty: top + height / 2,\n\t\t},\n\t]\n}\n\n/**\n *\n *\n * @param {CanvasRenderingContext2D} context\n * @param {*} element\n * @param {*} startHandle\n * @param {*} endHandle\n */\nfunction _drawCenter(context, element, startHandle, endHandle) {\n\t// Convert Image coordinates to Canvas coordinates given the element\n\tconst handleStartCanvas = pixelToCanvas(element, startHandle)\n\tconst handleEndCanvas = pixelToCanvas(element, endHandle)\n\n\t// Retrieve the bounds of the ellipse (left, top, width, and height)\n\t// In Canvas coordinates\n\tconst leftCanvas = Math.min(handleStartCanvas.x, handleEndCanvas.x)\n\tconst topCanvas = Math.min(handleStartCanvas.y, handleEndCanvas.y)\n\tconst widthCanvas = Math.abs(handleStartCanvas.x - handleEndCanvas.x)\n\tconst heightCanvas = Math.abs(handleStartCanvas.y - handleEndCanvas.y)\n\n\t// Draw center +\n\tconst xCenter = leftCanvas + widthCanvas / 2\n\tconst yCenter = topCanvas + heightCanvas / 2\n\tconst plusSize = 4\n\n\tcontext.beginPath()\n\tcontext.moveTo(xCenter - plusSize, yCenter)\n\tcontext.lineTo(xCenter + plusSize, yCenter)\n\tcontext.closePath()\n\tcontext.stroke()\n\tcontext.beginPath()\n\tcontext.moveTo(xCenter, yCenter - plusSize)\n\tcontext.lineTo(xCenter, yCenter + plusSize)\n\tcontext.closePath()\n\tcontext.stroke()\n\tcontext.closePath()\n}\n\nfunction _getUnit(modality, showHounsfieldUnits) {\n\treturn modality === 'CT' && showHounsfieldUnits !== false ? 'HU' : ''\n}\n\n/**\n *\n *\n * @param {*} context\n * @param {*} isColorImage\n * @param {*} [{ area, diameter, mean, stdDev, min, max }={}]\n * @param {*} modality\n * @param {*} hasPixelSpacing\n * @param {*} options\n * @returns\n */\nfunction _createTextBoxContent(\n\tcontext,\n\tisColorImage,\n\t{ area, diameter, mean, stdDev, min, max, meanStdDevSUV } = {},\n\tmodality,\n\thasPixelSpacing,\n\toptions\n) {\n\tconst showMinMax = options.showMinMax || false\n\n\tconst textLines = []\n\n\t// Don't display mean/standardDev for color images\n\tlet otherLines = []\n\tconst showStats = !isColorImage && ['PT', 'CT'].includes(modality)\n\n\tif (showStats) {\n\t\tconst hasStandardUptakeValues = meanStdDevSUV && meanStdDevSUV.mean !== 0\n\t\tconst unit = _getUnit(modality, options.showHounsfieldUnits)\n\n\t\tlet meanString = `Mean: ${formatNumber(round(mean, 2))} ${unit}`\n\t\tconst stdDevString = `Std Dev: ${formatNumber(round(stdDev, 2))} ${unit}`\n\n\t\t// If this image has SUV values to display, concatenate them to the text line\n\t\tif (hasStandardUptakeValues) {\n\t\t\tconst SUVtext = ' SUV: '\n\n\t\t\tconst meanSuvString = `${SUVtext}${formatNumber(round(meanStdDevSUV.mean, 2))}`\n\t\t\tconst stdDevSuvString = `${SUVtext}${formatNumber(round(meanStdDevSUV.stdDev, 2))}`\n\n\t\t\tconst targetStringLength = Math.floor(context.measureText(`${stdDevString}     `).width)\n\n\t\t\twhile (context.measureText(meanString).width < targetStringLength) {\n\t\t\t\tmeanString += ' '\n\t\t\t}\n\n\t\t\totherLines.push(`${meanString}${meanSuvString}`)\n\t\t\totherLines.push(`${stdDevString}     ${stdDevSuvString}`)\n\t\t} else {\n\t\t\totherLines.push(`${meanString}     ${stdDevString}`)\n\t\t}\n\n\t\tif (showMinMax) {\n\t\t\tlet minString = `Min: ${formatNumber(min)} ${unit}`\n\t\t\tconst maxString = `Max: ${formatNumber(max)} ${unit}`\n\t\t\tconst targetStringLength = hasStandardUptakeValues\n\t\t\t\t? Math.floor(context.measureText(`${stdDevString}     `).width)\n\t\t\t\t: Math.floor(context.measureText(`${meanString}     `).width)\n\n\t\t\twhile (context.measureText(minString).width < targetStringLength) {\n\t\t\t\tminString += ' '\n\t\t\t}\n\n\t\t\totherLines.push(`${minString}${maxString}`)\n\t\t}\n\t}\n\n\t// Build our text content\n\ttextLines.push(_formatArea(area, hasPixelSpacing))\n\ttextLines.push(_formatDiameter(diameter, hasPixelSpacing))\n\totherLines.forEach(x => textLines.push(x))\n\n\treturn textLines\n}\n\n/**\n *\n *\n * @param {*} area\n * @param {*} hasPixelSpacing\n * @returns\n */\nfunction _formatArea(area, hasPixelSpacing) {\n\t// This uses Char code 178 for a superscript 2\n\tconst suffix = hasPixelSpacing ? ` mm${String.fromCharCode(178)}` : ` px${String.fromCharCode(178)}`\n\n\treturn `Area: ${formatNumber(round(area, 2))}${suffix}`\n}\n\n/**\n *\n *\n * @param {*} diameter\n * @param {*} hasPixelSpacing\n * @returns\n */\nfunction _formatDiameter(diameter, hasPixelSpacing) {\n\tconst suffix = hasPixelSpacing ? ' mm' : ' px'\n\treturn `Diameter: ${formatNumber(round(diameter, 2))}${suffix}`\n}\n\n/**\n *\n *\n * @param {*} image\n * @param {*} element\n * @param {*} handles\n * @param {number} rowPixelSpacing\n * @returns\n */\nfunction _calculateCircleStatistics(image, element, handles, modality, rowPixelSpacing) {\n\t// Retrieve the bounds of the ellipse in image coordinates\n\tconst circleCoordinates = _getCircleImageCoordinates(handles.start, handles.end)\n\n\t// Retrieve the array of pixels that the ellipse bounds cover\n\tconst pixels = getPixels(\n\t\telement,\n\t\tcircleCoordinates.left,\n\t\tcircleCoordinates.top,\n\t\tcircleCoordinates.width,\n\t\tcircleCoordinates.height\n\t)\n\n\t// Calculate the mean & standard deviation from the pixels and the ellipse details\n\tconst circleMeanStdDev = calculateEllipseStatistics(pixels, circleCoordinates)\n\n\tlet meanStdDevSUV\n\n\tif (modality === 'PT') {\n\t\tmeanStdDevSUV = {\n\t\t\tmean: calculateSUV(image, circleMeanStdDev.mean, true) || 0,\n\t\t\tstdDev: calculateSUV(image, circleMeanStdDev.stdDev, true) || 0,\n\t\t}\n\t}\n\n\t// Calculate the image area from the ellipse dimensions and pixel spacing\n\tconst radius = _getRadius(handles, rowPixelSpacing)\n\tconst area = Math.PI * radius * radius\n\n\treturn {\n\t\tdiameter: radius ? radius * 2 : 0,\n\t\tarea: area || 0,\n\t\t//\n\t\tcount: circleMeanStdDev.count || 0,\n\t\tmean: circleMeanStdDev.mean || 0,\n\t\tvariance: circleMeanStdDev.variance || 0,\n\t\tstdDev: circleMeanStdDev.stdDev || 0,\n\t\tmin: circleMeanStdDev.min || 0,\n\t\tmax: circleMeanStdDev.max || 0,\n\t\t//\n\t\tmeanStdDevSUV,\n\t}\n}\n\nfunction _getRadius(handles, rowPixelSpacing) {\n\tconst circleCoordinates = _getCircleImageCoordinates(handles.start, handles.end)\n\treturn (circleCoordinates.width * rowPixelSpacing) / 2\n}\n\n/**\n *\n *\n * @param {*} startHandle\n * @param {*} endHandle\n * @returns\n */\nfunction _getCircleImageCoordinates(startHandle, endHandle) {\n\treturn {\n\t\tleft: Math.min(startHandle.x, endHandle.x),\n\t\ttop: Math.min(startHandle.y, endHandle.y),\n\t\twidth: Math.abs(startHandle.x - endHandle.x),\n\t\theight: Math.abs(startHandle.y - endHandle.y),\n\t}\n}\n","import {\n\tEllipticalRoiTool,\n\texternal,\n\taddToolState,\n\timport as csTools,\n\tgetToolState,\n\ttoolStyle,\n\tgetModule,\n\ttoolColors,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\n\nimport toolSelectedCallback from './_shared/toolSelectedCallback.js'\nimport { formatNumber } from '@utils/numberUtils'\n\n// Manipulators\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport moveHandle from '@/cornerstone/manipulators/moveHandle'\n\n// Handle helpers\nimport { initHandle } from './util/handles.js'\nimport getImagePixelSpacing from './util/getImagePixelSpacing'\nimport round from 'lodash/round'\n\nconst getNewContext = csTools('drawing/getNewContext')\nconst draw = csTools('drawing/draw')\nconst setShadow = csTools('drawing/setShadow')\nconst drawEllipse = csTools('drawing/drawEllipse')\nconst drawHandles = csTools('drawing/drawHandles')\nconst getROITextBoxCoords = csTools('util/getROITextBoxCoords')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\nconst calculateSUV = csTools('util/calculateSUV')\n\nexport default class AstEllipticalRoi extends EllipticalRoiTool {\n\tconstructor(configuration = {}) {\n\t\tsuper({\n\t\t\tname: 'AstEllipticalRoi',\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t\tdrawHandles: true,\n\t\t\t\tshowHounsfieldUnits: true,\n\t\t\t\tshowMinMax: true,\n\t\t\t},\n\t\t\t...configuration,\n\t\t})\n\t}\n\n\t// custom toolSelectedCallback for opening annotation dialog\n\ttoolSelectedCallback = toolSelectedCallback.bind(this)\n\n\taddNewMeasurement(evt, interactionType) {\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\t\tconst eventData = evt.detail\n\t\tconst element = eventData.element\n\t\tconst measurementData = this.createNewMeasurement(eventData)\n\n\t\tif (!measurementData) {\n\t\t\treturn\n\t\t}\n\n\t\tinitHandle(measurementData.handles.start, null, interactionType, this.options)\n\t\tinitHandle(measurementData.handles.end, null, interactionType, this.options)\n\n\t\t// Associate this data with this imageId so we can render it and manipulate it\n\t\taddToolState(element, this.name, measurementData)\n\n\t\texternal.cornerstone.updateImage(element)\n\n\t\tmoveNewHandle(eventData, this.name, measurementData, measurementData.handles.end, this.options, interactionType)\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tmoveHandle(evt.detail, this.name, toolData, handle, this.options, interactionType)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\trenderToolData(evt) {\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\n\t\tif (!toolData) {\n\t\t\treturn\n\t\t}\n\n\t\tconst eventData = evt.detail\n\t\tconst { image, element } = eventData\n\t\tconst lineWidth = toolStyle.getToolWidth()\n\t\tconst lineDash = getModule('globalConfiguration').configuration.lineDash\n\t\tconst { handleRadius, drawHandlesOnHover, renderDashed } = this.configuration\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\t\tconst { isPixelSpacingDefined } = getImagePixelSpacing(image)\n\n\t\t// Meta\n\t\tconst seriesModule = external.cornerstone.metaData.get('series', image.imageId) || {}\n\n\t\t// Pixel Spacing\n\t\tconst modality = seriesModule.modality\n\n\t\tdraw(context, context => {\n\t\t\t// If we have tool data for this element - iterate over each set and draw it\n\t\t\tfor (let i = 0; i < toolData.data.length; i++) {\n\t\t\t\tconst data = toolData.data[i]\n\n\t\t\t\tif (data.visible === false) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Configure\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tconst handleOptions = {\n\t\t\t\t\tcolor,\n\t\t\t\t\thandleRadius,\n\t\t\t\t\tdrawHandlesIfActive: drawHandlesOnHover,\n\t\t\t\t}\n\n\t\t\t\tsetShadow(context, this.configuration)\n\n\t\t\t\tconst ellipseOptions = { color }\n\n\t\t\t\tif (renderDashed) {\n\t\t\t\t\tellipseOptions.lineDash = lineDash\n\t\t\t\t}\n\n\t\t\t\t// Draw\n\t\t\t\tdrawEllipse(\n\t\t\t\t\tcontext,\n\t\t\t\t\telement,\n\t\t\t\t\tdata.handles.start,\n\t\t\t\t\tdata.handles.end,\n\t\t\t\t\tellipseOptions,\n\t\t\t\t\t'pixel',\n\t\t\t\t\tdata.handles.initialRotation\n\t\t\t\t)\n\t\t\t\tdrawHandles(context, eventData, data.handles, handleOptions)\n\n\t\t\t\t// Update textbox stats\n\t\t\t\tif (data.invalidated === true) {\n\t\t\t\t\tif (data.cachedStats) {\n\t\t\t\t\t\tthis.throttledUpdateCachedStats(image, element, data)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.updateCachedStats(image, element, data)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Default to textbox on right side of ROI\n\t\t\t\tif (!data.handles.textBox.hasMoved) {\n\t\t\t\t\tconst defaultCoords = getROITextBoxCoords(eventData.viewport, data.handles)\n\n\t\t\t\t\tObject.assign(data.handles.textBox, defaultCoords)\n\t\t\t\t}\n\n\t\t\t\tconst textBoxAnchorPoints = handles => _findTextBoxAnchorPoints(handles.start, handles.end)\n\t\t\t\tconst textBoxContent = _createTextBoxContent(\n\t\t\t\t\tcontext,\n\t\t\t\t\timage.color,\n\t\t\t\t\tdata.cachedStats,\n\t\t\t\t\tmodality,\n\t\t\t\t\tisPixelSpacingDefined,\n\t\t\t\t\tthis.configuration\n\t\t\t\t)\n\t\t\t\tdata.handles.textBox.text = textBoxContent\n\n\t\t\t\tdata.unit = _getUnit(modality, this.configuration.showHounsfieldUnits)\n\n\t\t\t\tif (!data.handles.textBox.hidden) {\n\t\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tdata.handles.textBox,\n\t\t\t\t\t\ttextBoxContent,\n\t\t\t\t\t\tdata.handles,\n\t\t\t\t\t\ttextBoxAnchorPoints,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tlineWidth,\n\t\t\t\t\t\t10,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\n/**\n *\n *\n * @param {*} startHandle\n * @param {*} endHandle\n * @returns {Array.<{x: number, y: number}>}\n */\nfunction _findTextBoxAnchorPoints(startHandle, endHandle) {\n\tconst { left, top, width, height } = _getEllipseImageCoordinates(startHandle, endHandle)\n\n\treturn [\n\t\t{\n\t\t\t// Top middle point of ellipse\n\t\t\tx: left + width / 2,\n\t\t\ty: top,\n\t\t},\n\t\t{\n\t\t\t// Left middle point of ellipse\n\t\t\tx: left,\n\t\t\ty: top + height / 2,\n\t\t},\n\t\t{\n\t\t\t// Bottom middle point of ellipse\n\t\t\tx: left + width / 2,\n\t\t\ty: top + height,\n\t\t},\n\t\t{\n\t\t\t// Right middle point of ellipse\n\t\t\tx: left + width,\n\t\t\ty: top + height / 2,\n\t\t},\n\t]\n}\n\nfunction _getUnit(modality, showHounsfieldUnits) {\n\treturn modality === 'CT' && showHounsfieldUnits !== false ? 'HU' : ''\n}\n\n/**\n *\n *\n * @param {*} context\n * @param {*} isColorImage\n * @param {*} { area, mean, stdDev, min, max, meanStdDevSUV }\n * @param {*} modality\n * @param {*} hasPixelSpacing\n * @param {*} [options={}] - { showMinMax, showHounsfieldUnits }\n * @returns {string[]}\n */\nfunction _createTextBoxContent(\n\tcontext,\n\tisColorImage,\n\t{ area, mean, stdDev, min, max, meanStdDevSUV } = {},\n\tmodality,\n\thasPixelSpacing,\n\toptions = {}\n) {\n\tconst showMinMax = options.showMinMax || false\n\tconst textLines = []\n\n\t// Don't display mean/standardDev for color images\n\tconst otherLines = []\n\n\tconst showStats = !isColorImage && ['PT', 'CT'].includes(modality)\n\n\tif (showStats) {\n\t\tconst hasStandardUptakeValues = meanStdDevSUV && meanStdDevSUV.mean !== 0\n\t\tconst unit = _getUnit(modality, options.showHounsfieldUnits)\n\n\t\tlet meanString = `Mean: ${formatNumber(round(mean, 2))} ${unit}`\n\t\tconst stdDevString = `Std Dev: ${formatNumber(round(stdDev, 2))} ${unit}`\n\n\t\t// If this image has SUV values to display, concatenate them to the text line\n\t\tif (hasStandardUptakeValues) {\n\t\t\tconst SUVtext = ' SUV: '\n\n\t\t\tconst meanSuvString = `${SUVtext}${formatNumber(round(meanStdDevSUV.mean, 2))}`\n\t\t\tconst stdDevSuvString = `${SUVtext}${formatNumber(round(meanStdDevSUV.stdDev, 2))}`\n\n\t\t\tconst targetStringLength = Math.floor(context.measureText(`${stdDevString}     `).width)\n\n\t\t\twhile (context.measureText(meanString).width < targetStringLength) {\n\t\t\t\tmeanString += ' '\n\t\t\t}\n\n\t\t\totherLines.push(`${meanString}${meanSuvString}`)\n\t\t\totherLines.push(`${stdDevString}     ${stdDevSuvString}`)\n\t\t} else {\n\t\t\totherLines.push(`${meanString}     ${stdDevString}`)\n\t\t}\n\n\t\tif (showMinMax) {\n\t\t\tlet minString = `Min: ${formatNumber(min)} ${unit}`\n\t\t\tconst maxString = `Max: ${formatNumber(max)} ${unit}`\n\t\t\tconst targetStringLength = hasStandardUptakeValues\n\t\t\t\t? Math.floor(context.measureText(`${stdDevString}     `).width)\n\t\t\t\t: Math.floor(context.measureText(`${meanString}     `).width)\n\n\t\t\twhile (context.measureText(minString).width < targetStringLength) {\n\t\t\t\tminString += ' '\n\t\t\t}\n\n\t\t\totherLines.push(`${minString}${maxString}`)\n\t\t}\n\t}\n\n\ttextLines.push(_formatArea(area, hasPixelSpacing))\n\totherLines.forEach(x => textLines.push(x))\n\n\treturn textLines\n}\n\n/**\n *\n *\n * @param {*} area\n * @param {*} hasPixelSpacing\n * @returns {string} The formatted label for showing area\n */\nfunction _formatArea(area, hasPixelSpacing) {\n\t// This uses Char code 178 for a superscript 2\n\tconst suffix = hasPixelSpacing ? ` mm${String.fromCharCode(178)}` : ` px${String.fromCharCode(178)}`\n\n\treturn `Area: ${formatNumber(round(area, 2))}${suffix}`\n}\n\n/**\n *\n *\n * @param {*} image\n * @param {*} element\n * @param {*} handles\n * @param {*} modality\n * @param {*} pixelSpacing\n * @returns {Object} The Stats object\n */\nfunction _calculateStats(image, element, handles, modality, pixelSpacing) {\n\t// Retrieve the bounds of the ellipse in image coordinates\n\tconst ellipseCoordinates = _getEllipseImageCoordinates(handles.start, handles.end)\n\n\t// Retrieve the array of pixels that the ellipse bounds cover\n\tconst pixels = external.cornerstone.getPixels(\n\t\telement,\n\t\tellipseCoordinates.left,\n\t\tellipseCoordinates.top,\n\t\tellipseCoordinates.width,\n\t\tellipseCoordinates.height\n\t)\n\n\t// Calculate the mean & standard deviation from the pixels and the ellipse details.\n\tconst ellipseMeanStdDev = _calculateEllipseStatistics(pixels, ellipseCoordinates)\n\n\tlet meanStdDevSUV\n\n\tif (modality === 'PT') {\n\t\tmeanStdDevSUV = {\n\t\t\tmean: calculateSUV(image, ellipseMeanStdDev.mean, true) || 0,\n\t\t\tstdDev: calculateSUV(image, ellipseMeanStdDev.stdDev, true) || 0,\n\t\t}\n\t}\n\n\t// Calculate the image area from the ellipse dimensions and pixel spacing\n\tconst area =\n\t\tMath.PI *\n\t\t((ellipseCoordinates.width * (pixelSpacing.colPixelSpacing || 1)) / 2) *\n\t\t((ellipseCoordinates.height * (pixelSpacing.rowPixelSpacing || 1)) / 2)\n\n\treturn {\n\t\tarea: area || 0,\n\t\tcount: ellipseMeanStdDev.count || 0,\n\t\tmean: ellipseMeanStdDev.mean || 0,\n\t\tvariance: ellipseMeanStdDev.variance || 0,\n\t\tstdDev: ellipseMeanStdDev.stdDev || 0,\n\t\tmin: ellipseMeanStdDev.min || 0,\n\t\tmax: ellipseMeanStdDev.max || 0,\n\t\tmeanStdDevSUV,\n\t}\n}\n\n/**\n * Retrieve the bounds of the ellipse in image coordinates\n *\n * @param {*} startHandle\n * @param {*} endHandle\n * @returns {{ left: number, top: number, width: number, height: number }}\n */\nfunction _getEllipseImageCoordinates(startHandle, endHandle) {\n\treturn {\n\t\tleft: Math.min(startHandle.x, endHandle.x),\n\t\ttop: Math.min(startHandle.y, endHandle.y),\n\t\twidth: Math.abs(startHandle.x - endHandle.x),\n\t\theight: Math.abs(startHandle.y - endHandle.y),\n\t}\n}\n\n/**\n * Calculates the statistics of an elliptical region of interest.\n *\n * @private\n * @function calculateEllipseStatistics\n *\n * @param {number[]} sp - Array of the image data's pixel values.\n * @param {Object} ellipse - { top, left, height, width } - An object describing the ellipse.\n * @returns {Object} { count, mean, variance, stdDev, min, max }\n */\nfunction _calculateEllipseStatistics(sp, ellipse) {\n\tlet sum = 0\n\tlet sumSquared = 0\n\tlet count = 0\n\tlet index = 0\n\tlet min = null\n\tlet max = null\n\n\tfor (let y = ellipse.top; y < ellipse.top + ellipse.height; y++) {\n\t\tfor (let x = ellipse.left; x < ellipse.left + ellipse.width; x++) {\n\t\t\tconst point = {\n\t\t\t\tx,\n\t\t\t\ty,\n\t\t\t}\n\n\t\t\tif (_pointInEllipse(ellipse, point)) {\n\t\t\t\tif (min === null) {\n\t\t\t\t\tmin = sp[index]\n\t\t\t\t\tmax = sp[index]\n\t\t\t\t}\n\n\t\t\t\tsum += sp[index]\n\t\t\t\tsumSquared += sp[index] * sp[index]\n\t\t\t\tmin = Math.min(min, sp[index])\n\t\t\t\tmax = Math.max(max, sp[index])\n\t\t\t\tcount++\n\t\t\t}\n\n\t\t\tindex++\n\t\t}\n\t}\n\n\tif (count === 0) {\n\t\treturn {\n\t\t\tcount,\n\t\t\tmean: 0.0,\n\t\t\tvariance: 0.0,\n\t\t\tstdDev: 0.0,\n\t\t\tmin: 0.0,\n\t\t\tmax: 0.0,\n\t\t}\n\t}\n\n\tconst mean = sum / count\n\tconst variance = sumSquared / count - mean * mean\n\n\treturn {\n\t\tcount,\n\t\tmean,\n\t\tvariance,\n\t\tstdDev: Math.sqrt(variance),\n\t\tmin,\n\t\tmax,\n\t}\n}\n\n/**\n * Returns true if a point is within an ellipse\n * @export @public @method\n * @name pointInEllipse\n *\n * @param  {Object} ellipse  Object defining the ellipse.\n * @param  {Object} location The location of the point.\n * @returns {boolean} True if the point is within the ellipse.\n */\nfunction _pointInEllipse(ellipse, location) {\n\tconst xRadius = ellipse.width / 2\n\tconst yRadius = ellipse.height / 2\n\n\tif (xRadius <= 0.0 || yRadius <= 0.0) {\n\t\treturn false\n\t}\n\n\tconst center = {\n\t\tx: ellipse.left + xRadius,\n\t\ty: ellipse.top + yRadius,\n\t}\n\n\t/* This is a more general form of the circle equation\n\t *\n\t * X^2/a^2 + Y^2/b^2 <= 1\n\t */\n\n\tconst normalized = {\n\t\tx: location.x - center.x,\n\t\ty: location.y - center.y,\n\t}\n\n\tconst inEllipse =\n\t\t(normalized.x * normalized.x) / (xRadius * xRadius) + (normalized.y * normalized.y) / (yRadius * yRadius) <= 1.0\n\n\treturn inEllipse\n}\n","import * as cornerstoneMath from 'cornerstone-math'\n\n/**\n * @param {Object} (x, y, z)\n * @returns Vector3\n */\nconst convertToVector3 = (obj: { x: number; y: number; z: number }) => {\n\treturn new cornerstoneMath.Vector3(obj.x, obj.y, obj.z)\n}\nexport default convertToVector3\n","/* eslint-disable curly, capitalized-comments, newline-before-return, newline-after-var, object-property-newline */\nimport { EVENTS, getEnabledElement, metaData, pixelToCanvas, updateImage } from 'cornerstone-core/dist/cornerstone.js'\nimport {\n\taddToolState,\n\tclearToolState,\n\tgetToolState,\n\timport as csTools,\n\tloadHandlerManager,\n\tsetToolDisabled,\n\tstore,\n\ttoolColors,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { waitForElementToBeEnabled, waitForEnabledElementImageToLoad } from '@/utils/wait.js'\nimport convertToVector3 from '@/utils/convertToVector3'\nimport isLocalizerImage from '../_shared/isLocalizerImage'\n\nconst BaseTool = csTools('base/BaseTool')\n\n// Drawing\nconst drawLine = csTools('drawing/drawLine')\nconst getNewContext = csTools('drawing/getNewContext')\n\n// Util\nconst imagePointToPatientPoint = csTools('util/imagePointToPatientPoint')\nconst projectPatientPointToImagePlane = csTools('util/projectPatientPointToImagePlane')\nconst scrollToIndex = csTools('util/scrollToIndex')\n\n/**\n * @export @public @class\n * @name AstCrossPoint\n * @classdesc\n * @extends BaseAnnotationTool\n */\nexport default class AstCrossPoint extends BaseTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstCrossPoint',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tpreventHandleOutsideImage: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\n\t\tsuper(initialConfiguration)\n\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\n\t\tthis.updatePoint = _updatePoint.bind(this)\n\t\tthis.clearPointsIfNotSynced = _clearPointsIfNotSynced.bind(this)\n\t\tthis.syncedId = null\n\n\t\tthis.postTouchStartCallback = this.onStart.bind(this)\n\t\tthis.touchDragCallback = this.onDrag.bind(this)\n\t\tthis.touchEndCallback = this.onEnd.bind(this)\n\n\t\tthis.postMouseDownCallback = this.onStart.bind(this)\n\t\tthis.mouseDragCallback = this.onDrag.bind(this)\n\t\tthis.mouseUpCallback = this.onEnd.bind(this)\n\n\t\tthis.mouseMoveCallback = () => false\n\t}\n\n\tactiveCallback(element, options) {\n\t\tthis.element.removeEventListener(EVENTS.NEW_IMAGE, this.clearPointsIfNotSynced)\n\t\tthis.element.addEventListener(EVENTS.NEW_IMAGE, this.clearPointsIfNotSynced)\n\t}\n\n\tpassiveCallback(element, options) {\n\t\tsetToolDisabled(this.name, options)\n\t}\n\n\tenabledCallback(element, options) {\n\t\tsetToolDisabled(this.name, options)\n\t}\n\n\tdisabledCallback(element, options) {\n\t\tthis.element.removeEventListener(EVENTS.NEW_IMAGE, this.clearPointsIfNotSynced)\n\t\tstore.state.enabledElements.forEach(async enabledElement => {\n\t\t\tclearToolState(enabledElement, this.name)\n\t\t\tconst isEnabled = await waitForElementToBeEnabled(enabledElement)\n\t\t\tconst hasLoadedImage = await waitForEnabledElementImageToLoad(enabledElement)\n\t\t\tif (isEnabled && hasLoadedImage) {\n\t\t\t\tupdateImage(enabledElement)\n\t\t\t}\n\t\t})\n\t}\n\n\trenderToolData(evt) {\n\t\tconst eventData = evt.detail\n\t\tconst element = eventData.element\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\t\tif (!toolData || !toolData.data || !toolData.data.length) return\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\t\ttoolData.data.forEach(data => {\n\t\t\tif (data.visible === false) return\n\t\t\tif (!data.point) return\n\t\t\t_drawCrosshairs(data, context, element)\n\t\t})\n\t}\n\n\t// Universal Event Handlers (Touch, Mouse)\n\tonStart(evt) {\n\t\tthis.updatePoint(evt)\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\n\t\tconst consumeEvent = true\n\t\treturn consumeEvent\n\t}\n\tonDrag(evt) {\n\t\tthis.updatePoint(evt)\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\t}\n\tonEnd(evt) {\n\t\tstore.state.enabledElements.forEach(enabledElement => {\n\t\t\tclearToolState(enabledElement, this.name)\n\t\t\tupdateImage(enabledElement)\n\t\t})\n\t}\n}\n\n/**\n *\n *\n * @param {*} data\n * @param {*} context\n * @param {*} element\n */\nconst _drawCrosshairs = function(data, context, element) {\n\tconst color = toolColors.getActiveColor()\n\tconst point = pixelToCanvas(element, data.point)\n\tconst distance = 15\n\tconst top = {\n\t\tx: point.x,\n\t\ty: point.y - distance,\n\t}\n\tconst right = {\n\t\tx: point.x + distance,\n\t\ty: point.y,\n\t}\n\tconst bottom = {\n\t\tx: point.x,\n\t\ty: point.y + distance,\n\t}\n\tconst left = {\n\t\tx: point.x - distance,\n\t\ty: point.y,\n\t}\n\tdrawLine(context, element, top, bottom, { color }, 'canvas')\n\tdrawLine(context, element, left, right, { color }, 'canvas')\n}\n\n/**\n *\n *\n * @param {*} evt\n * @returns\n */\nconst _updatePoint = function(evt) {\n\tconst eventData = evt.detail\n\tevt.stopImmediatePropagation()\n\tconst sourceElement = evt.currentTarget\n\tconst sourceEnabledElement = getEnabledElement(sourceElement)\n\tconst sourceImageId = sourceEnabledElement.image.imageId\n\tconst sourceImagePlane = metaData.get('imagePlaneModule', sourceImageId)\n\tif (\n\t\t!sourceImagePlane ||\n\t\t!sourceImagePlane.rowCosines ||\n\t\t!sourceImagePlane.columnCosines ||\n\t\t!sourceImagePlane.imagePositionPatient ||\n\t\t!sourceImagePlane.frameOfReferenceUID\n\t)\n\t\treturn\n\n\tconst sourceImagePoint = eventData.currentPoints.image\n\tconst sourcePatientPoint = imagePointToPatientPoint(sourceImagePoint, sourceImagePlane)\n\n\tstore.state.enabledElements.forEach(async targetElement => {\n\t\tconst stackToolDataSource = getToolState(targetElement, 'stack')\n\t\tconst isMissingStackData = !stackToolDataSource || !stackToolDataSource.data || !stackToolDataSource.data.length\n\t\tif (isMissingStackData) return\n\t\tconst seriesStack = stackToolDataSource.data[0]\n\n\t\t// Clear\n\t\tclearToolState(targetElement, this.name)\n\n\t\t// Update\n\t\tconst bestImageIdIndex = _findBestImageIdIndex(\n\t\t\tseriesStack,\n\t\t\tsourcePatientPoint,\n\t\t\tsourceImagePlane.frameOfReferenceUID,\n\t\t\tsourceImageId\n\t\t)\n\t\tif (bestImageIdIndex !== null) {\n\t\t\ttry {\n\t\t\t\tconst imageId = seriesStack.imageIds[bestImageIdIndex]\n\t\t\t\tconst targetTool = store.state.tools.find(tool => tool.element === targetElement && tool.name === this.name)\n\n\t\t\t\tif (targetTool) {\n\t\t\t\t\ttargetTool.syncedId = imageId\n\t\t\t\t}\n\t\t\t\tscrollToIndex(targetElement, bestImageIdIndex)\n\n\t\t\t\t// New ToolState w/ bestImageId\n\t\t\t\tconst targetMeta = metaData.get('imagePlaneModule', imageId)\n\t\t\t\tif (!targetMeta || !targetMeta.rowCosines || !targetMeta.columnCosines || !targetMeta.imagePositionPatient)\n\t\t\t\t\treturn\n\n\t\t\t\tconst crossPoint = projectPatientPointToImagePlane(sourcePatientPoint, targetMeta)\n\t\t\t\tconst toolData = getToolState(targetElement, this.name)\n\t\t\t\tif (!toolData || !toolData.data || !toolData.data.length) {\n\t\t\t\t\taddToolState(targetElement, this.name, {\n\t\t\t\t\t\tpoint: crossPoint,\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\ttoolData.data[0].point = crossPoint\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tconst errorLoadingHandler = loadHandlerManager.getErrorLoadingHandler()\n\t\t\t\tconst imageId = seriesStack.imageIds[bestImageIdIndex]\n\t\t\t\tif (errorLoadingHandler) errorLoadingHandler(targetElement, imageId, err)\n\t\t\t}\n\t\t}\n\n\t\t// Force redraw\n\t\tupdateImage(targetElement)\n\t})\n}\n\nconst _clearPointsIfNotSynced = function() {\n\tconst imageId = getEnabledElement(this.element).image.imageId\n\n\tif (!imageId) return // No image\n\tif (!this.syncedId) return // No syncedId\n\tif (imageId === this.syncedId) return // SyncedId matches :+1:\n\n\tstore.state.enabledElements.forEach(enabledElement => {\n\t\tclearToolState(enabledElement, this.name)\n\t\tupdateImage(enabledElement)\n\t})\n}\n\nconst _findBestImageIdIndex = function(seriesStack, sourcePatientPoint, sourceFrameOfReference, sourceImageId) {\n\tlet newImageIdIndex = null\n\tlet minDistance = Number.MAX_VALUE\n\tfor (let index = 0; index < seriesStack.imageIds.length; index++) {\n\t\tconst imageId = seriesStack.imageIds[index]\n\t\t// if this is the source image, use this index\n\t\tif (imageId === sourceImageId) {\n\t\t\tnewImageIdIndex = index\n\t\t\tbreak\n\t\t}\n\t\tconst targetMeta = metaData.get('imagePlaneModule', imageId)\n\t\tif (\n\t\t\t!targetMeta ||\n\t\t\t!targetMeta.imagePositionPatient ||\n\t\t\t!targetMeta.rowCosines ||\n\t\t\t!targetMeta.columnCosines ||\n\t\t\t!targetMeta.sliceThickness\n\t\t)\n\t\t\tcontinue\n\t\t// Verify image is from same study as source image\n\t\tif (targetMeta.frameOfReferenceUID !== sourceFrameOfReference) continue\n\t\t// Verify image is not a localizer image [ch4638]\n\t\tif (isLocalizerImage(seriesStack.imageIds, imageId, targetMeta)) continue\n\t\tconst imagePosition = convertToVector3(targetMeta.imagePositionPatient)\n\t\tconst row = convertToVector3(targetMeta.rowCosines)\n\t\tconst column = convertToVector3(targetMeta.columnCosines)\n\t\t// A vector that is perpendicular to both `column` and `row` and thus 'normal'\n\t\tconst normal = column.clone().cross(row.clone())\n\t\t// Distance from image's plane to normal's origin\n\t\tconst targetPlanePosition = normal.clone().dot(imagePosition)\n\t\t// Distance from a same-oriented plane containing the source point to normal's origin\n\t\tconst sourcePointPlanePosition = normal.clone().dot(sourcePatientPoint)\n\t\t// Distance between derived target and source planes\n\t\tconst distance = Math.abs(targetPlanePosition - sourcePointPlanePosition)\n\t\tconst tolerance = targetMeta.sliceThickness * 2\n\t\t// Do not scroll to an image that is more than double the slice thickness away\n\t\tif (distance > tolerance) continue\n\t\tif (distance < minDistance) {\n\t\t\tminDistance = distance\n\t\t\tnewImageIdIndex = index\n\t\t}\n\t}\n\n\treturn newImageIdIndex\n}\n","/* eslint-disable curly, capitalized-comments, newline-before-return, newline-after-var, object-property-newline */\nimport { updateImage, pixelToCanvas } from 'cornerstone-core/dist/cornerstone.js'\nimport { point } from 'cornerstone-math/dist/cornerstoneMath.js'\nimport {\n\taddToolState,\n\tclearToolState,\n\tgetToolState,\n\timport as csTools,\n\ttoolColors,\n\ttoolStyle,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport moveHandle from '@/cornerstone/manipulators/moveHandle'\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport triggerDoneModifying from './util/triggerDoneModifying'\nimport { handleLengthIsValid } from '@/cornerstone/tools/util/handles'\n\nconst BaseAnnotationTool = csTools('base/BaseAnnotationTool')\n\n// Drawing\nconst draw = csTools('drawing/draw')\nconst drawCircle = csTools('drawing/drawCircle')\nconst drawHandles = csTools('drawing/drawHandles')\nconst drawJoinedLines = csTools('drawing/drawJoinedLines')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\nconst getNewContext = csTools('drawing/getNewContext')\n\n// Util\nconst lineSegDistance = csTools('util/lineSegDistance')\nconst moveAnnotation = csTools('manipulators/moveAnnotation')\n\n/**\n * @export @public @class\n * @name AstHipDysplasia\n * @classdesc\n * @extends BaseAnnotationTool\n */\nexport default class AstHipDysplasia extends BaseAnnotationTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstHipDysplasia',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tprecisionHandlesEnabled: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t\tdrawHandlesOnHover: false,\n\t\t\t\tdefaultAngle: 105,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\n\t\tsuper(initialConfiguration)\n\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\n\t\tthis.disabledCallback = this._clearIncompleteToolData.bind(this)\n\t\tthis.passiveCallback = this._clearIncompleteToolData.bind(this)\n\t\tthis.enabledCallback = this._clearIncompleteToolData.bind(this)\n\t}\n\n\t// No stats to cache when moving, but CS complains otherwise\n\tupdateCachedStats() {}\n\n\t/**\n\t * Create the measurement data for this tool with the end handle activated\n\t *\n\t * @param {*} eventData\n\t * @returns\n\t */\n\tcreateNewMeasurement({ currentPoints, element }) {\n\t\tconst { x, y } = currentPoints.image\n\t\treturn {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tinvalidated: true,\n\t\t\tcolor: undefined,\n\t\t\thandles: [\n\t\t\t\t{\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: false,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: true,\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t}\n\n\taddNewMeasurement(evt, interactionType = 'mouse') {\n\t\tconst eventData = evt.detail\n\t\tconst { element } = eventData\n\t\tconst isMouse = interactionType === 'mouse'\n\t\tconst toolData = getToolState(element, this.name)\n\t\tconst isExistingInstance = toolData && toolData.data && toolData.data.length\n\t\tconst isDrawingSecondCircle = isExistingInstance && toolData.data[0].handles.length === 2\n\t\tlet data\n\n\t\tif (isExistingInstance) {\n\t\t\tdata = toolData.data[0]\n\t\t} else {\n\t\t\tdata = this.createNewMeasurement(eventData)\n\t\t\taddToolState(element, this.name, data)\n\t\t}\n\t\tif (isDrawingSecondCircle) {\n\t\t\tdata.handles = data.handles.concat(this.createNewMeasurement(eventData).handles)\n\t\t}\n\t\tif (!isExistingInstance || isDrawingSecondCircle)\n\t\t\tthis._addCircleHandles(eventData, data, isMouse, isDrawingSecondCircle, interactionType)\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} element\n\t * @param {*} data\n\t * @param {*} coords\n\t * @returns\n\t */\n\tpointNearTool(element, data, coords) {\n\t\tconst distance = 25 // isMouse ? 15 : 25\n\t\tif (pointOnCircle(data.handles[1], data.handles[0])) return true\n\t\tif (pointOnCircle(data.handles[3], data.handles[2])) return true\n\t\tif (pointOnLine(data.handles[4], data.handles[1])) return true\n\t\tif (pointOnLine(data.handles[1], data.handles[3])) return true\n\t\tif (pointOnLine(data.handles[3], data.handles[5])) return true\n\t\treturn false\n\n\t\tfunction pointOnCircle(centerPoint, outerPoint) {\n\t\t\tif (!centerPoint || !outerPoint) return false\n\t\t\tcenterPoint = pixelToCanvas(element, centerPoint)\n\t\t\touterPoint = pixelToCanvas(element, outerPoint)\n\t\t\tconst radius = point.distance(centerPoint, outerPoint)\n\t\t\tconst minDistance = radius - distance / 2\n\t\t\tconst maxDistance = radius + distance / 2\n\t\t\tconst pointDistance = point.distance(centerPoint, coords)\n\t\t\treturn pointDistance > minDistance && pointDistance < maxDistance\n\t\t}\n\t\tfunction pointOnLine(start, end) {\n\t\t\tif (!start || !end) return false\n\t\t\treturn lineSegDistance(element, start, end, coords) < distance\n\t\t}\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tmoveHandle(evt.detail, this.name, toolData, handle, this.options, interactionType)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\t// Custom selected callback for modified notification\n\ttoolSelectedCallback(evt, annotation, interactionType = 'mouse') {\n\t\tmoveAnnotation(evt, this, annotation, interactionType)\n\n\t\t// wait 180ms for mouseup/touchend, indicating a click rather than a drag\n\t\tconst UP_EVENT = interactionType === 'mouse' ? 'mouseup' : 'touchend'\n\n\t\t// Notify once we're done moving the tool, regardless of click vs drag\n\t\tconst changedEvent = e => {\n\t\t\tconst { element, image } = evt.detail\n\t\t\ttriggerDoneModifying(this.name, element, image)\n\t\t\tevt.detail.element.removeEventListener(UP_EVENT, changedEvent)\n\t\t}\n\t\tevt.detail.element.addEventListener(UP_EVENT, changedEvent)\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} evt\n\t * @returns\n\t */\n\trenderToolData(evt) {\n\t\tconst eventData = evt.detail\n\t\tconst { element, canvasContext } = eventData\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\t\tif (!toolData || !toolData.data || !toolData.data.length) return\n\n\t\tconst context = getNewContext(canvasContext.canvas)\n\t\tconst data = toolData.data[0] // only ever one instance of this tool\n\n\t\tif (data.visible === false) return\n\n\t\tdraw(context, context => {\n\t\t\tif (this.configuration.shadow) {\n\t\t\t\tcontext.shadowColor = this.configuration.shadowColor\n\t\t\t\tcontext.shadowOffsetX = this.configuration.shadowOffsetX\n\t\t\t\tcontext.shadowOffsetY = this.configuration.shadowOffsetY\n\t\t\t}\n\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\tconst haveLeftCircle = data.handles.length >= 2\n\t\t\tconst haveRightCircle = data.handles.length >= 4\n\t\t\tconst haveUpperRimHandles = data.handles.length >= 6\n\t\t\tconst haveTextBoxes = data.handles.length === 8\n\n\t\t\tif (haveLeftCircle) {\n\t\t\t\tconst outer = pixelToCanvas(element, data.handles[0])\n\t\t\t\tconst inner = pixelToCanvas(element, data.handles[1])\n\t\t\t\tconst leftRadius = point.distance(outer, inner)\n\t\t\t\tdrawCircle(context, element, data.handles[1], leftRadius, { color })\n\t\t\t}\n\t\t\tif (haveRightCircle) {\n\t\t\t\tconst outer = pixelToCanvas(element, data.handles[2])\n\t\t\t\tconst inner = pixelToCanvas(element, data.handles[3])\n\t\t\t\tconst rightRadius = point.distance(outer, inner)\n\t\t\t\tdrawCircle(context, element, data.handles[3], rightRadius, { color })\n\t\t\t}\n\t\t\tif (haveUpperRimHandles) {\n\t\t\t\tconst start = data.handles[4]\n\t\t\t\tconst points = [data.handles[1], data.handles[3], data.handles[5]]\n\t\t\t\tdrawJoinedLines(context, element, start, points, { color })\n\t\t\t}\n\t\t\tif (this.configuration.drawHandlesOnHover && data.active !== true) {\n\t\t\t\tdrawHandles(context, eventData, data.handles, {\n\t\t\t\t\tcolor,\n\t\t\t\t\tdrawHandlesIfActive: true,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tdrawHandles(context, eventData, data.handles, { color })\n\t\t\t}\n\t\t\tif (haveTextBoxes) drawTextBoxes()\n\t\t})\n\n\t\tfunction drawTextBoxes() {\n\t\t\tconst textBoxes = data.handles.slice(6)\n\t\t\ttextBoxes.forEach((textBox, i) => {\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tlet textBoxOffset = 0\n\t\t\t\tconst correspondingHandle = i === 0 ? data.handles[4] : data.handles[5]\n\t\t\t\tconst angle =\n\t\t\t\t\ti === 0\n\t\t\t\t\t\t? getAngleFromPoints(correspondingHandle, data.handles[1], data.handles[3])\n\t\t\t\t\t\t: getAngleFromPoints(data.handles[1], data.handles[3], correspondingHandle)\n\t\t\t\tif (!textBox.hasMoved) {\n\t\t\t\t\ttextBoxOffset = (correspondingHandle.radius || 6) + 6\n\t\t\t\t\ttextBox.x = correspondingHandle.x\n\t\t\t\t\ttextBox.y = correspondingHandle.y\n\t\t\t\t}\n\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\tcontext,\n\t\t\t\t\telement,\n\t\t\t\t\ttextBox,\n\t\t\t\t\t[`${angle}°`],\n\t\t\t\t\t[correspondingHandle],\n\t\t\t\t\t() => [correspondingHandle],\n\t\t\t\t\tcolor,\n\t\t\t\t\ttoolStyle.getToolWidth(),\n\t\t\t\t\ttextBoxOffset,\n\t\t\t\t\ttrue\n\t\t\t\t)\n\t\t\t})\n\t\t}\n\n\t\tfunction getAngleFromPoints(a, b, c) {\n\t\t\tconst ab = Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2))\n\t\t\tconst bc = Math.sqrt(Math.pow(b.x - c.x, 2) + Math.pow(b.y - c.y, 2))\n\t\t\tconst ac = Math.sqrt(Math.pow(c.x - a.x, 2) + Math.pow(c.y - a.y, 2))\n\t\t\tconst angle = Math.abs(Math.acos((bc * bc + ab * ab - ac * ac) / (2 * bc * ab)))\n\t\t\treturn Math.round((angle * 180) / Math.PI)\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * @private @method\n\t * @param {*} eventData\n\t * @param {*} data\n\t * @param {*} isMouse\n\t * @param {*} isDrawingSecondCircle\n\t * @memberof AstHipDysplasia\n\t */\n\t_addCircleHandles(eventData, data, isMouse, isDrawingSecondCircle, interactionType) {\n\t\tconst doneMovingCallback = () => {\n\t\t\tdata.active = !isDrawingSecondCircle // show active color until both circles are done\n\t\t\tdata.invalidated = true\n\n\t\t\t// Prevent single click events from creating tiny handles\n\t\t\tif (!handleLengthIsValid(data.handles[0], data.handles[1])) {\n\t\t\t\tclearToolState(this.element, this.name)\n\t\t\t}\n\n\t\t\tif (isDrawingSecondCircle) {\n\t\t\t\t// Prevent single click events from creating tiny handles\n\t\t\t\tif (!handleLengthIsValid(data.handles[2], data.handles[3])) {\n\t\t\t\t\tdata.handles.splice(2)\n\t\t\t\t} else {\n\t\t\t\t\t_addUpperRimHandles(data, this.configuration.defaultAngle)\n\t\t\t\t\t_addTextBoxes(data)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmoveNewHandle(\n\t\t\teventData,\n\t\t\tthis.name,\n\t\t\tdata,\n\t\t\tdata.handles[data.handles.length - 1],\n\t\t\tthis.options,\n\t\t\tinteractionType,\n\t\t\tdoneMovingCallback\n\t\t)\n\t}\n\n\t/**\n\t * Clears the tool's state if it is not a completed annotation. Usually\n\t * fired when exiting the tool's `active` mode.\n\t *\n\t * @memberof AstHipDysplasia\n\t */\n\t_clearIncompleteToolData(element, options) {\n\t\tconst toolData = getToolState(this.element, this.name)\n\t\tconst isToolInstance = toolData && toolData.data && toolData.data.length\n\t\tconst isIncompleteDrawing = isToolInstance && toolData.data[0].handles.length < 8\n\t\tif (isIncompleteDrawing) {\n\t\t\tclearToolState(this.element, this.name)\n\t\t\tupdateImage(this.element)\n\t\t}\n\t}\n}\n\n/**\n *\n *\n * @param {Object} data - Tool data\n * @param {Number} defaultAngle\n */\nconst _addUpperRimHandles = function(data, defaultAngle) {\n\t// create points that are 2*radius away from each circle's center and rotate to 105 degrees\n\tlet leftOuter = data.handles[0]\n\tlet leftCenter = data.handles[1]\n\tlet rightOuter = data.handles[2]\n\tlet rightCenter = data.handles[3]\n\tconst rightDrawnFirst = data.handles[3].x < data.handles[1].x\n\tif (rightDrawnFirst) {\n\t\tleftOuter = data.handles[2]\n\t\tleftCenter = data.handles[3]\n\t\trightOuter = data.handles[0]\n\t\trightCenter = data.handles[1]\n\t}\n\tconst leftRadius = point.distance(leftOuter, leftCenter)\n\tconst rightRadius = point.distance(rightOuter, rightCenter)\n\tconst circleDistance = point.distance(leftCenter, rightCenter)\n\tconst leftDistancePercent = Math.abs((leftRadius * 2) / circleDistance)\n\tconst rightDistancePercent = Math.abs((rightRadius * 2) / circleDistance)\n\tconst leftIntersection = {\n\t\tx: leftDistancePercent * rightCenter.x + (1 - leftDistancePercent) * leftCenter.x,\n\t\ty: leftDistancePercent * rightCenter.y + (1 - leftDistancePercent) * leftCenter.y,\n\t}\n\tconst rightIntersection = {\n\t\tx: (1 - rightDistancePercent) * rightCenter.x + rightDistancePercent * leftCenter.x,\n\t\ty: (1 - rightDistancePercent) * rightCenter.y + rightDistancePercent * leftCenter.y,\n\t}\n\tconst topLeft = _rotatePoint(leftIntersection, leftCenter, defaultAngle * -1)\n\tconst topRight = _rotatePoint(rightIntersection, rightCenter, defaultAngle)\n\tif (rightDrawnFirst) {\n\t\t_addHandle(data, topRight)\n\t\t_addHandle(data, topLeft)\n\t} else {\n\t\t_addHandle(data, topLeft)\n\t\t_addHandle(data, topRight)\n\t}\n}\n\n/**\n *\n *\n * @param {Object} point - { x, y }\n * @param {Object} origin - { x, y }\n * @param {Number} angle\n * @returns\n */\nconst _rotatePoint = function(point, origin, angle) {\n\tangle = (angle * Math.PI) / 180\n\treturn {\n\t\tx: Math.cos(angle) * (point.x - origin.x) - Math.sin(angle) * (point.y - origin.y) + origin.x,\n\t\ty: Math.sin(angle) * (point.x - origin.x) + Math.cos(angle) * (point.y - origin.y) + origin.y,\n\t}\n}\n\n/**\n *\n *\n * @param {Object} data - Tool data to add a new handle to\n * @param {Object} point - {x, y}\n */\nconst _addHandle = function(data, point) {\n\tdata.handles.push({\n\t\tx: point.x,\n\t\ty: point.y,\n\t\thighlight: true,\n\t\tactive: false,\n\t})\n}\n\n/**\n *\n *\n * @param {Object} data - Tool data\n */\nconst _addTextBoxes = function(data) {\n\tconst textBox = {\n\t\tactive: false,\n\t\thasMoved: false,\n\t\tmovesIndependently: true,\n\t\tdrawnIndependently: true,\n\t\tallowedOutsideImage: true,\n\t\thasBoundingBox: true,\n\t}\n\tdata.handles.push(Object.assign({}, textBox))\n\tdata.handles.push(Object.assign({}, textBox))\n}\n","/* eslint-disable curly, capitalized-comments, newline-before-return, newline-after-var, object-property-newline */\nimport { metaData, pixelToCanvas } from 'cornerstone-core/dist/cornerstone.js'\nimport { lineSegment, point } from 'cornerstone-math/dist/cornerstoneMath.js'\nimport {\n\texternal,\n\tgetToolState,\n\taddToolState,\n\timport as csTools,\n\ttoolColors,\n\ttoolStyle,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\n\nimport toolSelectedCallback from './_shared/toolSelectedCallback.js'\n\n// Manipulators\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport moveHandle from '@/cornerstone/manipulators/moveHandle'\n\n// Handle helpers\nimport { initHandle } from './util/handles'\nimport getImagePixelSpacing from './util/getImagePixelSpacing'\nimport { formatNumber } from '@utils/numberUtils'\nimport round from 'lodash/round'\n\nconst BaseAnnotationTool = csTools('base/BaseAnnotationTool')\n\n// Drawing\nconst draw = csTools('drawing/draw')\nconst drawHandles = csTools('drawing/drawHandles')\nconst drawLink = csTools('drawing/drawLink')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\nconst drawTextBox = csTools('drawing/drawTextBox')\nconst getNewContext = csTools('drawing/getNewContext')\n\n// Util\nconst lineSegDistance = csTools('util/lineSegDistance')\n\n/**\n * @export @public @class\n * @name AstLengthAngleTool\n * @classdesc Tool for measuring distances.\n * @extends BaseAnnotationTool\n */\nexport default class AstLengthAngle extends BaseAnnotationTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstLengthAngle',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tprecisionHandlesEnabled: true,\n\t\t\t\tshowAngles: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t\tdrawHandlesOnHover: false,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\t\tsuper(initialConfiguration)\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\t}\n\n\t// custom toolSelectedCallback for opening annotation dialog\n\ttoolSelectedCallback = toolSelectedCallback.bind(this)\n\n\taddNewMeasurement(evt, interactionType) {\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\n\t\tconst eventData = evt.detail\n\t\tconst element = evt.detail.element\n\t\tconst measurementData = this.createNewMeasurement(eventData)\n\n\t\tif (!measurementData) return\n\n\t\t// Associate this data with this imageId so we can render it and manipulate it\n\t\taddToolState(element, this.name, measurementData)\n\n\t\texternal.cornerstone.updateImage(element)\n\n\t\tconst doneMovingCallback = () => {\n\t\t\tmeasurementData.active = false\n\t\t\tthis.preventNewMeasurement = false\n\t\t\texternal.cornerstone.updateImage(element)\n\t\t}\n\n\t\t// Step 1, create start and end handle\n\t\tinitHandle(measurementData.handles.start, null, interactionType, this.options)\n\t\tmoveNewHandle(\n\t\t\teventData,\n\t\t\tthis.name,\n\t\t\tmeasurementData,\n\t\t\tmeasurementData.handles.end,\n\t\t\tthis.options,\n\t\t\tinteractionType,\n\t\t\tdoneMovingCallback\n\t\t)\n\t}\n\n\t/**\n\t * Create the measurement data for this tool with the end handle activated\n\t *\n\t * @param {*} eventData\n\t * @returns\n\t */\n\tcreateNewMeasurement(eventData) {\n\t\tconst goodEventData = eventData && eventData.currentPoints && eventData.currentPoints.image\n\t\tif (!goodEventData) return\n\n\t\tconst { x, y } = eventData.currentPoints.image\n\t\tconst measurementData = {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tinvalidated: true,\n\t\t\tcolor: undefined,\n\t\t\thandles: {\n\t\t\t\tstart: {\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: false,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: true,\n\t\t\t\t},\n\t\t\t\ttextBox: {\n\t\t\t\t\tactive: false,\n\t\t\t\t\thasMoved: false,\n\t\t\t\t\tmovesIndependently: false,\n\t\t\t\t\tdrawnIndependently: true,\n\t\t\t\t\tallowedOutsideImage: true,\n\t\t\t\t\thasBoundingBox: true,\n\t\t\t\t},\n\t\t\t\ttextBoxes: [],\n\t\t\t},\n\t\t}\n\t\treturn measurementData\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} element\n\t * @param {*} data\n\t * @param {*} coords\n\t * @returns\n\t */\n\tpointNearTool(element, data, coords, isMouse = true) {\n\t\tconst hasStartAndEndHandles = data && data.handles && data.handles.start && data.handles.end\n\t\tconst validParameters = hasStartAndEndHandles\n\t\tconst distance = isMouse ? 15 : 25\n\n\t\tif (!validParameters) {\n\t\t\treturn false\n\t\t}\n\n\t\tif (data.visible === false) {\n\t\t\treturn false\n\t\t}\n\n\t\treturn lineSegDistance(element, data.handles.start, data.handles.end, coords) < distance\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tmoveHandle(evt.detail, this.name, toolData, handle, this.options, interactionType)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\tupdateCachedStats() {}\n\n\t/**\n\t *\n\t *\n\t * @param {*} evt\n\t * @returns\n\t */\n\trenderToolData(evt) {\n\t\tconst eventData = evt.detail\n\t\tconst { image, element } = eventData\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\t\tif (!toolData || !toolData.data || !toolData.data.length) return\n\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\n\t\tconst lineWidth = toolStyle.getToolWidth()\n\t\tconst imagePlane = metaData.get('imagePlaneModule', image.imageId)\n\t\tconst { rowPixelSpacing, columnPixelSpacing, isPixelSpacingDefined } = getImagePixelSpacing(image)\n\n\t\t// Any lines or angles for lines with length less than or equal to\n\t\t// this tolerance value won't get rendered\n\t\tconst lineLengthTolerance = 0\n\t\ttoolData.data.forEach((line, i) => {\n\t\t\tif (line.visible === false) return\n\t\t\tcontext.save()\n\n\t\t\tdraw(context, context => {\n\t\t\t\tif (this.configuration.shadow) {\n\t\t\t\t\tcontext.shadowColor = this.configuration.shadowColor\n\t\t\t\t\tcontext.shadowOffsetX = this.configuration.shadowOffsetX\n\t\t\t\t\tcontext.shadowOffsetY = this.configuration.shadowOffsetY\n\t\t\t\t}\n\t\t\t\tconst color = toolColors.getColorIfActive(line)\n\n\t\t\t\tconst startHandle = line.handles['start']\n\t\t\t\tconst endHandle = line.handles['end']\n\t\t\t\tconst textBoxHandle = line.handles['textBox']\n\t\t\t\tconst handleStartCanvas = pixelToCanvas(element, startHandle)\n\t\t\t\tconst handleEndCanvas = pixelToCanvas(element, endHandle)\n\n\t\t\t\t// Don't render 0-length measurement lines\n\t\t\t\tif (point.distance(startHandle, endHandle) <= lineLengthTolerance) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tstartHandle.radius = startHandle.radius || 6\n\t\t\t\tendHandle.radius = endHandle.radius || 6\n\n\t\t\t\t// Draw the measurement line\n\t\t\t\tcontext.beginPath()\n\t\t\t\tcontext.strokeStyle = color\n\t\t\t\tcontext.lineWidth = lineWidth\n\t\t\t\tcontext.moveTo(handleStartCanvas.x, handleStartCanvas.y)\n\t\t\t\tcontext.lineTo(handleEndCanvas.x, handleEndCanvas.y)\n\t\t\t\tcontext.stroke()\n\n\t\t\t\t// Draw the handles\n\t\t\t\tconst handleOptions = {\n\t\t\t\t\tcolor,\n\t\t\t\t\tdrawHandlesIfActive: this.configuration.drawHandlesOnHover,\n\t\t\t\t}\n\t\t\t\tdrawHandles(context, eventData, [startHandle, endHandle], handleOptions)\n\n\t\t\t\t// Calculate length\n\t\t\t\tif (!line.length || line.invalidated) {\n\t\t\t\t\tconst dx = (endHandle.x - startHandle.x) * columnPixelSpacing\n\t\t\t\t\tconst dy = (endHandle.y - startHandle.y) * rowPixelSpacing\n\t\t\t\t\tconst length = Math.sqrt(dx * dx + dy * dy)\n\t\t\t\t\tline.length = length\n\t\t\t\t}\n\n\t\t\t\t// Draw length textbox\n\t\t\t\tlet textBoxOffset = 0\n\t\t\t\tif (!textBoxHandle.hasMoved) {\n\t\t\t\t\tconst rightmostHandle =\n\t\t\t\t\t\tstartHandle.x + startHandle.radius > endHandle.x + endHandle.radius ? startHandle : endHandle\n\t\t\t\t\ttextBoxHandle.x = rightmostHandle.x\n\t\t\t\t\ttextBoxHandle.y = rightmostHandle.y\n\t\t\t\t\ttextBoxOffset = (rightmostHandle.radius || 6) + 6\n\t\t\t\t}\n\t\t\t\tconst lengthText = getLengthText(line, isPixelSpacingDefined)\n\t\t\t\tif (!textBoxHandle.hidden) {\n\t\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\ttextBoxHandle,\n\t\t\t\t\t\tlengthText,\n\t\t\t\t\t\t[startHandle, endHandle, textBoxHandle],\n\t\t\t\t\t\ttextBoxAnchorPoints,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tlineWidth,\n\t\t\t\t\t\ttextBoxOffset,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\tif (!this.options.showAngles) return\n\n\t\t\t\t// Remove any angle textboxes related to destroyed lines\n\t\t\t\tline.handles['textBoxes'] = line.handles['textBoxes'].filter(isNotDestroyedAngle)\n\n\t\t\t\tfunction isNotDestroyedAngle(handle) {\n\t\t\t\t\tif (!('lineId' in handle)) return true\n\t\t\t\t\tconst existingLineIds = toolData.data.map(line => line.uuid)\n\t\t\t\t\treturn existingLineIds.includes(handle.lineId)\n\t\t\t\t}\n\n\t\t\t\t// Add/update angle textbox for every other line\n\t\t\t\tfor (let j = i + 1; j < toolData.data.length; j++) {\n\t\t\t\t\tconst otherLine = toolData.data[j]\n\n\t\t\t\t\t// Don't render angle if the other line doesn't meet length tolerance\n\t\t\t\t\tconst startHandle = otherLine.handles['start']\n\t\t\t\t\tconst endHandle = otherLine.handles['end']\n\t\t\t\t\tif (point.distance(startHandle, endHandle) <= lineLengthTolerance) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tconst intersection = getIntersection(line, otherLine)\n\t\t\t\t\tconst angleTextBoxes = line.handles['textBoxes'].filter(handle => handle.lineId === otherLine.uuid)\n\n\t\t\t\t\t// Create angle on otherLine\n\t\t\t\t\tif (!angleTextBoxes.length) {\n\t\t\t\t\t\tline.handles['textBoxes'].push(createAngleTextBox(otherLine.uuid))\n\t\t\t\t\t}\n\t\t\t\t\t// Create angle on current line\n\t\t\t\t\tif (intersection && angleTextBoxes.length === 1) {\n\t\t\t\t\t\tconst isObtuseAngle = true\n\t\t\t\t\t\tline.handles['textBoxes'].push(createAngleTextBox(otherLine.uuid, isObtuseAngle))\n\t\t\t\t\t}\n\t\t\t\t\t// Remove angle on currentLine\n\t\t\t\t\tif (!intersection && angleTextBoxes.length === 2) {\n\t\t\t\t\t\tconst indexToRemove = line.handles['textBoxes'].findIndex(\n\t\t\t\t\t\t\thandle => handle.lineId === otherLine.uuid && handle.isObtuseAngle\n\t\t\t\t\t\t)\n\t\t\t\t\t\tline.handles['textBoxes'].splice(indexToRemove, 1)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Draw angle textboxes\n\t\t\t\tconst angleTextBoxes = line.handles['textBoxes'].filter(handle => 'lineId' in handle)\n\t\t\t\tangleTextBoxes.forEach(textBox => {\n\t\t\t\t\tconst otherLine = toolData.data.find(line => line.uuid === textBox.lineId)\n\t\t\t\t\tif (line.invalidated || !textBox.angle) {\n\t\t\t\t\t\ttextBox.angle = getAngle(line, otherLine)\n\t\t\t\t\t\tif (textBox.isObtuseAngle) textBox.angle = 180 - textBox.angle\n\t\t\t\t\t}\n\t\t\t\t\tconst intersection = getIntersection(line, otherLine)\n\t\t\t\t\tconst linkAnchors = intersection ? [intersection] : getClosestHandlePair(line, otherLine)\n\t\t\t\t\tif (!textBox.hasMoved) {\n\t\t\t\t\t\tlet coords\n\t\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\t\tconst { acute, obtuse } = getAcuteObtuseCoords(line, otherLine, intersection)\n\t\t\t\t\t\t\tcoords = textBox.isObtuseAngle ? obtuse : acute\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcoords = getMidpoint(...linkAnchors)\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttextBox.x = coords.x\n\t\t\t\t\t\ttextBox.y = coords.y\n\t\t\t\t\t}\n\t\t\t\t\tconst textCoords = pixelToCanvas(element, textBox)\n\t\t\t\t\tconst textBoxColor = toolColors.getColorIfActive(line.active ? line : otherLine)\n\t\t\t\t\tif (!textBox.hidden) {\n\t\t\t\t\t\ttextBox.boundingBox = drawTextBox(\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t`${formatNumber(textBox.angle)}°`,\n\t\t\t\t\t\t\ttextCoords.x,\n\t\t\t\t\t\t\ttextCoords.y,\n\t\t\t\t\t\t\ttextBoxColor,\n\t\t\t\t\t\t\t{ centering: { x: true, y: true } },\n\t\t\t\t\t\t\ttextBox.hidden\n\t\t\t\t\t\t)\n\t\t\t\t\t\tlinkAnchors.forEach(anchor => {\n\t\t\t\t\t\t\tconst anchorCanvas = pixelToCanvas(element, anchor)\n\t\t\t\t\t\t\tdrawLink([anchorCanvas], textCoords, textBox.boundingBox, context, textBoxColor, lineWidth)\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t\tcontext.restore()\n\t\t})\n\t}\n}\n\n// START PRIVATE\n\nfunction createAngleTextBox(lineId, isObtuseAngle = false) {\n\treturn {\n\t\tlineId,\n\t\tisObtuseAngle,\n\t\tangle: null,\n\t\tactive: false,\n\t\thasMoved: false,\n\t\tmovesIndependently: false,\n\t\tdrawnIndependently: true,\n\t\tallowedOutsideImage: true,\n\t\thasBoundingBox: true,\n\t}\n}\n\nfunction getAngle(lineA, lineB) {\n\tconst slopeA = getSlope(lineA)\n\tconst slopeB = getSlope(lineB)\n\tlet angle = 0\n\tif ([-1, 0].includes(slopeA * slopeB)) {\n\t\tangle = Math.PI / 2\n\t} else {\n\t\tangle = Math.abs(Math.atan((slopeA - slopeB) / (1 + slopeA * slopeB)))\n\t}\n\tif (Number.isNaN(angle)) return\n\treturn round(angle * (180 / Math.PI), 1)\n}\n\nfunction getSlope(line) {\n\tconst startHandle = line.handles['start']\n\tconst endHandle = line.handles['end']\n\tif (startHandle.x - endHandle.x === 0) return Number.MAX_SAFE_INTEGER\n\treturn (startHandle.y - endHandle.y) / (startHandle.x - endHandle.x)\n}\n\nfunction getIntersection(lineA, lineB) {\n\tfunction invalidLineHandles(line) {\n\t\treturn !line || !line.handles || !line.handles.start || !line.handles.end\n\t}\n\tif (invalidLineHandles(lineA) || invalidLineHandles(lineB)) {\n\t\treturn\n\t}\n\treturn lineSegment.intersectLine(\n\t\t{ start: lineA.handles.start, end: lineA.handles.end },\n\t\t{ start: lineB.handles.start, end: lineB.handles.end }\n\t)\n}\n\nfunction getClosestHandlePair(lineA, lineB) {\n\tconst pointPairs = [\n\t\t[lineA.handles['start'], lineB.handles['start']],\n\t\t[lineA.handles['end'], lineB.handles['start']],\n\t\t[lineA.handles['start'], lineB.handles['end']],\n\t\t[lineA.handles['end'], lineB.handles['end']],\n\t]\n\tlet closestPair = pointPairs[0]\n\tpointPairs.forEach(pointPair => {\n\t\tif (point.distance(...pointPair) < point.distance(...closestPair)) {\n\t\t\tclosestPair = pointPair\n\t\t}\n\t})\n\treturn closestPair\n}\n\nfunction getAcuteObtuseCoords(lineA, lineB, intersection) {\n\tconst [horizontal, vertical] = [lineA, lineB].sort((a, b) => Math.abs(getSlope(a)) - Math.abs(getSlope(b)))\n\tconst [top] = [vertical.handles['start'], vertical.handles['end']].sort((a, b) => a.y - b.y)\n\tconst [horizontalAcute, horizontalObtuse] = [horizontal.handles['start'], horizontal.handles['end']].sort((a, b) => {\n\t\tconst angleA = getAngleFromPoints(intersection, top, a)\n\t\tconst angleB = getAngleFromPoints(intersection, top, b)\n\t\treturn angleA - angleB\n\t})\n\tconst acute = getMidpoint(horizontalAcute, top)\n\tconst obtuse = getMidpoint(horizontalObtuse, top)\n\tlet offset = 40 // space textboxes further apart\n\tacute.y -= offset\n\tobtuse.y -= offset\n\tif (acute.x > obtuse.x) offset *= -1\n\tacute.x -= offset\n\tobtuse.x += offset\n\treturn { acute, obtuse }\n}\n\nfunction getAngleFromPoints(origin, a, b) {\n\tconst radians = Math.atan2(b.y - origin.y, b.x - origin.x) - Math.atan2(a.y - origin.y, a.x - origin.x)\n\tlet degrees = Math.abs((radians * 180) / Math.PI)\n\tif (degrees > 360) degrees -= 360\n\tif (degrees > 180) degrees = 360 - degrees\n\treturn degrees\n}\n\nfunction getMidpoint(pointA, pointB) {\n\treturn {\n\t\tx: (pointA.x + pointB.x) / 2,\n\t\ty: (pointA.y + pointB.y) / 2,\n\t}\n}\n\nfunction getLengthText(data, isPixelSpacingDefined) {\n\tlet suffix = isPixelSpacingDefined ? ' mm' : ' px'\n\treturn `${formatNumber(round(data.length, 2))}${suffix}`\n}\n\nfunction textBoxAnchorPoints(handles) {\n\tconst midpoint = {\n\t\tx: (handles[0].x + handles[1].x) / 2,\n\t\ty: (handles[0].y + handles[1].y) / 2,\n\t}\n\treturn [handles[0], midpoint, handles[1]]\n}\n","import * as cornerstone from 'cornerstone-core/dist/cornerstone.js'\nimport * as cornerstoneTools from 'cornerstone-tools/dist/cornerstoneTools.js'\n\n// Pulling in modules :celebrate:\nconst BaseTool = cornerstoneTools.import('base/BaseTool')\nconst drawTextBox = cornerstoneTools.import('drawing/drawTextBox')\nconst textBoxWidth = cornerstoneTools.import('drawing/textBoxWidth')\nconst getNewContext = cornerstoneTools.import('drawing/getNewContext')\n\nexport default class AstOrientationMarkers extends BaseTool {\n  constructor(configuration = {}) {\n    const defaultConfig = {\n      name: 'AstOrientationMarkers',\n      mixins: ['enabledOrDisabledBinaryTool'],\n    }\n    const initialConfiguration = Object.assign(defaultConfig, configuration)\n\n    super(initialConfiguration)\n\n    this.initialConfiguration = initialConfiguration\n  }\n\n  enabledCallback() {\n    this._forceImageUpdate()\n  }\n\n  disabledCallback() {\n    this._forceImageUpdate()\n  }\n\n  _forceImageUpdate() {\n    const enabledElement = cornerstone.getEnabledElement(this.element)\n    const hasImageToUpdate = enabledElement.image\n\n    if (hasImageToUpdate) {\n      cornerstone.updateImage(this.element, true)\n    }\n  }\n\n  renderToolData(evt) {\n    const eventData = evt.detail\n    const { element, viewport } = eventData\n\n    const markers = getOrientationMarkers(viewport, element)\n\n    if (!markers) {\n      return\n    }\n\n    const coords = getOrientationMarkerPositions(element, markers)\n    const context = getNewContext(eventData.canvasContext.canvas)\n    const color = cornerstoneTools.toolColors.getToolColor()\n\n    const textWidths = {\n      top: textBoxWidth(context, markers.top, 0),\n      left: textBoxWidth(context, markers.left, 0),\n      right: textBoxWidth(context, markers.right, 0),\n      bottom: textBoxWidth(context, markers.bottom, 0),\n    }\n\n    drawTextBox(\n      context,\n      markers.top,\n      coords.top.x - textWidths.top / 2,\n      coords.top.y,\n      color\n    )\n    drawTextBox(\n      context,\n      markers.left,\n      coords.left.x - textWidths.left / 2,\n      coords.left.y,\n      color\n    )\n\n    const config = this.configuration\n\n    if (config && config.drawAllMarkers) {\n      drawTextBox(\n        context,\n        markers.right,\n        coords.right.x - textWidths.right / 2,\n        coords.right.y,\n        color\n      )\n      drawTextBox(\n        context,\n        markers.bottom,\n        coords.bottom.x - textWidths.bottom / 2,\n        coords.bottom.y,\n        color\n      )\n    }\n  }\n}\n\nfunction getOrientationMarkers(viewport, element) {\n  const enabledElement = cornerstone.getEnabledElement(element)\n  const imagePlaneMetaData = cornerstone.metaData.get(\n    'imagePlaneModule',\n    enabledElement.image.imageId\n  )\n\n  if (\n    !imagePlaneMetaData ||\n    !imagePlaneMetaData.rowCosines ||\n    !imagePlaneMetaData.columnCosines\n  ) {\n    return\n  }\n\n  const rowString = cornerstoneTools.orientation.getOrientationString(\n    imagePlaneMetaData.rowCosines\n  )\n  const columnString = cornerstoneTools.orientation.getOrientationString(\n    imagePlaneMetaData.columnCosines\n  )\n\n  const oppositeRowString = cornerstoneTools.orientation.invertOrientationString(\n    rowString\n  )\n  const oppositeColumnString = cornerstoneTools.orientation.invertOrientationString(\n    columnString\n  )\n\n  const rotation = viewport.rotation - (viewport.rotation % 90)\n  const isRotatedClockwise = rotation > 0\n  const steps = Math.abs(rotation) / 90\n  const orientationStrings = [\n    viewport.vflip ? columnString : oppositeColumnString,\n    viewport.hflip ? oppositeRowString : rowString,\n    viewport.vflip ? oppositeColumnString : columnString,\n    viewport.hflip ? rowString : oppositeRowString,\n  ]\n\n  for (let i = 0; i < steps; i++) {\n    if (isRotatedClockwise) {\n      orientationStrings.unshift(orientationStrings.pop())\n    } else {\n      orientationStrings.push(orientationStrings.shift())\n    }\n  }\n\n  return {\n    top: orientationStrings[0],\n    right: orientationStrings[1],\n    bottom: orientationStrings[2],\n    left: orientationStrings[3],\n  }\n}\n\nfunction getOrientationMarkerPositions(element) {\n  const enabledElement = cornerstone.getEnabledElement(element)\n\n  const top = {\n    x: enabledElement.canvas.width / 2,\n    y: 5,\n  }\n  const bottom = {\n    x: enabledElement.canvas.width / 2,\n    y: enabledElement.canvas.height - 27,\n  }\n  const left = {\n    x: 10,\n    y: enabledElement.canvas.height / 2,\n  }\n  const right = {\n    x: enabledElement.canvas.width - 24,\n    y: enabledElement.canvas.height / 2,\n  }\n\n  return {\n    top,\n    bottom,\n    left,\n    right,\n  }\n}\n","/* eslint-disable curly, capitalized-comments, newline-before-return, newline-after-var, object-property-newline */\nimport { updateImage, pixelToCanvas } from 'cornerstone-core/dist/cornerstone.js'\nimport { point } from 'cornerstone-math/dist/cornerstoneMath.js'\nimport {\n\taddToolState,\n\tclearToolState,\n\tgetToolState,\n\timport as csTools,\n\ttoolColors,\n\ttoolStyle,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\n\nimport moveHandle from '@/cornerstone/manipulators/moveHandle'\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport { formatNumber } from '@utils/numberUtils'\nimport round from 'lodash/round'\nimport triggerDoneModifying from './util/triggerDoneModifying'\n\nconst moveAllHandles = csTools('manipulators/moveAllHandles')\n\nconst BaseAnnotationTool = csTools('base/BaseAnnotationTool')\n\n// Drawing\nconst draw = csTools('drawing/draw')\nconst drawCircle = csTools('drawing/drawCircle')\nconst drawHandles = csTools('drawing/drawHandles')\nconst drawLine = csTools('drawing/drawLine')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\nconst getNewContext = csTools('drawing/getNewContext')\n\n/**\n * @export @public @class\n * @name AstPennHip\n * @classdesc\n * @extends BaseAnnotationTool\n */\nexport default class AstPennHip extends BaseAnnotationTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstPennHip',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tprecisionHandlesEnabled: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t\tdrawHandlesOnHover: false,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\n\t\tsuper(initialConfiguration)\n\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\n\t\tthis.disabledCallback = this._clearIncompleteToolData.bind(this)\n\t\tthis.passiveCallback = this._clearIncompleteToolData.bind(this)\n\t\tthis.enabledCallback = this._clearIncompleteToolData.bind(this)\n\t}\n\n\t// No stats to cache when moving, but CS complains otherwise\n\tupdateCachedStats() {}\n\n\t/**\n\t * Create the measurement data for this tool with the end handle activated\n\t *\n\t * @param {*} eventData\n\t * @returns\n\t */\n\tcreateNewMeasurement({ currentPoints }) {\n\t\tconst { x, y } = currentPoints.image\n\t\treturn {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tinvalidated: true,\n\t\t\tcolor: undefined,\n\t\t\thandles: [\n\t\t\t\t{\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: false,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: true,\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {HTMLElement} element\n\t * @param {*} data\n\t * @param {*} coords\n\t * @returns {boolean}\n\t */\n\tpointNearTool(element, data, coords, isMouse = true, returnShape = true) {\n\t\tconst distance = isMouse ? 6 : 12\n\t\tif (pointOnCircle(data.handles[1], data.handles[0])) return returnShape ? 'first' : true\n\t\tif (pointOnCircle(data.handles[3], data.handles[2])) return returnShape ? 'second' : true\n\t\treturn false\n\n\t\tfunction pointOnCircle(centerPoint, outerPoint) {\n\t\t\tif (!centerPoint || !outerPoint) return false\n\t\t\tcenterPoint = pixelToCanvas(element, centerPoint)\n\t\t\touterPoint = pixelToCanvas(element, outerPoint)\n\t\t\tconst radius = point.distance(centerPoint, outerPoint)\n\t\t\tconst minDistance = radius - distance / 2\n\t\t\tconst maxDistance = radius + distance / 2\n\t\t\tconst pointDistance = point.distance(centerPoint, coords)\n\t\t\treturn pointDistance > minDistance && pointDistance < maxDistance\n\t\t}\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tmoveHandle(evt.detail, this.name, toolData, handle, this.options, interactionType)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\taddNewMeasurement(evt, interactionType = 'mouse') {\n\t\tconst eventData = evt.detail\n\t\tconst element = eventData.element\n\t\tconst measurementData = getToolState(element, this.name)\n\n\t\tconst isExistingInstance = measurementData && measurementData.data && measurementData.data.length\n\t\tconst isInstanceUnfinished =\n\t\t\tisExistingInstance && measurementData.data[measurementData.data.length - 1].handles.length < 4\n\n\t\tlet data\n\t\tif (isInstanceUnfinished) {\n\t\t\tdata = measurementData.data[measurementData.data.length - 1]\n\t\t\tdata.handles = data.handles.concat(this.createNewMeasurement(eventData).handles)\n\t\t\tdata.handles.push({\n\t\t\t\tactive: false,\n\t\t\t\thasMoved: false,\n\t\t\t\tmovesIndependently: true,\n\t\t\t\tdrawnIndependently: true,\n\t\t\t\tallowedOutsideImage: true,\n\t\t\t\thasBoundingBox: true,\n\t\t\t})\n\t\t} else {\n\t\t\tdata = this.createNewMeasurement(eventData)\n\t\t\taddToolState(element, this.name, data)\n\t\t}\n\n\t\tstartMovingHandles.call(this)\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\n\t\tfunction startMovingHandles() {\n\t\t\tconst movableHandles = data.handles.filter(handle => !handle.movesIndependently)\n\n\t\t\tconst doneMovingCallback = () => {\n\t\t\t\tdata.active = isInstanceUnfinished // show active color until both circles are done\n\t\t\t\tdata.invalidated = true\n\t\t\t}\n\n\t\t\tmoveNewHandle(\n\t\t\t\teventData,\n\t\t\t\tthis.name,\n\t\t\t\tdata,\n\t\t\t\tmovableHandles[movableHandles.length - 1],\n\t\t\t\tthis.options,\n\t\t\t\tinteractionType,\n\t\t\t\tdoneMovingCallback\n\t\t\t)\n\t\t}\n\t}\n\n\ttoolSelectedCallback(evt, toolData, interactionType = 'mouse') {\n\t\tconst eventData = evt.detail\n\t\tconst { element, image } = eventData\n\t\tconst coords = eventData.startPoints.canvas\n\n\t\tconst circle = this.pointNearTool(element, toolData, coords, true)\n\t\tif (!circle) return\n\t\ttoolData.active = true\n\n\t\t// Move individual circle\n\t\tconst circleHandles = {\n\t\t\tfirst: [0, 1],\n\t\t\tsecond: [2, 3],\n\t\t}\n\t\tmakeCircleMoveIndependently(circleHandles[circle])\n\n\t\tconst doneMovingCallback = () => {\n\t\t\ttriggerDoneModifying(this.name, element, image)\n\t\t}\n\t\tmoveAllHandles(evt.detail, this.name, toolData, null, this.options, interactionType, doneMovingCallback)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\n\t\tfunction makeCircleMoveIndependently(indices) {\n\t\t\ttoolData.handles = toolData.handles.map((handle, i) => {\n\t\t\t\thandle.movesIndependently = !indices.includes(i)\n\t\t\t\treturn handle\n\t\t\t})\n\t\t}\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} evt\n\t * @returns\n\t */\n\trenderToolData(evt) {\n\t\tconst eventData = evt.detail\n\t\tconst { element } = eventData\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\t\tif (!toolData || !toolData.data || !toolData.data.length) return\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\n\t\t// If we have no toolData for this element, return immediately as there is nothing to do\n\t\tif (!toolData || !toolData.data || !toolData.data.length) {\n\t\t\treturn\n\t\t}\n\n\t\ttoolData.data.forEach(data => {\n\t\t\tif (data.visible === false) return\n\n\t\t\tdraw(context, context => {\n\t\t\t\tif (this.configuration.shadow) {\n\t\t\t\t\tcontext.shadowColor = this.configuration.shadowColor\n\t\t\t\t\tcontext.shadowOffsetX = this.configuration.shadowOffsetX\n\t\t\t\t\tcontext.shadowOffsetY = this.configuration.shadowOffsetY\n\t\t\t\t}\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tconst haveFirstCircle = data.handles.length >= 2\n\t\t\t\tconst haveSecondCircle = data.handles.length >= 4\n\t\t\t\t// Draw handles\n\t\t\t\tif (this.configuration.drawHandlesOnHover && data.active !== true) {\n\t\t\t\t\tdrawHandles(context, eventData, data.handles, {\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tdrawHandlesIfActive: true,\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tdrawHandles(context, eventData, data.handles, { color })\n\t\t\t\t}\n\t\t\t\tlet circle1Outer, circle1Inner, circle2Outer, circle2Inner\n\t\t\t\tlet firstRadius, secondRadius, firstRadiusPixels, secondRadiusPixels\n\t\t\t\tif (haveFirstCircle) {\n\t\t\t\t\t// Draw first circle\n\t\t\t\t\tcircle1Outer = pixelToCanvas(element, data.handles[0])\n\t\t\t\t\tcircle1Inner = pixelToCanvas(element, data.handles[1])\n\t\t\t\t\tfirstRadius = point.distance(circle1Outer, circle1Inner)\n\t\t\t\t\tfirstRadiusPixels = point.distance(data.handles[0], data.handles[1])\n\t\t\t\t\tdrawCircle(context, element, data.handles[1], firstRadius, { color })\n\t\t\t\t}\n\t\t\t\tif (haveSecondCircle) {\n\t\t\t\t\t// Draw second circle\n\t\t\t\t\tcircle2Outer = pixelToCanvas(element, data.handles[2])\n\t\t\t\t\tcircle2Inner = pixelToCanvas(element, data.handles[3])\n\t\t\t\t\tsecondRadius = point.distance(circle2Outer, circle2Inner)\n\t\t\t\t\tsecondRadiusPixels = point.distance(data.handles[2], data.handles[3])\n\t\t\t\t\tdrawCircle(context, element, data.handles[3], secondRadius, { color })\n\t\t\t\t\tconst lineDash = [1, 3]\n\t\t\t\t\t// Draw connector\n\t\t\t\t\tdrawLine(context, element, data.handles[1], data.handles[3], {\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tlineDash,\n\t\t\t\t\t})\n\t\t\t\t\t// Draw femur radius\n\t\t\t\t\tconst femurRadius = Math.min(firstRadius, secondRadius)\n\t\t\t\t\tif (femurRadius === firstRadius) {\n\t\t\t\t\t\tconst rightEdgeOfFemur = {\n\t\t\t\t\t\t\tx: data.handles[1].x,\n\t\t\t\t\t\t\ty: data.handles[1].y - firstRadiusPixels,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdrawLine(context, element, data.handles[1], rightEdgeOfFemur, {\n\t\t\t\t\t\t\tcolor,\n\t\t\t\t\t\t\tlineDash,\n\t\t\t\t\t\t})\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst rightEdgeOfFemur = {\n\t\t\t\t\t\t\tx: data.handles[3].x,\n\t\t\t\t\t\t\ty: data.handles[3].y - secondRadiusPixels,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdrawLine(context, element, data.handles[3], rightEdgeOfFemur, {\n\t\t\t\t\t\t\tcolor,\n\t\t\t\t\t\t\tlineDash,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\t// Draw textbox connected to rightmost circle's edge\n\t\t\t\t\tconst distance = point.distance(circle1Inner, circle2Inner)\n\t\t\t\t\tconst distractionIndex = formatNumber(round(distance / femurRadius, 2))\n\t\t\t\t\tconst rightCircle = {\n\t\t\t\t\t\tcenter: data.handles[3].x > data.handles[1].x ? data.handles[3] : data.handles[1],\n\t\t\t\t\t\tradius: data.handles[3].x > data.handles[1].x ? secondRadiusPixels : firstRadiusPixels,\n\t\t\t\t\t}\n\t\t\t\t\tconst rightEdgeOfShape = {\n\t\t\t\t\t\tx: rightCircle.center.x + rightCircle.radius,\n\t\t\t\t\t\ty: rightCircle.center.y,\n\t\t\t\t\t}\n\t\t\t\t\tdrawTextBox(data.handles[4], rightEdgeOfShape, [`DI: ${distractionIndex}`])\n\t\t\t\t}\n\t\t\t})\n\t\t\tfunction drawTextBox(textBox, linkedLineHandle, text) {\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tlet textBoxOffset = 0\n\t\t\t\tif (!textBox.hasMoved) {\n\t\t\t\t\ttextBoxOffset = (linkedLineHandle.radius || 6) + 6\n\t\t\t\t\ttextBox.x = linkedLineHandle.x + textBoxOffset\n\t\t\t\t\ttextBox.y = linkedLineHandle.y\n\t\t\t\t}\n\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\tcontext,\n\t\t\t\t\telement,\n\t\t\t\t\ttextBox,\n\t\t\t\t\ttext,\n\t\t\t\t\t[linkedLineHandle],\n\t\t\t\t\t() => [linkedLineHandle],\n\t\t\t\t\tcolor,\n\t\t\t\t\ttoolStyle.getToolWidth(),\n\t\t\t\t\ttextBoxOffset,\n\t\t\t\t\ttrue\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Clears the tool's state if it is not a completed annotation. Usually\n\t * fired when exiting the tool's `active` mode.\n\t *\n\t * @memberof AstVertebralHeart\n\t */\n\t_clearIncompleteToolData(element, options) {\n\t\tconst toolData = getToolState(this.element, this.name)\n\t\tconst isToolInstance = toolData && toolData.data && toolData.data.length\n\t\tconst isIncompleteDrawing = isToolInstance && toolData.data[0].handles.length < 5\n\t\tif (isIncompleteDrawing) {\n\t\t\tclearToolState(this.element, this.name)\n\t\t\tupdateImage(this.element)\n\t\t}\n\t}\n}\n","import {\n\tgetEnabledElement,\n\tmetaData,\n\tpixelToCanvas,\n\tupdateImage,\n\tgetStoredPixels,\n} from 'cornerstone-core/dist/cornerstone.js'\nimport convertToVector3 from '@/utils/convertToVector3'\nimport {\n\taddToolState,\n\tclearToolState,\n\tgetToolState,\n\timport as csTools,\n\ttextStyle,\n\ttoolColors,\n\tstore,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport isLocalizerImage from '../_shared/isLocalizerImage'\nimport { formatNumber } from '@utils/numberUtils'\nimport round from 'lodash/round'\n\n// Base\nconst BaseTool = csTools('base/BaseTool')\n\n// Drawing\nconst drawLine = csTools('drawing/drawLine')\nconst getNewContext = csTools('drawing/getNewContext')\nconst draw = csTools('drawing/draw')\nconst setShadow = csTools('drawing/setShadow')\nconst drawTextBox = csTools('drawing/drawTextBox')\n\n// Util\nconst imagePointToPatientPoint = csTools('util/imagePointToPatientPoint')\nconst projectPatientPointToImagePlane = csTools('util/projectPatientPointToImagePlane')\n\n/**\n * @public\n * @class AstProbe\n * @memberof Tools\n *\n * @classdesc Tool which provides a probe of the image data at the\n * input position on drag.\n * @extends Tools.Base.BaseTool\n */\nexport default class AstProbe extends BaseTool {\n\tconstructor(props = {}) {\n\t\tconst defaultProps = {\n\t\t\tname: 'AstProbe',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\tsvgCursor: null,\n\t\t\toptions: {\n\t\t\t\tpreventHandleOutsideImage: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t},\n\t\t}\n\t\tsuper(props, defaultProps)\n\t\tthis.mergeOptions(defaultProps.options)\n\n\t\tthis.postTouchStartCallback = this._movingEventCallback.bind(this)\n\t\tthis.touchDragCallback = this._movingEventCallback.bind(this)\n\t\tthis.touchEndCallback = this._endMovingEventCallback.bind(this)\n\n\t\tthis.postMouseDownCallback = this._movingEventCallback.bind(this)\n\t\tthis.mouseDragCallback = this._movingEventCallback.bind(this)\n\t\tthis.mouseUpCallback = this._endMovingEventCallback.bind(this)\n\n\t\tthis.mouseClickCallback = this._endMovingEventCallback.bind(this)\n\n\t\tthis.updatePoint = _updatePoint.bind(this)\n\t\tthis.syncedId = null\n\n\t\t// Used to ensure the actively clicked canvas doesn't render a crosshair\n\t\tthis.activeInstance = false\n\t}\n\n\t_movingEventCallback(evt) {\n\t\tthis.updatePoint(evt)\n\t\tthis.activeInstance = true\n\t}\n\n\t_endMovingEventCallback() {\n\t\tthis.activeInstance = false\n\t\tthis._clearAllPoints()\n\t}\n\n\trenderToolData(evt) {\n\t\tif (evt && evt.detail) {\n\t\t\tconst eventData = evt.detail\n\t\t\tconst element = eventData.element\n\t\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\t\t\tif (!toolData || !toolData.data || !toolData.data.length) return\n\t\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\t\t\ttoolData.data.forEach(data => {\n\t\t\t\tif (data.visible === false) return\n\t\t\t\tif (!data.point) return\n\t\t\t\tif (\n\t\t\t\t\tdata.point.x < 0 ||\n\t\t\t\t\tdata.point.y < 0 ||\n\t\t\t\t\tdata.point.x >= evt.detail.image.columns ||\n\t\t\t\t\tdata.point.y >= evt.detail.image.rows\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tdrawProbe.bind(this)(data.point, evt.detail.image, context, element)\n\t\t\t\tif (!this.activeInstance) _drawCrosshairs(data.point, context, element)\n\t\t\t})\n\t\t}\n\t}\n\t_clearAllPoints() {\n\t\tstore.state.enabledElements.forEach(enabledElement => {\n\t\t\tclearToolState(enabledElement, this.name)\n\t\t\tupdateImage(enabledElement)\n\t\t})\n\t}\n}\n\n/**\n * Minimal strategy will use the mouse position to get the HU value and display probe data.\n *\n * @param  {Object} evt Image rendered event\n * @returns {void}\n */\nfunction drawProbe(toolCoords, image, context, element) {\n\tconst config = this.configuration\n\tconst color = toolColors.getToolColor()\n\n\tdraw(context, context => {\n\t\tsetShadow(context, config)\n\t\tlet storedPixels\n\n\t\t// Assume modality is CT or we wouldn't be able to get to this point\n\t\tstoredPixels = getStoredPixels(element, toolCoords.x, toolCoords.y, 1, 1)\n\t\tconst sp = storedPixels[0]\n\t\tconst mo = sp * image.slope + image.intercept\n\t\tconst text = `${formatNumber(round(mo, 2))} HU`\n\n\t\t// Prepare text\n\t\tconst textCoords = pixelToCanvas(element, toolCoords)\n\n\t\t// Translate the x/y away from the cursor\n\t\ttextCoords.x += 12\n\t\ttextCoords.y += -18 - (textStyle.getFontSize() + 10) / 2\n\t\tdrawTextBox(context, text, textCoords.x, textCoords.y, color)\n\t})\n}\n\n/**\n * @param {*} data\n * @param {*} context\n * @param {*} element\n */\nfunction _drawCrosshairs(pixelPoint, context, element) {\n\tconst color = toolColors.getActiveColor()\n\tconst point = pixelToCanvas(element, pixelPoint)\n\tconst distance = 15\n\tconst top = {\n\t\tx: point.x,\n\t\ty: point.y - distance,\n\t}\n\tconst right = {\n\t\tx: point.x + distance,\n\t\ty: point.y,\n\t}\n\tconst bottom = {\n\t\tx: point.x,\n\t\ty: point.y + distance,\n\t}\n\tconst left = {\n\t\tx: point.x - distance,\n\t\ty: point.y,\n\t}\n\tdrawLine(context, element, top, bottom, { color }, 'canvas')\n\tdrawLine(context, element, left, right, { color }, 'canvas')\n}\n\n// Very similar to AstCrossPoint's tool\nconst _updatePoint = function(evt) {\n\tconst eventData = evt.detail\n\tevt.stopImmediatePropagation()\n\tconst sourceElement = evt.currentTarget\n\tconst sourceEnabledElement = getEnabledElement(sourceElement)\n\tconst sourceImageId = sourceEnabledElement.image.imageId\n\tconst sourceImagePlane = metaData.get('imagePlaneModule', sourceImageId)\n\tif (\n\t\t!sourceImagePlane ||\n\t\t!sourceImagePlane.rowCosines ||\n\t\t!sourceImagePlane.columnCosines ||\n\t\t!sourceImagePlane.imagePositionPatient ||\n\t\t!sourceImagePlane.frameOfReferenceUID\n\t)\n\t\treturn\n\n\tconst sourceImagePoint = eventData.currentPoints.image\n\tconst sourcePatientPoint = imagePointToPatientPoint(sourceImagePoint, sourceImagePlane)\n\n\tstore.state.enabledElements.forEach(async targetElement => {\n\t\tconst stackToolDataSource = getToolState(targetElement, 'stack')\n\t\tconst isMissingStackData = !stackToolDataSource || !stackToolDataSource.data || !stackToolDataSource.data.length\n\t\tif (isMissingStackData) return\n\t\tconst seriesStack = stackToolDataSource.data[0]\n\n\t\t// Clear\n\t\tclearToolState(targetElement, this.name)\n\n\t\t// Update\n\t\tconst bestImageIdIndex = _findBestImageIdIndex(\n\t\t\tseriesStack,\n\t\t\tsourcePatientPoint,\n\t\t\tsourceImagePlane.frameOfReferenceUID,\n\t\t\tsourceImageId\n\t\t)\n\t\t// Only show where the \"best\" ImageID is the currently shown ID. Ignores out of sync images.\n\t\tif (bestImageIdIndex !== null && seriesStack.currentImageIdIndex === bestImageIdIndex) {\n\t\t\tconst imageId = seriesStack.imageIds[bestImageIdIndex]\n\t\t\tconst targetTool = store.state.tools.find(tool => tool.element === targetElement && tool.name === this.name)\n\n\t\t\tif (targetTool) {\n\t\t\t\ttargetTool.syncedId = imageId\n\t\t\t}\n\t\t\t// New ToolState w/ bestImageId\n\t\t\tconst targetMeta = metaData.get('imagePlaneModule', imageId)\n\t\t\tif (!targetMeta || !targetMeta.rowCosines || !targetMeta.columnCosines || !targetMeta.imagePositionPatient) return\n\n\t\t\tconst crossPoint = projectPatientPointToImagePlane(sourcePatientPoint, targetMeta)\n\t\t\tconst toolData = getToolState(targetElement, this.name)\n\t\t\tif (!toolData || !toolData.data || !toolData.data.length) {\n\t\t\t\taddToolState(targetElement, this.name, {\n\t\t\t\t\tpoint: crossPoint,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\ttoolData.data[0].point = crossPoint\n\t\t\t}\n\t\t}\n\n\t\t// Force redraw\n\t\tupdateImage(targetElement)\n\t})\n}\n\nconst _findBestImageIdIndex = function(seriesStack, sourcePatientPoint, sourceFrameOfReference, sourceImageId) {\n\tlet newImageIdIndex = null\n\tlet minDistance = Number.MAX_VALUE\n\tfor (let index = 0; index < seriesStack.imageIds.length; index++) {\n\t\tconst imageId = seriesStack.imageIds[index]\n\t\t// if this is the source image, use this index\n\t\tif (imageId === sourceImageId) {\n\t\t\tnewImageIdIndex = index\n\t\t\tbreak\n\t\t}\n\t\tconst targetMeta = metaData.get('imagePlaneModule', imageId)\n\t\tif (\n\t\t\t!targetMeta ||\n\t\t\t!targetMeta.imagePositionPatient ||\n\t\t\t!targetMeta.rowCosines ||\n\t\t\t!targetMeta.columnCosines ||\n\t\t\t!targetMeta.sliceThickness\n\t\t)\n\t\t\tcontinue\n\t\t// Verify image is from same study as source image\n\t\tif (targetMeta.frameOfReferenceUID !== sourceFrameOfReference) continue\n\t\t// Verify image is not a localizer image [ch4638]\n\t\tif (isLocalizerImage(seriesStack.imageIds, imageId, targetMeta)) continue\n\t\tconst imagePosition = convertToVector3(targetMeta.imagePositionPatient)\n\t\tconst row = convertToVector3(targetMeta.rowCosines)\n\t\tconst column = convertToVector3(targetMeta.columnCosines)\n\t\t// A vector that is perpendicular to both `column` and `row` and thus 'normal'\n\t\tconst normal = column.clone().cross(row.clone())\n\t\t// Distance from image's plane to normal's origin\n\t\tconst targetPlanePosition = normal.clone().dot(imagePosition)\n\t\t// Distance from a same-oriented plane containing the source point to normal's origin\n\t\tconst sourcePointPlanePosition = normal.clone().dot(sourcePatientPoint)\n\t\t// Distance between derived target and source planes\n\t\tconst distance = Math.abs(targetPlanePosition - sourcePointPlanePosition)\n\t\tconst tolerance = targetMeta.sliceThickness * 2\n\t\t// Do not scroll to an image that is more than double the slice thickness away\n\t\tif (distance > tolerance) continue\n\t\tif (distance < minDistance) {\n\t\t\tminDistance = distance\n\t\t\tnewImageIdIndex = index\n\t\t}\n\t}\n\n\treturn newImageIdIndex\n}\n","/* eslint-disable curly, capitalized-comments, newline-before-return, newline-after-var, object-property-newline */\nimport { updateImage, metaData, pixelToCanvas } from 'cornerstone-core/dist/cornerstone.js'\nimport { lineSegment, point } from 'cornerstone-math/dist/cornerstoneMath.js'\nimport {\n\taddToolState,\n\tclearToolState,\n\tgetToolState,\n\timport as csTools,\n\ttoolColors,\n\ttoolStyle,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport moveHandle from '@/cornerstone/manipulators/moveHandle'\nimport { formatNumber } from '@utils/numberUtils'\nimport round from 'lodash/round'\nimport triggerDoneModifying from '@/cornerstone/tools/util/triggerDoneModifying'\nimport getImagePixelSpacing from './util/getImagePixelSpacing'\nconst BaseAnnotationTool = csTools('base/BaseAnnotationTool')\n\n// Drawing\nconst draw = csTools('drawing/draw')\nconst drawCircle = csTools('drawing/drawCircle')\nconst drawHandles = csTools('drawing/drawHandles')\nconst drawLine = csTools('drawing/drawLine')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\nconst getNewContext = csTools('drawing/getNewContext')\n\n// Util\nconst lineSegDistance = csTools('util/lineSegDistance')\nconst moveAnnotation = csTools('manipulators/moveAnnotation')\n\n/**\n * @export @public @class\n * @name AstTplo\n * @classdesc\n * @extends BaseAnnotationTool\n */\nexport default class AstTplo extends BaseAnnotationTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstTplo',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tprecisionHandlesEnabled: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t\tdrawHandlesOnHover: false,\n\t\t\t\tdefaultAngle: 105,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\n\t\tsuper(initialConfiguration)\n\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\t\tthis.isDragging = true\n\n\t\tthis.disabledCallback = this._clearIncompleteToolData.bind(this)\n\t\tthis.passiveCallback = this._clearIncompleteToolData.bind(this)\n\t\tthis.enabledCallback = this._clearIncompleteToolData.bind(this)\n\t}\n\n\t// No stats to cache when moving, but CS complains otherwise\n\tupdateCachedStats() {}\n\n\t/**\n\t * Create the measurement data for this tool with the end handle activated\n\t *\n\t * @param {*} eventData\n\t * @returns\n\t */\n\tcreateNewMeasurement({ currentPoints, element }) {\n\t\tconst { x, y } = currentPoints.image\n\t\treturn {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tinvalidated: true,\n\t\t\tcolor: undefined,\n\t\t\thandles: [\n\t\t\t\t{\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: false,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: true,\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t}\n\n\taddNewMeasurement(evt, interactionType = 'mouse') {\n\t\tconst eventData = evt.detail\n\t\tconst { element, image } = eventData\n\t\tconst toolData = getToolState(element, this.name)\n\n\t\t// Determine Current Step\n\t\tconst isExistingInstance = toolData && toolData.data && toolData.data.length\n\t\tconst isAddingTibialAxis = isExistingInstance && toolData.data[0].handles.length === 2\n\t\tconst isAddingPlateau = isExistingInstance && toolData.data[0].handles.length === 3\n\n\t\t//\n\t\tconst startMovingHandle = () => {\n\t\t\tconst movableHandles = data.handles.filter(x => !x.hasBoundingBox)\n\t\t\tmoveNewHandle(\n\t\t\t\teventData,\n\t\t\t\tthis.name,\n\t\t\t\tdata,\n\t\t\t\tmovableHandles[movableHandles.length - 1],\n\t\t\t\tthis.options,\n\t\t\t\tinteractionType\n\t\t\t)\n\t\t}\n\n\t\tlet data\n\t\tif (isExistingInstance) {\n\t\t\tdata = toolData.data[0]\n\t\t} else {\n\t\t\tdata = this.createNewMeasurement(eventData)\n\t\t\taddToolState(element, this.name, data)\n\t\t}\n\t\tif (!isExistingInstance) startMovingHandle()\n\t\tif (isAddingTibialAxis) addSingleHandle.bind(this)()\n\t\tif (isAddingPlateau) {\n\t\t\tdata.handles = data.handles.concat(this.createNewMeasurement(eventData).handles)\n\t\t\tdata.handles.push({\n\t\t\t\t// textbox\n\t\t\t\tactive: false,\n\t\t\t\thasMoved: false,\n\t\t\t\tmovesIndependently: true,\n\t\t\t\tdrawnIndependently: true,\n\t\t\t\tallowedOutsideImage: true,\n\t\t\t\thasBoundingBox: true,\n\t\t\t})\n\t\t\tstartMovingHandle()\n\t\t}\n\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\n\t\tfunction addSingleHandle() {\n\t\t\tdata.handles.push({\n\t\t\t\tx: eventData.currentPoints.image.x,\n\t\t\t\ty: eventData.currentPoints.image.y,\n\t\t\t\thighlight: true,\n\t\t\t\tactive: true,\n\t\t\t})\n\t\t\tupdateImage(element)\n\t\t\ttriggerDoneModifying(this.name, element, image)\n\t\t}\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} element\n\t * @param {*} data\n\t * @param {*} coords\n\t * @returns\n\t */\n\tpointNearTool(element, data, coords, isMouse = true) {\n\t\tconst distance = isMouse ? 15 : 25\n\t\tif (pointOnCircle(data.handles[1], data.handles[0])) return true // Talus\n\t\tif (pointOnLine(data.handles[1], data.handles[2])) return true // Tibial Axis\n\t\tif (pointOnLine(data.handles[3], data.handles[4])) return true // Plateau\n\t\tif (data.handles.length < 5) return\n\t\tconst referenceLine = _getReferenceLine(data.handles)\n\t\tif (referenceLine) {\n\t\t\tif (pointOnLine(referenceLine.start, referenceLine.end)) return true\n\t\t\tif (pointOnCircle(_getIntersection(data.handles), null, _getCutRadius(data.handles, element))) return true // Cut circle\n\t\t}\n\t\treturn false\n\n\t\tfunction pointOnCircle(centerPoint, outerPoint, radius) {\n\t\t\tif (!centerPoint || (!outerPoint && !radius)) return false\n\t\t\tcenterPoint = pixelToCanvas(element, centerPoint)\n\t\t\tif (outerPoint) {\n\t\t\t\touterPoint = pixelToCanvas(element, outerPoint)\n\t\t\t\tradius = point.distance(centerPoint, outerPoint)\n\t\t\t}\n\t\t\tconst minDistance = radius - distance / 2\n\t\t\tconst maxDistance = radius + distance / 2\n\t\t\tconst pointDistance = point.distance(centerPoint, coords)\n\t\t\treturn pointDistance > minDistance && pointDistance < maxDistance\n\t\t}\n\t\tfunction pointOnLine(start, end) {\n\t\t\tif (!start || !end) return false\n\t\t\treturn lineSegDistance(element, start, end, coords) < distance\n\t\t}\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tmoveHandle(evt.detail, this.name, toolData, handle, this.options, interactionType)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\t// Custom selected callback for modified notification\n\ttoolSelectedCallback(evt, annotation, interactionType = 'mouse') {\n\t\tmoveAnnotation(evt, this, annotation, interactionType)\n\n\t\t// wait 180ms for mouseup/touchend, indicating a click rather than a drag\n\t\tconst UP_EVENT = interactionType === 'mouse' ? 'mouseup' : 'touchend'\n\n\t\t// Notify once we're done moving the tool, regardless of click vs drag\n\t\tconst changedEvent = e => {\n\t\t\tconst { element, image } = evt.detail\n\t\t\ttriggerDoneModifying(this.name, element, image)\n\t\t\tevt.detail.element.removeEventListener(UP_EVENT, changedEvent)\n\t\t}\n\t\tevt.detail.element.addEventListener(UP_EVENT, changedEvent)\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} evt\n\t * @returns\n\t */\n\trenderToolData(evt) {\n\t\tconst eventData = evt.detail\n\t\tconst element = eventData.element\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\t\tif (!toolData || !toolData.data || !toolData.data.length) return\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\t\tconst data = toolData.data[0] // only ever one instance of this tool\n\n\t\tif (data.visible === false) return\n\n\t\tdraw(context, context => {\n\t\t\tif (this.configuration.shadow) {\n\t\t\t\tcontext.shadowColor = this.configuration.shadowColor\n\t\t\t\tcontext.shadowOffsetX = this.configuration.shadowOffsetX\n\t\t\t\tcontext.shadowOffsetY = this.configuration.shadowOffsetY\n\t\t\t}\n\t\t\tconst color = toolColors.getColorIfActive(data)\n\n\t\t\tconst haveTalusCircle = data.handles.length >= 2\n\t\t\tconst haveTibialAxis = data.handles.length >= 3\n\t\t\tconst havePlateau = data.handles.length >= 5\n\n\t\t\t// Draw handles\n\t\t\tif (this.configuration.drawHandlesOnHover && data.active !== true) {\n\t\t\t\tdrawHandles(context, eventData, data.handles, {\n\t\t\t\t\tcolor,\n\t\t\t\t\tdrawHandlesIfActive: true,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tdrawHandles(context, eventData, data.handles, { color })\n\t\t\t}\n\n\t\t\t// Draw lines\n\t\t\tif (haveTalusCircle) drawTalusCircle()\n\t\t\tif (haveTibialAxis) drawLine(context, element, data.handles[1], data.handles[2], { color })\n\t\t\tif (havePlateau) {\n\t\t\t\tdrawLine(context, element, data.handles[3], data.handles[4], { color })\n\t\t\t\tconst intersection = _getIntersection(data.handles)\n\t\t\t\tif (!intersection) return\n\t\t\t\tconst referenceLine = _getReferenceLine(data.handles)\n\t\t\t\tdrawLine(context, element, referenceLine.start, referenceLine.end, {\n\t\t\t\t\tcolor,\n\t\t\t\t})\n\t\t\t\tdrawCircle(context, element, intersection, _getCutRadius(data.handles, element), { color })\n\t\t\t\tdrawTextBox(data.handles[5], referenceLine.end, [`TPA: ${getTPA()}`, `Diameter: ${getCutDiameter()}`])\n\t\t\t}\n\n\t\t\tfunction drawTalusCircle() {\n\t\t\t\tconst outer = pixelToCanvas(element, data.handles[0])\n\t\t\t\tconst inner = pixelToCanvas(element, data.handles[1])\n\t\t\t\tconst leftRadius = point.distance(outer, inner)\n\t\t\t\tdrawCircle(context, element, data.handles[1], leftRadius, { color })\n\t\t\t}\n\t\t\tfunction drawTextBox(textBox, linkedLineHandle, text) {\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tlet textBoxOffset = 0\n\t\t\t\tif (!textBox.hasMoved) {\n\t\t\t\t\ttextBoxOffset = 6\n\t\t\t\t\ttextBox.x = linkedLineHandle.x + textBoxOffset\n\t\t\t\t\ttextBox.y = linkedLineHandle.y\n\t\t\t\t}\n\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\tcontext,\n\t\t\t\t\telement,\n\t\t\t\t\ttextBox,\n\t\t\t\t\ttext,\n\t\t\t\t\t[linkedLineHandle],\n\t\t\t\t\t() => [linkedLineHandle],\n\t\t\t\t\tcolor,\n\t\t\t\t\ttoolStyle.getToolWidth(),\n\t\t\t\t\ttextBoxOffset,\n\t\t\t\t\ttrue\n\t\t\t\t)\n\t\t\t}\n\t\t\tfunction getTPA() {\n\t\t\t\tconst tibialAxis = {\n\t\t\t\t\tstart: data.handles[1],\n\t\t\t\t\tend: data.handles[2],\n\t\t\t\t}\n\t\t\t\tconst plateau = {\n\t\t\t\t\tstart: data.handles[3],\n\t\t\t\t\tend: data.handles[4],\n\t\t\t\t}\n\t\t\t\tconst slopeA = getSlope(tibialAxis)\n\t\t\t\tconst slopeB = getSlope(plateau)\n\t\t\t\tlet angle = 0\n\t\t\t\tif ([-1, 0].includes(slopeA * slopeB)) {\n\t\t\t\t\tangle = Math.PI / 2\n\t\t\t\t} else {\n\t\t\t\t\tangle = Math.abs(Math.atan((slopeA - slopeB) / (1 + slopeA * slopeB)))\n\t\t\t\t}\n\t\t\t\tif (Number.isNaN(angle)) return\n\t\t\t\tangle = 90 - (angle * 180) / Math.PI\n\t\t\t\treturn `${formatNumber(round(angle, 1))}°`\n\n\t\t\t\tfunction getSlope(line) {\n\t\t\t\t\tif (line.start.x - line.end.x === 0) return Number.MAX_SAFE_INTEGER\n\t\t\t\t\treturn (line.start.y - line.end.y) / (line.start.x - line.end.x)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction getCutDiameter() {\n\t\t\t\tconst { rowPixelSpacing, columnPixelSpacing, isPixelSpacingDefined } = getImagePixelSpacing(eventData.image)\n\t\t\t\tconst distanceA = getAspectDistance(data.handles[3])\n\t\t\t\tconst distanceB = getAspectDistance(data.handles[4])\n\t\t\t\tconst unit = isPixelSpacingDefined ? 'mm' : 'px'\n\t\t\t\tconst diameter = Math.max(distanceA, distanceB) * 2\n\t\t\t\treturn `${formatNumber(round(diameter, 2))} ${unit}`\n\n\t\t\t\tfunction getAspectDistance(point) {\n\t\t\t\t\tconst intersection = _getIntersection(data.handles)\n\t\t\t\t\tconst dx = (point.x - intersection.x) * columnPixelSpacing\n\t\t\t\t\tconst dy = (point.y - intersection.y) * rowPixelSpacing\n\t\t\t\t\treturn Math.sqrt(dx * dx + dy * dy)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Clears the tool's state if it is not a completed annotation. Usually\n\t * fired when exiting the tool's `active` mode.\n\t *\n\t * @memberof AstTplo\n\t */\n\t_clearIncompleteToolData(element, options) {\n\t\tconst toolData = getToolState(this.element, this.name)\n\t\tconst isToolInstance = toolData && toolData.data && toolData.data.length\n\t\tconst isIncompleteDrawing = isToolInstance && toolData.data[0].handles.length < 6\n\t\tif (isIncompleteDrawing) {\n\t\t\tclearToolState(this.element, this.name)\n\t\t\tupdateImage(this.element)\n\t\t}\n\t}\n}\n\n/**\n * Get the point where the tibial axis and plateau intersect\n *\n * @param {*} handles\n * @returns\n */\nfunction _getIntersection(handles) {\n\tconst tibialAxis = {\n\t\tstart: handles[1],\n\t\tend: handles[2],\n\t}\n\tconst plateau = {\n\t\tstart: handles[3],\n\t\tend: handles[4],\n\t}\n\treturn lineSegment.intersectLine(tibialAxis, plateau)\n}\n\n/**\n * Get the osteotomy cut radius\n *\n * @param {*} handles\n * @param {*} element\n * @returns {Number} Osteotomy cut radius\n */\nfunction _getCutRadius(handles, element) {\n\tlet intersection = _getIntersection(handles)\n\tif (!intersection) return\n\tlet aspectA = handles[3]\n\tlet aspectB = handles[4]\n\tif (element) {\n\t\tintersection = pixelToCanvas(element, intersection)\n\t\taspectA = pixelToCanvas(element, aspectA)\n\t\taspectB = pixelToCanvas(element, aspectB)\n\t}\n\tconst distanceA = point.distance(intersection, aspectA)\n\tconst distanceB = point.distance(intersection, aspectB)\n\treturn Math.max(distanceA, distanceB)\n}\n\n/**\n * Get the perpendicular reference line for TPA\n *\n * @param {Array} handles\n * @returns {Object} {start: {x, y}, end: {x, y}}\n */\nfunction _getReferenceLine(handles) {\n\tconst intersection = _getIntersection(handles)\n\tif (!intersection) return\n\tconst referenceSlope = ((handles[2].x - handles[1].x) / (handles[2].y - handles[1].y)) * -1\n\tconst cutRadius = _getCutRadius(handles)\n\tconst cos = 1 / Math.sqrt(1 + referenceSlope * referenceSlope)\n\tconst sin = referenceSlope / Math.sqrt(1 + referenceSlope * referenceSlope)\n\treturn {\n\t\tstart: {\n\t\t\tx: intersection.x - cutRadius * cos,\n\t\t\ty: intersection.y - cutRadius * sin,\n\t\t},\n\t\tend: {\n\t\t\tx: intersection.x + cutRadius * cos,\n\t\t\ty: intersection.y + cutRadius * sin,\n\t\t},\n\t}\n}\n","/* eslint-disable curly, capitalized-comments, newline-before-return, newline-after-var, object-property-newline */\nimport { updateImage, metaData, pixelToCanvas } from 'cornerstone-core/dist/cornerstone.js'\nimport { point } from 'cornerstone-math/dist/cornerstoneMath.js'\nimport {\n\taddToolState,\n\tclearToolState,\n\tgetToolState,\n\timport as csTools,\n\ttoolColors,\n\ttoolStyle,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport moveHandle from '@/cornerstone/manipulators/moveHandle'\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport { formatNumber } from '@utils/numberUtils'\nimport round from 'lodash/round'\nimport triggerDoneModifying from './util/triggerDoneModifying'\nimport getImagePixelSpacing from './util/getImagePixelSpacing'\n\nconst BaseAnnotationTool = csTools('base/BaseAnnotationTool')\n\n// Drawing\nconst draw = csTools('drawing/draw')\nconst drawCircle = csTools('drawing/drawCircle')\nconst drawHandles = csTools('drawing/drawHandles')\nconst drawLine = csTools('drawing/drawLine')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\nconst getNewContext = csTools('drawing/getNewContext')\n\n// Util\nconst lineSegDistance = csTools('util/lineSegDistance')\nconst moveAnnotation = csTools('manipulators/moveAnnotation')\n\n/**\n * @export @public @class\n * @name AstTta\n * @classdesc\n * @extends BaseAnnotationTool\n */\nexport default class AstTta extends BaseAnnotationTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstTta',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tprecisionHandlesEnabled: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t\tdrawHandlesOnHover: false,\n\t\t\t\tdefaultAngle: 105,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\n\t\tsuper(initialConfiguration)\n\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\t\tthis.isDragging = true\n\n\t\tthis.disabledCallback = this._clearIncompleteToolData.bind(this)\n\t\tthis.passiveCallback = this._clearIncompleteToolData.bind(this)\n\t\tthis.enabledCallback = this._clearIncompleteToolData.bind(this)\n\t}\n\n\t// No stats to cache when moving, but CS complains otherwise\n\tupdateCachedStats() {}\n\n\t/**\n\t * Create the measurement data for this tool with the end handle activated\n\t *\n\t * @param {*} eventData\n\t * @returns\n\t */\n\tcreateNewMeasurement({ currentPoints, element }) {\n\t\tconst { x, y } = currentPoints.image\n\t\treturn {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tinvalidated: true,\n\t\t\tcolor: undefined,\n\t\t\thandles: [\n\t\t\t\t{\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: false,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: true,\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t}\n\n\taddNewMeasurement(evt, interactionType = 'mouse') {\n\t\tconst eventData = evt.detail\n\t\tconst { element } = eventData\n\t\tconst toolData = getToolState(element, this.name)\n\n\t\t// Determine Current Step\n\t\tconst isExistingInstance = toolData && toolData.data && toolData.data.length\n\t\tconst isAddingCircle = isExistingInstance && toolData.data[0].handles.length < 6\n\t\tconst isAddingLigament = isExistingInstance && toolData.data[0].handles.length === 6\n\n\t\t//\n\t\tconst startMovingHandle = () => {\n\t\t\tconst movableHandles = data.handles.filter(x => !x.hasBoundingBox)\n\t\t\tmoveNewHandle(\n\t\t\t\teventData,\n\t\t\t\tthis.name,\n\t\t\t\tdata,\n\t\t\t\tmovableHandles[movableHandles.length - 1],\n\t\t\t\tthis.options,\n\t\t\t\tinteractionType\n\t\t\t)\n\t\t}\n\n\t\tlet data\n\t\tif (isExistingInstance) {\n\t\t\tdata = toolData.data[0]\n\t\t} else {\n\t\t\tdata = this.createNewMeasurement(eventData)\n\t\t\taddToolState(element, this.name, data)\n\t\t}\n\t\tif (!isExistingInstance) startMovingHandle()\n\t\tif (isAddingCircle || isAddingLigament) {\n\t\t\tdata.handles = data.handles.concat(this.createNewMeasurement(eventData).handles)\n\t\t\tif (isAddingLigament) {\n\t\t\t\tdata.handles.push({\n\t\t\t\t\t// textbox\n\t\t\t\t\tactive: false,\n\t\t\t\t\thasMoved: false,\n\t\t\t\t\tmovesIndependently: true,\n\t\t\t\t\tdrawnIndependently: true,\n\t\t\t\t\tallowedOutsideImage: true,\n\t\t\t\t\thasBoundingBox: true,\n\t\t\t\t})\n\t\t\t}\n\t\t\tstartMovingHandle()\n\t\t}\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} element\n\t * @param {*} data\n\t * @param {*} coords\n\t * @returns\n\t */\n\tpointNearTool(element, data, coords, isMouse = true) {\n\t\tconst distance = isMouse ? 6 : 12\n\t\tif (pointOnCircle(data.handles[1], data.handles[0])) return true // First Condyle\n\t\tif (pointOnCircle(data.handles[3], data.handles[2])) return true // Second Condyle\n\t\tif (pointOnCircle(data.handles[5], data.handles[4])) return true // Femoral Head\n\t\tif (pointOnLine(data.handles[6], data.handles[7])) return true // Ligament\n\t\treturn false\n\n\t\tfunction pointOnCircle(centerPoint, outerPoint, radius) {\n\t\t\tif (!centerPoint || (!outerPoint && !radius)) return false\n\t\t\tcenterPoint = pixelToCanvas(element, centerPoint)\n\t\t\tif (outerPoint) {\n\t\t\t\touterPoint = pixelToCanvas(element, outerPoint)\n\t\t\t\tradius = point.distance(centerPoint, outerPoint)\n\t\t\t}\n\t\t\tconst minDistance = radius - distance / 2\n\t\t\tconst maxDistance = radius + distance / 2\n\t\t\tconst pointDistance = point.distance(centerPoint, coords)\n\t\t\treturn pointDistance > minDistance && pointDistance < maxDistance\n\t\t}\n\t\tfunction pointOnLine(start, end) {\n\t\t\tif (!start || !end) return false\n\t\t\treturn lineSegDistance(element, start, end, coords) < distance\n\t\t}\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tmoveHandle(evt.detail, this.name, toolData, handle, this.options, interactionType)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\t// Custom selected callback for modified notification\n\ttoolSelectedCallback(evt, annotation, interactionType = 'mouse') {\n\t\tmoveAnnotation(evt, this, annotation, interactionType)\n\n\t\t// wait 180ms for mouseup/touchend, indicating a click rather than a drag\n\t\tconst UP_EVENT = interactionType === 'mouse' ? 'mouseup' : 'touchend'\n\n\t\t// Notify once we're done moving the tool, regardless of click vs drag\n\t\tconst changedEvent = e => {\n\t\t\tconst { element, image } = evt.detail\n\t\t\ttriggerDoneModifying(this.name, element, image)\n\t\t\tevt.detail.element.removeEventListener(UP_EVENT, changedEvent)\n\t\t}\n\t\tevt.detail.element.addEventListener(UP_EVENT, changedEvent)\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} evt\n\t * @returns\n\t */\n\trenderToolData(evt) {\n\t\tconst eventData = evt.detail\n\t\tconst { image, element } = eventData\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\t\tif (!toolData || !toolData.data || !toolData.data.length) return\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\t\tconst data = toolData.data[0] // only ever one instance of this tool\n\n\t\tdraw(context, context => {\n\t\t\tif (this.configuration.shadow) {\n\t\t\t\tcontext.shadowColor = this.configuration.shadowColor\n\t\t\t\tcontext.shadowOffsetX = this.configuration.shadowOffsetX\n\t\t\t\tcontext.shadowOffsetY = this.configuration.shadowOffsetY\n\t\t\t}\n\t\t\tconst color = toolColors.getColorIfActive(data)\n\n\t\t\tconst haveFirstCircle = data.handles.length >= 2\n\t\t\tconst haveSecondCircle = data.handles.length >= 4\n\t\t\tconst haveThirdCircle = data.handles.length >= 6\n\t\t\tconst haveLigament = data.handles.length >= 8\n\n\t\t\t// Draw handles\n\t\t\tif (this.configuration.drawHandlesOnHover && data.active !== true) {\n\t\t\t\tdrawHandles(context, eventData, data.handles, {\n\t\t\t\t\tcolor,\n\t\t\t\t\tdrawHandlesIfActive: true,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tdrawHandles(context, eventData, data.handles, { color })\n\t\t\t}\n\n\t\t\t// Draw condyle circles\n\t\t\tif (haveFirstCircle) drawNewCircle(0, 1)\n\t\t\tif (haveSecondCircle) drawNewCircle(2, 3)\n\t\t\t// Draw condyle connector\n\t\t\tconst lineDash = [1, 3]\n\t\t\tif (haveFirstCircle && haveSecondCircle)\n\t\t\t\tdrawLine(context, element, data.handles[1], data.handles[3], {\n\t\t\t\t\tcolor,\n\t\t\t\t\tlineDash,\n\t\t\t\t})\n\t\t\t// Draw third circle and connector\n\t\t\tlet rightVertical\n\t\t\tif (haveThirdCircle) {\n\t\t\t\tdrawNewCircle(4, 5)\n\t\t\t\tconst start = {\n\t\t\t\t\tx: data.handles[1].x + (data.handles[3].x - data.handles[1].x) / 2,\n\t\t\t\t\ty: data.handles[1].y + (data.handles[3].y - data.handles[1].y) / 2,\n\t\t\t\t}\n\t\t\t\tconst end = data.handles[5]\n\t\t\t\trightVertical = {\n\t\t\t\t\tstart,\n\t\t\t\t\tend,\n\t\t\t\t}\n\t\t\t\tdrawLine(context, element, rightVertical.start, rightVertical.end, {\n\t\t\t\t\tcolor,\n\t\t\t\t\tlineDash,\n\t\t\t\t})\n\t\t\t}\n\t\t\t// Draw ligament, remaining lines, and textbox\n\t\t\tif (haveLigament) {\n\t\t\t\tdrawLine(context, element, data.handles[6], data.handles[7], { color })\n\t\t\t\tconst verticalSlope =\n\t\t\t\t\t(rightVertical.end.y - rightVertical.start.y) / (rightVertical.end.x - rightVertical.start.x)\n\t\t\t\tconst horizontalSlope =\n\t\t\t\t\t((rightVertical.end.x - rightVertical.start.x) / (rightVertical.end.y - rightVertical.start.y)) * -1\n\t\t\t\tconst lowerHorizontal = {\n\t\t\t\t\tstart: data.handles[7],\n\t\t\t\t\tend: _getIntersection(data.handles[7], horizontalSlope, rightVertical),\n\t\t\t\t}\n\t\t\t\tconst leftVertical = {\n\t\t\t\t\tstart: data.handles[6],\n\t\t\t\t\tend: _getIntersection(data.handles[6], verticalSlope, lowerHorizontal),\n\t\t\t\t}\n\t\t\t\tconst leftMidpoint = {\n\t\t\t\t\tx: leftVertical.start.x + (leftVertical.end.x - leftVertical.start.x) / 2,\n\t\t\t\t\ty: leftVertical.start.y + (leftVertical.end.y - leftVertical.start.y) / 2,\n\t\t\t\t}\n\t\t\t\tconst midHorizontal = {\n\t\t\t\t\tstart: leftMidpoint,\n\t\t\t\t\tend: _getIntersection(leftMidpoint, horizontalSlope, rightVertical),\n\t\t\t\t}\n\t\t\t\tconst advanceLine = {\n\t\t\t\t\tstart: leftVertical.end,\n\t\t\t\t\tend: lowerHorizontal.start,\n\t\t\t\t}\n\t\t\t\tdrawLine(context, element, advanceLine.start, advanceLine.end, {\n\t\t\t\t\tcolor,\n\t\t\t\t\tlineWidth: 2,\n\t\t\t\t})\n\t\t\t\tdrawLine(context, element, midHorizontal.start, midHorizontal.end, {\n\t\t\t\t\tcolor,\n\t\t\t\t\tlineDash,\n\t\t\t\t})\n\t\t\t\tdrawLine(context, element, leftVertical.start, leftVertical.end, {\n\t\t\t\t\tcolor,\n\t\t\t\t\tlineDash,\n\t\t\t\t})\n\t\t\t\tdrawTextBox(data.handles[8], leftVertical.end, [`TTA: ${getActualLength(advanceLine)}`])\n\t\t\t}\n\n\t\t\tfunction drawNewCircle(outerIndex, innerIndex) {\n\t\t\t\tconst outer = pixelToCanvas(element, data.handles[outerIndex])\n\t\t\t\tconst inner = pixelToCanvas(element, data.handles[innerIndex])\n\t\t\t\tconst radius = point.distance(outer, inner)\n\t\t\t\tdrawCircle(context, element, data.handles[innerIndex], radius, {\n\t\t\t\t\tcolor,\n\t\t\t\t})\n\t\t\t}\n\t\t\tfunction drawTextBox(textBox, linkedLineHandle, text) {\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tlet textBoxOffset = 0\n\t\t\t\tif (!textBox.hasMoved) {\n\t\t\t\t\ttextBoxOffset = 12\n\t\t\t\t\ttextBox.x = linkedLineHandle.x\n\t\t\t\t\ttextBox.y = linkedLineHandle.y + textBoxOffset\n\t\t\t\t}\n\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\tcontext,\n\t\t\t\t\telement,\n\t\t\t\t\ttextBox,\n\t\t\t\t\ttext,\n\t\t\t\t\t[linkedLineHandle],\n\t\t\t\t\t() => [linkedLineHandle],\n\t\t\t\t\tcolor,\n\t\t\t\t\ttoolStyle.getToolWidth(),\n\t\t\t\t\ttextBoxOffset,\n\t\t\t\t\ttrue\n\t\t\t\t)\n\t\t\t}\n\t\t\tfunction getActualLength(line) {\n\t\t\t\tconst { rowPixelSpacing, columnPixelSpacing, isPixelSpacingDefined } = getImagePixelSpacing(image)\n\t\t\t\tconst dx = (line.end.x - line.start.x) * columnPixelSpacing\n\t\t\t\tconst dy = (line.end.y - line.start.y) * rowPixelSpacing\n\t\t\t\tconst length = Math.sqrt(dx * dx + dy * dy)\n\t\t\t\tconst unit = isPixelSpacingDefined ? 'mm' : 'px'\n\t\t\t\treturn `${formatNumber(round(length, 2))} ${unit}`\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Clears the tool's state if it is not a completed annotation. Usually\n\t * fired when exiting the tool's `active` mode.\n\t *\n\t * @memberof AstTta\n\t */\n\t_clearIncompleteToolData(element, options) {\n\t\tconst toolData = getToolState(this.element, this.name)\n\t\tconst isToolInstance = toolData && toolData.data && toolData.data.length\n\t\tconst isIncompleteDrawing = isToolInstance && toolData.data[0].handles.length < 9\n\t\tif (isIncompleteDrawing) {\n\t\t\tclearToolState(this.element, this.name)\n\t\t\tupdateImage(this.element)\n\t\t}\n\t}\n}\n\n/**\n *\n *\n * @private @function\n * @param {*} lineAStart\n * @param {*} lineASlope\n * @param {*} lineB\n * @returns {Object} {x, y}\n */\nconst _getIntersection = function(lineAStart, lineASlope, lineB) {\n\t// https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given_two_points_on_each_line\n\tconst x1 = lineAStart.x\n\tconst y1 = lineAStart.y\n\tconst x2 = lineAStart.x + 1\n\tconst y2 = lineASlope + lineAStart.y\n\tconst x3 = lineB.start.x\n\tconst y3 = lineB.start.y\n\tconst x4 = lineB.end.x\n\tconst y4 = lineB.end.y\n\tconst x =\n\t\t((x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4)) /\n\t\t((x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4))\n\tconst y =\n\t\t((x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4)) /\n\t\t((x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4))\n\treturn {\n\t\tx,\n\t\ty,\n\t}\n}\n","/* eslint-disable curly, capitalized-comments, newline-before-return, newline-after-var, object-property-newline */\nimport { updateImage, pageToPixel } from 'cornerstone-core/dist/cornerstone.js'\nimport { import as csTools, EVENTS } from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport {\n\tinitHandle,\n\tsetPrecisionMode,\n\tdisablePrecisionForInactiveHandles,\n} from '@/cornerstone/tools/util/handles'\n\nconst triggerEvent = csTools('util/triggerEvent')\n\nconst MOUSE = true\nconst TOUCH = false\nexport const moveAndRotateHandlesMouse = moveAndRotateHandles(MOUSE)\nexport const moveAndRotateHandlesTouch = moveAndRotateHandles(TOUCH)\n\n// Move handles and rotate other movable handles relative to opposite handle\nfunction moveAndRotateHandles(isMouse) {\n\tconst dragEvents = isMouse ? ['MOUSE_DRAG'] : ['TOUCH_DRAG']\n\tconst upEvents = isMouse\n\t\t? ['MOUSE_UP', 'MOUSE_CLICK']\n\t\t: ['TOUCH_END', 'TOUCH_DRAG_END', 'TOUCH_PINCH', 'TOUCH_PRESS', 'TAP']\n\n\treturn function(eventData, toolType, data, handle, doneMovingCallback) {\n\t\tif (!isMouse) eventData = eventData.detail\n\t\thandle.active = true\n\t\tconst element = eventData.element\n\t\tconst coords = isMouse\n\t\t\t? eventData.currentPoints.image\n\t\t\t: pageToPixel(element, eventData.currentPoints.page.x, eventData.currentPoints.page.y)\n\t\tconst interactionType = isMouse ? 'mouse' : 'touch'\n\t\tinitHandle(handle, coords, interactionType, { precisionHandlesEnabled: true })\n\t\tdisablePrecisionForInactiveHandles(element)\n\n\t\t// Store each handle's starting position for relative angle calculation\n\t\tdata.handles = data.handles.map(handle => {\n\t\t\thandle.startingPoint = {\n\t\t\t\tx: handle.x,\n\t\t\t\ty: handle.y,\n\t\t\t}\n\t\t\treturn handle\n\t\t})\n\n\t\tdragEvents.forEach(event => {\n\t\t\telement.addEventListener(EVENTS[event], dragCallback)\n\t\t})\n\t\tupEvents.forEach(event => {\n\t\t\telement.addEventListener(EVENTS[event], upCallback)\n\t\t})\n\n\t\tfunction dragCallback({ detail }) {\n\t\t\tconst coords = isMouse\n\t\t\t\t? detail.currentPoints.image\n\t\t\t\t: pageToPixel(element, detail.currentPoints.page.x, detail.currentPoints.page.y)\n\t\t\tif (handle.hasMoved === false) handle.hasMoved = true\n\t\t\thandle.active = true\n\t\t\tconst drag = handle.drag\n\t\t\tif (drag) {\n\t\t\t\thandle.x = drag.originX + coords.x - drag.originDragX\n\t\t\t\thandle.y = drag.originY + coords.y - drag.originDragY\n\t\t\t} else {\n\t\t\t\thandle.x = coords.x\n\t\t\t\thandle.y = coords.y\n\t\t\t}\n\n\t\t\tif (!handle.movesIndependently) {\n\t\t\t\tconst oppositeHandleIndeces = {\n\t\t\t\t\t0: 1,\n\t\t\t\t\t1: 0,\n\t\t\t\t\t3: 4,\n\t\t\t\t\t4: 3,\n\t\t\t\t}\n\t\t\t\tconst handleIndex = data.handles.indexOf(handle)\n\t\t\t\tconst oppositeHandleIndex = oppositeHandleIndeces[handleIndex]\n\t\t\t\tconst oppositeHandle = data.handles[oppositeHandleIndex]\n\t\t\t\tconst angleDelta =\n\t\t\t\t\t_getRelativeAngle(oppositeHandle, handle) -\n\t\t\t\t\t_getRelativeAngle(oppositeHandle, handle.startingPoint)\n\t\t\t\tdata.handles.forEach((otherHandle, i) => {\n\t\t\t\t\tif (i === handleIndex || i === oppositeHandleIndex) return\n\t\t\t\t\tif (otherHandle.movesIndependently) return\n\t\t\t\t\tconst newLocation = _rotatePoint(\n\t\t\t\t\t\totherHandle.startingPoint,\n\t\t\t\t\t\toppositeHandle,\n\t\t\t\t\t\tangleDelta || 0\n\t\t\t\t\t)\n\t\t\t\t\totherHandle = Object.assign(otherHandle, newLocation)\n\t\t\t\t})\n\t\t\t}\n\t\t\tupdateImage(element)\n\t\t\tconst eventType = EVENTS.MEASUREMENT_MODIFIED\n\t\t\tconst modifiedEventData = {\n\t\t\t\ttoolType,\n\t\t\t\telement,\n\t\t\t\tmeasurementData: data,\n\t\t\t}\n\t\t\ttriggerEvent(element, eventType, modifiedEventData)\n\t\t}\n\n\t\tfunction upCallback(evt) {\n\t\t\tconst { element, currentPoints } = evt.detail\n\t\t\tconst coords = currentPoints.canvas\n\t\t\tconst nearHandle = handle.pointNearHandle && handle.pointNearHandle(element, handle, coords)\n\t\t\tif (nearHandle && [EVENTS.MOUSE_CLICK, EVENTS.TOUCH_END].includes(evt.type)) {\n\t\t\t\t// Toggle precision mode for handle on click or tap\n\t\t\t\tsetPrecisionMode(handle, nearHandle && !handle.precision)\n\t\t\t}\n\n\t\t\thandle.active = false\n\n\t\t\tdragEvents.forEach(event => {\n\t\t\t\telement.removeEventListener(EVENTS[event], dragCallback)\n\t\t\t})\n\t\t\tupEvents.forEach(event => {\n\t\t\t\telement.removeEventListener(EVENTS[event], upCallback)\n\t\t\t})\n\t\t\tupdateImage(element)\n\t\t\tif (typeof doneMovingCallback === 'function') {\n\t\t\t\tdoneMovingCallback()\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n *\n * @private @function\n * @param {*} center\n * @param {*} endpoint\n * @returns {Number} angle\n */\nconst _getRelativeAngle = function(center, endpoint) {\n\tconst dy = endpoint.y - center.y\n\tconst dx = endpoint.x - center.x\n\treturn Math.atan2(dy, dx)\n}\n\n/**\n *\n * @private @function\n * @param {*} point\n * @param {*} origin\n * @param {*} angle\n * @returns {Object} {x, y}\n */\nconst _rotatePoint = function(point, origin, angle) {\n\treturn {\n\t\tx: Math.cos(angle) * (point.x - origin.x) - Math.sin(angle) * (point.y - origin.y) + origin.x,\n\t\ty: Math.sin(angle) * (point.x - origin.x) + Math.cos(angle) * (point.y - origin.y) + origin.y,\n\t}\n}\n","/* eslint-disable curly, capitalized-comments, newline-before-return, newline-after-var, object-property-newline */\nimport { updateImage, metaData, pixelToCanvas } from 'cornerstone-core/dist/cornerstone.js'\nimport { point } from 'cornerstone-math/dist/cornerstoneMath.js'\nimport {\n\taddToolState,\n\tclearToolState,\n\tgetToolState,\n\timport as csTools,\n\tstore,\n\ttoolColors,\n\ttoolStyle,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { openPromptDlg } from '@dialogs/TextPromptDlg'\nimport { formatNumber, parseNumber } from '@utils/numberUtils'\nimport {\n\tmoveAndRotateHandlesMouse,\n\tmoveAndRotateHandlesTouch,\n} from '@/cornerstone/manipulators/moveAndRotateHandles.js'\nimport moveNewHandle from '@/cornerstone/manipulators/moveNewHandle'\nimport round from 'lodash/round'\nimport triggerDoneModifying from './util/triggerDoneModifying'\nimport getImagePixelSpacing from './util/getImagePixelSpacing'\n\nconst BaseAnnotationTool = csTools('base/BaseAnnotationTool')\n\n// Drawing\nconst draw = csTools('drawing/draw')\nconst drawHandles = csTools('drawing/drawHandles')\nconst drawLine = csTools('drawing/drawLine')\nconst drawLink = csTools('drawing/drawLink')\nconst drawLinkedTextBox = csTools('drawing/drawLinkedTextBox')\nconst drawTextBox = csTools('drawing/drawTextBox')\nconst getNewContext = csTools('drawing/getNewContext')\n\n// Manipulators\nconst moveAllHandles = csTools('manipulators/moveAllHandles')\n\n// Util\nconst lineSegDistance = csTools('util/lineSegDistance')\n\n/**\n * @export @public @class\n * @name AstVertebralHeart\n * @classdesc\n * @extends BaseAnnotationTool\n */\nexport default class AstVertebralHeart extends BaseAnnotationTool {\n\tconstructor(configuration = {}) {\n\t\tconst defaultConfig = {\n\t\t\tname: 'AstVertebralHeart',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\toptions: {\n\t\t\t\tprecisionHandlesEnabled: true,\n\t\t\t},\n\t\t\tconfiguration: {\n\t\t\t\tshadow: true,\n\t\t\t\tshadowColor: '#000000',\n\t\t\t\tshadowOffsetX: 1,\n\t\t\t\tshadowOffsetY: 1,\n\t\t\t\tdrawHandlesOnHover: false,\n\t\t\t\tdefaultAngle: 105,\n\t\t\t},\n\t\t}\n\t\tconst initialConfiguration = Object.assign(defaultConfig, configuration)\n\n\t\tsuper(initialConfiguration)\n\n\t\tthis.initialConfiguration = initialConfiguration\n\t\tthis.mergeOptions(initialConfiguration.options)\n\t\tthis.isDragging = true\n\n\t\tthis.disabledCallback = this._clearIncompleteToolData.bind(this)\n\t\tthis.passiveCallback = this._clearIncompleteToolData.bind(this)\n\t\tthis.enabledCallback = this._clearIncompleteToolData.bind(this)\n\t}\n\n\t// No stats to cache when moving, but CS complains otherwise\n\tupdateCachedStats() {}\n\n\t/**\n\t * Create the measurement data for this tool with the end handle activated\n\t *\n\t * @param {*} eventData\n\t * @returns\n\t */\n\tcreateNewMeasurement({ currentPoints, element }) {\n\t\tconst { x, y } = currentPoints.image\n\t\treturn {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tinvalidated: true,\n\t\t\tcolor: undefined,\n\t\t\thandles: [\n\t\t\t\t{\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: false,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\thighlight: true,\n\t\t\t\t\tactive: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tactive: false,\n\t\t\t\t\thasMoved: false,\n\t\t\t\t\tmovesIndependently: true,\n\t\t\t\t\tdrawnIndependently: true,\n\t\t\t\t\tallowedOutsideImage: true,\n\t\t\t\t\thasBoundingBox: true,\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t}\n\n\taddNewMeasurement(evt, interactionType = 'mouse') {\n\t\tconst eventData = evt.detail\n\t\tconst { element } = eventData\n\t\tconst toolData = getToolState(element, this.name)\n\n\t\t// Determine Current Step\n\t\tconst isExistingInstance = toolData && toolData.data && toolData.data.length\n\t\tconst isAddingSecondLine = isExistingInstance && toolData.data[0].handles.length === 3\n\t\tconst isAddingVertEdge = isExistingInstance && toolData.data[0].handles.length === 6\n\n\t\tlet data\n\t\tif (isExistingInstance) {\n\t\t\tdata = toolData.data[0]\n\t\t} else {\n\t\t\tdata = this.createNewMeasurement(eventData)\n\t\t\taddToolState(element, this.name, data)\n\t\t}\n\t\tif (isAddingSecondLine) {\n\t\t\tdata.handles = data.handles.concat(this.createNewMeasurement(eventData).handles)\n\t\t}\n\t\tif (!isExistingInstance || isAddingSecondLine)\n\t\t\tthis._addHeartLine(eventData, data, isAddingSecondLine, interactionType)\n\t\tif (isAddingVertEdge) this._addVertEdge(eventData, data)\n\t\tevt.preventDefault()\n\t\tevt.stopPropagation()\n\t}\n\n\thandleSelectedCallback(evt, toolData, handle, interactionType = 'mouse') {\n\t\tstore.state.isToolLocked = true\n\t\ttoolData.active = true\n\t\tconst isMouse = interactionType === 'mouse'\n\t\tconst eventData = evt.detail\n\t\tconst { element } = eventData\n\t\tconst upEvent = isMouse ? 'mouseup' : 'touchend'\n\n\t\t// Move handle\n\t\tconst handleMove = isMouse ? moveAndRotateHandlesMouse : moveAndRotateHandlesTouch\n\t\tconst isVhsTextbox = toolData.handles.indexOf(handle) === 9\n\t\tconst handleDoneMove = _handleDoneMove.bind(this, eventData, toolData, element, this.name)\n\t\t// If VHS textbox, show prompt if mouseup event occurs right away (a click)\n\t\tif (isVhsTextbox) {\n\t\t\tconst maxClickDuration = 150\n\t\t\tconst promptForVertebrae = _promptForVertebrae.bind(this, eventData, toolData)\n\t\t\tthis.isDragging = true\n\n\t\t\t// Drag handle if we haven't released in `maxClickDuration`\n\t\t\tsetTimeout(() => {\n\t\t\t\telement.removeEventListener(upEvent, promptForVertebrae)\n\t\t\t\tif (this.isDragging) {\n\t\t\t\t\thandleMove(\n\t\t\t\t\t\tisMouse ? eventData : evt,\n\t\t\t\t\t\tthis.name,\n\t\t\t\t\t\ttoolData,\n\t\t\t\t\t\thandle,\n\t\t\t\t\t\thandleDoneMove,\n\t\t\t\t\t\tthis.configuration.preventHandleOutsideImage,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\t_handleDoneMove(eventData, toolData, element, this.name)\n\t\t\t\t}\n\t\t\t}, maxClickDuration)\n\n\t\t\t// Prompt for vertebrae count if we released within `maxClickDuration`\n\t\t\telement.addEventListener(upEvent, promptForVertebrae)\n\t\t} else {\n\t\t\thandleMove(\n\t\t\t\tisMouse ? eventData : evt,\n\t\t\t\tthis.name,\n\t\t\t\ttoolData,\n\t\t\t\thandle,\n\t\t\t\thandleDoneMove,\n\t\t\t\tthis.configuration.preventHandleOutsideImage,\n\t\t\t\ttrue\n\t\t\t)\n\t\t}\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\ttoolSelectedCallback(evt, toolData, interactionType = 'mouse') {\n\t\tconst isMouse = interactionType === 'mouse'\n\t\tconst shapeHandles = {\n\t\t\theart1: [0, 1],\n\t\t\theart2: [3, 4],\n\t\t\tvert: [6, 7],\n\t\t}\n\n\t\tconst eventData = evt.detail\n\t\tconst { element } = eventData\n\t\tconst coords = eventData.startPoints.canvas\n\t\tconst shape = this.pointNearTool(element, toolData, coords, true, isMouse)\n\t\tif (!shape) return\n\n\t\ttoolData.active = true\n\n\t\t// Move shape\n\t\t_makeHandlesMoveAsGroup(toolData, shapeHandles[shape])\n\n\t\tconst doneMovingCallback = _handleDoneMove.bind(this, eventData, toolData, element, this.name)\n\t\tmoveAllHandles(evt.detail, this.name, toolData, null, this.options, interactionType, doneMovingCallback)\n\n\t\tevt.stopImmediatePropagation()\n\t\tevt.stopPropagation()\n\t\tevt.preventDefault()\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} element\n\t * @param {*} data\n\t * @param {*} coords\n\t * @returns\n\t */\n\tpointNearTool(element, data, coords, returnShape = true, isMouse = true) {\n\t\tconst distance = isMouse ? 15 : 25\n\t\tif (pointOnLine(data.handles[0], data.handles[1])) return returnShape ? 'heart1' : true\n\t\tif (pointOnLine(data.handles[3], data.handles[4])) return returnShape ? 'heart2' : true\n\t\tif (pointNearVert()) return returnShape ? 'vert' : true\n\t\treturn false\n\n\t\tfunction pointNearVert() {\n\t\t\tif (data.handles.length < 10) return\n\t\t\tif (pointOnLine(data.handles[6], data.handles[7])) return true\n\t\t\tconst vertLines = _getVertLines(data.handles)\n\t\t\tif (pointOnLine(vertLines[0].start, vertLines[0].end)) return true\n\t\t\tif (pointOnLine(vertLines[1].start, vertLines[1].end)) return true\n\t\t}\n\t\tfunction pointOnLine(start, end) {\n\t\t\tif (!start || !end) return false\n\t\t\treturn lineSegDistance(element, start, end, coords) < distance\n\t\t}\n\t}\n\n\t/**\n\t *\n\t *\n\t * @param {*} evt\n\t * @returns\n\t */\n\trenderToolData(evt) {\n\t\tconst eventData = evt.detail\n\t\tconst { image, element } = eventData\n\t\tconst toolData = getToolState(evt.currentTarget, this.name)\n\t\tif (!toolData || !toolData.data || !toolData.data.length) return\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\t\tconst data = toolData.data[0] // only ever one instance of this tool\n\n\t\tif (data.visible === false) return\n\n\t\tdraw(context, context => {\n\t\t\tif (this.configuration.shadow) {\n\t\t\t\tcontext.shadowColor = this.configuration.shadowColor || '#000000'\n\t\t\t\tcontext.shadowOffsetX = this.configuration.shadowOffsetX || 1\n\t\t\t\tcontext.shadowOffsetY = this.configuration.shadowOffsetY || 1\n\t\t\t}\n\t\t\tconst color = toolColors.getColorIfActive(data)\n\n\t\t\tconst haveFirstLine = data.handles.length >= 3\n\t\t\tconst haveSecondLine = data.handles.length >= 6\n\t\t\tconst haveVertEdge = data.handles.length >= 10\n\n\t\t\t// Draw handles\n\t\t\tif (this.configuration.drawHandlesOnHover && data.active !== true) {\n\t\t\t\tdrawHandles(context, eventData, data.handles, {\n\t\t\t\t\tcolor,\n\t\t\t\t\tdrawHandlesIfActive: true,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tdrawHandles(context, eventData, data.handles, { color })\n\t\t\t}\n\n\t\t\t// Draw lines\n\t\t\tconst { rowPixelSpacing, columnPixelSpacing, isPixelSpacingDefined } = getImagePixelSpacing(image)\n\t\t\tlet firstLength, secondLength, unit\n\t\t\tif (haveFirstLine) {\n\t\t\t\tdrawLine(context, element, data.handles[0], data.handles[1], { color })\n\t\t\t}\n\t\t\tif (haveSecondLine) {\n\t\t\t\tdrawLine(context, element, data.handles[3], data.handles[4], { color })\n\t\t\t}\n\t\t\tif (haveVertEdge) {\n\t\t\t\tdrawLine(context, element, data.handles[6], data.handles[7], { color })\n\t\t\t\tconst vertLines = _getVertLines(data.handles)\n\t\t\t\tdrawLine(context, element, vertLines[0].start, vertLines[0].end, {\n\t\t\t\t\tcolor,\n\t\t\t\t})\n\t\t\t\tdrawLine(context, element, vertLines[1].start, vertLines[1].end, {\n\t\t\t\t\tcolor,\n\t\t\t\t})\n\t\t\t\tdrawCenteredTextBox(data.handles[8], data.handles[7], 'T4', true)\n\t\t\t\tdrawCenteredTextBox(data.handles[9], data.handles[6], getVhsText(), false)\n\t\t\t}\n\n\t\t\t// Draw measurement textboxes\n\t\t\tif (haveFirstLine) {\n\t\t\t\tunit = isPixelSpacingDefined ? 'mm' : 'px'\n\t\t\t\tlet label = ''\n\t\t\t\tfirstLength = getLength(data.handles[0], data.handles[1])\n\t\t\t\tif (haveSecondLine) {\n\t\t\t\t\tsecondLength = getLength(data.handles[3], data.handles[4])\n\t\t\t\t\tlabel = firstLength > secondLength ? 'L: ' : 'S: '\n\t\t\t\t}\n\t\t\t\tdrawAnchoredTextBox(data.handles[2], data.handles[1], `${label}${formatNumber(round(firstLength, 2))} ${unit}`)\n\t\t\t}\n\t\t\tif (haveSecondLine) {\n\t\t\t\tconst label = secondLength > firstLength ? 'L: ' : 'S: '\n\t\t\t\tdrawAnchoredTextBox(data.handles[5], data.handles[4], `${label}${formatNumber(round(secondLength, 2))} ${unit}`)\n\t\t\t}\n\n\t\t\tfunction getLength(start, end) {\n\t\t\t\tconst dx = (end.x - start.x) * columnPixelSpacing\n\t\t\t\tconst dy = (end.y - start.y) * rowPixelSpacing\n\t\t\t\treturn Math.sqrt(dx * dx + dy * dy)\n\t\t\t}\n\t\t\tfunction getVhsText() {\n\t\t\t\tif (!data.long || !data.short) return '[Click to add score]'\n\t\t\t\tconst vhs = formatNumber(round(data.long + data.short, 1))\n\t\t\t\treturn `VHS: ${vhs} (${formatNumber(data.long)} + ${formatNumber(data.short)})`\n\t\t\t}\n\t\t\tfunction drawCenteredTextBox(textBox, linkedLineHandle, text, placeAbove) {\n\t\t\t\tif (!textBox.hasMoved) {\n\t\t\t\t\ttextBox.x = linkedLineHandle.x\n\t\t\t\t\ttextBox.y = linkedLineHandle.y\n\t\t\t\t}\n\t\t\t\tconst textCoords = pixelToCanvas(element, textBox)\n\t\t\t\tconst verticalOffset = (20 + (linkedLineHandle.radius || 6)) * (placeAbove ? -1 : 1)\n\t\t\t\tif (!textBox.hasMoved) textCoords.y += verticalOffset\n\t\t\t\tconst options = {\n\t\t\t\t\tcentering: {\n\t\t\t\t\t\tx: true,\n\t\t\t\t\t\ty: true,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t\ttextBox.boundingBox = drawTextBox(context, [text], textCoords.x, textCoords.y, color, options)\n\t\t\t\tif (textBox.hasMoved) {\n\t\t\t\t\t// Draw dashed link line between tool and text\n\t\t\t\t\tdrawLink(\n\t\t\t\t\t\t[pixelToCanvas(element, linkedLineHandle)],\n\t\t\t\t\t\ttextCoords,\n\t\t\t\t\t\ttextBox.boundingBox,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\ttoolStyle.getToolWidth()\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction drawAnchoredTextBox(textBox, linkedLineHandle, text) {\n\t\t\t\tconst color = toolColors.getColorIfActive(data)\n\t\t\t\tlet textBoxOffset = 0\n\t\t\t\tif (!textBox.hasMoved) {\n\t\t\t\t\ttextBoxOffset = linkedLineHandle.radius + 6\n\t\t\t\t\ttextBox.x = linkedLineHandle.x\n\t\t\t\t\ttextBox.y = linkedLineHandle.y\n\t\t\t\t}\n\t\t\t\tdrawLinkedTextBox(\n\t\t\t\t\tcontext,\n\t\t\t\t\telement,\n\t\t\t\t\ttextBox,\n\t\t\t\t\t[text],\n\t\t\t\t\t[linkedLineHandle],\n\t\t\t\t\t() => [linkedLineHandle],\n\t\t\t\t\tcolor,\n\t\t\t\t\ttoolStyle.getToolWidth(),\n\t\t\t\t\ttextBoxOffset,\n\t\t\t\t\tfalse\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t}\n\n\t_addHeartLine(eventData, data, isAddingSecondLine, interactionType) {\n\t\tconst doneMovingCallback = () => {\n\t\t\tdata.invalidated = true\n\n\t\t\tif (isAddingSecondLine) {\n\t\t\t\tif (isIntersecting()) snapToPerpendicular()\n\t\t\t\tif (!isIntersecting()) data.handles = data.handles.slice(0, 3) // remove badly placed second line\n\t\t\t}\n\t\t\tupdateImage(this.element)\n\t\t}\n\n\t\t// Move our new handle :+1:\n\t\tmoveNewHandle(\n\t\t\teventData,\n\t\t\tthis.name,\n\t\t\tdata,\n\t\t\tdata.handles[data.handles.length - 2],\n\t\t\tthis.options,\n\t\t\tinteractionType,\n\t\t\tdoneMovingCallback\n\t\t)\n\n\t\tfunction isIntersecting() {\n\t\t\tconst lineA = [data.handles[0], data.handles[1]]\n\t\t\tconst lineB = [data.handles[3], data.handles[4]]\n\t\t\tconst det =\n\t\t\t\t(lineA[1].x - lineA[0].x) * (lineB[1].y - lineB[0].y) - (lineB[1].x - lineB[0].x) * (lineA[1].y - lineA[0].y)\n\t\t\tif (det === 0) return false\n\t\t\tconst lambda =\n\t\t\t\t((lineB[1].y - lineB[0].y) * (lineB[1].x - lineA[0].x) +\n\t\t\t\t\t(lineB[0].x - lineB[1].x) * (lineB[1].y - lineA[0].y)) /\n\t\t\t\tdet\n\t\t\tconst gamma =\n\t\t\t\t((lineA[0].y - lineA[1].y) * (lineB[1].x - lineA[0].x) +\n\t\t\t\t\t(lineA[1].x - lineA[0].x) * (lineB[1].y - lineA[0].y)) /\n\t\t\t\tdet\n\t\t\treturn lambda > 0 && lambda < 1 && gamma > 0 && gamma < 1\n\t\t}\n\t\tfunction snapToPerpendicular() {\n\t\t\tconst crossPoint = _getCrossPoint(data.handles)\n\t\t\tconst slope = (crossPoint.y - data.handles[3].y) / (crossPoint.x - data.handles[3].x)\n\t\t\tconst isHorizontal = Math.abs(slope) < 1\n\t\t\tconst padding = 6\n\t\t\tif (isHorizontal) {\n\t\t\t\tsnapToX()\n\t\t\t\tif (!isWithinBounds()) {\n\t\t\t\t\tif (data.handles[4].y < padding) data.handles[4].y = padding\n\t\t\t\t\tif (data.handles[4].y > eventData.image.height - padding) data.handles[4].y = eventData.image.height - padding\n\t\t\t\t\tsnapToY()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsnapToY()\n\t\t\t\tif (!isWithinBounds()) {\n\t\t\t\t\tif (data.handles[4].x < padding) data.handles[4].x = padding\n\t\t\t\t\tif (data.handles[4].x > eventData.image.width - padding) data.handles[4].x = eventData.image.width - padding\n\t\t\t\t\tsnapToX()\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isWithinBounds()) data.handles = data.handles.slice(0, 3)\n\n\t\t\tfunction snapToX() {\n\t\t\t\tdata.handles[4].y = slope * (data.handles[4].x - crossPoint.x) + crossPoint.y\n\t\t\t}\n\t\t\tfunction snapToY() {\n\t\t\t\tdata.handles[4].x = (data.handles[4].y - crossPoint.y) / slope + crossPoint.x\n\t\t\t}\n\t\t\tfunction isWithinBounds() {\n\t\t\t\tconst yInBounds = data.handles[4].y >= padding && data.handles[4].y <= eventData.image.height - padding\n\t\t\t\tconst xInBounds = data.handles[4].x >= padding && data.handles[4].x <= eventData.image.width - padding\n\t\t\t\treturn yInBounds && xInBounds\n\t\t\t}\n\t\t}\n\t}\n\n\t_addVertEdge(eventData, data) {\n\t\tconst getDistance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2))\n\t\tconst heartLengths = [getDistance(data.handles[0], data.handles[1]), getDistance(data.handles[3], data.handles[4])]\n\t\tconst defaultHeight = Math.max(...heartLengths) / 2\n\t\tconst topHandle = {\n\t\t\tx: eventData.currentPoints.image.x,\n\t\t\ty: eventData.currentPoints.image.y,\n\t\t\thighlight: true,\n\t\t\tactive: true,\n\t\t\tmovesIndependently: true,\n\t\t}\n\t\tconst bottomHandle = {\n\t\t\tx: eventData.currentPoints.image.x,\n\t\t\ty: eventData.currentPoints.image.y + defaultHeight,\n\t\t\thighlight: true,\n\t\t\tactive: false,\n\t\t\tmovesIndependently: true,\n\t\t}\n\t\tconst textBox = {\n\t\t\tactive: false,\n\t\t\thasMoved: false,\n\t\t\tmovesIndependently: true,\n\t\t\tdrawnIndependently: true,\n\t\t\tallowedOutsideImage: true,\n\t\t\thasBoundingBox: true,\n\t\t}\n\t\tdata.handles.push(bottomHandle, topHandle, Object.assign({}, textBox), Object.assign({}, textBox))\n\t\tdata.invalidated = true\n\t\tupdateImage(this.element)\n\t\ttriggerDoneModifying(this.name, this.element, eventData.image)\n\t}\n\n\t/**\n\t * Clears the tool's state if it is not a completed annotation. Usually\n\t * fired when exiting the tool's `active` mode.\n\t *\n\t * @memberof AstVertebralHeart\n\t */\n\t_clearIncompleteToolData(element, options) {\n\t\tconst toolData = getToolState(this.element, this.name)\n\t\tconst isToolInstance = toolData && toolData.data && toolData.data.length\n\t\tconst isIncompleteDrawing = isToolInstance && toolData.data[0].handles.length < 10\n\t\tif (isIncompleteDrawing) {\n\t\t\tclearToolState(this.element, this.name)\n\t\t\tupdateImage(this.element)\n\t\t}\n\t}\n}\n\n/**\n *\n *\n * @param {*} data\n * @returns\n */\nasync function _promptForVertebrae(eventData, data) {\n\t/* eslint-disable no-alert */\n\tthis.isDragging = false\n\tconst lengths = _getVertLines(data.handles).map(line => point.distance(line.start, line.end))\n\tconst [longLength, shortLength] = lengths\n\tconst longToShortRatio = longLength / shortLength\n\tconst long = parseNumber(\n\t\tawait openPromptDlg({\n\t\t\ttitle: 'Vertabrae',\n\t\t\tprompt: 'Enter the vertebrae count for the long axis:',\n\t\t\tdefaultValue: (data.long && formatNumber(data.long)) || '',\n\t\t})\n\t)\n\tif (!long) return\n\tconst calculatedShortCount = round(long * longToShortRatio, 1)\n\tconst short = parseNumber(\n\t\tawait openPromptDlg({\n\t\t\ttitle: 'Vertabrae',\n\t\t\tprompt: 'Enter the vertebrae count for the short axis:',\n\t\t\tdefaultValue: formatNumber(data.short || calculatedShortCount),\n\t\t})\n\t)\n\tif (!short) return\n\tdata.long = long\n\tdata.short = short\n\tupdateImage(this.element)\n\ttriggerDoneModifying(this.name, this.element, eventData.image)\n}\n\n/**\n *\n *\n * @param {*} data\n * @param {*} indeces\n */\nfunction _makeHandlesMoveAsGroup(data, indeces) {\n\tdata.handles = data.handles.map((handle, i) => {\n\t\thandle.movesIndependently = !indeces.includes(i)\n\t\treturn handle\n\t})\n}\n\n/**\n *\n *\n * @param {*} eventData\n * @param {*} toolData\n * @param {HTMLElement} element\n * @param {string} toolName - The tool's name\n */\nfunction _handleDoneMove(eventData, toolData, element, toolName) {\n\tconst shapeHandles = {\n\t\theart1: [0, 1],\n\t\theart2: [3, 4],\n\t\tvert: [6, 7],\n\t}\n\t_makeHandlesMoveAsGroup(toolData, shapeHandles.heart1.concat(shapeHandles.heart2)) // reset heart back to move as group for rotation\n\ttoolData.active = false\n\ttoolData.invalidated = true\n\tstore.state.isToolLocked = false\n\tupdateImage(element)\n\n\ttriggerDoneModifying(toolName, element, eventData.image)\n}\n\n/**\n * Gets points for vertebrae lines (for both drawing and pointNearTool)\n *\n * @private @function\n * @param {*} handles\n * @returns {Array} {start, end} Sorted array of vertebrae lines\n */\nconst _getVertLines = function(handles) {\n\tconst lengths = [point.distance(handles[0], handles[1]), point.distance(handles[3], handles[4])]\n\treturn lengths.sort((a, b) => a - b).map((length, i) => getVertLine(handles, length, i))\n\n\tfunction getVertLine(handles, length, index) {\n\t\tconst position = index === 0 ? 0.4 : 0.6\n\t\tconst edgeDeltaX = handles[7].x - handles[6].x\n\t\tconst edgeDeltaY = handles[7].y - handles[6].y\n\t\tif (edgeDeltaY > 0) length *= -1 // allow lines to be rotated to left side\n\t\tconst start = {\n\t\t\tx: handles[6].x + edgeDeltaX * position,\n\t\t\ty: handles[6].y + edgeDeltaY * position,\n\t\t}\n\t\tconst slope = edgeDeltaX / edgeDeltaY\n\t\tconst end = {\n\t\t\tx: start.x + length * Math.sqrt(1 / (1 + Math.pow(slope, 2))),\n\t\t\ty: start.y - length * slope * Math.sqrt(1 / (1 + Math.pow(slope, 2))),\n\t\t}\n\t\treturn {\n\t\t\tstart,\n\t\t\tend,\n\t\t}\n\t}\n}\n\n/**\n * Gets points where heart lines intersect (for snapping last heart handle)\n *\n * @private @function\n * @param {*} handles\n * @returns {Object} {x, y}\n */\nconst _getCrossPoint = function(handles) {\n\tconst lineDeltaY = handles[1].y - handles[0].y\n\tconst lineDeltaX = handles[1].x - handles[0].x\n\tconst originDeltaX = handles[3].x - handles[0].x\n\tconst originDeltaY = handles[3].y - handles[0].y\n\tconst k =\n\t\t(lineDeltaY * originDeltaX - lineDeltaX * originDeltaY) / (lineDeltaY * lineDeltaY + lineDeltaX * lineDeltaX)\n\treturn {\n\t\tx: handles[3].x - k * lineDeltaY,\n\t\ty: handles[3].y + k * lineDeltaX,\n\t}\n}\n","import {\n  updateImage,\n  pixelToCanvas,\n} from 'cornerstone-core/dist/cornerstone.js'\n\nimport {\n  import as csTools,\n  store,\n  getToolState,\n  removeToolState,\n} from 'cornerstone-tools/dist/cornerstoneTools.js'\n\nconst BaseTool = csTools('base/BaseTool')\nconst state = store.state\n// const { eraserCursor } = csTools('tools/cursors')\n\n/**\n * @public\n * @class AstEraserTool\n * @memberof Tools.Custom\n *\n * @classdesc Tool for deleting the data of other Annotation Tools.\n * @extends Tools.Base.BaseTool\n */\nexport default class AstEraser extends BaseTool {\n  constructor(config = {}) {\n    const defaultConfig = {\n      name: 'AstEraser',\n      supportedInteractionTypes: ['Mouse', 'Touch'],\n      // svgCursor: eraserCursor,\n    }\n    super(Object.assign(defaultConfig, config))\n\n    this.preMouseDownCallback = this._deleteAllNearbyTools.bind(this)\n    this.preTouchStartCallback = this._deleteAllNearbyTools.bind(this)\n  }\n\n  _deleteAllNearbyTools(evt) {\n    const coords = evt.detail.currentPoints.canvas\n    const element = evt.detail.element\n\n    state.tools.forEach(tool => {\n      const toolState = getToolState(element, tool.name)\n      if (toolState) {\n        toolState.data.forEach(data => {\n          const handles = data.handles\n          let removeTool = false\n          // Check for handles\n          if (handles) {\n            if (handles.length) {\n              // Remove if coordinates are near any of the handle elements\n              removeTool = !!handles.find(h => this._pointsNear(coords, h))\n            } else if (handles.start && handles.end) {\n              // Remove if coordinates are near the handle start or end\n              const startCanvas = pixelToCanvas(element, handles.start)\n              const endCanvas = pixelToCanvas(element, handles.end)\n              removeTool =\n                this._pointsNear(coords, startCanvas) ||\n                this._pointsNear(coords, endCanvas)\n            }\n          }\n          // Or remove tool if coordinates are near the tool\n          if (\n            !removeTool &&\n            typeof tool.pointNearTool === 'function' &&\n            tool.pointNearTool(element, data, coords)\n          ) {\n            removeTool = true\n          }\n          // Remove it!\n          if (removeTool) {\n            removeToolState(element, tool.name, data)\n            updateImage(element)\n          }\n        })\n      }\n    })\n    return true\n  }\n\n  _pointsNear({ x: fromX, y: fromY }, { x: toX, y: toY }, tolerance = 5) {\n    return (\n      Math.abs(fromX - toX) <= tolerance && Math.abs(fromY - toY) <= tolerance\n    )\n  }\n}\n","/**\n * Copied from Cornerstone Tools so we can use previously stored metadata instead of relying on dom elements from other pages.\n * One file because that's easier.\n */\nimport { external, import as csTools, toolColors } from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { waitForEnabledElementImageToLoad } from '@/utils/wait.js'\n\nimport convertToVector3 from '@/utils/convertToVector3'\nimport store from '@store'\n\nconst BaseTool = csTools('base/BaseTool')\nconst draw = csTools('drawing/draw')\nconst drawLine = csTools('drawing/drawLine')\n\nconst getNewContext = csTools('drawing/getNewContext')\n\n/**\n * When enabled, this tool will display references lines for each source\n * enabledElement in the provided synchronizer. This tool can also be configured\n * to use a custom renderer for alternative reference line rendering behavior\n *\n * TODO: Need to watch for configuration changes to update ToolState\n * TODO:\n *\n * @export @public @class\n * @name ReferenceLinesTool\n * @classdesc Tool for displaying reference lines of other enabledElements\n * @extends Tools.Base.BaseTool\n */\nexport default class ReferenceLinesTool extends BaseTool {\n\tconstructor(props = {}) {\n\t\tconst defaultProps = {\n\t\t\tname: 'ReferenceLines',\n\t\t\tmixins: ['enabledOrDisabledBinaryTool'],\n\t\t\tconfiguration: {\n\t\t\t\trenderer: renderActiveReferenceLine,\n\t\t\t},\n\t\t}\n\n\t\tsuper(props, defaultProps)\n\n\t\tthis.renderer = null\n\t\tthis.synchronizationContext = null\n\t}\n\n\tasync enabledCallback(element, { synchronizationContext } = {}) {\n\t\tconst renderer = this.configuration.renderer\n\t\tconst enabledElement = await waitForEnabledElementImageToLoad(element)\n\n\t\tif (!enabledElement || !renderer || !synchronizationContext) {\n\t\t\t// TODO: Unable to add tool state, image never loaded.\n\t\t\t// Should we `setToolDisabledForElement` here?\n\t\t\t// logger.warn(\n\t\t\t//   `Unable to enable ${this.name}. Exiting enable callback. Tool will be enabled, but will not render.`\n\t\t\t// );\n\t\t\treturn\n\t\t}\n\t\tthis.renderer = renderer\n\t\tthis.synchronizationContext = synchronizationContext\n\n\t\tthis.forceImageUpdate(element)\n\t}\n\n\tdisabledCallback(element) {\n\t\tthis.forceImageUpdate(element)\n\t}\n\n\tforceImageUpdate(element) {\n\t\tconst enabledElement = external.cornerstone.getEnabledElement(element)\n\n\t\tif (enabledElement.image) {\n\t\t\texternal.cornerstone.updateImage(element)\n\t\t}\n\t}\n\n\trenderToolData(evt) {\n\t\tconst eventData = evt.detail\n\n\t\t// No renderer or synch context? Adios\n\t\tif (!this.renderer || !this.synchronizationContext) {\n\t\t\treturn\n\t\t}\n\n\t\t// This is a onetime check to see if the metadata hasn't been set yet.\n\t\t// Not ideal, but the first pass kept failing for some reason.\n\t\tlet referenceMetaData = store.state.viewer.activeImageMetadata\n\n\t\t// Get the enabled elements associated with this synchronization context and draw them\n\t\tconst enabledElements = this.synchronizationContext.getSourceElements()\n\t\tconst context = getNewContext(eventData.canvasContext.canvas)\n\n\t\texternal.cornerstone.setToPixelCoordinateSystem(eventData.enabledElement, context)\n\n\t\tif (enabledElements.length) {\n\t\t\tenabledElements.forEach(referenceEnabledElement => {\n\t\t\t\t// Render it\n\t\t\t\tthis.renderer(context, eventData, evt.currentTarget, referenceMetaData)\n\t\t\t})\n\t\t} else if (referenceMetaData) {\n\t\t\t// There is no enabled element (because it's on the other window)\n\t\t\tthis.renderer(context, eventData, evt.currentTarget, referenceMetaData)\n\t\t}\n\t}\n}\n\n/**\n * Renders the active reference line.\n *\n * @export @public @method\n * @name renderActiveReferenceLine\n * @param  {Object} context        The canvas context.\n * @param  {Object} eventData      The data associated with the event.\n * @param  {HTMLElement} targetElement    The element on which to render the reference line.\n * @param  {Object} referenceImageMetadata The metadata for the element referenced by the line.\n * @returns {void}\n */\nexport function renderActiveReferenceLine(\n\tcontext,\n\teventData,\n\ttargetElement,\n\treferenceImageMetadata\n) {\n\tconst cornerstone = external.cornerstone\n\tconst targetImage = cornerstone.getEnabledElement(targetElement).image\n\n\t// Make sure the images are actually loaded for the target and reference\n\tif (!targetImage || !referenceImageMetadata) {\n\t\treturn\n\t}\n\n\tconst targetImagePlane = cornerstone.metaData.get('imagePlaneModule', targetImage.imageId)\n\tconst referenceImagePlane = referenceImageMetadata\n\n\t// Make sure the target and reference actually have image plane metadata\n\tif (\n\t\t!targetImagePlane ||\n\t\t!referenceImagePlane ||\n\t\t!targetImagePlane.rowCosines ||\n\t\t!targetImagePlane.columnCosines ||\n\t\t!targetImagePlane.imagePositionPatient ||\n\t\t!referenceImagePlane.rowCosines ||\n\t\t!referenceImagePlane.columnCosines ||\n\t\t!referenceImagePlane.imagePositionPatient\n\t) {\n\t\treturn\n\t}\n\n\t// The image planes must be in the same frame of reference\n\tif (targetImagePlane.frameOfReferenceUID !== referenceImagePlane.frameOfReferenceUID) {\n\t\treturn\n\t}\n\n\ttargetImagePlane.rowCosines = convertToVector3(targetImagePlane.rowCosines)\n\ttargetImagePlane.columnCosines = convertToVector3(targetImagePlane.columnCosines)\n\ttargetImagePlane.imagePositionPatient = convertToVector3(targetImagePlane.imagePositionPatient)\n\treferenceImagePlane.rowCosines = convertToVector3(referenceImagePlane.rowCosines)\n\treferenceImagePlane.columnCosines = convertToVector3(referenceImagePlane.columnCosines)\n\treferenceImagePlane.imagePositionPatient = convertToVector3(\n\t\treferenceImagePlane.imagePositionPatient\n\t)\n\n\t// The image plane normals must be > 30 degrees apart\n\tconst targetNormal = targetImagePlane.rowCosines.clone().cross(targetImagePlane.columnCosines)\n\tconst referenceNormal = referenceImagePlane.rowCosines\n\t\t.clone()\n\t\t.cross(referenceImagePlane.columnCosines)\n\tlet angleInRadians = targetNormal.angleTo(referenceNormal)\n\n\tangleInRadians = Math.abs(angleInRadians)\n\tif (angleInRadians < 0.5) {\n\t\t// 0.5 radians = ~30 degrees\n\t\treturn\n\t}\n\n\tconst referenceLine = calculateReferenceLine(targetImagePlane, referenceImagePlane)\n\n\tif (!referenceLine) {\n\t\treturn\n\t}\n\n\tconst color = toolColors.getActiveColor()\n\n\t// Draw the referenceLines\n\tcontext.setTransform(1, 0, 0, 1, 0, 0)\n\n\tdraw(context, context => {\n\t\tdrawLine(context, eventData.element, referenceLine.start, referenceLine.end, { color })\n\t})\n}\n\nconst planePlaneIntersection = csTools('util/planePlaneIntersection')\nconst projectPatientPointToImagePlane = csTools('util/projectPatientPointToImagePlane')\n\n/**\n * Calculates a reference line between two planes by projecting the top left hand corner and bottom right hand corner\n * Of the reference image onto the target image.  Ideally we would calculate the intersection between the planes but\n * That requires a bit more math and this works fine for most cases.\n *\n * @export\n * @public\n * @method\n * @name calculateReferenceLine\n * @param  {Object} targetImagePlane    The imagePlane on which the reference line will be drawn.\n * @param  {Object} referenceImagePlane The imagePlane being referenced.\n * @returns {Object}  The start and end points of the line to be drawn.\n */\nexport function calculateReferenceLine(targetImagePlane, referenceImagePlane) {\n\tconst points = planePlaneIntersection(targetImagePlane, referenceImagePlane)\n\n\tif (!points) {\n\t\treturn\n\t}\n\n\treturn {\n\t\tstart: projectPatientPointToImagePlane(points.start, targetImagePlane),\n\t\tend: projectPatientPointToImagePlane(points.end, targetImagePlane),\n\t}\n}\n","import { external, import as csTools } from 'cornerstone-tools/dist/cornerstoneTools.js'\nconst BaseTool = csTools('base/BaseTool')\n\n/**\n * @public\n * @class RotateTool\n * @memberof Tools\n *\n * @classdesc Tool for rotating the image.\n * @extends Tools.Base.BaseTool\n */\n\nexport default class RotateTool extends BaseTool {\n\tfirstTouchOnMobile = true\n\tconstructor(props = {}) {\n\t\tconst defaultProps = {\n\t\t\tname: 'Rotate',\n\t\t\tstrategies: {\n\t\t\t\thorizontal: horizontalStrategy,\n\t\t\t\tvertical: verticalStrategy,\n\t\t\t},\n\t\t\tdefaultStrategy: 'vertical',\n\t\t\tsupportedInteractionTypes: ['Mouse', 'Touch'],\n\t\t\tconfiguration: {\n\t\t\t\troundAngles: true,\n\t\t\t\tflipHorizontal: true,\n\t\t\t\tflipVertical: true,\n\t\t\t\trotateScale: 0.33,\n\t\t\t},\n\t\t\trotationValue: 0,\n\t\t}\n\t\tsuper(props, defaultProps)\n\t\tthis.postMouseDownCallback = this._movingEventCallback.bind(this)\n\t\tthis.touchEndCallback = this._endMobileMovingEventCallback.bind(this)\n\t}\n\ttouchDragCallback(evt) {\n\t\tthis.dragCallback(evt)\n\t\tif (this.firstTouchOnMobile) {\n\t\t\tif (typeof this.rotationValue === 'undefined') {\n\t\t\t\tevt.detail.viewport.rotation = 0\n\t\t\t\tthis._movingEventCallback(evt)\n\t\t\t}\n\t\t}\n\t\tthis.firstTouchOnMobile = false\n\t}\n\n\t_endMobileMovingEventCallback(evt) {\n\t\tthis.rotationValue = evt.detail.viewport.rotation\n\t}\n\n\tmouseDragCallback(evt) {\n\t\tthis.dragCallback(evt)\n\t}\n\n\t_movingEventCallback(evt) {\n\t\tconst { viewport } = evt.detail\n\t\tthis.rotationValue = viewport.rotation\n\t}\n\n\tdragCallback(evt) {\n\t\tconsole.log('dragcallback')\n\t\tif (this.initialRotation === undefined) this.initialRotation = evt.detail.viewport.rotation\n\t\tevt.detail.viewport.initialRotation = this.initialRotation\n\t\tthis.applyActiveStrategy(evt)\n\t\texternal.cornerstone.setViewport(evt.detail.element, evt.detail.viewport)\n\t}\n}\n\nfunction horizontalStrategy(evt) {\n\tconst { roundAngles, flipHorizontal, rotateScale } = this.configuration\n\tconst { viewport, startPoints, currentPoints } = evt.detail\n\tif (!startPoints) return\n\tconst initialRotation = viewport.initialRotation\n\tconst initialPointX = startPoints.client.x\n\tconst currentPointX = currentPoints.client.x\n\n\tlet angle = (currentPointX - initialPointX) * rotateScale\n\n\tif (roundAngles) {\n\t\tangle = Math.round(Math.abs(angle)) * (angle > 0 ? 1 : -1)\n\t}\n\tif (flipHorizontal) {\n\t\tangle = -angle\n\t}\n\n\tviewport.rotation = initialRotation + angle\n}\n\nfunction verticalStrategy(evt) {\n\tconst { roundAngles, flipVertical, rotateScale } = this.configuration\n\tconst { viewport, startPoints, currentPoints } = evt.detail\n\tif (!startPoints) return\n\tconst initialRotation = this.rotationValue\n\tconst initialPointY = startPoints.client.y\n\tconst currentPointY = currentPoints.client.y\n\n\tlet angle = (currentPointY - initialPointY) * rotateScale\n\n\tif (roundAngles) {\n\t\tangle = Math.round(Math.abs(angle)) * (angle > 0 ? 1 : -1)\n\t}\n\tif (flipVertical) {\n\t\tangle = -angle\n\t}\n\n\tviewport.rotation = initialRotation + angle\n}\n","import AstAngle from './AstAngle'\nimport AstCalibration from './AstCalibration'\nimport AstText from './AstText'\nimport AstArrowAnnotate from './AstArrowAnnotate'\nimport AstRectangleRoi from './AstRectangleRoi'\nimport AstCircleRoi from './AstCircleRoi'\nimport AstEllipticalRoi from './AstEllipticalRoi'\nimport AstCrossPoint from './AstCrossPoint'\nimport AstHipDysplasia from './AstHipDysplasia'\nimport AstLengthAngle from './AstLengthAngle'\nimport AstOrientationMarkers from './AstOrientationMarkers'\nimport AstPennHip from './AstPennHip'\nimport AstProbe from './AstProbe'\nimport AstTplo from './AstTplo'\nimport AstTta from './AstTta'\nimport AstVertebralHeart from './AstVertebralHeart'\nimport AstEraser from './AstEraser'\nimport AstReferenceLines from './AstReferenceLines'\nimport AstRotateTool from './AstRotateTool'\n\nexport default {\n\tAstAngle,\n\tAstCalibration,\n\tAstText,\n\tAstArrowAnnotate,\n\tAstRectangleRoi,\n\tAstCircleRoi,\n\tAstEllipticalRoi,\n\tAstCrossPoint,\n\tAstHipDysplasia,\n\tAstLengthAngle,\n\tAstOrientationMarkers,\n\tAstPennHip,\n\tAstProbe,\n\tAstTplo,\n\tAstTta,\n\tAstVertebralHeart,\n\tAstEraser,\n\tAstReferenceLines,\n\tAstRotateTool,\n}\n","// This cannot detect, or exit from, fullscreen triggered by F11/browser UI\n// https://stackoverflow.com/a/44368592/6136739\nimport { omniDesktop } from '@/electron/omniDesktop'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tisFullScreenSupported: true,\n\t\t\tisFullScreen: false,\n\t\t}\n\t},\n\tcreated() {\n\t\t// make sure browser supports a fullscreen property, as well as an enter and exit method\n\t\tconst fullScreenProperties = ['fullscreen', 'mozFullScreen', 'webkitIsFullScreen']\n\t\tconst fullScreenProperty = fullScreenProperties.find(p => p in document)\n\t\tif ((!fullScreenProperty || document.fullscreenEnabled === false) && !omniDesktop.isConnected)\n\t\t\tthis.isFullScreenSupported = false\n\t\tif (this.isFullScreenSupported) {\n\t\t\tconst onResize = async () => {\n\t\t\t\tif (omniDesktop.isConnected) {\n\t\t\t\t\tthis.isFullScreen = await omniDesktop.request('isWindowFullscreen')\n\t\t\t\t} else this.isFullScreen = document[fullScreenProperty]\n\t\t\t}\n\t\t\t// The fullscreenchange event is not as well supported as the resize event, so we use that\n\t\t\twindow.addEventListener('resize', onResize)\n\t\t\tthis.$once('hook:beforeDestroy', () => window.removeEventListener('resize', onResize))\n\t\t}\n\t},\n\tmethods: {\n\t\ttoggleFullScreen() {\n\t\t\tif (this.isFullScreen) return exitFullScreen()\n\t\t\treturn enterFullScreen()\n\n\t\t\tfunction enterFullScreen() {\n\t\t\t\tif (omniDesktop.isConnected) {\n\t\t\t\t\tomniDesktop.request('setWindowFullscreen', true)\n\t\t\t\t} else {\n\t\t\t\t\tconst enterMethods = [\n\t\t\t\t\t\t'requestFullscreen',\n\t\t\t\t\t\t'mozRequestFullScreen',\n\t\t\t\t\t\t'webkitRequestFullscreen',\n\t\t\t\t\t\t'msRequestFullscreen',\n\t\t\t\t\t]\n\t\t\t\t\tconst el = document.documentElement\n\t\t\t\t\tconst method = enterMethods.find(m => m in el)\n\t\t\t\t\tif (!method) return\n\t\t\t\t\tel[method]()\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction exitFullScreen() {\n\t\t\t\tif (omniDesktop.isConnected) {\n\t\t\t\t\tomniDesktop.request('setWindowFullscreen', false)\n\t\t\t\t} else {\n\t\t\t\t\tconst exitMethods = ['exitFullscreen', 'mozCancelFullScreen', 'webkitExitFullscreen', 'msExitFullscreen']\n\t\t\t\t\tconst method = exitMethods.find(m => m in document)\n\t\t\t\t\tif (!method) return\n\t\t\t\t\tdocument[method]()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isOpen)?_c('dialog',{directives:[{name:\"draggable\",rawName:\"v-draggable\"}],ref:\"dialog\",staticClass:\"annotation-dialog\",attrs:{\"open\":\"\"}},[_c('h4',{staticStyle:{\"margin-bottom\":\"16px\"}},[_c('svg-icon',{attrs:{\"icon\":_vm.toolInfo.iconName,\"fixed\":\"\"}}),_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.toolInfo.title)+\"\\n\\t\")],1),(_vm.tool.name === 'AstCircleRoi')?_c('ast-circle-roi',{attrs:{\"diameter\":_vm.annotation.cachedStats.diameter.toFixed(2),\"event\":_vm.event,\"tool\":_vm.tool,\"unit\":_vm.unit},on:{\"set-diameter\":_vm.setCircleDiameter,\"close\":function($event){return _vm.close()}}}):_vm._e(),(_vm.tool.name === 'AstCalibration')?_c('ast-calibration',{attrs:{\"annotation\":_vm.annotation,\"event\":_vm.event,\"tool\":_vm.tool},on:{\"update-image\":_vm.updateImage,\"close\":function($event){return _vm.close()}}}):_vm._e(),(_vm.textboxes.length)?[_c('h5',{staticStyle:{\"margin-bottom\":\"4px\"}},[_vm._v(\"Textboxes\")]),_c('ul',{staticClass:\"unlist\"},_vm._l((_vm.textboxes),function(textbox,i){return _c('li',{key:((_vm.annotation.uuid) + \"-\" + i),staticStyle:{\"padding\":\"2px 0\"}},[_c('annotation-checkbox',{attrs:{\"textbox\":textbox,\"disabled\":!_vm.canHideTextbox},on:{\"update-image\":_vm.updateImage}},[(_vm.canEditTextbox)?_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.annotation.text),expression:\"annotation.text\"}],staticClass:\"input\",attrs:{\"placeholder\":\"Annotation Text\"},domProps:{\"value\":(_vm.annotation.text)},on:{\"mousedown\":function($event){$event.stopPropagation();},\"input\":[function($event){if($event.target.composing){ return; }_vm.$set(_vm.annotation, \"text\", $event.target.value)},_vm.updateImage]}}):_c('span',{staticClass:\"textbox-label\"},[_vm._v(_vm._s(_vm.getTextboxLabel(textbox)))])])],1)}),0)]:_vm._e(),_c('button',{staticClass:\"btn btn-default\",staticStyle:{\"margin-top\":\"8px\",\"float\":\"right\"},attrs:{\"title\":\"Erase Annotation (Del)\"},on:{\"click\":_vm.erase}},[_c('svg-icon',{attrs:{\"icon\":\"eraser\"}}),_vm._v(\"\\n\\t\\tErase\\n\\t\")],1),_c('button',{staticClass:\"close\",on:{\"click\":function($event){return _vm.close()}}},[_c('svg-icon',{attrs:{\"icon\":\"close\"}})],1)],2):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('ast-checkbox',{staticStyle:{\"margin-bottom\":\"4px\"},attrs:{\"disabled\":_vm.disabled},model:{value:(_vm.isVisible),callback:function ($$v) {_vm.isVisible=$$v},expression:\"isVisible\"}},[_vm._t(\"default\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<ast-checkbox v-model=\"isVisible\" :disabled=\"disabled\" style=\"margin-bottom: 4px;\">\n\t\t<slot></slot>\n\t</ast-checkbox>\n</template>\n\n<script>\nimport AstCheckbox from '@components/Checkbox.vue'\n\nexport default {\n\tname: 'AnnotationCheckbox',\n\tcomponents: {\n\t\tAstCheckbox,\n\t},\n\tprops: {\n\t\ttextbox: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\tcomputed: {\n\t\tisVisible: {\n\t\t\tget() {\n\t\t\t\treturn !this.textbox.hidden\n\t\t\t},\n\t\t\tset() {\n\t\t\t\tthis.textbox.hidden = !this.textbox.hidden\n\t\t\t\tthis.$emit('update-image')\n\t\t\t},\n\t\t},\n\t},\n}\n</script>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerAnnotationDialogCheckbox.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerAnnotationDialogCheckbox.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ViewerAnnotationDialogCheckbox.vue?vue&type=template&id=7aaff10e\"\nimport script from \"./ViewerAnnotationDialogCheckbox.vue?vue&type=script&lang=js\"\nexport * from \"./ViewerAnnotationDialogCheckbox.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h5',[_vm._v(\"Diameter (\"+_vm._s(_vm.unit)+\")\")]),_c('div',{staticStyle:{\"display\":\"flex\",\"margin-bottom\":\"24px\"}},[_c('input',{staticClass:\"input\",domProps:{\"value\":_vm.diameterInputValue},on:{\"mousedown\":function($event){$event.stopPropagation();},\"input\":_vm.updateNewCircleDiameter,\"keydown\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }return _vm.onEnterKeydown($event)}}}),_c('button',{staticClass:\"btn btn-primary\",attrs:{\"disabled\":!_vm.canSetDiameter},on:{\"click\":_vm.setCircleDiameter,\"mousedown\":function($event){$event.stopPropagation();}}},[_c('svg-icon',{staticStyle:{\"opacity\":\"1\"},attrs:{\"icon\":\"check\"}})],1)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<div>\n\t\t<h5>Diameter ({{ unit }})</h5>\n\t\t<div style=\"display: flex; margin-bottom: 24px;\">\n\t\t\t<input\n\t\t\t\t:value=\"diameterInputValue\"\n\t\t\t\tclass=\"input\"\n\t\t\t\t@mousedown.stop\n\t\t\t\t@input=\"updateNewCircleDiameter\"\n\t\t\t\t@keydown.enter=\"onEnterKeydown\"\n\t\t\t/>\n\t\t\t<button class=\"btn btn-primary\" :disabled=\"!canSetDiameter\" @click=\"setCircleDiameter\" @mousedown.stop>\n\t\t\t\t<svg-icon icon=\"check\" style=\"opacity: 1;\" />\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'AstCircleRoiAnnotation',\n\tprops: {\n\t\tdiameter: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\tevent: {\n\t\t\ttype: CustomEvent,\n\t\t\trequired: true,\n\t\t},\n\t\ttool: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tunit: {\n\t\t\ttype: String,\n\t\t\tdefault: 'mm',\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\thasChangedDiameter: false,\n\t\t\tnewCircleDiameter: null,\n\t\t}\n\t},\n\tcomputed: {\n\t\tcanSetDiameter() {\n\t\t\tif (!this.hasChangedDiameter) return false\n\t\t\tif (!this.newCircleDiameter) return false\n\t\t\treturn true\n\t\t},\n\t\tdiameterInputValue() {\n\t\t\tif (this.hasChangedDiameter) return this.newCircleDiameter\n\t\t\treturn this.$options.filters.formatNumber(+this.diameter) || ''\n\t\t},\n\t},\n\twatch: {\n\t\tdiameter() {\n\t\t\tthis.hasChangedDiameter = false\n\t\t\tthis.newCircleDiameter = null\n\t\t},\n\t},\n\tmethods: {\n\t\tupdateNewCircleDiameter(e) {\n\t\t\tthis.newCircleDiameter = e.target.value\n\t\t\tthis.hasChangedDiameter = true\n\t\t},\n\t\tonEnterKeydown() {\n\t\t\tif (this.canSetDiameter) {\n\t\t\t\tthis.setCircleDiameter()\n\t\t\t}\n\t\t},\n\t\tsetCircleDiameter() {\n\t\t\tthis.$emit('set-diameter', this.$options.filters.parseNumber(this.newCircleDiameter))\n\t\t},\n\t},\n}\n</script>\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AstCircleRoi.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AstCircleRoi.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./AstCircleRoi.vue?vue&type=template&id=6209bb8b\"\nimport script from \"./AstCircleRoi.vue?vue&type=script&lang=js\"\nexport * from \"./AstCircleRoi.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"calibration-annotation\"},[_c('h5',[_vm._v(\"Length\")]),_c('input',{ref:\"lengthInput\",staticClass:\"input\",domProps:{\"value\":_vm.hasChangedLength ? _vm.newLength : _vm.currentLength},on:{\"mousedown\":function($event){$event.stopPropagation();},\"input\":_vm.updatenewLength,\"keydown\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }return _vm.calibrate($event)}}}),_c('div',[_c('ast-radio',{attrs:{\"value\":\"mm\"},model:{value:(_vm.unit),callback:function ($$v) {_vm.unit=$$v},expression:\"unit\"}},[_vm._v(\"mm\")]),_c('ast-radio',{attrs:{\"value\":\"cm\"},model:{value:(_vm.unit),callback:function ($$v) {_vm.unit=$$v},expression:\"unit\"}},[_vm._v(\"cm\")])],1),_c('div',{staticStyle:{\"text-align\":\"right\"}},[_c('button',{staticClass:\"btn btn-default\",on:{\"click\":function($event){return _vm.$emit('close')}}},[_vm._v(\"\\n\\t\\t\\tCancel\\n\\t\\t\")]),_c('button',{staticClass:\"btn btn-primary\",attrs:{\"disabled\":!_vm.canCalibrate},on:{\"click\":_vm.calibrate}},[_c('svg-icon',{attrs:{\"icon\":\"check\",\"fixed\":\"\"}}),_vm._v(\"\\n\\t\\t\\tCalibrate\\n\\t\\t\")],1)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<div class=\"calibration-annotation\">\n\t\t<h5>Length</h5>\n\t\t<input\n\t\t\tref=\"lengthInput\"\n\t\t\t:value=\"hasChangedLength ? newLength : currentLength\"\n\t\t\tclass=\"input\"\n\t\t\t@mousedown.stop\n\t\t\t@input=\"updatenewLength\"\n\t\t\t@keydown.enter=\"calibrate\"\n\t\t/>\n\t\t<div>\n\t\t\t<ast-radio v-model=\"unit\" value=\"mm\">mm</ast-radio>\n\t\t\t<ast-radio v-model=\"unit\" value=\"cm\">cm</ast-radio>\n\t\t</div>\n\t\t<div style=\"text-align: right\">\n\t\t\t<button class=\"btn btn-default\" @click=\"$emit('close')\">\n\t\t\t\tCancel\n\t\t\t</button>\n\t\t\t<button class=\"btn btn-primary\" :disabled=\"!canCalibrate\" @click=\"calibrate\">\n\t\t\t\t<svg-icon icon=\"check\" fixed />\n\t\t\t\tCalibrate\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport AstRadio from '@components/Radio.vue'\nimport { removeToolState } from 'cornerstone-tools'\n\nexport default {\n\tname: 'AstCalibrationAnnotation',\n\tcomponents: {\n\t\tAstRadio,\n\t},\n\tprops: {\n\t\tannotation: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tevent: {\n\t\t\ttype: CustomEvent,\n\t\t\trequired: true,\n\t\t},\n\t\ttool: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\thasChangedLength: false,\n\t\t\tnewLength: null,\n\t\t\tunit: 'mm',\n\t\t}\n\t},\n\tcomputed: {\n\t\tcanCalibrate() {\n\t\t\tif (!this.hasChangedLength) return false\n\t\t\tif (this.newLength === this.currentLength) return false\n\t\t\tif (!this.newLength) return false\n\t\t\treturn true\n\t\t},\n\t\tcurrentLength() {\n\t\t\tif (this.unit === 'mm') return this.annotation.length\n\t\t\treturn parseFloat((this.annotation.length / 10).toFixed(2))\n\t\t},\n\t},\n\twatch: {\n\t\t'annotation.length': {\n\t\t\thandler() {\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tif (!this.hasChangedLength && document.getSelection() !== this.currentLength) {\n\t\t\t\t\t\tthis.$refs.lengthInput.select()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\timmediate: true,\n\t\t},\n\t},\n\tbeforeDestroy() {\n\t\tremoveToolState(this.event.detail.element, this.tool.name, this.annotation)\n\t\tthis.$emit('update-image')\n\t},\n\tmethods: {\n\t\tupdatenewLength(e) {\n\t\t\tthis.newLength = parseFloat(e.target.value)\n\t\t\tthis.hasChangedLength = true\n\t\t},\n\t\tcalibrate() {\n\t\t\tlet newLength = this.newLength\n\t\t\tif (this.unit === 'cm') newLength *= 10\n\t\t\tthis.tool.calibrate(this.event, this.annotation, newLength)\n\t\t\tthis.$emit('close')\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n.calibration-annotation {\n\t& > * {\n\t\tmargin-top: 8px;\n\t}\n\tbutton {\n\t\tmargin-top: 16px;\n\t}\n\tbutton + button {\n\t\tmargin-left: 4px;\n\t}\n}\n</style>\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AstCalibration.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AstCalibration.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./AstCalibration.vue?vue&type=template&id=e4ba6302\"\nimport script from \"./AstCalibration.vue?vue&type=script&lang=js\"\nexport * from \"./AstCalibration.vue?vue&type=script&lang=js\"\nimport style0 from \"./AstCalibration.vue?vue&type=style&index=0&id=e4ba6302&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { eventBus } from '@services/eventBus'\nimport AnnotationCheckbox from './ViewerAnnotationDialogCheckbox.vue'\nimport AstCircleRoi from './ViewerAnnotationDialog/AstCircleRoi.vue'\nimport AstCalibration from './ViewerAnnotationDialog/AstCalibration.vue'\nimport { updateImage, pixelToCanvas } from 'cornerstone-core'\nimport { createPopper, VirtualElement } from '@popperjs/core'\nimport round from 'lodash/round'\nimport { formatNumber } from '@utils/numberUtils'\nimport getImagePixelSpacing from '@/cornerstone/tools/util/getImagePixelSpacing'\nimport { EVENTS as csEvents, removeToolState } from 'cornerstone-tools'\n\nexport default {\n\tname: 'AnnotationDialog',\n\tcomponents: {\n\t\tAnnotationCheckbox,\n\t\tAstCalibration,\n\t\tAstCircleRoi,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tannotation: null,\n\t\t\tevent: null,\n\t\t\tisOpen: false,\n\t\t\tpopper: null,\n\t\t\ttool: null,\n\t\t\ttoolState: null,\n\t\t}\n\t},\n\tcomputed: {\n\t\tangleTextboxes() {\n\t\t\tif (this.tool.name !== 'AstLengthAngle') return []\n\t\t\tif (!this.$store.state.viewer.settingsPanel.isLengthAnglesEnabled) return []\n\t\t\tconst textboxes = []\n\t\t\t// angle textboxes need to show for either annotation, regardless of which annotation\n\t\t\t// the handles are actually attached to, so we find those related textboxes via lineId\n\t\t\tthis.toolState.data.forEach(annotation => {\n\t\t\t\tconst isRelatedAngle = t => t.lineId === this.annotation.uuid || annotation === this.annotation\n\t\t\t\ttextboxes.push(...annotation.handles.textBoxes.filter(isRelatedAngle))\n\t\t\t})\n\t\t\treturn textboxes\n\t\t},\n\t\ttextboxes() {\n\t\t\tif (!this.annotation || !this.annotation.handles) return []\n\t\t\tconst isTextbox = handle => handle.hasBoundingBox\n\t\t\t// handles array\n\t\t\tif (Array.isArray(this.annotation.handles)) {\n\t\t\t\treturn this.annotation.handles.filter(isTextbox)\n\t\t\t}\n\t\t\t// handles object\n\t\t\tconst textboxes = []\n\t\t\tfor (const key in this.annotation.handles) {\n\t\t\t\tconst handle = this.annotation.handles[key]\n\t\t\t\tif (isTextbox(handle)) textboxes.push(handle)\n\t\t\t}\n\t\t\treturn textboxes.concat(this.angleTextboxes)\n\t\t},\n\t\tcanHideTextbox() {\n\t\t\treturn this.tool.name !== 'AstText'\n\t\t},\n\t\tcanEditTextbox() {\n\t\t\treturn ['AstArrowAnnotate', 'AstText'].includes(this.tool.name)\n\t\t},\n\t\ttoolInfo() {\n\t\t\tif (!this.tool) return {}\n\t\t\treturn this.$store.getters.availableTools.find(t => t.alias === this.tool.name)\n\t\t},\n\t\tunit() {\n\t\t\tif (!this.isOpen) return\n\t\t\tconst { isPixelSpacingDefined } = getImagePixelSpacing(this.event.detail?.image)\n\t\t\treturn isPixelSpacingDefined ? 'mm' : 'px'\n\t\t},\n\t},\n\twatch: {\n\t\t'$store.getters.activeImage'() {\n\t\t\tif (this.isOpen) this.close()\n\t\t},\n\t\t'annotation.handles': {\n\t\t\t// HACK: Fixes view not updating (though devtools does) for annotations that are not the first\n\t\t\t// annotation for that tool AND were created after the dialog was first opened.  Vue 3 might\n\t\t\t// fix this.\n\t\t\thandler() {\n\t\t\t\tif (this.isOpen) this.$forceUpdate()\n\t\t\t},\n\t\t\tdeep: true,\n\t\t},\n\t},\n\tcreated() {\n\t\teventBus.on(eventBus.type.ANNOTATION_CLICK, this.onAnnotationClick)\n\t\teventBus.on(eventBus.type.ANNOTATIONS_CLEARED, this.onAnnotationRemoved)\n\t},\n\tmounted() {\n\t\tconst onKeydown = e => {\n\t\t\tif (!this.isOpen) return\n\t\t\tconst activeElement = document.activeElement as HTMLInputElement\n\t\t\tif (activeElement.tagName.toLowerCase() === 'input' && activeElement.type.toLowerCase() === 'text') return\n\t\t\tif (e.key === 'Delete') this.erase()\n\t\t}\n\t\tdocument.addEventListener('keydown', onKeydown)\n\t\tthis.$once('beforeDestroy', () => {\n\t\t\tdocument.removeEventListener('keydown', onKeydown)\n\t\t})\n\t},\n\tdestroyed() {\n\t\teventBus.off(eventBus.type.ANNOTATION_CLICK, this.onAnnotationClick)\n\t\teventBus.off(eventBus.type.ANNOTATIONS_CLEARED, this.onAnnotationRemoved)\n\t\tthis.listenForAnnotationRemoved(false)\n\t\tif (this.popper) this.popper.destroy()\n\t},\n\tmethods: {\n\t\tonAnnotationClick({ tool, annotation, toolState, event }) {\n\t\t\tthis.listenForAnnotationRemoved(false)\n\t\t\tthis.tool = tool // cornerstone tool class instance\n\t\t\tthis.toolState = toolState // all annotations for the tool\n\t\t\tthis.annotation = annotation // the clicked annotation\n\t\t\tthis.event = event // the click event\n\t\t\tthis.listenForAnnotationRemoved(true)\n\t\t\tif (!this.isOpen) {\n\t\t\t\tthis.isOpen = true\n\t\t\t\tif (this.mq.small) this.$nextTick(this.positionDialog)\n\t\t\t}\n\t\t},\n\t\tpositionDialog() {\n\t\t\tif (this.popper) this.popper.destroy()\n\t\t\tconst referenceElement: VirtualElement = createReferenceElement(\n\t\t\t\tthis.annotation,\n\t\t\t\tthis.textboxes, // pass textboxes since it contains related angle textboxes from other annotations\n\t\t\t\tthis.event\n\t\t\t)\n\t\t\tthis.popper = createPopper(referenceElement, this.$refs.dialog, {\n\t\t\t\tplacement: 'left',\n\t\t\t\tmodifiers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'offset',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\toffset: [16, 16],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t// if no room on the left, try the other placements\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'flip',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tfallbackPlacements: ['top', 'bottom', 'right'],\n\t\t\t\t\t\t\tpadding: 8,\n\t\t\t\t\t\t\tboundary: document.querySelector('.layout-pane-container'),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t// otherwise overlap the annotation if no room in the layout-pane-container\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'preventOverflow',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\taltAxis: true,\n\t\t\t\t\t\t\tpadding: 8,\n\t\t\t\t\t\t\tboundary: document.querySelector('.layout-pane-container'),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t})\n\t\t},\n\t\tlistenForAnnotationRemoved(isAddingListener) {\n\t\t\tif (!this.event) return\n\t\t\tconst toggleListener = isAddingListener ? 'addEventListener' : 'removeEventListener'\n\t\t\tthis.event.detail.element[toggleListener](csEvents.MEASUREMENT_REMOVED, this.onAnnotationRemoved)\n\t\t},\n\t\terase() {\n\t\t\tremoveToolState(this.event.detail.element, this.tool.name, this.annotation)\n\t\t\tthis.updateImage()\n\t\t},\n\t\tonAnnotationRemoved(e) {\n\t\t\tif (!e || e.detail.measurementData === this.annotation) this.close()\n\t\t},\n\t\tgetTextboxLabel(textbox) {\n\t\t\tif (textbox.text) return textbox.text.join('\\n') // ellipse, rectangle & circle\n\t\t\tif (this.annotation.text) return this.annotation.text // text/arrow annotation\n\t\t\tif (textbox.angle) return formatNumber(round(textbox.angle, 1)) + '°' // length angles\n\t\t\tif (this.annotation.rAngle) return this.annotation.rAngle + '°' // angle\n\t\t\tif (this.annotation.length) return formatNumber(round(this.annotation.length, 2)) + ' ' + this.unit // length\n\t\t},\n\t\tsetCircleDiameter(newDiameter) {\n\t\t\tthis.tool._createCircleFromDiameter(\n\t\t\t\tthis.event.detail,\n\t\t\t\tthis.event.detail.element,\n\t\t\t\tthis.annotation,\n\t\t\t\tNumber(newDiameter)\n\t\t\t)\n\t\t},\n\t\tupdateImage() {\n\t\t\tupdateImage(this.event.detail.element)\n\t\t},\n\t\tclose() {\n\t\t\tthis.isOpen = false\n\t\t},\n\t},\n}\n\nfunction createReferenceElement(annotation, textboxes, event): VirtualElement {\n\t// get min and max x and y values for all handles\n\tconst bounds = event.detail.element.getBoundingClientRect()\n\tconst coords: { x: number; y: number }[] = getHandleCoords()\n\tconst xValues = coords.map(c => c.x + bounds.left)\n\tconst yValues = coords.map(c => c.y + bounds.top)\n\tconst left = Math.max(Math.min(...xValues), bounds.left)\n\tconst right = Math.min(Math.max(...xValues), bounds.right)\n\tconst top = Math.max(Math.min(...yValues), bounds.top)\n\tconst bottom = Math.min(Math.max(...yValues), bounds.bottom)\n\t// offset canvas coordinates to get page coordinates\n\tconst getBoundingClientRect:any = () => {\n\t\treturn {\n\t\t\twidth: right - left,\n\t\t\theight: bottom - top,\n\t\t\ttop,\n\t\t\tright,\n\t\t\tbottom,\n\t\t\tleft,\n\t\t}\n\t}\n\treturn { getBoundingClientRect }\n\n\tfunction getHandleCoords(): { x: number; y: number }[] {\n\t\tlet regularHandles = [] // not textboxes\n\t\tif (Array.isArray(annotation.handles)) {\n\t\t\tregularHandles = annotation.handles.filter(h => !h.hasBoundingBox)\n\t\t} else {\n\t\t\tfor (const key in annotation.handles) {\n\t\t\t\tconst handle = annotation.handles[key]\n\t\t\t\tif (!handle.hasBoundingBox) regularHandles.push(handle)\n\t\t\t}\n\t\t}\n\t\tlet coords = [].concat(...regularHandles.map(handleToCanvasCoords)) // convert regular handles\n\t\tcoords = coords.concat(...textboxes.map(handleToCanvasCoords)) // convert textboxes\n\t\treturn coords\n\t}\n\n\tfunction handleToCanvasCoords(handle): { x: number; y: number }[] {\n\t\tif (!handle.x) return []\n\t\tconst textBoxToCoords = textBox => {\n\t\t\t// textbox coordinates are already relative to the canvas\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tx: textBox.left,\n\t\t\t\t\ty: textBox.top,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tx: textBox.left + textBox.width,\n\t\t\t\t\ty: textBox.top + textBox.height,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t\t// convert textbox handles\n\t\tif (handle.boundingBox) return textBoxToCoords(handle.boundingBox)\n\t\t// other handles' coordinates are relative to the image, so they must be transformed\n\t\treturn [pixelToCanvas(event.detail.element, handle)]\n\t}\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerAnnotationDialog.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerAnnotationDialog.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./ViewerAnnotationDialog.vue?vue&type=template&id=7d21e374&scoped=true\"\nimport script from \"./ViewerAnnotationDialog.vue?vue&type=script&lang=ts\"\nexport * from \"./ViewerAnnotationDialog.vue?vue&type=script&lang=ts\"\nimport style0 from \"./ViewerAnnotationDialog.vue?vue&type=style&index=0&id=7d21e374&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"7d21e374\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isOpen)?_c('dialog',{directives:[{name:\"draggable\",rawName:\"v-draggable\"}],ref:\"dialog\",staticClass:\"annotation-dialog\",attrs:{\"open\":\"\"}},[_c('h4',{staticStyle:{\"margin-bottom\":\"16px\"}},[_c('svg-icon',{attrs:{\"icon\":_vm.toolInfo.iconName,\"fixed\":\"\"}}),_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.toolInfo.title)+\"\\n\\t\")],1),(_vm.annotation.type === _vm.TOOLS.CIRCLE_TOOL)?_c('circle-annotation-dialog',{attrs:{\"annotation\":_vm.annotation},on:{\"close\":_vm.close}}):_vm._e(),_c('h5',{staticStyle:{\"margin-bottom\":\"4px\"}},[_vm._v(\"Textboxes\")]),_c('checkbox',{attrs:{\"disabled\":!_vm.canHideTextbox},model:{value:(_vm.component.statsVisible),callback:function ($$v) {_vm.$set(_vm.component, \"statsVisible\", $$v)},expression:\"component.statsVisible\"}},[([_vm.TOOLS.ARROW_TOOL, _vm.TOOLS.TEXT_TOOL].includes(_vm.annotation.type))?_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.component.text),expression:\"component.text\"},{name:\"focus\",rawName:\"v-focus\"}],staticClass:\"input\",attrs:{\"placeholder\":\"Annotation Text\"},domProps:{\"value\":(_vm.component.text)},on:{\"mousedown\":function($event){$event.stopPropagation();},\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.component, \"text\", $event.target.value)}}}):_c('span',{staticClass:\"textbox-label\"},[_vm._v(_vm._s(_vm.component.statText))])]),_c('button',{staticClass:\"btn btn-default\",staticStyle:{\"margin-top\":\"8px\",\"float\":\"right\"},attrs:{\"title\":\"Erase Annotation (Del)\"},on:{\"click\":_vm.erase}},[_c('svg-icon',{attrs:{\"icon\":\"eraser\"}}),_vm._v(\"\\n\\t\\tErase\\n\\t\")],1),_c('button',{staticClass:\"close\",on:{\"click\":_vm.close}},[_c('svg-icon',{attrs:{\"icon\":\"close\"}})],1)],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h5',{staticStyle:{\"margin-bottom\":\"4px\"}},[_vm._v(\"Diameter (mm)\")]),_c('div',{staticStyle:{\"display\":\"flex\",\"margin-bottom\":\"1rem\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.formattedDiameter),expression:\"formattedDiameter\"},{name:\"focus\",rawName:\"v-focus\"}],staticClass:\"input\",domProps:{\"value\":(_vm.formattedDiameter)},on:{\"mousedown\":function($event){$event.stopPropagation();},\"keydown\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }return _vm.onEnter($event)},\"input\":function($event){if($event.target.composing){ return; }_vm.formattedDiameter=$event.target.value}}}),_c('button',{staticClass:\"btn btn-primary\",attrs:{\"disabled\":!_vm.canSetDiameter},on:{\"click\":_vm.setDiameter,\"mousedown\":function($event){$event.stopPropagation();}}},[_c('svg-icon',{staticStyle:{\"opacity\":\"1\"},attrs:{\"icon\":\"check\"}})],1)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<div>\n\t\t<h5 style=\"margin-bottom: 4px;\">Diameter (mm)</h5>\n\t\t<div style=\"display: flex; margin-bottom: 1rem;\">\n\t\t\t<input v-model=\"formattedDiameter\" v-focus class=\"input\" @mousedown.stop @keydown.enter=\"onEnter\" />\n\t\t\t<button class=\"btn btn-primary\" :disabled=\"!canSetDiameter\" @click=\"setDiameter\" @mousedown.stop>\n\t\t\t\t<svg-icon icon=\"check\" style=\"opacity: 1;\" />\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'CircleAnnotationDialog',\n\tprops: {\n\t\tannotation: { type: Object, required: true },\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tdiameter: '',\n\t\t}\n\t},\n\tcomputed: {\n\t\tformattedDiameter: {\n\t\t\tget() {\n\t\t\t\treturn this.$options.filters.formatNumber(+this.diameter)\n\t\t\t},\n\t\t\tset(value) {\n\t\t\t\tthis.diameter = value === '' ? value : this.$options.filters.parseNumber(value)\n\t\t\t},\n\t\t},\n\t\tcomponent() {\n\t\t\treturn this.annotation.componentRef\n\t\t},\n\t\tcanSetDiameter() {\n\t\t\tconst diameter = this.component.validateDiameter(this.diameter)\n\t\t\treturn !Number.isNaN(diameter) && diameter !== this.component.worldDiameter\n\t\t},\n\t},\n\twatch: {\n\t\t'component.worldDiameter': {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.diameter = `${this.component.worldDiameter}`\n\t\t\t},\n\t\t},\n\t},\n\tmethods: {\n\t\tsetDiameter() {\n\t\t\tthis.component.updateDiameter(this.diameter)\n\t\t},\n\t\tonEnter() {\n\t\t\tif (this.canSetDiameter) {\n\t\t\t\tthis.setDiameter()\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CircleAnnotationDialog.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CircleAnnotationDialog.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./CircleAnnotationDialog.vue?vue&type=template&id=227a508c\"\nimport script from \"./CircleAnnotationDialog.vue?vue&type=script&lang=js\"\nexport * from \"./CircleAnnotationDialog.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport CircleAnnotationDialog from './ViewerAnnotationDialog/CircleAnnotationDialog.vue'\nimport Checkbox from '../Checkbox.vue'\nimport { createPopper } from '@popperjs/core'\nimport { eventBus } from '@services/eventBus'\nimport { consts } from '@vtk'\n\nexport default {\n\tname: 'MprViewerAnnotationDialog',\n\tcomponents: {\n\t\tCircleAnnotationDialog,\n\t\tCheckbox,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tannotation: null,\n\t\t\tcomponent: null,\n\t\t\tisOpen: false,\n\t\t\tpopper: null,\n\t\t\tTOOLS: consts,\n\t\t}\n\t},\n\tcomputed: {\n\t\tcanHideTextbox() {\n\t\t\treturn this.annotation.type !== consts.TEXT_TOOL\n\t\t},\n\t\ttoolInfo() {\n\t\t\tif (!this.annotation) return {}\n\t\t\treturn this.$store.state.mpr.tools.find(t => t.alias === this.annotation.type)\n\t\t},\n\t},\n\tcreated() {\n\t\teventBus.on(eventBus.type.MPR_ANNOTATION_CLICK, this.onAnnotationClick)\n\t\teventBus.on(eventBus.type.MPR_ANNOTATION_REMOVED, this.onAnnotationRemoved)\n\t\teventBus.on(eventBus.type.MPR_ANNOTATIONS_CLEARED, this.onAnnotationRemoved)\n\t},\n\tmounted() {\n\t\tconst onKeydown = e => {\n\t\t\tif (!this.isOpen) return\n\t\t\tconst activeElement = document.activeElement as HTMLInputElement\n\t\t\tif (activeElement.tagName.toLowerCase() === 'input' && activeElement.type.toLowerCase() === 'text') return\n\t\t\tif (e.key === 'Delete') this.erase()\n\t\t}\n\t\tdocument.addEventListener('keydown', onKeydown)\n\t\tthis.$once('beforeDestroy', () => {\n\t\t\tdocument.removeEventListener('keydown', onKeydown)\n\t\t})\n\t},\n\tdestroyed() {\n\t\teventBus.off(eventBus.type.MPR_ANNOTATION_CLICK, this.onAnnotationClick)\n\t\teventBus.off(eventBus.type.MPR_ANNOTATION_REMOVED, this.onAnnotationRemoved)\n\t\teventBus.off(eventBus.type.MPR_ANNOTATIONS_CLEARED, this.onAnnotationRemoved)\n\t\tif (this.popper) this.popper.destroy()\n\t},\n\tmethods: {\n\t\tonAnnotationClick(annotation) {\n\t\t\tthis.annotation = annotation\n\t\t\tthis.component = annotation.componentRef\n\t\t\tif (!this.isOpen) {\n\t\t\t\tthis.isOpen = true\n\t\t\t\tif (this.mq.small) this.$nextTick(this.positionDialog)\n\t\t\t}\n\t\t},\n\t\terase() {\n\t\t\tthis.annotation.componentRef.$emit('delete', this.annotation.componentRef)\n\t\t},\n\t\tonAnnotationRemoved(annotation) {\n\t\t\tif (!annotation || annotation === this.annotation) {\n\t\t\t\tthis.annotation = null\n\t\t\t\tthis.close()\n\t\t\t}\n\t\t},\n\t\tpositionDialog() {\n\t\t\t// Get nested annotation element with `data-position-ref` attribute\n\t\t\tconst ref = this.component.$el.querySelector('[data-position-ref]')\n\t\t\tif (!ref) return\n\t\t\tconst selector = '.viewer-content'\n\t\t\tif (this.popper) this.popper.destroy()\n\t\t\tthis.popper = createPopper(ref, this.$refs.dialog, {\n\t\t\t\tplacement: 'left',\n\t\t\t\tmodifiers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'offset',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\toffset: [16, 16],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t// If no room on the left, try the other placements\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'flip',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tfallbackPlacements: ['top', 'bottom', 'right'],\n\t\t\t\t\t\t\tpadding: 8,\n\t\t\t\t\t\t\tboundary: document.querySelector(selector),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t// Otherwise overlap the annotation if no room in the container\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'preventOverflow',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\taltAxis: true,\n\t\t\t\t\t\t\tpadding: 8,\n\t\t\t\t\t\t\tboundary: document.querySelector(selector),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t})\n\t\t},\n\t\tclose() {\n\t\t\tthis.isOpen = false\n\t\t},\n\t},\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprViewerAnnotationDialog.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprViewerAnnotationDialog.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./MprViewerAnnotationDialog.vue?vue&type=template&id=6a1265b4&scoped=true\"\nimport script from \"./MprViewerAnnotationDialog.vue?vue&type=script&lang=ts\"\nexport * from \"./MprViewerAnnotationDialog.vue?vue&type=script&lang=ts\"\nimport style0 from \"./MprViewerAnnotationDialog.vue?vue&type=style&index=0&id=6a1265b4&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"6a1265b4\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.showHotkeys)?_c('modal-wrapper',{on:{\"close\":_vm.closeModal}},[_c('div',{staticClass:\"hotkey-modal\"},[_c('dlg-header',{attrs:{\"title\":\"Keyboard Shortcuts\"},on:{\"close\":_vm.closeModal}}),_c('div',{staticClass:\"hotkey-modal-body\"},_vm._l((_vm.hotkeyGroups),function(keygroup){return _c('div',{key:keygroup.key},[_c('div',{staticClass:\"hotkey-list\"},[_c('ul',[_c('li',[_c('h5',[_vm._v(_vm._s(keygroup.title))])]),_vm._l((keygroup.hotKeys),function(hotkey){return _c('li',{key:hotkey.name},[_c('div',{staticClass:\"key\"},[_c('span',[_vm._v(_vm._s(_vm._f(\"hotkey\")(hotkey.keyBinding)))])]),_c('div',{staticClass:\"keyname\"},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(hotkey.description)+\"\\n\\t\\t\\t\\t\\t\\t\\t\")])])})],2)])])}),0)],1)]):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<modal-wrapper v-if=\"showHotkeys\" @close=\"closeModal\">\n\t\t<div class=\"hotkey-modal\">\n\t\t\t<!-- HEADER -->\n\t\t\t<dlg-header title=\"Keyboard Shortcuts\" @close=\"closeModal\" />\n\n\t\t\t<!-- BODY -->\n\t\t\t<div class=\"hotkey-modal-body\">\n\t\t\t\t<div v-for=\"keygroup in hotkeyGroups\" :key=\"keygroup.key\">\n\t\t\t\t\t<div class=\"hotkey-list\">\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<!-- TITLE ROW -->\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<h5>{{ keygroup.title }}</h5>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<!-- HOTKEYS -->\n\t\t\t\t\t\t\t<li v-for=\"hotkey in keygroup.hotKeys\" :key=\"hotkey.name\">\n\t\t\t\t\t\t\t\t<div class=\"key\">\n\t\t\t\t\t\t\t\t\t<span>{{ hotkey.keyBinding | hotkey }}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"keyname\">\n\t\t\t\t\t\t\t\t\t{{ hotkey.description }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</modal-wrapper>\n</template>\n\n<script>\nimport ModalWrapper from '@components/ModalWrapper'\nimport DlgHeader from '@components/DlgHeader.vue'\nimport { mapState } from 'vuex'\n\nconst keyGroups = [\n\t{ key: 'canvas-tools', title: 'Canvas Tools' },\n\t{ key: 'navigation-tools', title: 'Navigation Tools' },\n\t{ key: 'image-tools', title: 'Image Tools' },\n\t{ key: 'misc-tools', title: 'Misc Tools' },\n]\n\nexport default {\n\tname: 'HotkeyModal',\n\tcomponents: {\n\t\tModalWrapper,\n\t\tDlgHeader,\n\t},\n\tfilters: {\n\t\thotkey: value => {\n\t\t\tif (value === 'pagedown') {\n\t\t\t\treturn 'PgDn'\n\t\t\t}\n\t\t\tif (value === 'pageup') {\n\t\t\t\treturn 'PgUp'\n\t\t\t}\n\t\t\tif (value === 'up') {\n\t\t\t\treturn '↑'\n\t\t\t}\n\t\t\tif (value === 'down') {\n\t\t\t\treturn '↓'\n\t\t\t}\n\t\t\tif (value === 'left') {\n\t\t\t\treturn '←'\n\t\t\t}\n\t\t\tif (value === 'right') {\n\t\t\t\treturn '→'\n\t\t\t}\n\t\t\tif (value === undefined) {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\treturn value.toUpperCase()\n\t\t},\n\t},\n\tprops: {\n\t\tshowHotkeys: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tcomputed: {\n\t\t...mapState({\n\t\t\thotkeys: state => state.viewerHotkeys.hotkeys,\n\t\t}),\n\t\thotkeyGroups() {\n\t\t\tconst g = []\n\t\t\tkeyGroups.forEach(({ key, title }) => {\n\t\t\t\tconst filtered = this.hotkeys.filter(h => h.group === key)\n\t\t\t\tif (filtered.length) {\n\t\t\t\t\tg.push({ key, title, hotKeys: filtered })\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn g\n\t\t},\n\t},\n\tmethods: {\n\t\tcloseModal() {\n\t\t\tthis.$emit('close', false)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '~@styles/_vars.scss';\n.hotkey-modal {\n\tbackground: var(--secondary-bg);\n\tborder: 1px solid var(--secondary-border);\n\tdisplay: flex;\n\tflex-direction: column;\n\tposition: relative;\n\toverflow-x: hidden;\n\tmin-width: 320px;\n\tmax-width: 900px;\n\tmax-height: 90vh;\n\twidth: 100%;\n}\n\n.hotkey-modal-body {\n\tpadding: 16px;\n\toverflow: auto;\n\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fill, minmax(400px, 1fr));\n\n\t& > div {\n\t\twidth: 45%;\n\t\tdisplay: flex;\n\t\tpadding-left: 50px;\n\t\tmargin-bottom: 20px;\n\t}\n\t@media (max-width: $mqMedium) {\n\t\t& > div {\n\t\t\tpadding-left: 10px;\n\t\t}\n\t}\n}\n\n.hotkey-list {\n\tmin-width: 240px;\n\tul {\n\t\tlist-style: none;\n\t}\n\n\tli {\n\t\tpadding: 10px 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t.key {\n\t\ttext-align: right;\n\t}\n\n\tspan {\n\t\tdisplay: inline-block;\n\t\ttext-align: center;\n\t\tmin-width: 2em;\n\t\tpadding: 3px;\n\t\tmargin-right: 8px;\n\t\tfont-size: 0.8em;\n\t\tcolor: var(--hotkey-indicator-color);\n\t\tbackground: var(--hotkey-indicator-bg);\n\t\tborder: 1px solid var(--hotkey-indicator-border);\n\t}\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HotkeyModal.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HotkeyModal.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./HotkeyModal.vue?vue&type=template&id=28ebfed9&scoped=true\"\nimport script from \"./HotkeyModal.vue?vue&type=script&lang=js\"\nexport * from \"./HotkeyModal.vue?vue&type=script&lang=js\"\nimport style0 from \"./HotkeyModal.vue?vue&type=style&index=0&id=28ebfed9&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"28ebfed9\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"image-placeholder\",attrs:{\"oncontextmenu\":\"return false\",\"unselectable\":\"on\",\"onselectstart\":\"return false;\"}},[_c('p',{staticClass:\"placeholder-text\"},[_vm._t(\"default\")],2)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div\n    class=\"image-placeholder\"\n    oncontextmenu=\"return false\"\n    unselectable=\"on\"\n    onselectstart=\"return false;\"\n  >\n    <p class=\"placeholder-text\">\n      <slot></slot>\n    </p>\n  </div>\n</template>\n\n<script>\nexport default {\n  name: 'ImagePlaceholder'\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.image-placeholder {\n  border: 1px solid #333;\n  display: flex;\n  height: 100%;\n  align-content: center;\n  align-items: center;\n  color: #fff;\n  background: #000;\n\n  &.isActiveViewer {\n    border: 2px solid white;\n  }\n\n  .placeholder-text {\n    display: block;\n    padding: 1rem;\n    margin: 0 auto;\n    font-size: 1.5rem;\n    text-align: center;\n  }\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImagePlaceholder.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImagePlaceholder.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ImagePlaceholder.vue?vue&type=template&id=4ec63bbe&scoped=true\"\nimport script from \"./ImagePlaceholder.vue?vue&type=script&lang=js\"\nexport * from \"./ImagePlaceholder.vue?vue&type=script&lang=js\"\nimport style0 from \"./ImagePlaceholder.vue?vue&type=style&index=0&id=4ec63bbe&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"4ec63bbe\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"wrapper\"},[_c('div',{ref:\"canvas\",staticClass:\"dicom-image-canvas\",on:{\"contextmenu\":function($event){$event.preventDefault();}}}),_c('div',{staticClass:\"border\"}),_c('div',{staticClass:\"dicom-image-overlay\"},[_c('div',{staticClass:\"dot\",style:({ background: _vm.canvasColor })}),(_vm.showOverlayText && _vm.image)?_c('div',{staticClass:\"dicom-image-overlay-text\",class:{ compact: _vm.useCompactOverlay }},[_c('div',{staticClass:\"top-left\"},[_c('ul',[_c('li',{staticClass:\"full-only\"},[_vm._v(\"Zoom: \"+_vm._s(_vm._f(\"formatNumber\")(+_vm.imageOverlayInfo.zoom))+\"%\")]),_c('li',[_vm._v(\"Series: \"+_vm._s(_vm.seriesIndex + 1)+\" / \"+_vm._s(_vm.seriesTotal))]),_c('li',[_vm._v(\"Image: \"+_vm._s(_vm.imageOverlayInfo.imageIndex)+\" / \"+_vm._s(_vm.series.images.length))]),(_vm.image.fullName || _vm.image.simpleName)?_c('li',{staticClass:\"full-only\"},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\tView: \"+_vm._s(_vm.image.fullName || _vm.image.simpleName)+\"\\n\\t\\t\\t\\t\\t\")]):_vm._e(),(_vm.series.images.length > 1 && _vm.imageView)?_c('li',{staticClass:\"is-danger\"},[_c('strong',[_vm._v(\"View contains multiple images\")])]):_vm._e()])]),_c('div',{staticClass:\"top-right\"},[_c('ul',[(!_vm.isRepository)?[_c('li',[_vm._v(\"Name: \"+_vm._s(_vm.series.overlayInformation.patientName))]),_c('li',[_vm._v(\"Id: \"+_vm._s(_vm.series.overlayInformation.patientId))]),_c('li',[_vm._v(\"Owner: \"+_vm._s(_vm.series.overlayInformation.ownerName))]),_c('li',[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\tInstitution:\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm.series.overlayInformation.institutionName)+\"\\n\\t\\t\\t\\t\\t\\t\")]),_c('li',[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\tStudy Date:\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm._f(\"localizeDate\")(_vm.series.overlayInformation.studyDate,{ forceUTC: false }))+\"\\n\\t\\t\\t\\t\\t\\t\")]),(_vm.image.acquisitionTime)?_c('li',[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\tAcq Time: \"+_vm._s(_vm._f(\"localizeDate\")(_vm.image.acquisitionTime,{ forceUTC: false }))+\"\\n\\t\\t\\t\\t\\t\\t\")]):_vm._e()]:[_c('li',[_vm._v(\"Id: \"+_vm._s(_vm.image.overlayInformation.lotNumber))]),_c('li',[_vm._v(\"Chip Id: \"+_vm._s(_vm.image.overlayInformation.chipId))]),_c('li',[_vm._v(\"Sire: \"+_vm._s(_vm.image.overlayInformation.sire))]),_c('li',[_vm._v(\"Dam: \"+_vm._s(_vm.image.overlayInformation.dam))]),_c('li',[_vm._v(\"Institution: \"+_vm._s(_vm.image.overlayInformation.institutionName))]),_c('li',[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\tStudy Date:\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm._f(\"localizeDate\")(_vm.image.overlayInformation.studyDate,{ forceUTC: false }))+\"\\n\\t\\t\\t\\t\\t\\t\")]),_c('li',[_vm._v(\"Acq Time: \"+_vm._s(_vm._f(\"localizeDate\")(_vm.image.acquisitionTime,{ forceUTC: false })))])]],2)]),_c('div',{staticClass:\"bottom-right\"},[_c('ul',[(_vm.imageOverlayInfo.hflip || _vm.imageOverlayInfo.vflip)?_c('li',[(_vm.imageOverlayInfo.hflip)?_c('span',[_vm._v(\"H. Flip\")]):_vm._e(),(_vm.imageOverlayInfo.hflip && _vm.imageOverlayInfo.vflip)?_c('span',[_vm._v(\"/\")]):_vm._e(),(_vm.imageOverlayInfo.vflip)?_c('span',[_vm._v(\"V. Flip\")]):_vm._e()]):_vm._e(),_c('li',[_vm._v(\" Rotation Angle: \"+_vm._s(_vm.imageOverlayInfo.rotation)+\"°\")])])]),_c('div',{staticClass:\"bottom-left\"},[_c('ul',[(_vm.imageOverlayInfo.invert)?_c('li',[_vm._v(\"Inverted\")]):_vm._e(),_c('li',[_vm._v(\"\\n\\t\\t\\t\\t\\t\\tW/L:\\n\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm.imageOverlayInfo.windowWidth +\n\t\t\t\t\t\t\t\t'/' +\n\t\t\t\t\t\t\t\t_vm.imageOverlayInfo.windowCenter +\n\t\t\t\t\t\t\t\t(_vm.imageOverlayInfo.isLevelingAdjusted ? '*' : ''))+\"\\n\\t\\t\\t\\t\\t\")]),_c('li',{staticClass:\"compact-only\"},[_vm._v(\"Zoom: \"+_vm._s(_vm.imageOverlayInfo.zoom)+\"%\")]),_c('li',{staticClass:\"compact-only\"},[_vm._v(\" Rotation Angle: \"+_vm._s(_vm.imageOverlayInfo.rotation)+\"°\")]),(_vm.image.fullName || _vm.image.simpleName)?_c('li',{staticClass:\"compact-only\"},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\tView: \"+_vm._s(_vm.image.fullName || _vm.image.simpleName)+\"\\n\\t\\t\\t\\t\\t\")]):_vm._e(),(_vm.activeDisplaySet)?_c('li',[_vm._v(\"Display Set: \"+_vm._s(_vm.activeDisplaySet))]):_vm._e()])])]):_vm._e(),_c('transition',{attrs:{\"name\":\"fade\"}},[(_vm.showViewportCacheMessage)?_c('div',{staticClass:\"viewport-message\"},[_c('div',{staticClass:\"overlay-wrapper\"},[_vm._v(\"\\n\\t\\t\\t\\t\\tUsing saved leveling and orientation information\\n\\t\\t\\t\\t\")])]):_vm._e()]),_c('transition',{attrs:{\"name\":\"fade\"}},[(_vm.showLoadingSpinner)?_c('div',{staticClass:\"loading\"},[_c('svg-icon',{attrs:{\"icon\":\"spinner\",\"pulse\":\"\"}})],1):_vm._e()]),(_vm.series.images.length > 1 && _vm.image && !_vm.isInitializing)?_c('ast-image-scroll',{attrs:{\"image\":_vm.image,\"stack-index\":_vm.stackIndex,\"series\":_vm.series}}):_vm._e()],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import isMobileOS from './isMobileOS'\n\nexport default function shouldRenderWebGL() {\n\treturn !(isMobileOS() || window.screen.width <= 768)\n}\n","<template>\n\t<div\n\t\tclass=\"viewer-toolbar-container\"\n\t\t:class=\"({ 'is-disabled': isLoading, 'show-compact': showCompactToolbar }, toolbarLocation)\"\n\t>\n\t\t<!-- Full / Grouped -->\n\t\t<ast-toolbar ref=\"fullToolbar\" class=\"full\">\n\t\t\t<!-- Levels -->\n\t\t\t<template v-if=\"!isGrouped.levels\">\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\tv-for=\"tool in itemsInGroup('levels')\"\n\t\t\t\t\t:key=\"tool.label\"\n\t\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t\t:label=\"tool.label\"\n\t\t\t\t\t:title=\"tool.title\"\n\t\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t\t@mousedown.native.prevent=\"tool.command ? tool.command() : activateTool({ event: $event, tool })\"\n\t\t\t\t\t@contextmenu.native.prevent\n\t\t\t\t/>\n\t\t\t\t<span class=\"separator\"></span>\n\t\t\t</template>\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\tv-else\n\t\t\t\t:items=\"itemsInGroup('levels')\"\n\t\t\t\t:available-tools=\"availableTools\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t@activate-tool=\"activateTool\"\n\t\t\t/>\n\n\t\t\t<!-- Tools without Groups -->\n\t\t\t<ast-toolbar-button\n\t\t\t\tv-for=\"tool in ungroupedTools\"\n\t\t\t\t:key=\"tool.label\"\n\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t:label=\"tool.label\"\n\t\t\t\t:title=\"tool.title\"\n\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t@mousedown.native.prevent=\"activateTool({ event: $event, tool })\"\n\t\t\t\t@contextmenu.native.prevent\n\t\t\t/>\n\t\t\t<span class=\"separator\"></span>\n\n\t\t\t<!-- Annotations -->\n\t\t\t<template v-if=\"!isGrouped.annotation\">\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\tv-for=\"tool in itemsInGroup('annotation')\"\n\t\t\t\t\t:key=\"tool.label\"\n\t\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t\t:label=\"tool.label\"\n\t\t\t\t\t:title=\"tool.title\"\n\t\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t\t@mousedown.native.prevent=\"activateTool({ event: $event, tool })\"\n\t\t\t\t\t@contextmenu.native.prevent\n\t\t\t\t/>\n\t\t\t\t<span class=\"separator\"></span>\n\t\t\t</template>\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\tv-else\n\t\t\t\t:items=\"itemsInGroup('annotation')\"\n\t\t\t\t:available-tools=\"availableTools\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t@activate-tool=\"activateTool\"\n\t\t\t/>\n\n\t\t\t<!-- Scroll -->\n\t\t\t<template v-if=\"!isGrouped.scroll\">\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\tv-for=\"tool in itemsInGroup('scroll')\"\n\t\t\t\t\t:key=\"tool.label\"\n\t\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t\t:label=\"tool.label\"\n\t\t\t\t\t:title=\"tool.title\"\n\t\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t\t@mousedown.native.prevent=\"activateTool({ event: $event, tool })\"\n\t\t\t\t\t@contextmenu.native.prevent\n\t\t\t\t/>\n\t\t\t</template>\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\tv-else\n\t\t\t\t:items=\"itemsInGroup('scroll')\"\n\t\t\t\t:available-tools=\"availableTools\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t@activate-tool=\"activateTool\"\n\t\t\t/>\n\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\tkey=\"hack-bugfix?!\"\n\t\t\t\ticon=\"gradient\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t:label=\"activeBlendMethod.label\"\n\t\t\t\t:title=\"activeBlendMethod.title\"\n\t\t\t\t:items=\"blendMethods\"\n\t\t\t/>\n\t\t\t<span class=\"separator\"></span>\n\n\t\t\t<ast-toolbar-button\n\t\t\t\tv-for=\"tool in itemsInGroup('switch')\"\n\t\t\t\t:key=\"tool.label\"\n\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t:label=\"tool.label\"\n\t\t\t\t:title=\"tool.title\"\n\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t@mousedown.native.prevent=\"tool.command()\"\n\t\t\t\t@contextmenu.native.prevent\n\t\t\t/>\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\ticon=\"repeat2\"\n\t\t\t\tlabel=\"Rotate\"\n\t\t\t\ttitle=\"Rotation Tools\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t:items=\"rotateItems\"\n\t\t\t/>\n\t\t\t<ast-toolbar-button icon=\"backup-restore\" label=\"Reset\" title=\"Reset Image\" @click.native=\"resetViewData\" />\n\t\t\t<span class=\"separator\"></span>\n\n\t\t\t<!--ACTIONS-->\n\t\t\t<ast-toolbar-button icon=\"dots-horizontal\" label=\"Actions\" @click.native=\"$emit('toggle-drawer', 'mprActions')\" />\n\t\t</ast-toolbar>\n\n\t\t<!-- Compact -->\n\t\t<!-- <ast-toolbar class=\"compact\">\n\t\t\t<ast-toolbar-button icon=\"backup-restore\" label=\"Reset\" @click.native=\"$emit('reset')\" />\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\ticon=\"repeat2\"\n\t\t\t\tlabel=\"Rotate\"\n\t\t\t\ttitle=\"Rotation Tools\"\n\t\t\t\t:items=\"itemsInGroup('rotate')\"\n\t\t\t/>\n\t\t\t<ast-toolbar-dropdown :items=\"compactItems\" @activate-tool=\"activateTool\" />\n\t\t\t<ast-toolbar-button icon=\"tag\" label=\"DICOM\" @click.native=\"$emit('toggle-drawer', 'dicom')\" />\n\t\t\t<ast-toolbar-button\n\t\t\t\ticon=\"dots-horizontal\"\n\t\t\t\tlabel=\"Actions\"\n\t\t\t\t@click.native=\"$emit('toggle-drawer', 'actions')\"\n\t\t\t/>\n\t\t</ast-toolbar> -->\n\t</div>\n</template>\n\n<script>\nimport { mapState, mapGetters, mapActions, mapMutations } from 'vuex'\nimport { consts } from '@vtk'\nimport ViewerToolsMixin from './ViewerToolsMixin'\n\nlet toolActivationDebounce\n\nexport default {\n\tname: 'MprViewerTools',\n\tmixins: [ViewerToolsMixin],\n\tdata() {\n\t\treturn {\n\t\t\tgroupOrder: ['scroll', 'levels', 'annotation'],\n\t\t\tisGrouped: {\n\t\t\t\tlevels: false,\n\t\t\t\tannotation: false,\n\t\t\t\tscroll: false,\n\t\t\t},\n\t\t}\n\t},\n\tcomputed: {\n\t\t...mapState({\n\t\t\tavailableTools: state => state.mpr.availableTools,\n\t\t\tactiveTools: state => state.mpr.activeTools,\n\t\t\tswitchModeActive: state => state.mpr.activeSeries.switchModeActive,\n\t\t\tisLoading: state => !state.mpr.activeSeries || !state.mpr.activeSeries.volumeData,\n\t\t}),\n\t\t...mapGetters(['isAuthenticated']),\n\t\tactions() {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'InvertTool',\n\t\t\t\t\tlabel: 'Invert',\n\t\t\t\t\ttitle: 'Invert View',\n\t\t\t\t\tgroups: ['levels'],\n\t\t\t\t\ticonName: 'invert-colors',\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\tthis.invertVolume()\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'AstSwitchViews',\n\t\t\t\t\tlabel: 'Switch',\n\t\t\t\t\ttitle: 'Switch Views',\n\t\t\t\t\ticonName: 'switch',\n\t\t\t\t\tgroups: ['switch'],\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\tthis.setSwitchModeActive(!this.switchModeActive)\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]\n\t\t},\n\t\trotateItems() {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ticonName: 'flip-horizontal2',\n\t\t\t\t\tlabel: 'Flip Horizontally',\n\t\t\t\t\tcommand: () => this.flipHActiveView(),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'flip-vertical',\n\t\t\t\t\tlabel: 'Flip Vertically',\n\t\t\t\t\tcommand: () => this.flipVActiveView(),\n\t\t\t\t},\n\t\t\t\t// Removed due to bug with 90 degrees [ch7465]\n\t\t\t\t{\n\t\t\t\t\ticonName: 'rotate-right',\n\t\t\t\t\tlabel: 'Rotate Clockwise',\n\t\t\t\t\tcommand: () => this.rotateActiveViewClockwise(),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'rotate-left2',\n\t\t\t\t\tlabel: 'Rotate Counterclockwise',\n\t\t\t\t\tcommand: () => this.rotateActiveViewCounterClockwise(),\n\t\t\t\t},\n\t\t\t]\n\t\t},\n\t\tblendMethods() {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: consts.BLEND_NONE,\n\t\t\t\t\tlabel: 'None',\n\t\t\t\t\ttitle: 'No Blend Mode',\n\t\t\t\t\ticonName: 'cancel',\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\tthis.setBlendMode(consts.BLEND_NONE)\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: consts.BLEND_MIP,\n\t\t\t\t\tlabel: 'MIP',\n\t\t\t\t\ttitle: 'Maximum Intensity Projection',\n\t\t\t\t\ticonName: 'brightness-high',\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\tthis.setBlendMode(consts.BLEND_MIP)\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: consts.BLEND_MINIP,\n\t\t\t\t\tlabel: 'MinIP',\n\t\t\t\t\ttitle: 'Minimum Intensity Projection',\n\t\t\t\t\ticonName: 'brightness-low',\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\tthis.setBlendMode(consts.BLEND_MINIP)\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: consts.BLEND_AVG,\n\t\t\t\t\tlabel: 'AvgIP',\n\t\t\t\t\ttitle: 'Average Intensity Projection',\n\t\t\t\t\ticonName: 'brightness-auto',\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\tthis.setBlendMode(consts.BLEND_AVG)\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]\n\t\t},\n\t\tactiveBlendMethod() {\n\t\t\ttry {\n\t\t\t\treturn (\n\t\t\t\t\tthis.blendMethods.find(m => m.name === this.$store.state.mpr.activeSeries.blendMode) || this.blendMethods[0]\n\t\t\t\t)\n\t\t\t} catch (err) {\n\t\t\t\treturn this.blendMethods[0]\n\t\t\t}\n\t\t},\n\t\tcompactItems() {\n\t\t\tlet compactItems = [].concat(\n\t\t\t\tthis.itemsInGroup('levels'),\n\t\t\t\tthis.itemsInGroup('zoom'),\n\t\t\t\tthis.ungroupedTools,\n\t\t\t\tthis.itemsInGroup('annotation')\n\t\t\t)\n\t\t\treturn compactItems // .filter(deduplicateItems)\n\t\t},\n\t},\n\twatch: {\n\t\tactiveTools: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.updateToolBindings()\n\t\t\t},\n\t\t},\n\t},\n\tmethods: {\n\t\t...mapActions([\n\t\t\t'rotateActiveViewClockwise',\n\t\t\t'rotateActiveViewCounterClockwise',\n\t\t\t'flipHActiveView',\n\t\t\t'flipVActiveView',\n\t\t\t'resetViewData',\n\t\t\t'invertVolume',\n\t\t\t'updateMouseBinding',\n\t\t\t'setMprActiveToolAndBroadcast',\n\t\t]),\n\t\t...mapMutations({\n\t\t\tupdateToolBindings: 'UPDATE_TOOL_BINDINGS',\n\t\t\tsetSwitchModeActive: 'SET_MPR_SWITCH_MODE_ACTIVE',\n\t\t\tsetBlendMode: 'SET_MPR_BLEND_MODE_ALL',\n\t\t}),\n\t\tactivateTool({ tool, event }) {\n\t\t\tclearTimeout(toolActivationDebounce)\n\t\t\ttoolActivationDebounce = setTimeout(() => {\n\t\t\t\tconst buttonMask = event.buttons || whichToButtons[event.which] || 1\n\t\t\t\tif (!validButtons.includes(buttonMask) || tool.disabled) return\n\t\t\t\tthis.setMprActiveToolAndBroadcast({\n\t\t\t\t\ttool: tool.name,\n\t\t\t\t\tbuttonMask,\n\t\t\t\t})\n\t\t\t\t// Save and synchronize the binding with image viewer\n\t\t\t\tthis.updateMouseBinding({ tool: tool.name, button: buttonMask, type: 'mpr' })\n\t\t\t}, 200)\n\t\t},\n\t},\n}\n\nconst whichToButtons = {\n\t// map event.which to equivalent event.buttons for Safari\n\t1: 1, // L\n\t2: 4, // M\n\t3: 2, // R\n}\nconst validButtons = [1, 2, 4] // L, R, M,\n</script>\n","<template>\n\t<div class=\"wrapper\">\n\t\t<div ref=\"canvas\" class=\"dicom-image-canvas\" @contextmenu.prevent></div>\n\n\t\t<div class=\"border\"></div>\n\t\t<div class=\"dicom-image-overlay\">\n\t\t\t<div class=\"dot\" :style=\"{ background: canvasColor }\"></div>\n\t\t\t<div v-if=\"showOverlayText && image\" class=\"dicom-image-overlay-text\" :class=\"{ compact: useCompactOverlay }\">\n\t\t\t\t<div class=\"top-left\">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"full-only\">Zoom: {{ +imageOverlayInfo.zoom | formatNumber }}%</li>\n\t\t\t\t\t\t<li>Series: {{ seriesIndex + 1 }} / {{ seriesTotal }}</li>\n\t\t\t\t\t\t<li>Image: {{ imageOverlayInfo.imageIndex }} / {{ series.images.length }}</li>\n\t\t\t\t\t\t<li v-if=\"image.fullName || image.simpleName\" class=\"full-only\">\n\t\t\t\t\t\t\tView: {{ image.fullName || image.simpleName }}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li v-if=\"series.images.length > 1 && imageView\" class=\"is-danger\">\n\t\t\t\t\t\t\t<strong>View contains multiple images</strong>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"top-right\">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<template v-if=\"!isRepository\">\n\t\t\t\t\t\t\t<li>Name: {{ series.overlayInformation.patientName }}</li>\n\t\t\t\t\t\t\t<li>Id: {{ series.overlayInformation.patientId }}</li>\n\t\t\t\t\t\t\t<li>Owner: {{ series.overlayInformation.ownerName }}</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\tInstitution:\n\t\t\t\t\t\t\t\t{{ series.overlayInformation.institutionName }}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\tStudy Date:\n\t\t\t\t\t\t\t\t{{ series.overlayInformation.studyDate | localizeDate({ forceUTC: false }) }}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li v-if=\"image.acquisitionTime\">\n\t\t\t\t\t\t\t\tAcq Time: {{ image.acquisitionTime | localizeDate({ forceUTC: false }) }}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<li>Id: {{ image.overlayInformation.lotNumber }}</li>\n\t\t\t\t\t\t\t<li>Chip Id: {{ image.overlayInformation.chipId }}</li>\n\t\t\t\t\t\t\t<li>Sire: {{ image.overlayInformation.sire }}</li>\n\t\t\t\t\t\t\t<li>Dam: {{ image.overlayInformation.dam }}</li>\n\t\t\t\t\t\t\t<li>Institution: {{ image.overlayInformation.institutionName }}</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\tStudy Date:\n\t\t\t\t\t\t\t\t{{ image.overlayInformation.studyDate | localizeDate({ forceUTC: false }) }}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>Acq Time: {{ image.acquisitionTime | localizeDate({ forceUTC: false }) }}</li>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bottom-right\">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li v-if=\"imageOverlayInfo.hflip || imageOverlayInfo.vflip\">\n\t\t\t\t\t\t\t<span v-if=\"imageOverlayInfo.hflip\">H. Flip</span>\n\t\t\t\t\t\t\t<span v-if=\"imageOverlayInfo.hflip && imageOverlayInfo.vflip\">/</span>\n\t\t\t\t\t\t\t<span v-if=\"imageOverlayInfo.vflip\">V. Flip</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li> Rotation Angle: {{ imageOverlayInfo.rotation }}&deg;</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bottom-left\">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li v-if=\"imageOverlayInfo.invert\">Inverted</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\tW/L:\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\timageOverlayInfo.windowWidth +\n\t\t\t\t\t\t\t\t\t'/' +\n\t\t\t\t\t\t\t\t\timageOverlayInfo.windowCenter +\n\t\t\t\t\t\t\t\t\t(imageOverlayInfo.isLevelingAdjusted ? '*' : '')\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"compact-only\">Zoom: {{ imageOverlayInfo.zoom }}%</li>\n\t\t\t\t\t\t<li class=\"compact-only\"> Rotation Angle: {{ imageOverlayInfo.rotation }}&deg;</li>\n\t\t\t\t\t\t<li v-if=\"image.fullName || image.simpleName\" class=\"compact-only\">\n\t\t\t\t\t\t\tView: {{ image.fullName || image.simpleName }}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li v-if=\"activeDisplaySet\">Display Set: {{ activeDisplaySet }}</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<transition name=\"fade\">\n\t\t\t\t<div v-if=\"showViewportCacheMessage\" class=\"viewport-message\">\n\t\t\t\t\t<div class=\"overlay-wrapper\">\n\t\t\t\t\t\tUsing saved leveling and orientation information\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</transition>\n\n\t\t\t<transition name=\"fade\">\n\t\t\t\t<div v-if=\"showLoadingSpinner\" class=\"loading\">\n\t\t\t\t\t<svg-icon icon=\"spinner\" pulse />\n\t\t\t\t</div>\n\t\t\t</transition>\n\n\t\t\t<ast-image-scroll\n\t\t\t\tv-if=\"series.images.length > 1 && image && !isInitializing\"\n\t\t\t\t:image=\"image\"\n\t\t\t\t:stack-index=\"stackIndex\"\n\t\t\t\t:series=\"series\"\n\t\t\t/>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { mapGetters, mapActions } from 'vuex'\nimport { eventBus } from '@services/eventBus'\nimport * as cornerstone from 'cornerstone-core/dist/cornerstone.js'\nimport * as cornerstoneTools from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { waitForElementToBeEnabled } from '@/utils/wait.js'\nimport { scaleJpegVoiToDicom } from '@/utils/wwwc.js'\nimport shouldRenderWebGL from '@/utils/shouldRenderWebGL'\nimport { disablePrecisionForInactiveHandles } from '@/cornerstone/tools/util/handles'\nimport { loadMetadata } from '@/cornerstone/metadata'\nimport { imageLoader, getCornerstoneImageIdsForSeries, getCornerstoneImageId } from '@/imageLoader'\nimport { clinicAPI } from '@services/clinicAPI'\nimport { MEASUREMENT_DONE_MODIFYING } from '@/cornerstone/_shared/events'\nimport { dicomServiceData } from '@services/dicomServiceData'\n\nconst { updateImage, getEnabledElementsByImageId, getEnabledElement } = cornerstone\nconst { NEW_IMAGE, IMAGE_RENDERED } = cornerstone.EVENTS\nconst { STACK_SCROLL, MEASUREMENT_REMOVED } = cornerstoneTools.EVENTS\nconst { EVENTS: TOOL_EVENTS, globalImageIdSpecificToolStateManager } = cornerstoneTools\n// Events that we should disable precision mode for inactivate handles\nconst disablePrecisionEvents = [\n\tTOOL_EVENTS.MOUSE_DOWN,\n\tTOOL_EVENTS.TOUCH_START,\n\tTOOL_EVENTS.MEASUREMENT_ADDED,\n\tTOOL_EVENTS.MEASUREMENT_MODIFIED,\n]\n\nconst modifiedAnnotationEvents = [MEASUREMENT_DONE_MODIFYING, MEASUREMENT_REMOVED]\n\nexport default {\n\tname: 'ImageViewer',\n\tcomponents: {\n\t\tAstImageScroll: () =>\n\t\t\timport(/* webpackChunkName: \"componentViewerImageScroll\" */ '@components/view/ViewerImageScroll.vue'),\n\t},\n\tprops: {\n\t\tindex: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\tseries: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tasterisImageId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tframeIndex: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\timageView: {\n\t\t\ttype: Object,\n\t\t\tdefault: undefined,\n\t\t},\n\t\tisInitializing: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tcinePlayer: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tshowOverlayText: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\t// Used exclusively to toggle what overlay information is displayed\n\t\t// All of the following properties are why we need to make overlays\n\t\t// A [scoped] <slot>\n\t\tisRepository: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tseriesIndex: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\tseriesTotal: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tstackIndex: 0,\n\t\t\timageOverlayInfo: {\n\t\t\t\timageIndex: 1,\n\t\t\t\trotation: 0,\n\t\t\t\thflip: false,\n\t\t\t\tvflip: false,\n\t\t\t\tinvert: false,\n\t\t\t\tisLevelingAdjusted: false,\n\t\t\t\twindowWidth: 0,\n\t\t\t\twindowCenter: 0,\n\t\t\t\tzoom: 100,\n\t\t\t},\n\t\t\tdefaultViewport: undefined,\n\t\t\tisAnyImageLevelAdjusted: false,\n\t\t\tshowViewportCacheMessage: false,\n\t\t\tshowLoadingSpinner: false,\n\t\t\tupdateDebounce: undefined,\n\t\t\tuseCompactOverlay: false,\n\t\t}\n\t},\n\tcomputed: {\n\t\t...mapGetters(['canvasColors', 'activeDisplaySet']),\n\t\tcanvasColor() {\n\t\t\treturn this.canvasColors[this.series.seriesId]\n\t\t},\n\t\timage() {\n\t\t\tlet asterisImageId = this.asterisImageId\n\t\t\treturn this.series.images.find(x => x.imageId === asterisImageId && x.frameIndex === this.frameIndex)\n\t\t},\n\t},\n\twatch: {\n\t\tseries: {\n\t\t\thandler(series, previousSeries) {\n\t\t\t\t// Load and display a new series when the canvas's active series changes\n\t\t\t\tif (series && series.seriesId !== previousSeries?.seriesId) this.loadSeries()\n\t\t\t\t// Load new images added to series (when connected to local clinic)\n\t\t\t\telse if (series && series.seriesId === previousSeries?.seriesId) {\n\t\t\t\t\tif (series.images.length !== previousSeries.images.length) {\n\t\t\t\t\t\tthis.updateStackToolState()\n\t\t\t\t\t\timageLoader.prefetch()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeep: true,\n\t\t},\n\t\tcinePlayer: {\n\t\t\thandler() {\n\t\t\t\tthis.applyCinePlayerSettings()\n\t\t\t},\n\t\t\tdeep: true,\n\t\t},\n\t},\n\tmounted() {\n\t\tconst opts = shouldRenderWebGL() ? { renderer: 'webgl' } : undefined\n\t\tcornerstone.enable(this.$refs.canvas, opts)\n\t\tthis.addListeners()\n\t\tthis.$store.dispatch('setCanvasInfo', {\n\t\t\tcanvasIndex: this.index,\n\t\t\tdomCanvas: this.$refs.canvas,\n\t\t\tvueCanvas: this,\n\t\t})\n\t\tthis.loadSeries(true)\n\t},\n\tbeforeDestroy() {\n\t\ttry {\n\t\t\t// Stop any playing cinePlayers\n\t\t\tif (this.cinePlayer.isPlaying) {\n\t\t\t\tcornerstoneTools.stopClip(this.$refs.canvas)\n\t\t\t}\n\n\t\t\tthis.$store.dispatch('cacheSeriesViewport', this.$store.state.viewer.canvases[this.index])\n\t\t\tcornerstone.disable(this.$refs.canvas)\n\t\t} catch (err) {\n\t\t\t// ignore \"element not enabled\" errors\n\t\t} finally {\n\t\t\tthis.removeListeners()\n\t\t}\n\t},\n\tdestroyed() {\n\t\timageLoader.prefetch()\n\t},\n\tmethods: {\n\t\t...mapActions(['updateCanvas', 'refreshCanvas']),\n\t\taddListeners() {\n\t\t\tthis.removeListeners()\n\t\t\tthis.$refs.canvas.addEventListener(NEW_IMAGE, this.onNewImage)\n\t\t\tthis.$refs.canvas.addEventListener(IMAGE_RENDERED, this.updateOverlayInformation)\n\t\t\tthis.$refs.canvas.addEventListener(STACK_SCROLL, this.onStackScroll)\n\t\t\tmodifiedAnnotationEvents.forEach(evt => this.$refs.canvas.addEventListener(evt, this.onAnnotationModified))\n\t\t\tdisablePrecisionEvents.forEach(evt => this.$refs.canvas.addEventListener(evt, this.onDisablePrecision))\n\t\t},\n\t\tremoveListeners() {\n\t\t\tthis.$refs.canvas.removeEventListener(NEW_IMAGE, this.onNewImage)\n\t\t\tthis.$refs.canvas.removeEventListener(IMAGE_RENDERED, this.updateOverlayInformation)\n\t\t\tthis.$refs.canvas.removeEventListener(STACK_SCROLL, this.onStackScroll)\n\t\t\tmodifiedAnnotationEvents.forEach(evt => this.$refs.canvas.removeEventListener(evt, this.onAnnotationModified))\n\t\t\tdisablePrecisionEvents.forEach(evt => this.$refs.canvas.removeEventListener(evt, this.onDisablePrecision))\n\t\t},\n\t\tonDisablePrecision(e) {\n\t\t\tdisablePrecisionForInactiveHandles(e.detail.element)\n\t\t},\n\t\tonAnnotationModified(e) {\n\t\t\t// Don't rebroadcast these tool states. They have their own synchronizing handlers\n\t\t\tconst blacklist = ['AstCalibration', 'stack']\n\t\t\tconst { toolName, element } = e.detail\n\t\t\t// remove annotation doesn't have the image key in the detail object\n\t\t\tconst image = e.detail.image || getEnabledElement(element)?.image\n\t\t\tif (!blacklist.includes(toolName) && image) {\n\t\t\t\t// redraw any other matching image canvases\n\t\t\t\tgetEnabledElementsByImageId(image.imageId)\n\t\t\t\t\t.filter(enabledElement => enabledElement.element !== element)\n\t\t\t\t\t.forEach(enabledElement => {\n\t\t\t\t\t\tupdateImage(enabledElement.element)\n\t\t\t\t\t})\n\t\t\t\tconst toolState = globalImageIdSpecificToolStateManager.getImageIdToolState(image.imageId, toolName)\n\t\t\t\teventBus.broadcast(eventBus.type.VUEX_ACTION, {\n\t\t\t\t\ttype: 'updateExternalToolStateForId',\n\t\t\t\t\tpayload: {\n\t\t\t\t\t\timageId: image.imageId,\n\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\ttoolState,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * When a native cornerstone method updates the image being displayed,\n\t\t * we need to notify and update our store so we can keep cornerstone and our\n\t\t * store in sync.\n\t\t */\n\t\tonNewImage(e) {\n\t\t\t// HACK: reset the viewport.displayedArea (crop) to the image width/height\n\t\t\t// https://github.com/cornerstonejs/cornerstone/issues/304\n\t\t\tif (e.detail.viewport.displayedArea) {\n\t\t\t\te.detail.viewport.displayedArea.brhc.x = e.detail.image.width\n\t\t\t\te.detail.viewport.displayedArea.brhc.y = e.detail.image.height\n\t\t\t}\n\n\t\t\tthis.defaultViewport = cornerstone.getDefaultViewportForImage(this.$refs.canvas, e.detail.image)\n\t\t\tif (!this.isAnyImageLevelAdjusted) {\n\t\t\t\t// HACK: Reset image to default ww/wc if no manual adjustments have been made to any image\n\t\t\t\t// in the series. Cornerstone's default behavior is to reuse the ww/wc between images, but\n\t\t\t\t// each image may have its own default ww/wc, so we need to apply the defaults here.\n\t\t\t\te.detail.viewport.voi = { ...this.defaultViewport.voi }\n\t\t\t}\n\n\t\t\tclearTimeout(this.updateDebounce)\n\t\t\tthis.updateDebounce = setTimeout(() => {\n\t\t\t\tconst { asterisImageId, frameIndex } = e.detail.image\n\t\t\t\t// do not update the canvas if the new image is not in this series (ch11948)\n\t\t\t\tif (this.series.images.some(i => i.imageId === asterisImageId)) {\n\t\t\t\t\tthis.updateCanvas({\n\t\t\t\t\t\tseriesId: this.series.seriesId,\n\t\t\t\t\t\tcanvasIndex: this.index,\n\t\t\t\t\t\tasterisImageId,\n\t\t\t\t\t\tframeIndex,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}, 100)\n\t\t},\n\t\t/**\n\t\t * Update the overlay information for this enabledElement when a new image\n\t\t * is rendered.\n\t\t */\n\t\tupdateOverlayInformation(e) {\n\t\t\tconst eventData = e.detail\n\t\t\tif (!eventData || !eventData.viewport || !eventData.image) return\n\t\t\tconst toolState = cornerstoneTools.getToolState(this.$refs.canvas, 'stack')\n\t\t\tif (!toolState || !toolState.data || !toolState.data.length) return\n\n\t\t\tlet isLevelingAdjusted = false\n\t\t\tif (this.defaultViewport) {\n\t\t\t\tconst defaultVoi = this.defaultViewport.voi\n\t\t\t\tconst { voi } = eventData.viewport\n\t\t\t\tif (voi.windowWidth !== defaultVoi.windowWidth) isLevelingAdjusted = true\n\t\t\t\tif (voi.windowCenter !== defaultVoi.windowCenter) isLevelingAdjusted = true\n\t\t\t}\n\t\t\tif (isLevelingAdjusted) this.isAnyImageLevelAdjusted = true\n\n\t\t\tlet windowWidth, windowCenter\n\t\t\tconst isDicom = eventData.image.isDicom\n\t\t\tif (isDicom) {\n\t\t\t\twindowWidth = eventData.viewport.voi.windowWidth\n\t\t\t\twindowCenter = eventData.viewport.voi.windowCenter\n\t\t\t} else {\n\t\t\t\tconst scaledDisplayValues = scaleJpegVoiToDicom(eventData.viewport.voi, eventData.image)\n\n\t\t\t\twindowWidth = scaledDisplayValues.windowWidth\n\t\t\t\twindowCenter = scaledDisplayValues.windowCenter\n\t\t\t}\n\n\t\t\tthis.imageOverlayInfo = {\n\t\t\t\timageIndex: parseInt(toolState.data[0].currentImageIdIndex) + 1,\n\t\t\t\trotation: eventData.viewport.rotation,\n\t\t\t\tinvert: eventData.viewport.invert,\n\t\t\t\thflip: eventData.viewport.hflip,\n\t\t\t\tvflip: eventData.viewport.vflip,\n\t\t\t\tisLevelingAdjusted,\n\t\t\t\twindowWidth: Math.round(windowWidth),\n\t\t\t\twindowCenter: Math.round(windowCenter),\n\t\t\t\tzoom: (eventData.viewport.scale * 100).toFixed(2),\n\t\t\t}\n\t\t},\n\t\t/****\n\t\t * Tool Management\n\t\t *\n\t\t */\n\t\tinitCanvasTools() {\n\t\t\t// Set the stack as tool state\n\t\t\tcornerstoneTools.addStackStateManager(this.$refs.canvas, ['crossPoint'])\n\t\t\tthis.updateStackToolState()\n\t\t\tthis.$store.commit('UPDATE_TOOL_BINDINGS')\n\t\t},\n\t\tdisableWheelTools() {\n\t\t\tcornerstoneTools.setToolDisabledForElement(this.$refs.canvas, 'StackScrollMouseWheel', {})\n\t\t\tcornerstoneTools.setToolDisabledForElement(this.$refs.canvas, 'ZoomMouseWheel', {})\n\t\t},\n\t\tupdateActiveWheelTool() {\n\t\t\tconst activeWheelTool =\n\t\t\t\tthis.series.images && this.series.images.length > 1 ? 'StackScrollMouseWheel' : 'ZoomMouseWheel'\n\n\t\t\tcornerstoneTools.setToolActiveForElement(this.$refs.canvas, activeWheelTool, {})\n\t\t},\n\t\tapplyCinePlayerSettings() {\n\t\t\tlet settings = this.cinePlayer\n\t\t\tif (settings.isPlaying) {\n\t\t\t\tcornerstoneTools.playClip(this.$refs.canvas, settings.frameRate)\n\t\t\t} else {\n\t\t\t\tcornerstoneTools.stopClip(this.$refs.canvas)\n\t\t\t}\n\t\t},\n\t\tasync loadSeries(initTools) {\n\t\t\tlet loadingSpinnerDelay\n\t\t\ttry {\n\t\t\t\tthis.defaultViewport = undefined\n\t\t\t\tthis.isAnyImageLevelAdjusted = false\n\t\t\t\tthis.showViewportCacheMessage = false\n\t\t\t\tif (!this.image || !this.series || !this.series.images) return\n\t\t\t\tthis.$store.commit('SET_CANVAS_INITIALIZING', { canvasIndex: this.index, isInitializing: true })\n\t\t\t\tloadingSpinnerDelay = setTimeout(() => {\n\t\t\t\t\tthis.showLoadingSpinner = true\n\t\t\t\t}, 200)\n\t\t\t\tthis.disableWheelTools()\n\t\t\t\tthis.stackIndex = this.series.images.findIndex(image => image.imageId === this.asterisImageId)\n\t\t\t\tthis.updateStackToolState()\n\t\t\t\tconst cornerstoneImageId = getCornerstoneImageId(this.series, this.image)\n\n\t\t\t\tlet study = this.$store.state.viewer.studies.find(s => s.studyId === this.series.studyId)\n\t\t\t\tif (study && !study.isArchived) {\n\t\t\t\t\tif (clinicAPI.firstScanPromise) {\n\t\t\t\t\t\tawait clinicAPI.firstScanPromise\n\t\t\t\t\t}\n\t\t\t\t\tawait dicomServiceData.firstStatusPromise\n\t\t\t\t}\n\t\t\t\tawait loadMetadata(this.series)\n\t\t\t\t// remove existing prefetch promise for image\n\t\t\t\tconst cachedImage = cornerstone.imageCache.cachedImages.find(i => i.imageId === cornerstoneImageId)\n\t\t\t\tif (cachedImage && !cachedImage.image) cornerstone.imageCache.removeImageLoadObject(cornerstoneImageId)\n\t\t\t\tconst image = await cornerstone.loadAndCacheImage(cornerstoneImageId)\n\t\t\t\tconst enabledElement = await waitForElementToBeEnabled(this.$refs.canvas)\n\t\t\t\tif (enabledElement) {\n\t\t\t\t\tcornerstone.displayImage(this.$refs.canvas, image)\n\t\t\t\t\tthis.updateActiveWheelTool()\n\t\t\t\t\tif (initTools) this.initCanvasTools()\n\t\t\t\t\timageLoader.prefetch()\n\t\t\t\t\tcornerstone.reset(this.$refs.canvas)\n\t\t\t\t\tthis.$nextTick(this.refreshCanvas)\n\t\t\t\t}\n\t\t\t\tclearTimeout(loadingSpinnerDelay)\n\t\t\t\tthis.$store.commit('SET_CANVAS_INITIALIZING', { canvasIndex: this.index, isInitializing: false })\n\t\t\t\tthis.showLoadingSpinner = false\n\t\t\t\tthis.glitchCanvas()\n\t\t\t\tif (this.$store.state.viewer.seriesViewportCache[this.series.seriesId]) {\n\t\t\t\t\tthis.isAnyImageLevelAdjusted = true\n\t\t\t\t\tthis.showViewportCacheMessage = true\n\t\t\t\t\tsetTimeout(() => (this.showViewportCacheMessage = false), 2000)\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tclearTimeout(loadingSpinnerDelay)\n\t\t\t\tthis.$store.commit('SET_CANVAS_INITIALIZING', { canvasIndex: this.index, isInitializing: false })\n\t\t\t\tthis.showLoadingSpinner = false\n\t\t\t\tif (err && err.message && !err.message.includes('element not enabled')) {\n\t\t\t\t\tthis.$store.dispatch('addNotification', {\n\t\t\t\t\t\tmessage: err.message,\n\t\t\t\t\t\tnotificationType: 'error',\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tupdateStackToolState() {\n\t\t\tlet currentState = cornerstoneTools.getToolState(this.$refs.canvas, 'stack')\n\t\t\tif (!currentState) return\n\t\t\tcornerstoneTools.clearToolState(this.$refs.canvas, 'stack')\n\t\t\tcornerstoneTools.addToolState(this.$refs.canvas, 'stack', {\n\t\t\t\tcurrentImageIdIndex: this.stackIndex,\n\t\t\t\timageIds: getCornerstoneImageIdsForSeries(this.series),\n\t\t\t})\n\t\t},\n\t\tonStackScroll(e) {\n\t\t\tthis.stackIndex = e.detail.newImageIdIndex\n\t\t\timageLoader.prefetch(e.detail.newImageIdIndex)\n\t\t},\n\t\t// LOOK AWAY!! LOOK AWAY!!\n\t\t// Really sorry for this, but Safari sometimes retains overlay background pixels\n\t\t// All this does is slightly lower the opacity and then reset it 10ms later\n\t\tglitchCanvas() {\n\t\t\tif (!this.$refs.canvas) return\n\t\t\tthis.$refs.canvas.style.opacity = 0.99\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (!this.$refs.canvas) return\n\t\t\t\tthis.$refs.canvas.style.opacity = 1\n\t\t\t}, 10)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '~@styles/_vars.scss';\n\n.wrapper {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n\tuser-select: none;\n\n\t.border {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tbottom: 0;\n\t\tright: 0;\n\t\tborder: 1px solid #333;\n\t\ttouch-action: none;\n\t\tpointer-events: none;\n\t}\n\n\t&.isActiveViewer .border {\n\t\tborder: 2px solid white;\n\t}\n}\n\n.dicom-image-canvas {\n\twidth: 100%;\n\theight: 100%;\n}\n.dot {\n\tposition: absolute;\n\ttop: 0;\n\tright: 0;\n\twidth: 12px;\n\theight: 12px;\n\tmargin: 4px;\n\tborder-radius: 100%;\n}\n\n.dicom-image-overlay {\n\tdisplay: flex;\n\tposition: absolute;\n\tjustify-content: flex-end;\n\twidth: 100%;\n\theight: 100%;\n\ttop: 0;\n\tleft: 0;\n\tpointer-events: none;\n}\n.viewport-message {\n\tdisplay: flex;\n\tposition: absolute;\n\talign-items: center;\n\tjustify-content: center;\n\tfont-size: 1.1em;\n\twidth: 100%;\n\theight: 33%;\n\tbottom: 0;\n\tleft: 0;\n\tpointer-events: none;\n\t.overlay-wrapper {\n\t\ttext-align: center;\n\t\tpadding: 8px 16px;\n\t\tcolor: #fff;\n\t\tborder: 1px solid #888;\n\t\tbackground: #000;\n\t\tborder-radius: 1em;\n\t\topacity: 0.75;\n\t}\n}\n.loading {\n\tdisplay: flex;\n\tposition: absolute;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 100%;\n\theight: 100%;\n\ttop: 0;\n\tleft: 0;\n\tfont-size: 4em;\n\topacity: 0.5;\n\tbackground: #000;\n\tcolor: #fff;\n}\n\n.dicom-image-overlay-text {\n\tposition: relative;\n\tflex-grow: 1;\n\tcolor: white;\n\ttext-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;\n\n\tul {\n\t\tlist-style: none;\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t}\n\n\t.top-left,\n\t.top-right,\n\t.bottom-left,\n\t.bottom-right {\n\t\tposition: absolute;\n\t\tmax-width: 50%;\n\t\tpadding: 12px;\n\t}\n\n\t.compact-only {\n\t\tdisplay: none;\n\t}\n\t.full-only {\n\t\tdisplay: block;\n\t}\n\t&.compact {\n\t\t.top-left,\n\t\t.bottom-left {\n\t\t\tmax-width: 100%;\n\t\t}\n\t\t.top-right,\n\t\t.bottom-right {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.compact-only {\n\t\t\tdisplay: block;\n\t\t}\n\t\t.full-only {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t.top-left {\n\t\ttop: 0;\n\t\tleft: 0;\n\t}\n\n\t.top-right {\n\t\ttop: 0;\n\t\tright: 0;\n\t}\n\n\t.bottom-right {\n\t\tbottom: 0;\n\t\tright: 0;\n\t}\n\n\t.bottom-left {\n\t\tbottom: 0;\n\t\tleft: 0;\n\t}\n}\n\n// MEDIA\n.hide-compact {\n\tdisplay: none;\n}\n.show-compact {\n\tdisplay: block;\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImageViewer.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImageViewer.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ImageViewer.vue?vue&type=template&id=396a52cf&scoped=true\"\nimport script from \"./ImageViewer.vue?vue&type=script&lang=js\"\nexport * from \"./ImageViewer.vue?vue&type=script&lang=js\"\nimport style0 from \"./ImageViewer.vue?vue&type=style&index=0&id=396a52cf&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"396a52cf\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.hasActiveSeries)?_c('ast-toolbar-button',{attrs:{\"title\":\"Select Layout\",\"icon\":\"layout\"},scopedSlots:_vm._u([{key:\"dropdown\",fn:function(ref){\nvar hide = ref.hide;\nreturn [_c('ast-toolbar-menu',{staticClass:\"viewer-layout-menu\"},[_c('div',{staticClass:\"layouts\"},_vm._l((_vm.layouts),function(layout){return _c('ast-toolbar-button',{key:layout.name,attrs:{\"title\":layout.title,\"icon\":layout.icon},nativeOn:{\"click\":function($event){return _vm.layoutSelected(layout, hide)}}})}),1),_c('ul',_vm._l((_vm.settings),function(setting,i){return _c('li',{key:i,on:{\"mousedown\":function($event){$event.stopPropagation();return setting.toggle($event)}}},[_c('checkbox',{staticStyle:{\"margin\":\"0\"},attrs:{\"value\":_vm._self[setting.computed]}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\"+_vm._s(setting.label)+\"\\n\\t\\t\\t\\t\\t\")])],1)}),0),(_vm.mq.small)?_c('div',{staticClass:\"dock-toolbar\"},[_vm._v(\"\\n\\t\\t\\t\\tDock Toolbar\\n\\t\\t\\t\\t\"),_c('div',_vm._l((['top', 'bottom', 'left', 'right']),function(location,i){return _c('svg-icon',{key:i,class:{ 'is-selected': _vm.toolbarLocation === location },style:({ transform: i === 0 || i === 3 ? 'rotate(180deg)' : '' }),attrs:{\"icon\":i <= 1 ? 'dock-bottom' : 'dock-left',\"title\":_vm.$options.filters.capitalize(location)},nativeOn:{\"click\":function($event){_vm.toolbarLocation = location}}})}),1)]):_vm._e()])]}}],null,false,1246470958)}):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<ast-toolbar-button v-if=\"hasActiveSeries\" title=\"Select Layout\" icon=\"layout\">\n\t\t<template #dropdown=\"{ hide }\">\n\t\t\t<ast-toolbar-menu class=\"viewer-layout-menu\">\n\t\t\t\t<div class=\"layouts\">\n\t\t\t\t\t<ast-toolbar-button\n\t\t\t\t\t\tv-for=\"layout in layouts\"\n\t\t\t\t\t\t:key=\"layout.name\"\n\t\t\t\t\t\t:title=\"layout.title\"\n\t\t\t\t\t\t:icon=\"layout.icon\"\n\t\t\t\t\t\t@click.native=\"layoutSelected(layout, hide)\"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<ul>\n\t\t\t\t\t<li v-for=\"(setting, i) in settings\" :key=\"i\" @mousedown.stop=\"setting.toggle\">\n\t\t\t\t\t\t<checkbox :value=\"_self[setting.computed]\" style=\"margin:0\">\n\t\t\t\t\t\t\t{{ setting.label }}\n\t\t\t\t\t\t</checkbox>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t<div v-if=\"mq.small\" class=\"dock-toolbar\">\n\t\t\t\t\tDock Toolbar\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<svg-icon\n\t\t\t\t\t\t\tv-for=\"(location, i) in ['top', 'bottom', 'left', 'right']\"\n\t\t\t\t\t\t\t:key=\"i\"\n\t\t\t\t\t\t\t:icon=\"i <= 1 ? 'dock-bottom' : 'dock-left'\"\n\t\t\t\t\t\t\t:class=\"{ 'is-selected': toolbarLocation === location }\"\n\t\t\t\t\t\t\t:title=\"$options.filters.capitalize(location)\"\n\t\t\t\t\t\t\t:style=\"{ transform: i === 0 || i === 3 ? 'rotate(180deg)' : '' }\"\n\t\t\t\t\t\t\t@click.native=\"toolbarLocation = location\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</ast-toolbar-menu>\n\t\t</template>\n\t</ast-toolbar-button>\n</template>\n\n<script>\nimport { mapState, mapMutations } from 'vuex'\nimport AstToolbarMenu from '@components/ToolbarMenu.vue'\nimport AstToolbarButton from '@components/ToolbarButton.vue'\nimport layouts from '@store/modules/mpr/state/layouts.json'\nimport { keys as MPRKeys } from '@store/modules/mpr/mutations'\nimport Checkbox from '@components/Checkbox.vue'\n\nexport default {\n\tname: 'LayoutSelector',\n\tcomponents: {\n\t\tAstToolbarButton,\n\t\tAstToolbarMenu,\n\t\tCheckbox,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tlayouts,\n\t\t\tsettings: [\n\t\t\t\t{\n\t\t\t\t\tcomputed: 'showOverlayText',\n\t\t\t\t\tlabel: 'Overlay Text',\n\t\t\t\t\ttoggle: () => this.$store.commit('SET_MPR_SHOW_OVERLAY_TEXT', !this.showOverlayText),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcomputed: 'showImageOrientationMarkers',\n\t\t\t\t\tlabel: 'Orientation Markers',\n\t\t\t\t\ttoggle: () => this.$store.commit('SET_MPR_SHOW_IMAGE_ORIENTATION_MARKERS', !this.showImageOrientationMarkers),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcomputed: 'showAxis',\n\t\t\t\t\tlabel: 'View Axis',\n\t\t\t\t\ttoggle: () => this.$store.commit('TOGGLE_MPR_SHOW_AXIS', !this.showAxis),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcomputed: 'isSyncWindowLevelsEnabled',\n\t\t\t\t\tlabel: 'Sync Window Levels',\n\t\t\t\t\ttoggle: () => this.$store.commit('SET_MPR_SYNC_WINDOW_LEVELS', !this.isSyncWindowLevelsEnabled),\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t},\n\tcomputed: {\n\t\t...mapState({\n\t\t\thasActiveSeries: state => !!state.mpr.activeSeries,\n\t\t\tshowOverlayText: state => state.mpr.showOverlayText,\n\t\t\tshowImageOrientationMarkers: state => state.mpr.showImageOrientationMarkers,\n\t\t\tshowAxis: state => state.mpr.showAxisOverlay,\n\t\t\tisSyncWindowLevelsEnabled: state => state.mpr.syncWindowLevels,\n\t\t}),\n\t\ttoolbarLocation: {\n\t\t\tget() {\n\t\t\t\treturn this.$store.state.viewer.settingsPanel.toolbarLocation\n\t\t\t},\n\t\t\tset(location) {\n\t\t\t\tthis.$store.dispatch('setViewerToolbarLocation', location)\n\t\t\t},\n\t\t},\n\t},\n\tmethods: {\n\t\t...mapMutations({\n\t\t\tsetLayout: MPRKeys.SET_MPR_LAYOUT,\n\t\t}),\n\t\tlayoutSelected(e, hideDropdown) {\n\t\t\thideDropdown()\n\t\t\tthis.setLayout(e)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '~@styles/_vars.scss';\n\n.layouts {\n\tdisplay: grid;\n\tgrid-template-rows: 1fr 1fr;\n\tgrid-template-columns: 1fr 1fr 1fr;\n\twidth: 150px;\n\tpadding: 4px 0;\n}\n// Update if we add more view options\n.layouts :last-child {\n\tgrid-column: 2;\n}\nul {\n\tborder-top: 1px solid var(--divider);\n}\nli {\n\tpadding: 8px 8px;\n\t& > * {\n\t\tpointer-events: none;\n\t}\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprViewerLayoutSelector.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprViewerLayoutSelector.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./MprViewerLayoutSelector.vue?vue&type=template&id=f3d3b0cc&scoped=true\"\nimport script from \"./MprViewerLayoutSelector.vue?vue&type=script&lang=js\"\nexport * from \"./MprViewerLayoutSelector.vue?vue&type=script&lang=js\"\nimport style0 from \"./MprViewerLayoutSelector.vue?vue&type=style&index=0&id=f3d3b0cc&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"f3d3b0cc\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"viewer-toolbar-container\",class:({ 'is-disabled': _vm.isLoading, 'show-compact': _vm.showCompactToolbar }, _vm.toolbarLocation)},[_c('ast-toolbar',{ref:\"fullToolbar\",staticClass:\"full\"},[(!_vm.isGrouped.levels)?[_vm._l((_vm.itemsInGroup('levels')),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();tool.command ? tool.command() : _vm.activateTool({ event: $event, tool: tool })},\"contextmenu\":function($event){$event.preventDefault();}}})}),_c('span',{staticClass:\"separator\"})]:_c('ast-toolbar-dropdown',{attrs:{\"items\":_vm.itemsInGroup('levels'),\"available-tools\":_vm.availableTools,\"dropdown-location\":_vm.dropdownLocation},on:{\"activate-tool\":_vm.activateTool}}),_vm._l((_vm.ungroupedTools),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();return _vm.activateTool({ event: $event, tool: tool })},\"contextmenu\":function($event){$event.preventDefault();}}})}),_c('span',{staticClass:\"separator\"}),(!_vm.isGrouped.annotation)?[_vm._l((_vm.itemsInGroup('annotation')),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();return _vm.activateTool({ event: $event, tool: tool })},\"contextmenu\":function($event){$event.preventDefault();}}})}),_c('span',{staticClass:\"separator\"})]:_c('ast-toolbar-dropdown',{attrs:{\"items\":_vm.itemsInGroup('annotation'),\"available-tools\":_vm.availableTools,\"dropdown-location\":_vm.dropdownLocation},on:{\"activate-tool\":_vm.activateTool}}),(!_vm.isGrouped.scroll)?_vm._l((_vm.itemsInGroup('scroll')),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();return _vm.activateTool({ event: $event, tool: tool })},\"contextmenu\":function($event){$event.preventDefault();}}})}):_c('ast-toolbar-dropdown',{attrs:{\"items\":_vm.itemsInGroup('scroll'),\"available-tools\":_vm.availableTools,\"dropdown-location\":_vm.dropdownLocation},on:{\"activate-tool\":_vm.activateTool}}),_c('ast-toolbar-dropdown',{key:\"hack-bugfix?!\",attrs:{\"icon\":\"gradient\",\"dropdown-location\":_vm.dropdownLocation,\"label\":_vm.activeBlendMethod.label,\"title\":_vm.activeBlendMethod.title,\"items\":_vm.blendMethods}}),_c('span',{staticClass:\"separator\"}),_vm._l((_vm.itemsInGroup('switch')),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();return tool.command()},\"contextmenu\":function($event){$event.preventDefault();}}})}),_c('ast-toolbar-dropdown',{attrs:{\"icon\":\"repeat2\",\"label\":\"Rotate\",\"title\":\"Rotation Tools\",\"dropdown-location\":_vm.dropdownLocation,\"items\":_vm.rotateItems}}),_c('ast-toolbar-button',{attrs:{\"icon\":\"backup-restore\",\"label\":\"Reset\",\"title\":\"Reset Image\"},nativeOn:{\"click\":function($event){return _vm.resetViewData($event)}}}),_c('span',{staticClass:\"separator\"}),_c('ast-toolbar-button',{attrs:{\"icon\":\"dots-horizontal\",\"label\":\"Actions\"},nativeOn:{\"click\":function($event){return _vm.$emit('toggle-drawer', 'mprActions')}}})],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import AstToolbar from '@components/Toolbar'\nimport AstToolbarButton from '@components/ToolbarButton'\nimport AstToolbarDropdown from '@components/ToolbarDropdown'\nimport { eventBus } from '@services/eventBus'\n\nexport default {\n\tcomponents: {\n\t\tAstToolbar,\n\t\tAstToolbarButton,\n\t\tAstToolbarDropdown,\n\t},\n\tprops: {\n\t\tisRepository: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\ttoolbarLocation: {\n\t\t\ttype: String,\n\t\t\tdefault: 'top',\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tisBurningAnnotations: false,\n\t\t\tshowCompactToolbar: false,\n\t\t}\n\t},\n\tcomputed: {\n\t\tdropdownLocation() {\n\t\t\treturn this.toolbarLocation === 'top'\n\t\t\t\t? 'bottom'\n\t\t\t\t: this.toolbarLocation === 'bottom'\n\t\t\t\t? 'top'\n\t\t\t\t: this.toolbarLocation === 'left'\n\t\t\t\t? 'right'\n\t\t\t\t: 'left'\n\t\t},\n\t\tungroupedTools() {\n\t\t\treturn this.availableTools.filter(tool => !tool.groups.length)\n\t\t},\n\t},\n\twatch: {\n\t\t'availableTools.length'() {\n\t\t\tthis.groupTools()\n\t\t},\n\t\ttoolbarLocation() {\n\t\t\tthis.groupTools()\n\t\t},\n\t},\n\tmounted() {\n\t\tthis.groupTools()\n\t\teventBus.on('resize', this.groupTools)\n\t},\n\tdestroyed() {\n\t\teventBus.off('resize', this.groupTools)\n\t},\n\tmethods: {\n\t\tasync groupTools() {\n\t\t\tthis.showCompactToolbar = false\n\t\t\tawait this.$nextTick()\n\t\t\tif (!this.$refs.fullToolbar) return\n\t\t\tconst toolbar = this.$refs.fullToolbar.$el\n\t\t\tif (!toolbar || !toolbar.clientWidth) return\n\t\t\ttoolbar.style.opacity = 0 // makes rendering look less glitchy in IE\n\t\t\t// Ungroup all tools\n\t\t\tthis.groupOrder.forEach(group => {\n\t\t\t\tthis.isGrouped[group] = false\n\t\t\t})\n\t\t\tconst isToolbarOverflowing = () => {\n\t\t\t\treturn ['top', 'bottom'].includes(this.toolbarLocation)\n\t\t\t\t\t? toolbar.clientWidth < toolbar.scrollWidth\n\t\t\t\t\t: toolbar.clientHeight < toolbar.scrollHeight\n\t\t\t}\n\t\t\t// Group tools until toolbar is not overflowing\n\t\t\tfor (let i = 0; i < this.groupOrder.length; i++) {\n\t\t\t\tawait this.$nextTick()\n\t\t\t\tif (!isToolbarOverflowing()) break\n\t\t\t\tthis.isGrouped[this.groupOrder[i]] = true\n\t\t\t}\n\t\t\tawait this.$nextTick()\n\t\t\tthis.showCompactToolbar = isToolbarOverflowing()\n\t\t\ttoolbar.style.opacity = 1\n\t\t},\n\t\titemsInGroup(group) {\n\t\t\tlet tools = this.availableTools.filter(tool => tool.groups.includes(group))\n\t\t\tlet actions = this.actions.filter(action => action.groups.includes(group))\n\t\t\treturn [].concat(tools, actions).filter(item => !(item.isHiddenForRepository && this.isRepository))\n\t\t},\n\t\tasync burnInAnnotations() {\n\t\t\tif (this.isBurningAnnotations) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tthis.isBurningAnnotations = true\n\t\t\t\tawait this.$store.dispatch('createAnnotationRenderingAsync')\n\t\t\t} finally {\n\t\t\t\tthis.isBurningAnnotations = false\n\t\t\t}\n\t\t},\n\t},\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprViewerTools.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprViewerTools.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./MprViewerTools.vue?vue&type=template&id=5faf4614\"\nimport script from \"./MprViewerTools.vue?vue&type=script&lang=js\"\nexport * from \"./MprViewerTools.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('ast-toolbar-button',{attrs:{\"icon\":\"layout\",\"title\":\"Viewer Settings\"},scopedSlots:_vm._u([{key:\"dropdown\",fn:function(ref){\nvar hide = ref.hide;\nreturn [_c('ast-toolbar-menu',{staticClass:\"viewer-layout-menu\"},[_c('layout-grid-selector',{staticStyle:{\"margin\":\"1em 0\"},attrs:{\"value\":_vm.activeLayout},on:{\"input\":function($event){return _vm.layoutSelected($event, hide)}}}),_vm._t(\"mpr\"),_c('ul',_vm._l((_vm.settings),function(setting,i){return _c('li',{key:i,on:{\"mousedown\":function($event){$event.stopPropagation();return setting.toggle($event)}}},[_c('checkbox',{staticStyle:{\"margin\":\"0\"},attrs:{\"value\":_vm._self[setting.computed]}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\"+_vm._s(setting.label)+\"\\n\\t\\t\\t\\t\\t\")])],1)}),0),(_vm.mq.small)?_c('div',{staticClass:\"dock-toolbar\"},[_vm._v(\"\\n\\t\\t\\t\\tDock Toolbar\\n\\t\\t\\t\\t\"),_c('div',_vm._l((['top', 'bottom', 'left', 'right']),function(location,i){return _c('svg-icon',{key:i,class:{ 'is-selected': _vm.toolbarLocation === location },style:({ transform: i === 0 || i === 3 ? 'rotate(180deg)' : '' }),attrs:{\"icon\":i <= 1 ? 'dock-bottom' : 'dock-left',\"title\":_vm.$options.filters.capitalize(location)},nativeOn:{\"click\":function($event){_vm.toolbarLocation = location}}})}),1)]):_vm._e()],2)]}}],null,true)})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<ast-toolbar-button icon=\"layout\" title=\"Viewer Settings\">\n\t\t<template #dropdown=\"{ hide }\">\n\t\t\t<ast-toolbar-menu class=\"viewer-layout-menu\">\n\t\t\t\t<layout-grid-selector :value=\"activeLayout\" style=\"margin: 1em 0\" @input=\"layoutSelected($event, hide)\" />\n\t\t\t\t<slot name=\"mpr\"></slot>\n\t\t\t\t<ul>\n\t\t\t\t\t<li v-for=\"(setting, i) in settings\" :key=\"i\" @mousedown.stop=\"setting.toggle\">\n\t\t\t\t\t\t<checkbox :value=\"_self[setting.computed]\" style=\"margin:0\">\n\t\t\t\t\t\t\t{{ setting.label }}\n\t\t\t\t\t\t</checkbox>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t<div v-if=\"mq.small\" class=\"dock-toolbar\">\n\t\t\t\t\tDock Toolbar\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<svg-icon\n\t\t\t\t\t\t\tv-for=\"(location, i) in ['top', 'bottom', 'left', 'right']\"\n\t\t\t\t\t\t\t:key=\"i\"\n\t\t\t\t\t\t\t:icon=\"i <= 1 ? 'dock-bottom' : 'dock-left'\"\n\t\t\t\t\t\t\t:class=\"{ 'is-selected': toolbarLocation === location }\"\n\t\t\t\t\t\t\t:title=\"$options.filters.capitalize(location)\"\n\t\t\t\t\t\t\t:style=\"{ transform: i === 0 || i === 3 ? 'rotate(180deg)' : '' }\"\n\t\t\t\t\t\t\t@click.native=\"toolbarLocation = location\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</ast-toolbar-menu>\n\t\t</template>\n\t</ast-toolbar-button>\n</template>\n\n<script>\nimport { mapState } from 'vuex'\nimport AstToolbarMenu from '@components/ToolbarMenu.vue'\nimport AstToolbarButton from '@components/ToolbarButton.vue'\nimport Checkbox from '@components/Checkbox.vue'\nimport LayoutGridSelector from '@components/layout/LayoutGridSelector.vue'\nimport api from \"@services/api\";\n\nexport default {\n\tname: 'LayoutSelector',\n\tcomponents: {\n\t\tAstToolbarButton,\n\t\tAstToolbarMenu,\n\t\tCheckbox,\n\t\tLayoutGridSelector,\n\t},\n\tprops: {\n\t\tsettingsConfig: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tmaxRows: 3,\n\t\t\tmaxColumns: 3,\n\t\t\tsettings: [\n\t\t\t\t{\n\t\t\t\t\tcomputed: 'overlayText',\n\t\t\t\t\tlabel: 'Overlay Text',\n\t\t\t\t\ttoggle: () => {\n            this.$store.commit('TOGGLE_OVERLAY_TEXT')\n            this.saveViewerSetting()\n          },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcomputed: 'showImageOrientationMarkers',\n\t\t\t\t\tlabel: 'Orientation Markers',\n\t\t\t\t\ttoggle: () => {\n            this.$store.dispatch('toggleImageOrientationMarkers')\n            this.saveViewerSetting()\n          },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcomputed: 'isLengthAnglesEnabled',\n\t\t\t\t\tlabel: 'Intersecting Line Angles',\n\t\t\t\t\ttoggle: () => {\n            this.$store.dispatch('toggleLengthAngles')\n            this.saveViewerSetting()\n          },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcomputed: 'isReferenceLineSynchronizationEnabled',\n\t\t\t\t\tlabel: 'Reference Lines',\n\t\t\t\t\ttoggle: () => {\n            this.$store.dispatch('toggleReferenceLineSynchronization')\n            this.saveViewerSetting()\n          },\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t},\n\tcomputed: {\n\t\t...mapState({\n\t\t\toverlayText: state => state.viewer.settingsPanel.overlayText,\n\t\t\tshowImageOrientationMarkers: state => state.viewer.settingsPanel.isImageOrientationMarkersEnabled,\n\t\t\tisLengthAnglesEnabled: state => state.viewer.settingsPanel.isLengthAnglesEnabled,\n\t\t\tisReferenceLineSynchronizationEnabled: state => state.viewer.settingsPanel.isReferenceLineSynchronizationEnabled,\n\t\t\tactiveLayout: state => {\n\t\t\t\treturn {\n\t\t\t\t\tc: state.viewer.canvasLayout.canvasesPerRow,\n\t\t\t\t\tr: Math.floor(state.viewer.canvasLayout.numCanvases / state.viewer.canvasLayout.canvasesPerRow),\n\t\t\t\t}\n\t\t\t},\n\t\t}),\n\t\ttoolbarLocation: {\n\t\t\tget() {\n\t\t\t\treturn this.$store.state.viewer.settingsPanel.toolbarLocation\n\t\t\t},\n\t\t\tset(location) {\n\t\t\t\tthis.$store.dispatch('setViewerToolbarLocation', location)\n\t\t\t},\n\t\t},\n\t},\n\tmounted() {\n\t\tthis.settings = this.settings.filter(s => {\n\t\t\tif (this.settingsConfig[s.label] && this.settingsConfig[s.label].hidden) return false\n\t\t\treturn true\n\t\t})\n\t\tlet debounceTimer\n\t\tconst setMaxRowsAndColumns = () => {\n\t\t\tclearTimeout(debounceTimer)\n\t\t\tdebounceTimer = setTimeout(() => {\n\t\t\t\tconst minCanvasHeight = 100\n\t\t\t\tconst minCanvasWidth = 150\n\t\t\t\tlet maxRows = Math.floor(window.innerHeight / minCanvasHeight) || 1\n\t\t\t\tlet maxColumns = Math.floor(window.innerWidth / minCanvasWidth) || 1\n\t\t\t\tthis.maxRows = Math.min(maxRows, 3)\n\t\t\t\tthis.maxColumns = Math.min(maxColumns, 3)\n\t\t\t}, 100)\n\t\t}\n\t\twindow.addEventListener('resize', setMaxRowsAndColumns)\n\t\tthis.$once('hook:beforeDestroy', () => {\n\t\t\twindow.removeEventListener('resize', this.setMaxRowsAndColumns)\n\t\t})\n\t\tsetMaxRowsAndColumns()\n\t},\n\tmethods: {\n\t\tlayoutSelected(e, hideDropdown) {\n\t\t\thideDropdown()\n\t\t\tthis.$emit('layout-selected', e)\n\t\t},\n    async saveViewerSetting(){\n      let payload = {\n        overlayTextEnabled: this.overlayText,\n        imageOrientationMarkersEnabled: this.showImageOrientationMarkers,\n        lengthAnglesEnabled: this.isLengthAnglesEnabled,\n        referenceLineSynchronizationEnabled: this.isReferenceLineSynchronizationEnabled\n      }\n      try {\n        await api.user.setUserSetting('ViewerSettings', 'OmniReport', JSON.stringify(payload))\n      } finally {\n      }\n    }\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n@import '~@styles/_vars.scss';\n\n.viewer-layout-menu {\n\tflex-direction: column;\n\talign-items: center;\n\n\t.dock-toolbar {\n\t\twidth: 100%;\n\t\tpadding: 8px;\n\t\tborder-top: 1px solid var(--primary-border);\n\t\t.icon {\n\t\t\tfont-size: 28px;\n\t\t\topacity: 0.5;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.icon + .icon {\n\t\t\tmargin-left: 4px;\n\t\t}\n\t\t.icon.is-selected {\n\t\t\topacity: 1;\n\t\t\tcolor: var(--checkbox-checked-bg);\n\t\t}\n\t}\n\n\tul {\n\t\tborder-top: 1px solid var(--divider);\n\t\twidth: 100%;\n\t}\n\tli {\n\t\tpadding: 12px 8px;\n\t\t& > * {\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n\tli.disabled {\n\t\tuser-select: none;\n\t\tpointer-events: none;\n\t\t& > *:not(.no-disable) {\n\t\t\topacity: 0.5;\n\t\t}\n\t}\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerLayoutSelector.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerLayoutSelector.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ViewerLayoutSelector.vue?vue&type=template&id=408da2f8\"\nimport script from \"./ViewerLayoutSelector.vue?vue&type=script&lang=js\"\nexport * from \"./ViewerLayoutSelector.vue?vue&type=script&lang=js\"\nimport style0 from \"./ViewerLayoutSelector.vue?vue&type=style&index=0&id=408da2f8&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"navigation\"},[_c('div',{staticClass:\"buttons\"},[_c('ast-toolbar-button',{attrs:{\"icon\":\"play-box-outline\",\"title\":\"CINE\",\"disabled\":!_vm.hasMultipleImages},nativeOn:{\"click\":function($event){return _vm.toggleCine($event)}}}),(!_vm.hangingProtocol)?[_c('ast-toolbar-button',{attrs:{\"icon\":\"skip-previous\",\"title\":\"Previous Series\",\"disabled\":!_vm.hasPreviousSeries},nativeOn:{\"click\":function($event){return _vm.$store.dispatch('previousSeries')}}}),_c('ast-toolbar-button',{attrs:{\"icon\":\"skip-next\",\"title\":\"Next Series\",\"disabled\":!_vm.hasNextSeries},nativeOn:{\"click\":function($event){return _vm.$store.dispatch('nextSeries')}}})]:[_c('ast-toolbar-button',{attrs:{\"icon\":\"skip-previous\",\"title\":\"Previous Display Set\",\"disabled\":!_vm.hasPreviousDisplaySet},nativeOn:{\"click\":function($event){return _vm.setHangingProtocolDisplaySet(_vm.activeDisplaySetIndex - 1)}}}),_c('ast-toolbar-button',{attrs:{\"icon\":\"skip-next\",\"title\":\"Next Display Set\",\"disabled\":!_vm.hasNextDisplaySet},nativeOn:{\"click\":function($event){return _vm.setHangingProtocolDisplaySet(_vm.activeDisplaySetIndex + 1)}}})]],2),(_vm.hangingProtocols && _vm.hangingProtocols.length)?_c('div',{staticClass:\"dropdowns\"},[_c('ast-toolbar-button',{attrs:{\"title\":\"Hanging Protocol\",\"disabled\":_vm.isHangingProtocolLoading,\"dropdown-location\":_vm.showDropdownsBelow ? 'bottom' : 'top'},scopedSlots:_vm._u([{key:\"label\",fn:function(){return [_c('p',{staticClass:\"label full-label\"},[_vm._v(_vm._s(_vm.hangingProtocolLabel))]),_c('p',{staticClass:\"label compact-label\"},[_vm._v(\"Hanging Protocol\")])]},proxy:true},{key:\"dropdown\",fn:function(ref){\nvar hide = ref.hide;\nreturn [_c('ast-toolbar-menu',{attrs:{\"items\":_vm.hangingProtocolOptions},on:{\"select\":function (protocol) { return _vm.setHangingProtocol(protocol.value, hide); }},scopedSlots:_vm._u([{key:\"item\",fn:function(ref){\nvar protocol = ref.item;\nreturn [_c('span',{class:{ selected: _vm.hangingProtocol && protocol.value === _vm.hangingProtocol.id }},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(protocol.label)+\"\\n\\t\\t\\t\\t\\t\\t\")])]}}],null,true)})]}}],null,false,3110910219)}),(_vm.hangingProtocol)?_c('ast-toolbar-button',{attrs:{\"title\":\"Display Sets\",\"disabled\":_vm.isHangingProtocolLoading,\"dropdown-location\":_vm.showDropdownsBelow ? 'bottom' : 'top'},scopedSlots:_vm._u([{key:\"label\",fn:function(){return [_c('p',{staticClass:\"label full-label\"},[_vm._v(\" DS: \"+_vm._s(_vm.hangingProtocol.displaySets[_vm.activeDisplaySetIndex].name)+\" \")]),_c('p',{staticClass:\"label compact-label\"},[_vm._v(\"Display Set\")])]},proxy:true},{key:\"dropdown\",fn:function(ref){\nvar hide = ref.hide;\nreturn [_c('ast-toolbar-menu',{attrs:{\"items\":_vm.hangingProtocol.displaySets},on:{\"select\":function (e) { return _vm.switchDisplaySet(e, hide); }},scopedSlots:_vm._u([{key:\"item\",fn:function(ref){\nvar displaySet = ref.item;\nreturn [_c('span',{class:{\n\t\t\t\t\t\t\t\tselected: displaySet === _vm.hangingProtocol.displaySets[_vm.activeDisplaySetIndex],\n\t\t\t\t\t\t\t}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(displaySet.name)+\"\\n\\t\\t\\t\\t\\t\\t\")])]}}],null,true)})]}}],null,false,1589826515)}):_vm._e()],1):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<div class=\"navigation\">\n\t\t<div class=\"buttons\">\n\t\t\t<ast-toolbar-button\n\t\t\t\ticon=\"play-box-outline\"\n\t\t\t\ttitle=\"CINE\"\n\t\t\t\t:disabled=\"!hasMultipleImages\"\n\t\t\t\t@click.native=\"toggleCine\"\n\t\t\t/>\n\t\t\t<template v-if=\"!hangingProtocol\">\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\ticon=\"skip-previous\"\n\t\t\t\t\ttitle=\"Previous Series\"\n\t\t\t\t\t:disabled=\"!hasPreviousSeries\"\n\t\t\t\t\t@click.native=\"$store.dispatch('previousSeries')\"\n\t\t\t\t/>\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\ticon=\"skip-next\"\n\t\t\t\t\ttitle=\"Next Series\"\n\t\t\t\t\t:disabled=\"!hasNextSeries\"\n\t\t\t\t\t@click.native=\"$store.dispatch('nextSeries')\"\n\t\t\t\t/>\n\t\t\t</template>\n\t\t\t<template v-else>\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\ticon=\"skip-previous\"\n\t\t\t\t\ttitle=\"Previous Display Set\"\n\t\t\t\t\t:disabled=\"!hasPreviousDisplaySet\"\n\t\t\t\t\t@click.native=\"setHangingProtocolDisplaySet(activeDisplaySetIndex - 1)\"\n\t\t\t\t/>\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\ticon=\"skip-next\"\n\t\t\t\t\ttitle=\"Next Display Set\"\n\t\t\t\t\t:disabled=\"!hasNextDisplaySet\"\n\t\t\t\t\t@click.native=\"setHangingProtocolDisplaySet(activeDisplaySetIndex + 1)\"\n\t\t\t\t/>\n\t\t\t</template>\n\t\t</div>\n\t\t<div v-if=\"hangingProtocols && hangingProtocols.length\" class=\"dropdowns\">\n\t\t\t<ast-toolbar-button\n\t\t\t\ttitle=\"Hanging Protocol\"\n\t\t\t\t:disabled=\"isHangingProtocolLoading\"\n\t\t\t\t:dropdown-location=\"showDropdownsBelow ? 'bottom' : 'top'\"\n\t\t\t>\n\t\t\t\t<template #label>\n\t\t\t\t\t<p class=\"label full-label\">{{ hangingProtocolLabel }}</p>\n\t\t\t\t\t<p class=\"label compact-label\">Hanging Protocol</p>\n\t\t\t\t</template>\n\t\t\t\t<template #dropdown=\"{ hide }\">\n\t\t\t\t\t<ast-toolbar-menu\n\t\t\t\t\t\t:items=\"hangingProtocolOptions\"\n\t\t\t\t\t\t@select=\"protocol => setHangingProtocol(protocol.value, hide)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template #item=\"{ item: protocol }\">\n\t\t\t\t\t\t\t<span :class=\"{ selected: hangingProtocol && protocol.value === hangingProtocol.id }\">\n\t\t\t\t\t\t\t\t{{ protocol.label }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</ast-toolbar-menu>\n\t\t\t\t</template>\n\t\t\t</ast-toolbar-button>\n\t\t\t<ast-toolbar-button\n\t\t\t\tv-if=\"hangingProtocol\"\n\t\t\t\ttitle=\"Display Sets\"\n\t\t\t\t:disabled=\"isHangingProtocolLoading\"\n\t\t\t\t:dropdown-location=\"showDropdownsBelow ? 'bottom' : 'top'\"\n\t\t\t>\n\t\t\t\t<template #label>\n\t\t\t\t\t<p class=\"label full-label\"> DS: {{ hangingProtocol.displaySets[activeDisplaySetIndex].name }} </p>\n\t\t\t\t\t<p class=\"label compact-label\">Display Set</p>\n\t\t\t\t</template>\n\t\t\t\t<template #dropdown=\"{ hide }\">\n\t\t\t\t\t<ast-toolbar-menu :items=\"hangingProtocol.displaySets\" @select=\"e => switchDisplaySet(e, hide)\">\n\t\t\t\t\t\t<template #item=\"{ item: displaySet }\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\tselected: displaySet === hangingProtocol.displaySets[activeDisplaySetIndex],\n\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{{ displaySet.name }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</ast-toolbar-menu>\n\t\t\t\t</template>\n\t\t\t</ast-toolbar-button>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { mapState, mapActions } from 'vuex'\nimport AstToolbarButton from '@components/ToolbarButton'\nimport AstToolbarMenu from '@components/ToolbarMenu'\nimport Hammer from 'hammerjs'\n\nexport default {\n\tcomponents: {\n\t\tAstToolbarButton,\n\t\tAstToolbarMenu,\n\t},\n\tprops: {\n\t\tactiveSeries: {\n\t\t\ttype: Object,\n\t\t\trequired: false,\n\t\t},\n\t\tallSeries: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\t\tshowDropdownsBelow: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\tcomputed: {\n\t\t...mapState({\n\t\t\tactiveDisplaySetIndex: state => state.viewer.activeDisplaySetIndex,\n\t\t\tisHangingProtocolLoading: state => state.viewer.isHangingProtocolLoading,\n\t\t\thangingProtocol: state => state.viewer.hangingProtocol,\n\t\t\thangingProtocols: state => state.viewer.hangingProtocols,\n\t\t}),\n\t\thasMultipleImages() {\n\t\t\treturn this.activeSeries && this.activeSeries.images && this.activeSeries.images.length > 1\n\t\t},\n\t\tactiveSeriesIndex() {\n\t\t\tif (!this.activeSeries) return\n\t\t\treturn this.allSeries.findIndex(series => series.seriesId === this.activeSeries.seriesId)\n\t\t},\n\t\thasPreviousSeries() {\n\t\t\treturn this.activeSeriesIndex > 0\n\t\t},\n\t\thasNextSeries() {\n\t\t\treturn this.activeSeriesIndex + 1 < this.allSeries.length\n\t\t},\n\t\thasPreviousDisplaySet() {\n\t\t\treturn this.activeDisplaySetIndex > 0\n\t\t},\n\t\thasNextDisplaySet() {\n\t\t\treturn this.activeDisplaySetIndex + 1 < this.hangingProtocol.displaySets.length\n\t\t},\n\t\thangingProtocolOptions() {\n\t\t\tif (!this.hangingProtocols || !this.hangingProtocols.length) return\n\t\t\tconst noHangingProtocol = {\n\t\t\t\tlabel: 'No Hanging Protocol',\n\t\t\t\tvalue: undefined,\n\t\t\t}\n\t\t\treturn [].concat([noHangingProtocol], this.hangingProtocols)\n\t\t},\n\t\thangingProtocolLabel() {\n\t\t\tif (!this.hangingProtocol) return 'Hanging Protocol'\n\t\t\treturn 'HP: ' + this.hangingProtocol.name\n\t\t},\n\t},\n\tmounted() {\n\t\tlet config = {\n\t\t\tinputClass: Hammer.TouchInput,\n\t\t\trecognizers: [\n\t\t\t\t[\n\t\t\t\t\tHammer.Swipe,\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: Hammer.DIRECTION_HORIZONTAL,\n\t\t\t\t\t\tthreshold: 10,\n\t\t\t\t\t\tvelocity: 0.5,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t],\n\t\t}\n\t\tthis.hammertime = new Hammer(this.$el, config)\n\t\tthis.hammertime.on('swipe', ev => {\n\t\t\tif (ev.velocityX < 0) {\n\t\t\t\tthis.$store.dispatch('previousSeries')\n\t\t\t} else {\n\t\t\t\tthis.$store.dispatch('nextSeries')\n\t\t\t}\n\t\t})\n\t},\n\tbeforeDestroy() {\n\t\tthis.hammertime.destroy()\n\t},\n\tmethods: {\n\t\t...mapActions(['setHangingProtocolDisplaySet', 'updateHangingProtocol']),\n\t\ttoggleCine() {\n\t\t\tif (this.hasMultipleImages) this.$emit('toggle-cine')\n\t\t},\n\t\tsetHangingProtocol(hangingProtocol, hideDropdown) {\n\t\t\thideDropdown()\n\t\t\tthis.$store.commit('SET_USER_SETTINGS', { hangingProtocol })\n\t\t\tthis.updateHangingProtocol({ id: hangingProtocol })\n\t\t},\n\t\tswitchDisplaySet(displaySet, hideDropdown) {\n\t\t\thideDropdown()\n\t\t\tconst displaySetIndex = this.hangingProtocol.displaySets.indexOf(displaySet)\n\t\t\tthis.setHangingProtocolDisplaySet(displaySetIndex)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '~@styles/_vars.scss';\n\n.navigation {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tflex-direction: row-reverse;\n\tflex-grow: 1;\n\t.buttons,\n\t.dropdowns {\n\t\tdisplay: flex;\n\t}\n}\n\n.hanging-protocol-menu li:hover {\n\tbackground: var(--menu-item-hover-bg);\n}\n\n.selected {\n\tfont-weight: bold;\n}\n\n.full-label {\n\tdisplay: none;\n}\n\n.compact-label {\n\tdisplay: block;\n}\n\n@media (min-width: $mqSmall) {\n\t.full-label {\n\t\tdisplay: block;\n\t}\n\t.compact-label {\n\t\tdisplay: none;\n\t}\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerNavigation.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerNavigation.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ViewerNavigation.vue?vue&type=template&id=11c5467c&scoped=true\"\nimport script from \"./ViewerNavigation.vue?vue&type=script&lang=js\"\nexport * from \"./ViewerNavigation.vue?vue&type=script&lang=js\"\nimport style0 from \"./ViewerNavigation.vue?vue&type=style&index=0&id=11c5467c&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"11c5467c\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:\"study\"},[(_vm.showHeading)?_c('div',{staticClass:\"study-heading\",attrs:{\"title\":(\"Click to \" + (_vm.isCollapsed ? 'expand' : 'collapse') + \" this study\")},on:{\"click\":function($event){_vm.isCollapsed = !_vm.isCollapsed}}},[_c('div',{staticClass:\"heading-left\"},[_c('svg-icon',{style:({ transform: _vm.isCollapsed ? '' : 'rotate(90deg)' }),attrs:{\"icon\":\"chevron-right\"}}),_c('div',[(_vm.showPatientName)?_c('p',{staticClass:\"patient-name\"},[_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm.study.patientName)+\"\\n\\t\\t\\t\\t\")]):_vm._e(),_c('p',{staticClass:\"study-date\"},[_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm._f(\"localizeDate\")(_vm.study.studyDateTime,{ forceUTC: false, showTime: false }))+\"\\n\\t\\t\\t\\t\")])])],1),_c('button',{staticClass:\"close-button\",attrs:{\"title\":\"Remove study\"},on:{\"click\":function($event){$event.stopPropagation();return _vm.removeStudy(_vm.study)}}},[_c('div',{staticClass:\"circle\"},[_c('svg-icon',{attrs:{\"icon\":\"close\"}})],1)])]):_vm._e(),(!_vm.isCollapsed)?_c('div',{staticClass:\"series\"},[_c('ast-thumbnail-list',{attrs:{\"thumbnails\":_vm.study.imageData.thumbnails,\"study\":_vm.study},on:{\"drag-thumbnail\":function($event){return _vm.$emit('drag-thumbnail')},\"click\":function($event){return _vm.updateCanvas({ seriesId: $event })}}}),_c('ast-attachment-list',{attrs:{\"attachments\":_vm.study.imageData.attachments}}),(_vm.reports)?_c('ast-report-list',{attrs:{\"reports\":_vm.reports}}):_vm._e(),(_vm.hasSignalPETAttachment)?_c('a',{staticStyle:{\"margin\":\"16px\"},on:{\"click\":_vm.gotoSignalPET}},[_c('svg-icon',{attrs:{\"icon\":\"signalpet\",\"fixed\":\"\"}}),_vm._v(\"\\n\\t\\t\\tOpen SignalPET\\n\\t\\t\")],1):_vm._e()],1):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"thumbnail-list\"},_vm._l((_vm.thumbnails),function(thumbnail,index){return _c('div',{key:index,staticClass:\"thumbnail\",attrs:{\"draggable\":\"true\"},on:{\"touchstart\":_vm.startLongPress,\"selectstart\":function($event){$event.preventDefault();},\"contextmenu\":function($event){$event.preventDefault();},\"dragstart\":function($event){return _vm.onDragStart(thumbnail.seriesId, $event)},\"dragend\":function($event){return _vm.onDragEnd($event)},\"click\":function($event){$event.preventDefault();return _vm.$emit('click', thumbnail.seriesId)}}},[_c('div',{staticClass:\"thumbnail-image\",style:(_vm.findImageBackground(thumbnail))},[_c('div',{staticClass:\"dot\",style:(_vm.getCanvasColor(thumbnail.seriesId))}),_c('div',{staticClass:\"progress-bar\",attrs:{\"id\":(\"progress-\" + (thumbnail.seriesId))}})]),(thumbnail.isMultiFrame)?_c('svg-icon',{attrs:{\"icon\":\"play-box-outline\"}}):_vm._e(),_c('div',{staticClass:\"thumbnail-text\"},[_c('p',{staticClass:\"name\"},[_vm._v(_vm._s(thumbnail.simpleName))]),_c('p',[_vm._v(\"S:\"+_vm._s(thumbnail.seriesNumber))])])],1)}),0)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<div class=\"thumbnail-list\">\n\t\t<div\n\t\t\tv-for=\"(thumbnail, index) in thumbnails\"\n\t\t\t:key=\"index\"\n\t\t\tdraggable=\"true\"\n\t\t\tclass=\"thumbnail\"\n\t\t\t@touchstart=\"startLongPress\"\n\t\t\t@selectstart.prevent\n\t\t\t@contextmenu.prevent\n\t\t\t@dragstart=\"onDragStart(thumbnail.seriesId, $event)\"\n\t\t\t@dragend=\"onDragEnd($event)\"\n\t\t\t@click.prevent=\"$emit('click', thumbnail.seriesId)\"\n\t\t>\n\t\t\t<div class=\"thumbnail-image\" :style=\"findImageBackground(thumbnail)\">\n\t\t\t\t<div class=\"dot\" :style=\"getCanvasColor(thumbnail.seriesId)\"></div>\n\t\t\t\t<div :id=\"`progress-${thumbnail.seriesId}`\" class=\"progress-bar\"></div>\n\t\t\t</div>\n\n\t\t\t<svg-icon v-if=\"thumbnail.isMultiFrame\" icon=\"play-box-outline\" />\n\n\t\t\t<div class=\"thumbnail-text\">\n\t\t\t\t<p class=\"name\">{{ thumbnail.simpleName }}</p>\n\t\t\t\t<p>S:{{ thumbnail.seriesNumber }}</p>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport { mapGetters, mapActions } from 'vuex'\nimport { findThumbnailUrl } from '@utils/urlUtility'\n// Pollyfill\nimport { polyfill } from 'mobile-drag-drop'\nimport { scrollBehaviourDragImageTranslateOverride } from 'mobile-drag-drop/scroll-behaviour'\nimport { imageProgress} from '@/imageLoader'\nimport { events as csEvents } from 'cornerstone-core/dist/cornerstone'\nimport throttle from '@/utils/throttle'\npolyfill({\n\tdragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride,\n})\n\nexport default {\n\tname: 'ThumbnailList',\n\tprops: {\n\t\tstudy: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tthumbnails: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tcomputed: {\n\t\t...mapGetters(['canvasColors']),\n\t},\n\tmounted() {\n\t\t// @Hack\n\t\t// Fix for iOS10 touchmove bug (https://github.com/timruffles/ios-html5-drag-drop-shim/issues/77)\n\t\twindow.addEventListener('touchmove', this.doNothing)\n\t\tthis.refreshSeriesProgress()\n\t\tconst throttledProgress = throttle(this.refreshSeriesProgress, 200)\n\t\tcsEvents.addEventListener('cornerstoneimageloaded', throttledProgress)\n\t\tthis.$once('hook:beforeDestroy', () => {\n\t\t\tcsEvents.removeEventListener('cornerstoneimageloaded', throttledProgress)\n\t\t})\n\t},\n\tbeforeDestroy() {\n\t\twindow.removeEventListener('touchmove', this.doNothing)\n\t},\n\tmethods: {\n\t\trefreshSeriesProgress() {\n\t\t\tthis.study.imageData.series.forEach(series => {\n\t\t\t\tconst loadedImages = series.images.reduce(\n\t\t\t\t\t(a, image) => a + (imageProgress.has(image.imageId + image.frameIndex) ? 1 : 0),\n\t\t\t\t\t0\n\t\t\t\t)\n\t\t\t\tif (loadedImages) {\n\t\t\t\t\t// not using Vue to update the progress bars because it slows down image loading\n\t\t\t\t\tconst progressBar = document.getElementById(`progress-${series.seriesId}`)\n\t\t\t\t\tif (!progressBar) return\n\t\t\t\t\tconst percent = Math.floor((loadedImages / series.images.length) * 100) + '%'\n\t\t\t\t\tif (progressBar.style.width !== percent) progressBar.style.width = percent\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tfindImageBackground(thumbnail) {\n\t\t\tif (!thumbnail || !thumbnail.storageLocation) return {}\n\t\t\t\tconst url = findThumbnailUrl(thumbnail)\n\t\t\treturn url ? { backgroundImage: `url('${url}')` } : {}\n\t\t},\n\t\tgetCanvasColor(seriesId) {\n\t\t\tlet color = this.canvasColors[seriesId]\n\t\t\tif (!color) color = 'transparent'\n\t\t\treturn { background: color }\n\t\t},\n\t\tstartLongPress(startEvent) {\n\t\t\tlet longPressTimer\n\t\t\tif (startEvent.isTrusted) {\n\t\t\t\t// true for real event, false for dispatched event\n\t\t\t\tstartEvent.stopPropagation() // prevent initial, real event from dragging\n\t\t\t\tlongPressTimer = setTimeout(startDragging, 500)\n\t\t\t\tdocument.addEventListener('touchmove', onTouchMove)\n\t\t\t\tdocument.addEventListener('touchend', cancelDragListeners)\n\t\t\t}\n\n\t\t\tfunction startDragging() {\n\t\t\t\tstartEvent.preventDefault()\n\t\t\t\tif (window.navigator.vibrate) window.navigator.vibrate(100)\n\t\t\t\tstartEvent.srcElement.dispatchEvent(startEvent) // re-fire touchstart event to start dragging\n\t\t\t\tcancelDragListeners()\n\t\t\t}\n\t\t\tfunction onTouchMove(moveEvent) {\n\t\t\t\tif (!moveEvent.changedTouches.length) return\n\t\t\t\tconst tolerance = 10\n\t\t\t\tconst isMoved = (a, b) => Math.abs(a - b) > tolerance\n\t\t\t\tconst getTouch = event => event.changedTouches[0]\n\t\t\t\tif (isMoved(getTouch(moveEvent).clientX, getTouch(startEvent).clientX)) cancelDragListeners()\n\t\t\t\tif (isMoved(getTouch(moveEvent).clientY, getTouch(startEvent).clientY)) cancelDragListeners()\n\t\t\t}\n\t\t\tfunction cancelDragListeners() {\n\t\t\t\tdocument.removeEventListener('touchmove', onTouchMove)\n\t\t\t\tdocument.removeEventListener('touchend', cancelDragListeners)\n\t\t\t\tclearTimeout(longPressTimer)\n\t\t\t}\n\t\t},\n\t\tonDragStart(seriesId, event) {\n\t\t\tthis.$emit('drag-thumbnail')\n\t\t\t// Attach data to dragged item\n\t\t\tconst data = { seriesId }\n\t\t\tif (this.study.reportId) data.reportId = this.study.reportId\n\t\t\telse data.studyId = this.study.studyId\n\t\t\tevent.dataTransfer.setData('text/plain', JSON.stringify(data))\n\t\t\t// Flag that drag from thumbnail list has started\n\t\t\tthis.$store.commit('SET_DRAGGING_FROM_THUMBNAIL_LIST', true)\n\t\t\t// Try setting a proper drag image if triggered on a dnd-handle (won't work in IE).\n\t\t\tif (event._dndHandle && event.dataTransfer.setDragImage) {\n\t\t\t\tconst ghostImage = event.target.closest('[draggable=\"true\"]')\n\t\t\t\tevent.dataTransfer.setDragImage(ghostImage)\n\t\t\t}\n\t\t},\n\t\tonDragEnd(event) {\n\t\t\tthis.$store.commit('SET_DRAGGING_FROM_THUMBNAIL_LIST', false)\n\t\t},\n\t\tdoNothing() {},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '~@styles/_vars.scss';\n\n.thumbnail {\n\tmargin: 0 16px 16px 16px;\n\tcursor: pointer;\n\twidth: 180px;\n\tuser-select: none;\n\tposition: relative;\n\n\t.icon {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tcolor: white;\n\t\tfont-size: 2em;\n\t}\n}\n\n.thumbnail-image {\n\tposition: relative;\n\tbackground-color: black;\n\twidth: 100%;\n\theight: 138px;\n\ttransition: all 0.2s linear;\n\tbackground-repeat: no-repeat;\n\tbackground-position: center;\n\tbackground-size: fill;\n\tuser-select: none;\n\n\t.dot {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\twidth: 12px;\n\t\theight: 12px;\n\t\tmargin: 4px;\n\t\tborder-radius: 100%;\n\t}\n\n\t.progress-bar {\n\t\tposition: absolute;\n\t\tbottom: 4px;\n\t\tleft: 4px;\n\t\twidth: 0;\n\t\tmax-width: 172px;\n\t\theight: 3px;\n\t\tbackground: var(--button-success-bg);\n\t\ttransition: width 0.15s ease;\n\t}\n}\n\n.thumbnail-text {\n\tdisplay: flex;\n\tpadding-top: 4px;\n\tjustify-content: space-between;\n\tfont-size: 0.9em;\n\tuser-select: none;\n\n\t.name {\n\t\tmin-width: 50%;\n\t\tword-break: break-word;\n\t\tpadding-right: 8px;\n\t}\n}\n</style>\n","<template>\n\t<div class=\"viewer-toolbar-container\" :class=\"({ 'show-compact': showCompactToolbar }, toolbarLocation)\">\n\t\t<!-- Full / Grouped -->\n\t\t<ast-toolbar ref=\"fullToolbar\" class=\"full\">\n\t\t\t<!-- Levels -->\n\t\t\t<template v-if=\"!isGrouped.levels\">\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\tv-for=\"tool in itemsInGroup('levels')\"\n\t\t\t\t\t:key=\"tool.label\"\n\t\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t\t:label=\"tool.label\"\n\t\t\t\t\t:title=\"tool.title\"\n\t\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t\t@mousedown.native.prevent=\"tool.command ? tool.command() : activateTool({ event: $event, tool })\"\n\t\t\t\t\t@contextmenu.native.prevent\n\t\t\t\t/>\n\t\t\t\t<span class=\"separator\"></span>\n\t\t\t</template>\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\tv-else\n\t\t\t\t:items=\"itemsInGroup('levels')\"\n\t\t\t\t:available-tools=\"availableTools\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t@activate-tool=\"activateTool\"\n\t\t\t/>\n\n\t\t\t<!-- Zoom tools  -->\n\t\t\t<template v-if=\"!isGrouped.zoom\">\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\tv-for=\"tool in itemsInGroup('zoom')\"\n\t\t\t\t\t:key=\"tool.label\"\n\t\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t\t:label=\"tool.label\"\n\t\t\t\t\t:title=\"tool.title\"\n\t\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t\t@mousedown.native.prevent=\"tool.command ? tool.command() : activateTool({ event: $event, tool })\"\n\t\t\t\t\t@contextmenu.native.prevent\n\t\t\t\t/>\n\t\t\t\t<!-- <span class=\"separator\"></span> -->\n\t\t\t</template>\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\tv-else\n\t\t\t\t:items=\"itemsInGroup('zoom')\"\n\t\t\t\t:available-tools=\"availableTools\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t@activate-tool=\"activateTool\"\n\t\t\t/>\n\n\t\t\t<!-- Tools without Groups -->\n\t\t\t<ast-toolbar-button\n\t\t\t\tv-for=\"tool in ungroupedTools\"\n\t\t\t\t:key=\"tool.label\"\n\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t:label=\"tool.label\"\n\t\t\t\t:title=\"tool.title\"\n\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t@mousedown.native.prevent=\"activateTool({ event: $event, tool })\"\n\t\t\t\t@contextmenu.native.prevent\n\t\t\t/>\n\t\t\t<span class=\"separator\"></span>\n\n\t\t\t<!-- Annotation -->\n\t\t\t<template v-if=\"!isGrouped.annotation\">\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\tv-for=\"tool in itemsInGroup('annotation')\"\n\t\t\t\t\t:key=\"tool.label\"\n\t\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t\t:label=\"tool.label\"\n\t\t\t\t\t:title=\"tool.title\"\n\t\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t\t@mousedown.native.prevent=\"activateTool({ event: $event, tool })\"\n\t\t\t\t\t@contextmenu.native.prevent\n\t\t\t\t/>\n\t\t\t\t<span class=\"separator\"></span>\n\t\t\t</template>\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\tv-else\n\t\t\t\t:items=\"itemsInGroup('annotation')\"\n\t\t\t\t:available-tools=\"availableTools\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t@activate-tool=\"activateTool\"\n\t\t\t/>\n\n\t\t\t<template v-if=\"!isRepository\">\n\t\t\t\t<!-- Surgical -->\n\t\t\t\t<template v-if=\"!isGrouped.surgical\">\n\t\t\t\t\t<ast-toolbar-button\n\t\t\t\t\t\tv-for=\"tool in itemsInGroup('surgical')\"\n\t\t\t\t\t\t:key=\"tool.label\"\n\t\t\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t\t\t:label=\"tool.label\"\n\t\t\t\t\t\t:title=\"tool.title\"\n\t\t\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t\t\t@mousedown.native.prevent=\"activateTool({ event: $event, tool })\"\n\t\t\t\t\t\t@contextmenu.native.prevent\n\t\t\t\t\t/>\n\t\t\t\t\t<span class=\"separator\"></span>\n\t\t\t\t</template>\n\t\t\t\t<ast-toolbar-dropdown\n\t\t\t\t\tv-else\n\t\t\t\t\t:items=\"itemsInGroup('surgical')\"\n\t\t\t\t\t:available-tools=\"availableTools\"\n\t\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t\t@activate-tool=\"activateTool\"\n\t\t\t\t/>\n\t\t\t\t<!-- Scroll -->\n\t\t\t\t<template v-if=\"!isGrouped.scroll\">\n\t\t\t\t\t<ast-toolbar-button\n\t\t\t\t\t\tv-for=\"tool in itemsInGroup('scroll')\"\n\t\t\t\t\t\t:key=\"tool.label\"\n\t\t\t\t\t\t:icon=\"tool.iconName\"\n\t\t\t\t\t\t:label=\"tool.label\"\n\t\t\t\t\t\t:title=\"tool.title\"\n\t\t\t\t\t\t:badge=\"tool.binding\"\n\t\t\t\t\t\t:disabled=\"tool.disabled\"\n\t\t\t\t\t\t@mousedown.native.prevent=\"activateTool({ event: $event, tool })\"\n\t\t\t\t\t\t@contextmenu.native.prevent\n\t\t\t\t\t/>\n\t\t\t\t\t<span class=\"separator\"></span>\n\t\t\t\t</template>\n\t\t\t\t<ast-toolbar-dropdown\n\t\t\t\t\tv-else\n\t\t\t\t\t:items=\"itemsInGroup('scroll')\"\n\t\t\t\t\t:available-tools=\"availableTools\"\n\t\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t\t@activate-tool=\"activateTool\"\n\t\t\t\t/>\n\t\t\t\t<!-- Sync Method -->\n\t\t\t\t<ast-toolbar-dropdown\n\t\t\t\t\t:icon=\"currentSyncMethod.iconName\"\n\t\t\t\t\tlabel=\"Sync\"\n\t\t\t\t\t:title=\"currentSyncMethod.title\"\n\t\t\t\t\t:items=\"syncItems\"\n\t\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t/>\n\t\t\t</template>\n\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\ticon=\"repeat2\"\n\t\t\t\tlabel=\"Rotate\"\n\t\t\t\ttitle=\"Rotation Tools\"\n\t\t\t\t:items=\"rotateItems\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t/>\n\t\t\t<ast-toolbar-button icon=\"backup-restore\" label=\"Reset\" title=\"Reset Image\" @click.native=\"resetActiveCanvas\" />\n\t\t\t<span class=\"separator\"></span>\n\t\t\t<ast-toolbar-button icon=\"tag\" label=\"DICOM\" @click.native=\"$emit('toggle-drawer', 'dicom')\" />\n\t\t\t<ast-toolbar-button\n\t\t\t\ticon=\"dots-horizontal\"\n\t\t\t\tlabel=\"Actions\"\n\t\t\t\ttitle=\"Export images, burn in annotations, etc.\"\n\t\t\t\t@click.native=\"$emit('toggle-drawer', 'actions')\"\n\t\t\t/>\n\t\t</ast-toolbar>\n\n\t\t<!-- Compact -->\n\t\t<ast-toolbar class=\"compact\">\n\t\t\t<ast-toolbar-button icon=\"backup-restore\" label=\"Reset\" @click.native=\"resetActiveCanvas\" />\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\ticon=\"repeat2\"\n\t\t\t\tlabel=\"Rotate\"\n\t\t\t\ttitle=\"Rotation Tools\"\n\t\t\t\t:items=\"rotateItems\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t/>\n\t\t\t<ast-toolbar-dropdown\n\t\t\t\t:items=\"compactItems\"\n\t\t\t\t:available-tools=\"availableTools\"\n\t\t\t\t:dropdown-location=\"dropdownLocation\"\n\t\t\t\t@activate-tool=\"activateTool\"\n\t\t\t/>\n\t\t\t<ast-toolbar-button icon=\"tag\" label=\"DICOM\" @click.native=\"$emit('toggle-drawer', 'dicom')\" />\n\t\t\t<ast-toolbar-button\n\t\t\t\ticon=\"dots-horizontal\"\n\t\t\t\tlabel=\"Actions\"\n\t\t\t\ttitle=\"Export images, burn in annotations, etc.\"\n\t\t\t\t@click.native=\"$emit('toggle-drawer', 'actions')\"\n\t\t\t/>\n\t\t</ast-toolbar>\n\t</div>\n</template>\n\n<script>\nimport { mapState, mapGetters, mapActions } from 'vuex'\nimport ViewerToolsMixin from './ViewerToolsMixin'\n\nlet toolActivationDebounce\n\nexport default {\n\tname: 'ViewerTools',\n\tmixins: [ViewerToolsMixin],\n\tprops: {\n\t\tactiveSeries: {\n\t\t\ttype: Object,\n\t\t\trequired: false,\n\t\t},\n\t\tactiveImage: {\n\t\t\ttype: null,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tisGrouped: {\n\t\t\t\tlevels: false,\n\t\t\t\tzoom: false,\n\t\t\t\tannotation: false,\n\t\t\t\tsurgical: false,\n\t\t\t\tscroll: false,\n\t\t\t},\n\t\t\trotateItems: [\n\t\t\t\t{\n\t\t\t\t\ticonName: 'flip-horizontal2',\n\t\t\t\t\tlabel: 'Flip Horizontally',\n\t\t\t\t\tcommand: () => this.$store.dispatch('toggleCanvasHorizontalFlip'),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'flip-vertical',\n\t\t\t\t\tlabel: 'Flip Vertically',\n\t\t\t\t\tcommand: () => this.$store.dispatch('toggleCanvasVerticalFlip'),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'rotate-right',\n\t\t\t\t\tlabel: 'Rotate Clockwise',\n\t\t\t\t\tcommand: () => this.$store.dispatch('rotateCanvas', 90),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'rotate-left2',\n\t\t\t\t\tlabel: 'Rotate Counterclockwise',\n\t\t\t\t\tcommand: () => this.$store.dispatch('rotateCanvas', -90),\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t},\n\tcomputed: {\n\t\t...mapGetters(['allSeries', 'availableTools', 'isAuthenticated', 'activeStudy']),\n\t\t...mapState({\n\t\t\tisStackScrollSynchronizationEnabled: state => state.viewer.settingsPanel.isStackScrollSynchronizationEnabled,\n\t\t\tisManualStackScrollSynchronizationEnabled: state =>\n\t\t\t\tstate.viewer.settingsPanel.isManualStackScrollSynchronizationEnabled,\n\t\t}),\n\t\tactions() {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ticonName: 'invert-colors',\n\t\t\t\t\tlabel: 'Invert',\n\t\t\t\t\ttitle: 'Toggle Invert Image',\n\t\t\t\t\tcommand: () => this.$store.dispatch('toggleCanvasInvert'),\n\t\t\t\t\tgroups: ['levels'],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'fullscreen',\n\t\t\t\t\tlabel: '1:1',\n\t\t\t\t\ttitle: 'Toggle 1:1 Scale',\n\t\t\t\t\tcommand: () => this.$store.dispatch('toggleZoom1to1'),\n\t\t\t\t\tgroups: ['zoom'],\n\t\t\t\t},\n\t\t\t]\n\t\t},\n\t\tsyncItems() {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ticonName: 'link',\n\t\t\t\t\ttitle: 'Auto Series Synchronization',\n\t\t\t\t\tlabel: 'auto_sync',\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\tthis.setStackSynchronizationMethodAndBroadcast('auto')\n\t\t\t\t\t},\n\t\t\t\t\tactive: this.isStackScrollSynchronizationEnabled,\n\t\t\t\t\tgroups: ['sync'],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'link_manual',\n\t\t\t\t\ttitle: 'Manual Series Synchronization',\n\t\t\t\t\tlabel: 'manual_sync',\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\tthis.setStackSynchronizationMethodAndBroadcast('manual')\n\t\t\t\t\t},\n\t\t\t\t\tactive: this.isManualStackScrollSynchronizationEnabled,\n\t\t\t\t\tgroups: ['sync'],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'link_off',\n\t\t\t\t\ttitle: 'Series Synchronization Off',\n\t\t\t\t\tlabel: 'sync_off',\n\t\t\t\t\tcommand: () => {\n\t\t\t\t\t\tthis.setStackSynchronizationMethodAndBroadcast('off')\n\t\t\t\t\t},\n\t\t\t\t\tactive: !this.isStackScrollSynchronizationEnabled && !this.isManualStackScrollSynchronizationEnabled,\n\t\t\t\t\tgroups: ['sync'],\n\t\t\t\t},\n\t\t\t]\n\t\t},\n\t\thasMultiImageSeries() {\n\t\t\treturn this.allSeries.some(series => series.images.length > 1)\n\t\t},\n\t\tgroupOrder() {\n\t\t\tlet groupOrder = ['levels', 'zoom', 'surgical', 'annotation', 'scroll']\n\t\t\tif (!this.hasMultiImageSeries) groupOrder = ['scroll', 'levels', 'zoom', 'surgical', 'annotation']\n\t\t\treturn groupOrder\n\t\t},\n\t\tcompactItems() {\n\t\t\tlet compactItems = [].concat(\n\t\t\t\tthis.itemsInGroup('levels'),\n\t\t\t\tthis.itemsInGroup('zoom'),\n\t\t\t\tthis.ungroupedTools,\n\t\t\t\tthis.itemsInGroup('annotation')\n\t\t\t)\n\t\t\tif (!this.isRepository)\n\t\t\t\tcompactItems = compactItems.concat(this.itemsInGroup('surgical'), this.itemsInGroup('scroll'), this.syncItems)\n\t\t\treturn compactItems.filter(deduplicateItems)\n\n\t\t\tfunction deduplicateItems(item, i) {\n\t\t\t\treturn compactItems.findIndex(each => each.label === item.label) === i\n\t\t\t}\n\t\t},\n\t\tcurrentSyncMethod() {\n\t\t\treturn this.syncItems.find(s => s.active)\n\t\t},\n\t},\n\tmethods: {\n\t\t...mapActions(['resetActiveCanvas', 'setStackSynchronizationMethodAndBroadcast']),\n\t\tactivateTool({ tool, event }) {\n\t\t\tclearTimeout(toolActivationDebounce)\n\t\t\tif (typeof tool.command === 'function') {\n\t\t\t\t// don't run the command if no canvas/series is active\n\t\t\t\tif (this.activeSeries) {\n\t\t\t\t\ttool.command(this.activeSeries, this.activeImage, this.activeStudy)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttoolActivationDebounce = setTimeout(() => {\n\t\t\t\tconst whichToButtons = {\n\t\t\t\t\t// map event.which to equivalent event.buttons for Safari\n\t\t\t\t\t1: 1, // L\n\t\t\t\t\t2: 4, // M\n\t\t\t\t\t3: 2, // R\n\t\t\t\t}\n\t\t\t\tconst mouseButtonMask = event.buttons || whichToButtons[event.which] || 1\n\t\t\t\tconst validButtons = [1, 2, 3, 4, 5, 6, 7] // L, R, LR, M, LM, MR, LMR (no Back or Forward yet)\n\t\t\t\tif (!validButtons.includes(mouseButtonMask) || tool.disabled) return\n\t\t\t\tconst options = { mouseButtonMask }\n\t\t\t\tthis.$store.dispatch('setActiveToolAndBroadcast', {\n\t\t\t\t\talias: tool.alias,\n\t\t\t\t\toptions,\n\t\t\t\t})\n\t\t\t\t// Save and synchronize the binding with mpr viewer\n\t\t\t\tthis.$store.dispatch('updateMouseBinding', {\n\t\t\t\t\ttype: 'img',\n\t\t\t\t\ttool: tool.alias,\n\t\t\t\t\tbutton: mouseButtonMask,\n\t\t\t\t})\n\t\t\t}, 200)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n.viewer-toolbar-container {\n\t&.top,\n\t&.bottom {\n\t\t.separator {\n\t\t\twidth: 0;\n\t\t\tborder-right: 1px solid var(--divider);\n\t\t\tmargin: 0 6px;\n\t\t}\n\t}\n\t&.left,\n\t&.right {\n\t\t.separator {\n\t\t\twidth: 100%;\n\t\t\tborder-bottom: 1px solid var(--divider);\n\t\t\tmargin: 6px 0;\n\t\t}\n\t\t.button-container + .button-container {\n\t\t\tmargin-top: 6px;\n\t\t}\n\t\t.full,\n\t\t.compact {\n\t\t\tflex-direction: column;\n\t\t}\n\t}\n\t&.top {\n\t\tborder-bottom: 1px solid var(--viewer-menu-border);\n\t\tbox-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n\t}\n\t&.bottom {\n\t\tborder-top: 1px solid var(--viewer-menu-border);\n\t\tbox-shadow: 0 -1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n\t}\n\t&.left {\n\t\tz-index: 11;\n\t\tbox-shadow: 1px 0 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n\t}\n\t&.right {\n\t\tz-index: 11;\n\t\tbox-shadow: -1px 0 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n\t}\n\t.toolbar-button button.has-caret {\n\t\tmin-width: 64px; /* prevent buttons from shifting when changing active tool */\n\t}\n\t.full {\n\t\tdisplay: flex !important;\n\t\tjustify-content: flex-start;\n\t}\n\t.compact {\n\t\tdisplay: none !important;\n\t\tjustify-content: space-around;\n\t}\n\t&.show-compact {\n\t\t.full {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\t.compact {\n\t\t\tdisplay: flex !important;\n\t\t}\n\t}\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerThumbnailList.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerThumbnailList.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ViewerThumbnailList.vue?vue&type=template&id=1f6197a4&scoped=true\"\nimport script from \"./ViewerThumbnailList.vue?vue&type=script&lang=js\"\nexport * from \"./ViewerThumbnailList.vue?vue&type=script&lang=js\"\nimport style0 from \"./ViewerThumbnailList.vue?vue&type=style&index=0&id=1f6197a4&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"1f6197a4\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"report-list\"},[(_vm.reports && _vm.reports.length)?_c('h4',[_vm._v(\"Reports\")]):_vm._e(),_c('ul',[_c('transition-group',{attrs:{\"name\":\"fade\"}},_vm._l((_vm.reports),function(report){return _c('li',{key:report.reportId},[(report.isVetCT)?_c('div',[_c('span',[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(report.name)+\" \"+_vm._s(_vm._f(\"localizeDate\")(report.date))+\"\\n\\t\\t\\t\\t\\t\\t\")]),(report.isComplete && report.isVetCT)?_c('a',{staticClass:\"link\",attrs:{\"href\":report.thirdPartyCaseLink,\"target\":\"_blank\"}},[_c('span',[_vm._v(\"Open In VetCT\")])]):(report.isVetCT)?_c('span',[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(report.vetCTCaseStatus)+\"\\n\\t\\t\\t\\t\\t\\t\")]):_vm._e()]):(report.consultantClinicCode === _vm.IDEXXAPI)?_c('div',[(report.isComplete)?_c('div',[_c('a',{staticClass:\"report-title\",on:{\"click\":function($event){return _vm.downloadExternalReport(_vm.IDEXXAPI, report.consultantReportId)}}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\"+_vm._s('IDEXX VMS')+\" \"+_vm._s(_vm._f(\"localizeDate\")(report.date))+\"\\n\\t\\t\\t\\t\\t\\t\\t\")]),_c('a',{staticClass:\"pdf\",on:{\"click\":function($event){return _vm.downloadExternalReport(_vm.IDEXXAPI, report.consultantReportId)}}},[_c('svg-icon',{attrs:{\"icon\":\"file-pdf-o\"}}),_vm._v(\" \\n\\t\\t\\t\\t\\t\\t\\t\\t\"),_c('span',[_vm._v(\"PDF\")])],1)]):_c('div',[_c('span',[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\"+_vm._s('IDEXX VMS')+\" \"+_vm._s(_vm._f(\"localizeDate\")(report.date))+\"\\n\\t\\t\\t\\t\\t\\t\\t\")])])]):(_vm.isVetsChoice(report))?_c('div',[(report.isComplete)?_c('div',[_c('a',{staticClass:\"report-title\",attrs:{\"href\":report.thirdPartyCaseLink,\"target\":\"_blank\"}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\"+_vm._s('Vets Choice')+\" \"+_vm._s(_vm._f(\"localizeDate\")(report.date))+\"\\n\\t\\t\\t\\t\\t\\t\\t\")]),_c('a',{staticClass:\"pdf\",attrs:{\"href\":report.thirdPartyCaseLink,\"target\":\"_blank\"}},[_c('svg-icon',{attrs:{\"icon\":\"file-pdf-o\"}}),_vm._v(\" \\n\\t\\t\\t\\t\\t\\t\\t\\t\"),_c('span',[_vm._v(\"PDF\")])],1)]):_c('div',[_c('span',[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\"+_vm._s('Vets Choice')+\" \"+_vm._s(_vm._f(\"localizeDate\")(report.date))+\"\\n\\t\\t\\t\\t\\t\\t\\t\")])])]):_c('div',[_c('a',{staticClass:\"report-title\",on:{\"click\":function($event){return _vm.openReportPdf(report)}}},[_c('svg-icon',{attrs:{\"icon\":\"file-pdf-o\",\"fixed\":\"\",\"inline\":\"\"}}),_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(report.name)+\"\\n\\t\\t\\t\\t\\t\\t\")],1)])])}),0)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { openReportPdf } from '@dialogs/ReportPdf.vue'\nimport consultations from \"@services/consultationService\";\n\nexport default {\n\tname: 'ReportList',\n\tprops: {\n\t\treports: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t},\n\tdata: function() {\n    return {\n      IDEXXAPI : this.$IDEXXAPI,\n\t\t\tVetsChoice_ClinicCode : this.$VetsChoice_ClinicCode\n    }\n  },\n\twatch: {\n\t\treports() {\n\t\t\tthis.tryOpenFromUrlQuery()\n\t\t},\n\t},\n\tmethods: {\n\t\ttryOpenFromUrlQuery() {\n\t\t\tif (this.reports && this.$route.query.reportId) {\n\t\t\t\tlet found = this.reports.find(r => r.reportId === this.$route.query.reportId)\n\t\t\t\tif (found) {\n\t\t\t\t\tthis.openReportPdf(found)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\topenReportPdf(report) {\n\t\t\tconst { reportId, consultantReportId, isComplete } = report\n\t\t\topenReportPdf(reportId, consultantReportId, isComplete)\n\t\t},\n\t\tasync downloadExternalReport(providerClinicCode: string, consultantReportId: string) {\n\t\t\tvar clientClinicCode = this.$store.state.auth.claims.activeClinicCode\n      var getReportResult = await consultations.downloadExternalReport(providerClinicCode, clientClinicCode, consultantReportId)\n\n\t\t\tif (getReportResult['Success']){\n\t\t\t\tvar reportBinaryString = getReportResult['Data']\n\t\t\t\tlet pdfWindow = window.open(\"\")\n\t\t\t\tpdfWindow.document.write(\n    \t\t\t\"<iframe width='100%' height='100%' src='data:application/pdf;base64, \" +\n    \t\t\tencodeURI(reportBinaryString) + \"'></iframe>\"\n\t\t\t\t)\n\t\t\t}\n\t\t},\n    isVetsChoice(report) {\n      return report.consultantClinicCode && report.consultantClinicCode.toUpperCase().includes(this.VetsChoice_ClinicCode)\n    },\n\t},\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerReportList.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerReportList.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./ViewerReportList.vue?vue&type=template&id=c152e392&scoped=true\"\nimport script from \"./ViewerReportList.vue?vue&type=script&lang=ts\"\nexport * from \"./ViewerReportList.vue?vue&type=script&lang=ts\"\nimport style0 from \"./ViewerReportList.vue?vue&type=style&index=0&id=c152e392&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"c152e392\",\n  null\n  \n)\n\nexport default component.exports","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { mapActions, mapState, mapGetters } from 'vuex'\nimport AstThumbnailList from '@components/view/ViewerThumbnailList.vue'\nimport AstAttachmentList from '@components/AttachmentList.vue'\nimport AstReportList from '@components/view/ViewerReportList.vue'\nimport { SIGNALPET_IMAGEVIEW_ID } from '@services/dicomPartners'\nimport consultations from \"@services/consultationService\";\nimport { studyData } from '@services/studyData'\n\nexport default {\n\tname: 'ViewerStudy',\n\tcomponents: {\n\t\tAstThumbnailList,\n\t\tAstAttachmentList,\n\t\tAstReportList,\n\t},\n\tprops: {\n\t\tstudy: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tshowHeading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tshowPatientName: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tclinicCode: {\n\t\t\ttype: String,\n\t\t\tdefault: null\n\t\t}\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tisCollapsed: false,\n\t\t\treports: [],\n\t\t}\n\t},\n\tcomputed: {\n\t\thasSignalPETAttachment() {\n\t\t\treturn this.study.imageData.attachments.find(a => a.imageViewId === SIGNALPET_IMAGEVIEW_ID)\n\t\t},\n\t\t...mapGetters(['isAuthenticated']),\n\t\t...mapState({\n\t\t\t// @ts-ignore\n\t\t\tconsultationRequest: state => state.viewer.consultationRequest,\n\t\t\t// @ts-ignore\n\t\t\tviewer: state => state.viewer,\n\t\t}),\n\t},\n\twatch: {\n\t\tshowHeading(show) {\n\t\t\tif (!show) this.isCollapsed = false\n\t\t},\n\t},\n\tasync created() {\n\t\tawait Promise.all([\n\t\t\tthis.getReports(),])\n\t},\n\tmethods: {\n\t\t...mapActions(['removeStudy', 'updateCanvas']),\n\t\tgotoSignalPET() {\n\t\t\tthis.$router.push({\n\t\t\t\tname: 'signalpet',\n\t\t\t\tparams: {\n\t\t\t\t\tstudyId: this.study.studyId,\n\t\t\t\t\tclinicCode: this.study.clinicCode,\n\t\t\t\t},\n\t\t\t})\n\t\t},\n\t\tasync getReports() {\n\t\t\tlet reports = []\n\t\t\tconst data = await studyData.getRelatedStudiesAndReports(this.study.studyId, this.clinicCode)\n\n\t\t\tif (!data) return\n\t\t\tif (this.consultationRequest.toEmail) {\n\t\t\t\tconst emailedReports = this.consultationRequest.reports\n\t\t\t\treports = data.reports.filter(r => emailedReports.some(emailedReport => (emailedReport.reportId === r.reportId) || (emailedReport.reportId === r.consultantReportId)))\n\t\t\t} else {\n\t\t\t\treports = data.reports\n\t\t\t}\n\t\t\tfor (const report of reports) {\n\n\t\t\t\tconst { reportId, consultantReportId, isComplete } = report\n\t\t\t\tif (consultantReportId !== null && this.isAuthenticated) {\n\t\t\t\t\tlet consultantReport = await consultations.getConsultantReport(consultantReportId)\n\t\t\t\t\treport.consultantClinicCode = consultantReport.consultant.clinicCode\n\n\t\t\t\t\tif (consultantReport.consultant.clinicCode === this.$VetCTAPI) {\n\t\t\t\t\t\tvar vetCTCase = await this.getThirdPartyRadiologyReport(report)\n\t\t\t\t\t\tif (vetCTCase !== undefined && vetCTCase[\"Success\"] === true && vetCTCase[\"Message\"]) {\n\t\t\t\t\t\t\treport.isVetCT = true\n\t\t\t\t\t\t\treport.thirdPartyCaseLink = vetCTCase.Message\n\t\t\t\t\t\t\treport.vetCTCaseStatus = vetCTCase.Data\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (consultantReport.consultant.clinicCode && consultantReport.consultant.clinicCode.toUpperCase().includes(this.$VetsChoice_ClinicCode)) {\n\t\t\t\t\t\tvar thirdPartyReportResult = await this.getThirdPartyRadiologyReport(report)\n\t\t\t\t\t\tif (thirdPartyReportResult !== undefined && thirdPartyReportResult[\"Success\"] === true && thirdPartyReportResult[\"Message\"]) {\n\t\t\t\t\t\t\treport.thirdPartyCaseLink = thirdPartyReportResult.Message\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.reports = reports\n\t\t},\n\t\tasync getThirdPartyRadiologyReport(report: IReportInfo) {\n\t\t\tvar result\n\t\t\tconst { reportId, consultantReportId, isComplete } = report\n\t\t\tif (consultantReportId !== null) {\n\t\t\t\tlet consultantReport = await consultations.getConsultantReport(consultantReportId)\n\t\t\t\tresult = await consultations.getCase(consultantReport.consultant.clinicCode, consultantReportId)\n\t\t\t\tthis.thirdPartyCaseLink = result.Message\n\t\t\t\tthis.vetCTCaseStatus = result.Data\n\t\t\t}\n\t\t\treturn result\n\t\t},\n\t},\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerStudy.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerStudy.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./ViewerStudy.vue?vue&type=template&id=57701a2f&scoped=true\"\nimport script from \"./ViewerStudy.vue?vue&type=script&lang=ts\"\nexport * from \"./ViewerStudy.vue?vue&type=script&lang=ts\"\nimport style0 from \"./ViewerStudy.vue?vue&type=style&index=0&id=57701a2f&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"57701a2f\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"viewer-toolbar-container\",class:({ 'show-compact': _vm.showCompactToolbar }, _vm.toolbarLocation)},[_c('ast-toolbar',{ref:\"fullToolbar\",staticClass:\"full\"},[(!_vm.isGrouped.levels)?[_vm._l((_vm.itemsInGroup('levels')),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();tool.command ? tool.command() : _vm.activateTool({ event: $event, tool: tool })},\"contextmenu\":function($event){$event.preventDefault();}}})}),_c('span',{staticClass:\"separator\"})]:_c('ast-toolbar-dropdown',{attrs:{\"items\":_vm.itemsInGroup('levels'),\"available-tools\":_vm.availableTools,\"dropdown-location\":_vm.dropdownLocation},on:{\"activate-tool\":_vm.activateTool}}),(!_vm.isGrouped.zoom)?_vm._l((_vm.itemsInGroup('zoom')),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();tool.command ? tool.command() : _vm.activateTool({ event: $event, tool: tool })},\"contextmenu\":function($event){$event.preventDefault();}}})}):_c('ast-toolbar-dropdown',{attrs:{\"items\":_vm.itemsInGroup('zoom'),\"available-tools\":_vm.availableTools,\"dropdown-location\":_vm.dropdownLocation},on:{\"activate-tool\":_vm.activateTool}}),_vm._l((_vm.ungroupedTools),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();return _vm.activateTool({ event: $event, tool: tool })},\"contextmenu\":function($event){$event.preventDefault();}}})}),_c('span',{staticClass:\"separator\"}),(!_vm.isGrouped.annotation)?[_vm._l((_vm.itemsInGroup('annotation')),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();return _vm.activateTool({ event: $event, tool: tool })},\"contextmenu\":function($event){$event.preventDefault();}}})}),_c('span',{staticClass:\"separator\"})]:_c('ast-toolbar-dropdown',{attrs:{\"items\":_vm.itemsInGroup('annotation'),\"available-tools\":_vm.availableTools,\"dropdown-location\":_vm.dropdownLocation},on:{\"activate-tool\":_vm.activateTool}}),(!_vm.isRepository)?[(!_vm.isGrouped.surgical)?[_vm._l((_vm.itemsInGroup('surgical')),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();return _vm.activateTool({ event: $event, tool: tool })},\"contextmenu\":function($event){$event.preventDefault();}}})}),_c('span',{staticClass:\"separator\"})]:_c('ast-toolbar-dropdown',{attrs:{\"items\":_vm.itemsInGroup('surgical'),\"available-tools\":_vm.availableTools,\"dropdown-location\":_vm.dropdownLocation},on:{\"activate-tool\":_vm.activateTool}}),(!_vm.isGrouped.scroll)?[_vm._l((_vm.itemsInGroup('scroll')),function(tool){return _c('ast-toolbar-button',{key:tool.label,attrs:{\"icon\":tool.iconName,\"label\":tool.label,\"title\":tool.title,\"badge\":tool.binding,\"disabled\":tool.disabled},nativeOn:{\"mousedown\":function($event){$event.preventDefault();return _vm.activateTool({ event: $event, tool: tool })},\"contextmenu\":function($event){$event.preventDefault();}}})}),_c('span',{staticClass:\"separator\"})]:_c('ast-toolbar-dropdown',{attrs:{\"items\":_vm.itemsInGroup('scroll'),\"available-tools\":_vm.availableTools,\"dropdown-location\":_vm.dropdownLocation},on:{\"activate-tool\":_vm.activateTool}}),_c('ast-toolbar-dropdown',{attrs:{\"icon\":_vm.currentSyncMethod.iconName,\"label\":\"Sync\",\"title\":_vm.currentSyncMethod.title,\"items\":_vm.syncItems,\"dropdown-location\":_vm.dropdownLocation}})]:_vm._e(),_c('ast-toolbar-dropdown',{attrs:{\"icon\":\"repeat2\",\"label\":\"Rotate\",\"title\":\"Rotation Tools\",\"items\":_vm.rotateItems,\"dropdown-location\":_vm.dropdownLocation}}),_c('ast-toolbar-button',{attrs:{\"icon\":\"backup-restore\",\"label\":\"Reset\",\"title\":\"Reset Image\"},nativeOn:{\"click\":function($event){return _vm.resetActiveCanvas($event)}}}),_c('span',{staticClass:\"separator\"}),_c('ast-toolbar-button',{attrs:{\"icon\":\"tag\",\"label\":\"DICOM\"},nativeOn:{\"click\":function($event){return _vm.$emit('toggle-drawer', 'dicom')}}}),_c('ast-toolbar-button',{attrs:{\"icon\":\"dots-horizontal\",\"label\":\"Actions\",\"title\":\"Export images, burn in annotations, etc.\"},nativeOn:{\"click\":function($event){return _vm.$emit('toggle-drawer', 'actions')}}})],2),_c('ast-toolbar',{staticClass:\"compact\"},[_c('ast-toolbar-button',{attrs:{\"icon\":\"backup-restore\",\"label\":\"Reset\"},nativeOn:{\"click\":function($event){return _vm.resetActiveCanvas($event)}}}),_c('ast-toolbar-dropdown',{attrs:{\"icon\":\"repeat2\",\"label\":\"Rotate\",\"title\":\"Rotation Tools\",\"items\":_vm.rotateItems,\"dropdown-location\":_vm.dropdownLocation}}),_c('ast-toolbar-dropdown',{attrs:{\"items\":_vm.compactItems,\"available-tools\":_vm.availableTools,\"dropdown-location\":_vm.dropdownLocation},on:{\"activate-tool\":_vm.activateTool}}),_c('ast-toolbar-button',{attrs:{\"icon\":\"tag\",\"label\":\"DICOM\"},nativeOn:{\"click\":function($event){return _vm.$emit('toggle-drawer', 'dicom')}}}),_c('ast-toolbar-button',{attrs:{\"icon\":\"dots-horizontal\",\"label\":\"Actions\",\"title\":\"Export images, burn in annotations, etc.\"},nativeOn:{\"click\":function($event){return _vm.$emit('toggle-drawer', 'actions')}}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerTools.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerTools.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ViewerTools.vue?vue&type=template&id=3c1cc306\"\nimport script from \"./ViewerTools.vue?vue&type=script&lang=js\"\nexport * from \"./ViewerTools.vue?vue&type=script&lang=js\"\nimport style0 from \"./ViewerTools.vue?vue&type=style&index=0&id=3c1cc306&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"email-images-bar\"}},[_c('h3',[_vm._v(\"Email Images\")]),_c('div',{staticClass:\"buttons\"},[_c('button',{staticClass:\"btn btn-default\",on:{\"click\":function($event){return _vm.addItem()}}},[_vm._v(\"Add Image\")]),_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":!_vm.canAddSeries},on:{\"click\":function($event){return _vm.addItem(true)}}},[_vm._v(\"\\n\\t\\t\\tAdd Series\\n\\t\\t\")]),_c('button',{staticClass:\"btn btn-success\",attrs:{\"disabled\":_vm.items.length == 0},on:{\"click\":_vm.sendEmail}},[_vm._v(\"\\n\\t\\t\\tSend Email\\n\\t\\t\")]),_c('button',{staticClass:\"btn btn-danger\",on:{\"click\":_vm.close}},[_vm._v(\"Cancel\")])]),_c('div',{staticClass:\"image-list\"},_vm._l((_vm.items),function(item){return _c('span',{key:item.key,staticClass:\"item\",on:{\"click\":function($event){return _vm.removeItem(item)}}},[_c('img',{attrs:{\"src\":item.thumbUrl}}),(item.entireSeries)?_c('span',{staticClass:\"seriesTag\"},[_vm._v(_vm._s(item.countText))]):_vm._e(),_c('span',{staticClass:\"removeBtn\"},[_vm._v(\"Remove\")])])}),0)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<div id=\"email-images-bar\">\n\t\t<h3>Email Images</h3>\n\t\t<div class=\"buttons\">\n\t\t\t<button class=\"btn btn-default\" @click=\"addItem()\">Add Image</button>\n\t\t\t<button class=\"btn btn-default\" :disabled=\"!canAddSeries\" @click=\"addItem(true)\">\n\t\t\t\tAdd Series\n\t\t\t</button>\n\t\t\t<button class=\"btn btn-success\" :disabled=\"items.length == 0\" @click=\"sendEmail\">\n\t\t\t\tSend Email\n\t\t\t</button>\n\t\t\t<button class=\"btn btn-danger\" @click=\"close\">Cancel</button>\n\t\t</div>\n\t\t<div class=\"image-list\">\n\t\t\t<span v-for=\"item in items\" :key=\"item.key\" class=\"item\" @click=\"removeItem(item)\">\n\t\t\t\t<img :src=\"item.thumbUrl\" />\n\t\t\t\t<span v-if=\"item.entireSeries\" class=\"seriesTag\">{{ item.countText }}</span>\n\t\t\t\t<span class=\"removeBtn\">Remove</span>\n\t\t\t</span>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { openEmailStudyDlg } from '@dialogs/emailStudyDlg.vue'\nimport { EmailItem } from '@components/EmailStudyForm.vue'\n\nexport default {\n\tname: 'EmailImagesSidebar',\n\tdata() {\n\t\treturn {\n\t\t\titems: [],\n\t\t}\n\t},\n\tcomputed: {\n\t\tcanAddSeries() {\n\t\t\treturn this.$store.getters.activeSeries.images.length > 1\n\t\t},\n\t},\n\tmethods: {\n\t\tclose() {\n\t\t\tthis.$emit('close')\n\t\t},\n\t\tsendEmail() {\n\t\t\tlet studies = this.$store.state.viewer.studies\n\t\t\topenEmailStudyDlg(studies, this.items)\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.close()\n\t\t\t\t})\n\t\t\t\t.catch(err => {})\n\t\t},\n\t\tremoveItem(item) {\n\t\t\tif (this.items.includes(item)) this.items.splice(this.items.indexOf(item), 1)\n\t\t},\n\t\taddItem(entireSeries = false) {\n\t\t\tlet img = this.$store.getters.activeImage\n\t\t\tlet series = this.$store.getters.activeSeries\n\t\t\tlet item = new EmailItem(series, img, entireSeries)\n\n\t\t\tlet existingSeriesItems = this.items.filter(i => i.seriesId === item.seriesId)\n\n\t\t\t// only add item if not already in list, if entires series then only add 1 item for the series\n\t\t\tif (entireSeries) {\n\t\t\t\tthis.items = this.items.filter(i => i.seriesId !== item.seriesId)\n\t\t\t} else {\n\t\t\t\tlet found = existingSeriesItems.find(s => s.entireSeries || s.imageId === item.imageId)\n\t\t\t\tif (found) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.items.push(item)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n#email-images-bar {\n\tpadding: 10px;\n\tbackground: var(--secondary-bg);\n\theight: 100%;\n\tflex-shrink: 0;\n\twidth: 300px;\n\n\th3 {\n\t\tmargin-bottom: 6px;\n\t}\n\n\tbutton {\n\t\tmargin-right: 4px;\n\t\tmargin-bottom: 4px;\n\t}\n\n\t.buttons {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t}\n\n\t.image-list {\n\t\tmargin-top: 10px;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tjustify-content: center;\n\t\talign-items: flex-start;\n\n\t\t.item {\n\t\t\tmargin: 1%;\n\t\t\tbox-sizing: border-box;\n\t\t\twidth: 48%;\n\t\t\tposition: relative;\n\t\t\tcursor: pointer;\n\n\t\t\t.seriesTag {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 10px;\n\t\t\t\tleft: 10px;\n\t\t\t\tcolor: white;\n\t\t\t}\n\n\t\t\t.removeBtn {\n\t\t\t\tdisplay: none;\n\t\t\t\tposition: absolute;\n\t\t\t\tbottom: 10px;\n\t\t\t\tleft: 10px;\n\t\t\t\tcolor: white;\n\t\t\t}\n\n\t\t\timg {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\t&:hover {\n\t\t\t\timg {\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t\t.removeBtn {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EmailImagesSidebar.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EmailImagesSidebar.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./EmailImagesSidebar.vue?vue&type=template&id=1d80bbc9\"\nimport script from \"./EmailImagesSidebar.vue?vue&type=script&lang=js\"\nexport * from \"./EmailImagesSidebar.vue?vue&type=script&lang=js\"\nimport style0 from \"./EmailImagesSidebar.vue?vue&type=style&index=0&id=1d80bbc9&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"dialog\"},[_c('modal-dialog',{attrs:{\"is-open\":true,\"title\":\"Multi-Planar Reconstruction\"},on:{\"close\":_vm.close}},[(_vm.reasonKeys.length)?[_c('p',[_vm._v(\"\\n\\t\\t\\t\\tWe are unable to run MPR for this series, for the following reason\"+_vm._s(_vm.reasonKeys.length > 1 ? 's' : '')+\":\\n\\t\\t\\t\")]),_c('ul',_vm._l((_vm.reasonKeys),function(reasonKey){return _c('li',{key:reasonKey},[_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm.disabledReasons[reasonKey])+\"\\n\\t\\t\\t\\t\")])}),0)]:_vm._e(),(_vm.warningKeys.length)?[_c('p',[_c('strong',[_vm._v(\"Warning:\")])]),_c('ul',[(_vm.warningKeys.includes('512'))?_c('li',[_vm._v(\"\\n\\t\\t\\t\\t\\tThis Series has over 900 images, which have a width and height of 512 pixels. This is approaching the limit\\n\\t\\t\\t\\t\\tof what Keystone Omni can handle, and you may experience slow loading, instability, or it just won't load.\\n\\t\\t\\t\\t\")]):_vm._e(),(_vm.warningKeys.includes('1024'))?_c('li',[_vm._v(\"\\n\\t\\t\\t\\t\\tThis Series has over 200 images, which have a width and height of 1024 pixels. This is approaching the limit\\n\\t\\t\\t\\t\\tof what Keystone Omni can handle, and you may experience slow loading, instability, or it just won't load.\\n\\t\\t\\t\\t\")]):_vm._e(),_c('br'),_c('div',[_c('ast-button',{nativeOn:{\"click\":function($event){return _vm.launchMPR($event)}}},[_vm._v(\"Attempt Loading MPR\")]),_c('checkbox',{staticStyle:{\"margin\":\"16px 0 0 0\"},model:{value:(_vm.hideWarningChecked),callback:function ($$v) {_vm.hideWarningChecked=$$v},expression:\"hideWarningChecked\"}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\tDon't warn me again\\n\\t\\t\\t\\t\\t\")])],1)])]:_vm._e()],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<div class=\"dialog\">\n\t\t<modal-dialog :is-open=\"true\" title=\"Multi-Planar Reconstruction\" @close=\"close\">\n\t\t\t<template v-if=\"reasonKeys.length\">\n\t\t\t\t<p>\n\t\t\t\t\tWe are unable to run MPR for this series, for the following reason{{ reasonKeys.length > 1 ? 's' : '' }}:\n\t\t\t\t</p>\n\t\t\t\t<ul>\n\t\t\t\t\t<li v-for=\"reasonKey in reasonKeys\" :key=\"reasonKey\">\n\t\t\t\t\t\t{{ disabledReasons[reasonKey] }}\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</template>\n\t\t\t<template v-if=\"warningKeys.length\">\n\t\t\t\t<p><strong>Warning:</strong></p>\n\t\t\t\t<ul>\n\t\t\t\t\t<li v-if=\"warningKeys.includes('512')\">\n\t\t\t\t\t\tThis Series has over 900 images, which have a width and height of 512 pixels. This is approaching the limit\n\t\t\t\t\t\tof what Keystone Omni can handle, and you may experience slow loading, instability, or it just won't load.\n\t\t\t\t\t</li>\n\t\t\t\t\t<li v-if=\"warningKeys.includes('1024')\">\n\t\t\t\t\t\tThis Series has over 200 images, which have a width and height of 1024 pixels. This is approaching the limit\n\t\t\t\t\t\tof what Keystone Omni can handle, and you may experience slow loading, instability, or it just won't load.\n\t\t\t\t\t</li>\n\t\t\t\t\t<br />\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<ast-button @click.native=\"launchMPR\">Attempt Loading MPR</ast-button>\n\t\t\t\t\t\t<checkbox v-model=\"hideWarningChecked\" style=\"margin:16px 0 0 0\">\n\t\t\t\t\t\t\tDon't warn me again\n\t\t\t\t\t\t</checkbox>\n\t\t\t\t\t</div>\n\t\t\t\t</ul>\n\t\t\t</template>\n\t\t</modal-dialog>\n\t</div>\n</template>\n\n<script>\nimport ModalDialog from '@components/ModalDialog.vue'\nimport { dlg } from '@utils/dlgUtils'\nimport AstButton from '@components/Button.vue'\nimport Checkbox from '@components/Checkbox.vue'\nimport storage from '@services/storage'\n\nconst MprDisabledDlg = {\n\tname: 'MprDisabledDlg',\n\tcomponents: {\n\t\tModalDialog,\n\t\tAstButton,\n\t\tCheckbox,\n\t},\n\tprops: {\n\t\treasonKeys: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\t\twarningKeys: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\thideWarningChecked: false,\n\t\t}\n\t},\n\tcomputed: {\n\t\tdisabledReasons() {\n\t\t\tconst minimumImages = 15\n\t\t\treturn {\n\t\t\t\tmobile: 'Mobile devices not supported at this time. They are unable to run MPR.',\n\t\t\t\tsize: 'Your window size is too small. Please maximize your browser window.',\n\t\t\t\tedge:\n\t\t\t\t\t'Microsoft Edge has performance and compatibility issues preventing MPR from running. Try using Firefox or Chrome.',\n\t\t\t\tmodality: 'MPR can only be run on CT or MR modalities.',\n\t\t\t\tminimg: `MPR requires ${minimumImages} or more images in a series.`,\n\t\t\t\tinvalidmin: `MPR requires ${minimumImages} or more images in a series. There are images in this series that don't meet requirements, making it incompatible with MPR.`,\n\t\t\t\tmissing: 'MPR requires metadata for all images in a series',\n\t\t\t\torientation:\n\t\t\t\t\t'MPR requires a consistent orientation between images in a series. Irregular orientation can cause dramatic rendering and calculation errors.',\n\t\t\t\tspacing:\n\t\t\t\t\t'MPR requires a consistent spacing between images in a series. Irregular spacing can cause dramatic rendering and calculation errors.',\n\t\t\t\tderived: 'MPR requires a series with original images. This series contains derived images.',\n\t\t\t}\n\t\t},\n\t},\n\twatch: {\n\t\thideWarningChecked(hide) {\n\t\t\tstorage.setItem('hideMPRSizeWarning', hide)\n\t\t},\n\t},\n\tmethods: {\n\t\tclose() {\n\t\t\tdlg.close(this, true, false, false)\n\t\t},\n\t\tlaunchMPR() {\n\t\t\tthis.$store.commit('SET_MPR_ACTIVE', true)\n\t\t\tthis.close()\n\t\t},\n\t},\n}\n\nexport default MprDisabledDlg\n\nexport function showMprDisabledDialog(reasonKeys, warningKeys) {\n\treturn dlg.open(MprDisabledDlg, { reasonKeys, warningKeys }, false)\n}\n</script>\n\n<style lang=\"scss\" scoped>\nul {\n\tmargin-block-start: 1em;\n\tmargin-block-end: 0;\n\tmargin-inline-start: 0px;\n\tmargin-inline-end: 0px;\n\tpadding-inline-start: 24px;\n\t> li:not(:last-child) {\n\t\tmargin-bottom: 8px;\n\t}\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprDisabledDlg.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprDisabledDlg.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./MprDisabledDlg.vue?vue&type=template&id=7097eca2&scoped=true\"\nimport script from \"./MprDisabledDlg.vue?vue&type=script&lang=js\"\nexport * from \"./MprDisabledDlg.vue?vue&type=script&lang=js\"\nimport style0 from \"./MprDisabledDlg.vue?vue&type=style&index=0&id=7097eca2&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"7097eca2\",\n  null\n  \n)\n\nexport default component.exports","import store from '@store'\n\nconst playClip = function() {\n  store.commit('CINE_PLAY')\n}\n\nconst pauseClip = function() {\n  store.commit('CINE_PAUSE')\n}\n\nconst cineNextSeries = function() {\n  pauseClip()\n  store.dispatch('nextSeries')\n}\n\nconst cinePreviousSeries = function() {\n  pauseClip()\n  store.dispatch('previousSeries')\n}\n\nconst goToImage = function(action) {\n  pauseClip()\n\n  switch (action) {\n    case 'first':\n      store.dispatch('firstImage')\n      break\n    case 'previous':\n      store.dispatch('previousImage')\n      break\n    case 'next':\n      store.dispatch('nextImage')\n      break\n    case 'last':\n      store.dispatch('lastImage')\n      break\n  }\n}\n\nconst onFrameRateChange = function(event) {\n  const value = parseInt(event.target.value)\n  store.commit('SET_CINE_FRAMERATE', value)\n}\n\nexport default {\n  cineNextSeries,\n  cinePreviousSeries,\n  playClip,\n  pauseClip,\n  goToImage,\n  onFrameRateChange,\n}\n","const preventDefaultAndStopPropagation = function(event) {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n}\n\nconst onCanvasDragOver = function(hoveredCanvasIndex, event) {\n\t// Only allow drags from current window for repository/email viewers\n\tif ((this.isRepository || this.isEmail) && !this.draggingFromThumbnailList) {\n\t\treturn\n\t}\n\n\tif (event.dataTransfer.types.length > 0) {\n\t\t// Set active canvas to the one we're hovering over\n\t\tif (this.activeCanvasIndex !== hoveredCanvasIndex) {\n\t\t\tthis.$store.dispatch('setActiveCanvas', {\n\t\t\t\tcanvasIndex: hoveredCanvasIndex,\n\t\t\t})\n\t\t}\n\t\t// Tell the world that it is okay to drop here\n\t\tpreventDefaultAndStopPropagation(event)\n\t\tevent.dataTransfer.dropEffect = 'copy'\n\t}\n}\n\nconst onCanvasDrop = function(event) {\n\ttry {\n\t\tconst data = JSON.parse(event.dataTransfer.getData('text/plain'))\n\t\tif (data) this.switchSeries(data)\n\t} catch (err) {\n\t\t// ignore exceptions when non-JSON text is dropped onto canvas\n\t} finally {\n\t\tpreventDefaultAndStopPropagation(event)\n\t}\n}\n\nexport default {\n\tonCanvasDragEnter: preventDefaultAndStopPropagation,\n\tonCanvasDragExit: preventDefaultAndStopPropagation,\n\tonCanvasDragLeave: preventDefaultAndStopPropagation,\n\tonCanvasDragOver,\n\tonCanvasDrop,\n}\n","<template>\n\t<main class=\"viewer-layout\">\n\t\t<desktop-downloader />\n\t\t<template v-if=\"toolbarLocation === 'bottom'\">\n\t\t\t<ast-mpr-viewer-tools v-if=\"mprActive\" :toolbar-location=\"toolbarLocation\" @toggle-drawer=\"toggleDrawer\" />\n\t\t\t<ast-viewer-tools\n\t\t\t\tv-else\n\t\t\t\t:active-series=\"activeSeries\"\n\t\t\t\t:active-image=\"activeImage\"\n\t\t\t\t:is-repository=\"isRepository\"\n\t\t\t\t:toolbar-location=\"toolbarLocation\"\n\t\t\t\t@toggle-drawer=\"toggleDrawer\"\n\t\t\t/>\n\t\t</template>\n\n\t\t<div class=\"viewer-content\">\n\t\t\t<transition name=\"reveal-right\" @after-enter=\"resizeCanvases\" @after-leave=\"resizeCanvases\">\n\t\t\t\t<persistent-navigation-drawer\n\t\t\t\t\tv-if=\"mq.medium && isPersistentDrawerOpen && !mprActive\"\n\t\t\t\t\tclass=\"navigation-drawer\"\n\t\t\t\t\t:class=\"{ 'dragged-over': navPanelDraggedOver }\"\n\t\t\t\t\t@transition=\"resizeCanvases\"\n\t\t\t\t\t@dragover.native=\"onNavDrawerDragOver\"\n\t\t\t\t\t@dragleave.native=\"onNavDrawerDragLeave\"\n\t\t\t\t\t@drop.native=\"onNavDrawerDrop\"\n\t\t\t\t>\n\t\t\t\t\t<ast-viewer-add-related-study\n\t\t\t\t\t\tv-if=\"allowRelatedStudies && !isViewerLoading\"\n\t\t\t\t\t\t:related-studies=\"relatedStudies\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div class=\"study-container\">\n\t\t\t\t\t\t<transition-group name=\"fade\">\n\t\t\t\t\t\t\t<ast-viewer-study\n\t\t\t\t\t\t\t\tv-for=\"study in studies\"\n\t\t\t\t\t\t\t\t:key=\"study.studyId\"\n\t\t\t\t\t\t\t\t:study=\"study\"\n\t\t\t\t\t\t\t\t:show-heading=\"studies.length > 1\"\n\t\t\t\t\t\t\t\t:show-patient-name=\"isMultiplePatients\"\n                :clinic-code =\"clinicCode\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</transition-group>\n\t\t\t\t\t</div>\n\t\t\t\t</persistent-navigation-drawer>\n\t\t\t</transition>\n\n\t\t\t<template v-if=\"toolbarLocation === 'left'\">\n\t\t\t\t<ast-mpr-viewer-tools v-if=\"mprActive\" :toolbar-location=\"toolbarLocation\" @toggle-drawer=\"toggleDrawer\" />\n\t\t\t\t<ast-viewer-tools\n\t\t\t\t\tv-else\n\t\t\t\t\t:active-series=\"activeSeries\"\n\t\t\t\t\t:active-image=\"activeImage\"\n\t\t\t\t\t:is-repository=\"isRepository\"\n\t\t\t\t\t:toolbar-location=\"toolbarLocation\"\n\t\t\t\t\t@toggle-drawer=\"toggleDrawer\"\n\t\t\t\t/>\n\t\t\t</template>\n\n\t\t\t<div class=\"page-wrapper\">\n\t\t\t\t<div v-if=\"!mprActive\" ref=\"layoutContainer\" class=\"layout-pane-container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"canvas in visibleCanvases\"\n\t\t\t\t\t\t:key=\"canvas.index\"\n\t\t\t\t\t\tclass=\"layout-pane\"\n\t\t\t\t\t\t:style=\"layoutPaneSize\"\n\t\t\t\t\t\t@contextmenu=\"openRelatedMenu\"\n\t\t\t\t\t\t@dragover=\"onCanvasDragOver(canvas.index, $event)\"\n\t\t\t\t\t\t@dragenter=\"onCanvasDragEnter\"\n\t\t\t\t\t\t@dragexit=\"onCanvasDragExit\"\n\t\t\t\t\t\t@dragleave=\"onCanvasDragLeave\"\n\t\t\t\t\t\t@drop=\"onCanvasDrop\"\n\t\t\t\t\t\t@mousedown=\"onImageViewerMouseDown($event, canvas.index)\"\n\t\t\t\t\t\t@touchstart=\"setActiveCanvas({ canvasIndex: canvas.index })\"\n\t\t\t\t\t\t@wheel=\"setActiveCanvas({ canvasIndex: canvas.index })\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template v-show=\"!isViewerLoading\">\n\t\t\t\t\t\t\t<ast-image-viewer\n\t\t\t\t\t\t\t\tv-if=\"canvasIsVisible(canvas)\"\n\t\t\t\t\t\t\t\tref=\"canvases\"\n\t\t\t\t\t\t\t\t:key=\"canvas.index\"\n\t\t\t\t\t\t\t\tv-dblclick=\"() => $store.dispatch('resetLevels')\"\n\t\t\t\t\t\t\t\tv-bind=\"canvas\"\n\t\t\t\t\t\t\t\t:class=\"{ isActiveViewer: activeCanvasIndex == canvas.index }\"\n\t\t\t\t\t\t\t\t:is-repository=\"isRepository\"\n\t\t\t\t\t\t\t\t:series=\"getCanvasSeries(canvas)\"\n\t\t\t\t\t\t\t\t:series-index=\"activeStudySeries.findIndex(x => x.seriesId == canvas.seriesId)\"\n\t\t\t\t\t\t\t\t:series-total=\"activeStudySeries.length\"\n\t\t\t\t\t\t\t\t:show-overlay-text=\"settings.overlayText\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ast-image-placeholder\n\t\t\t\t\t\t\t\tv-else-if=\"isUnmatchedImageView(canvas) || hideLoadingText\"\n\t\t\t\t\t\t\t\t:key=\"canvas.index\"\n\t\t\t\t\t\t\t\t:index=\"canvas.index\"\n\t\t\t\t\t\t\t\t:class=\"{ isActiveViewer: activeCanvasIndex == canvas.index }\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<template v-if=\"studies.length && isUnmatchedImageView(canvas)\">\n\t\t\t\t\t\t\t\t\t{{ canvas.imageView.name }} is not available\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t</ast-image-placeholder>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div>\n\t\t\t\t\t<transition v-if=\"loadingText\" name=\"fade\">\n\t\t\t\t\t\t<h1 class=\"loading-text\">{{ loadingText }}</h1>\n\t\t\t\t\t</transition>\n\t\t\t\t</div>\n\t\t\t\t<ast-mpr-viewer\n\t\t\t\t\tv-if=\"mprActive\"\n\t\t\t\t\tv-bind=\"activeCanvas\"\n\t\t\t\t\t:series=\"getCanvasSeries(activeCanvas)\"\n\t\t\t\t\t:initial-slice=\"mprInitialSlice\"\n\t\t\t\t\t:initial-voi=\"mprInitialVoi\"\n\t\t\t\t/>\n\t\t\t\t<ast-toolbar v-if=\"!mprActive && showBottomNavigation\" class=\"bottom-navigation\">\n\t\t\t\t\t<ast-viewer-navigation\n\t\t\t\t\t\t:active-series=\"activeSeries\"\n\t\t\t\t\t\t:all-series=\"activeStudySeries\"\n\t\t\t\t\t\t:show-dropdowns-below=\"false\"\n\t\t\t\t\t\t@toggle-cine=\"isCineDialogOpen = !isCineDialogOpen\"\n\t\t\t\t\t/>\n\t\t\t\t</ast-toolbar>\n\t\t\t</div>\n\n\t\t\t<template v-if=\"toolbarLocation === 'right'\">\n\t\t\t\t<ast-mpr-viewer-tools v-if=\"mprActive\" :toolbar-location=\"toolbarLocation\" @toggle-drawer=\"toggleDrawer\" />\n\t\t\t\t<ast-viewer-tools\n\t\t\t\t\tv-else\n\t\t\t\t\t:active-series=\"activeSeries\"\n\t\t\t\t\t:active-image=\"activeImage\"\n\t\t\t\t\t:is-repository=\"isRepository\"\n\t\t\t\t\t:toolbar-location=\"toolbarLocation\"\n\t\t\t\t\t@toggle-drawer=\"toggleDrawer\"\n\t\t\t\t/>\n\t\t\t</template>\n\n\t\t\t<persistent-navigation-drawer class=\"tool-help-drawer\">\n\t\t\t\t<slot name=\"right-drawer\">\n\t\t\t\t\t<ast-viewer-tool-help @transition=\"resizeCanvases\" />\n\t\t\t\t</slot>\n\t\t\t</persistent-navigation-drawer>\n\n\t\t\t<email-images-sidebar v-if=\"showEmailImages\" @close=\"showEmailImages = false\" />\n\t\t</div>\n\n\t\t<template v-if=\"toolbarLocation === 'top'\">\n\t\t\t<ast-mpr-viewer-tools v-if=\"mprActive\" :toolbar-location=\"toolbarLocation\" @toggle-drawer=\"toggleDrawer\" />\n\t\t\t<ast-viewer-tools\n\t\t\t\tv-else\n\t\t\t\t:active-series=\"activeSeries\"\n\t\t\t\t:active-image=\"activeImage\"\n\t\t\t\t:is-repository=\"isRepository\"\n\t\t\t\t:toolbar-location=\"toolbarLocation\"\n\t\t\t\t@toggle-drawer=\"toggleDrawer\"\n\t\t\t/>\n\t\t</template>\n\n\t\t<ast-toolbar :is-primary=\"true\">\n\t\t\t<!--TOOLBAR LEFT SIDE (NON-MPR)-->\n\t\t\t<div v-if=\"!mprActive\" class=\"left\">\n\t\t\t\t<!--KEYSTONE BRANDING-->\n\t\t\t\t<ast-toolbar-branding v-if=\"!isDesktop\" />\n\t\t\t\t<!--PRIMARY BUTTONS (LEFT)-->\n\t\t\t\t<slot name=\"primary-buttons-left\"></slot>\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\tv-for=\"(btn, title) in getPrimaryToolbarGroup('left')\"\n\t\t\t\t\t:key=\"title\"\n\t\t\t\t\t:icon=\"btn.icon\"\n\t\t\t\t\t:title=\"title\"\n\t\t\t\t\t:label=\"btn.label\"\n\t\t\t\t\t:class=\"btn.class\"\n\t\t\t\t\t:has-notification=\"btn.hasNotification\"\n\t\t\t\t\t@click.native=\"btn.action()\"\n\t\t\t\t/>\n\t\t\t\t<!--LAYOUT SELECTOR-->\n\t\t\t\t<ast-viewer-layout-selector :settings-config=\"settingsConfig\" @layout-selected=\"handleLayoutSelected\">\n\t\t\t\t\t<template #mpr>\n\t\t\t\t\t\t<ul v-if=\"!isRepository\">\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t:class=\"{ disabled: !!mprLoadingReason }\"\n\t\t\t\t\t\t\t\tstyle=\"display: flex; flex-direction: row; align-items: flex-start; max-width: 250px;\"\n\t\t\t\t\t\t\t\t@mousedown.stop=\"checkAndLoadMpr\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<svg-icon\n\t\t\t\t\t\t\t\t\tv-if=\"hasActiveSeries && !!mprLoadingReason\"\n\t\t\t\t\t\t\t\t\ticon=\"spinner-circle-thick\"\n\t\t\t\t\t\t\t\t\tclass=\"no-disable\"\n\t\t\t\t\t\t\t\t\tspin\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<svg-icon v-else icon=\"layout-mpr-3x1\" fixed inline />\n\t\t\t\t\t\t\t\t<span style=\"white-space: normal; text-overflow: initial; flex-grow:1; margin-left: 4px;\">\n\t\t\t\t\t\t\t\t\t{{ mprLoadingReason || 'View MPR' }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</template>\n\t\t\t\t</ast-viewer-layout-selector>\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\tv-if=\"isFullScreenSupported\"\n\t\t\t\t\t:icon=\"isFullScreen ? 'fullscreen-exit-alt' : 'fullscreen-alt'\"\n\t\t\t\t\t:title=\"isFullScreen ? 'Exit Full Screen' : 'Full Screen'\"\n\t\t\t\t\t@click.native=\"toggleFullScreen\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<!--TOOLBAR LEFT SIDE (MPR)-->\n\t\t\t<div v-else class=\"left\">\n\t\t\t\t<!--KEYSTONE BRANDING-->\n\t\t\t\t<ast-toolbar-branding />\n\t\t\t\t<!--EXIT MPR BUTTON-->\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\tlabel=\"Exit MPR\"\n\t\t\t\t\tclass=\"back-btn\"\n\t\t\t\t\ticon=\"arrow-left\"\n\t\t\t\t\t@click.native=\"() => setMprActive(false)\"\n\t\t\t\t/>\n\t\t\t\t<!--MPR LAYOUT SELECTOR-->\n\t\t\t\t<ast-mpr-viewer-layout-selector />\n\t\t\t</div>\n\t\t\t<!--CENTER VIEWER NAVIGATION-->\n\t\t\t<ast-viewer-navigation\n\t\t\t\tv-if=\"!mprActive && !showBottomNavigation\"\n\t\t\t\tclass=\"top-navigation\"\n\t\t\t\t:active-series=\"activeSeries\"\n\t\t\t\t:all-series=\"activeStudySeries\"\n\t\t\t\t@toggle-cine=\"isCineDialogOpen = !isCineDialogOpen\"\n\t\t\t/>\n\t\t\t<!--TOOLBAR RIGHT SIDE-->\n\t\t\t<div class=\"right\">\n\t\t\t\t<slot name=\"primary-buttons-right\"></slot>\n\t\t\t\t<!-- HELP BUTTONS -->\n\t\t\t\t<help-menu :items=\"helpItems\" />\n\t\t\t\t<!--USER DROPDOWN MENU-->\n\t\t\t\t<user-menu />\n\t\t\t\t<!--PRIMARY BUTTONS (RIGHT)-->\n\t\t\t\t<ast-toolbar-button\n\t\t\t\t\tv-for=\"(btn, title) in getPrimaryToolbarGroup('right')\"\n\t\t\t\t\t:key=\"title\"\n\t\t\t\t\t:icon=\"btn.icon\"\n\t\t\t\t\t:title=\"title\"\n\t\t\t\t\t:label=\"btn.label\"\n\t\t\t\t\t:class=\"btn.class\"\n\t\t\t\t\t:has-notification=\"btn.hasNotification\"\n\t\t\t\t\t@click.native=\"btn.action()\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</ast-toolbar>\n\n\t\t<!-- DRAWER -->\n\t\t<modal-drawer\n\t\t\tv-if=\"!mq.medium && isModalDrawerOpen\"\n\t\t\tclass=\"navigation-drawer\"\n\t\t\t@close=\"$store.commit('TOGGLE_MODAL_DRAWER', false)\"\n\t\t>\n\t\t\t<ast-viewer-add-related-study v-if=\"allowRelatedStudies && !isViewerLoading\" :related-studies=\"relatedStudies\" />\n\t\t\t<div class=\"study-container\">\n\t\t\t\t<transition-group name=\"fade\">\n\t\t\t\t\t<ast-viewer-study\n\t\t\t\t\t\tv-for=\"study in studies\"\n\t\t\t\t\t\t:key=\"study.studyId\"\n\t\t\t\t\t\t:study=\"study\"\n\t\t\t\t\t\t:show-heading=\"studies.length > 1\"\n\t\t\t\t\t\t:show-patient-name=\"isMultiplePatients\"\n\t\t\t\t\t\t@drag-thumbnail=\"$store.commit('TOGGLE_MODAL_DRAWER', false)\"\n\t\t\t\t\t\t@openattachment=\"openAttachment\"\n\t\t\t\t\t/>\n\t\t\t\t</transition-group>\n\t\t\t</div>\n\t\t</modal-drawer>\n\n\t\t<slot name=\"dialogs\"></slot>\n\n\t\t<slot name=\"panels\"></slot>\n\t\t<!-- Panels -->\n\t\t<viewer-actions-drawer\n\t\t\tv-if=\"isDrawerOpen.mprActions\"\n\t\t\t@save=\"saveMprImageAsync\"\n\t\t\t@print=\"printMprImageAsync\"\n\t\t\t@copy=\"copyMprImageAsync\"\n\t\t\t@clear-annotations=\"() => clearMprActiveAnnotations()\"\n\t\t\t@burn-in-annotations=\"$emit('burn-in-annotations', $event)\"\n\t\t\t@close=\"isDrawerOpen.mprActions = false\"\n\t\t/>\n\n\t\t<viewer-actions-drawer\n\t\t\tv-if=\"isDrawerOpen.actions\"\n\t\t\t@save=\"saveCanvasAsync\"\n\t\t\t@print=\"printCanvasAsync\"\n\t\t\t@copy=\"copyCanvasAsync\"\n\t\t\t@show-email-images=\"showEmailImages = true\"\n\t\t\t@clear-annotations=\"() => syncClearAnnotations({ activeImage, activeSeries })\"\n\t\t\t@burn-in-annotations=\"$emit('burn-in-annotations', $event)\"\n\t\t\t@download-study=\"$emit('download-study')\"\n\t\t\t@download-dicom-images=\"$emit('download-dicom-images')\"\n\t\t\t@download-jpeg-images=\"$emit('download-jpeg-images')\"\n\t\t\t@import-into-keystone=\"$emit('import-into-keystone')\"\n\t\t\t@close=\"isDrawerOpen.actions = false\"\n\t\t/>\n\n\t\t<dicom-tags-drawer\n\t\t\tv-if=\"isDrawerOpen.dicom\"\n\t\t\t:preview-image-url=\"previewImageUrl\"\n\t\t\t:dicom-tags=\"activeDicomTags\"\n\t\t\t:canvas=\"activeCanvas\"\n\t\t\t@close=\"isDrawerOpen.dicom = false\"\n\t\t/>\n\n\t\t<ast-viewer-context-menu\n\t\t\tv-if=\"contextMenu.isOpen\"\n\t\t\t:top=\"contextMenu.top\"\n\t\t\t:left=\"contextMenu.left\"\n\t\t\t:active-series=\"activeSeries\"\n\t\t\t:allow-related-studies=\"allowRelatedStudies\"\n\t\t\t:related-studies=\"relatedStudies\"\n\t\t\t:mpr-title=\"mprLoadingReason || 'View MPR'\"\n\t\t\t:mpr-loading=\"!!mprLoadingReason\"\n\t\t\t:container-ref=\"$refs.layoutContainer\"\n\t\t\t@select=\"switchSeries\"\n\t\t\t@view-mpr=\"checkAndLoadMpr()\"\n\t\t\t@close=\"contextMenu.isOpen = false\"\n\t\t/>\n\n\t\t<ast-cine-dialog\n\t\t\tv-if=\"isCineDialogOpen\"\n\t\t\t:is-open=\"isCineDialogOpen\"\n\t\t\tv-bind=\"activeCanvas.cinePlayer\"\n\t\t\t@play-clip=\"playClip\"\n\t\t\t@pause-clip=\"pauseClip\"\n\t\t\t@framerate-change=\"onFrameRateChange\"\n\t\t\t@goto-image=\"goToImage\"\n\t\t\t@goto-next-series=\"cineNextSeries\"\n\t\t\t@goto-previous-series=\"cinePreviousSeries\"\n\t\t/>\n\n\t\t<mpr-annotation-dialog v-if=\"mprActive\" />\n\t\t<annotation-dialog v-else />\n\n\t\t<ast-hotkey-modal :show-hotkeys=\"hotkeysVisible\" @close=\"toggleHotkeyModal\" />\n\t</main>\n</template>\n\n<script>\nimport { detect } from 'detect-browser'\nimport { mapActions, mapGetters, mapState, mapMutations } from 'vuex'\nimport { polyfill } from 'mobile-drag-drop'\nimport { scrollBehaviourDragImageTranslateOverride } from 'mobile-drag-drop/scroll-behaviour'\nimport Hammer from 'hammerjs'\nimport storage from '@services/storage'\n\nimport * as cornerstone from 'cornerstone-core/dist/cornerstone.js'\nimport * as cornerstoneMath from 'cornerstone-math'\nimport * as cornerstoneTools from 'cornerstone-tools/dist/cornerstoneTools.js'\nimport { provider as metadataProvider } from '@/cornerstone/metadata'\nimport CustomTools from '@/cornerstone/tools'\nimport synchronizers from '@store/modules/toolManager/synchronizers.js'\n\nimport FullScreenMixin from '@mixins/fullscreen.js'\nimport { eventBus } from '@services/eventBus'\nimport { findImageUrlFromImage } from '@utils/urlUtility'\nimport { scaleDicomPresetToJpeg, scaleJpegVoiToDicom } from '@/utils/wwwc.js'\nimport { validateMPRImages } from '@vtk'\nimport shouldLoadDicom from '@/utils/shouldLoadDicom.js'\n\n// COMPONENTS\nimport AnnotationDialog from '@components/layout/ViewerAnnotationDialog'\nimport MprAnnotationDialog from '@components/layout/MprViewerAnnotationDialog'\nimport AstHotkeyModal from '@components/hotkeys/HotkeyModal'\nimport AstImagePlaceholder from '@components/ImagePlaceholder'\nimport AstImageViewer from '@components/ImageViewer'\nimport AstMprViewerLayoutSelector from '@components/layout/MprViewerLayoutSelector'\nimport AstMprViewerTools from '@components/layout/MprViewerTools'\nimport AstToolbar from '@components/Toolbar'\nimport AstToolbarBranding from '@components/ToolbarBranding'\nimport AstToolbarButton from '@components/ToolbarButton'\nimport AstViewerLayoutSelector from '@components/layout/ViewerLayoutSelector'\nimport AstViewerNavigation from '@components/layout/ViewerNavigation'\nimport AstViewerStudy from '@components/layout/ViewerStudy'\nimport AstViewerTools from '@components/layout/ViewerTools'\nimport EmailImagesSidebar from '@components/EmailImagesSidebar.vue'\nimport ModalDrawer from '@components/ModalDrawer'\nimport PersistentNavigationDrawer from '@components/PersistentNavigationDrawer'\nimport UserMenu from '@components/UserMenu.vue'\nimport HelpMenu from '@components/HelpMenu.vue'\n\n// Dialogs\nimport { showMprDisabledDialog } from '@dialogs/MprDisabledDlg.vue'\n\nimport viewerCineDialog from './ViewerCineDialog'\nimport viewerDragAndDrop from './ViewerDragAndDrop'\nimport { tryStartTour, startTour } from './ViewerTour'\nimport { startTour as startMprTour } from './MprViewerTour'\nimport { openAttachmentDlg } from '../../dialogs/attachmentDlg.vue'\nimport { imageLoader, decacheInactiveStudies } from '@/imageLoader'\nimport { omniDesktop } from '@/electron/omniDesktop'\nimport listToArray from '@/utils/listToArray'\nimport DesktopDownloader from '@components/DesktopDownloader.vue'\n\npolyfill({\n\tdragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride,\n})\n\ncornerstoneTools.external.cornerstoneMath = cornerstoneMath\ncornerstoneTools.external.cornerstone = cornerstone\ncornerstoneTools.external.Hammer = Hammer\n\ncornerstone.metaData.addProvider(metadataProvider)\n\n// Originally: white\n// Backup purple: #c000ff\ncornerstoneTools.toolColors.setToolColor('#00e0ff')\ncornerstoneTools.textStyle.setBackgroundColor('rgba(15,10,25,0.6)')\n\n// Perform OS and screen size checks before enabling preset hotkeys.\n// Passing 'CT' as modality to assume that study MAY have CTs or MRs.\nconst shouldLoadLevelPresets = shouldLoadDicom('CT')\n\nexport default {\n\tname: 'BaseViewerLayout',\n\tcomponents: {\n\t\tDesktopDownloader,\n\t\tAnnotationDialog,\n\t\tMprAnnotationDialog,\n\t\tAstHotkeyModal,\n\t\tAstImagePlaceholder,\n\t\tAstImageViewer,\n\t\tAstMprViewerLayoutSelector,\n\t\tAstMprViewerTools,\n\t\tAstToolbar,\n\t\tAstToolbarBranding,\n\t\tAstToolbarButton,\n\t\tAstViewerLayoutSelector,\n\t\tAstViewerNavigation,\n\t\tAstViewerStudy,\n\t\tAstViewerTools,\n\t\tEmailImagesSidebar,\n\t\tModalDrawer,\n\t\tPersistentNavigationDrawer,\n\t\tUserMenu,\n\t\tHelpMenu,\n\t\t// Dialog\n\t\tAstCineDialog: () => import(/* webpackChunkName: \"componentCineDialog\" */ '@components/CineDialog'),\n\t\tAstViewerAddRelatedStudy: () =>\n\t\t\timport(/* webpackChunkName: \"componentViewerAddRelatedStudy\" */ '@components/layout/ViewerAddRelatedStudy'),\n\t\tAstViewerContextMenu: () =>\n\t\t\timport(/* webpackChunkName: \"componentViewerContextMenu\" */ '@components/layout/ViewerContextMenu'),\n\t\t// Drawer\n\t\tAstViewerToolHelp: () =>\n\t\t\timport(/* webpackChunkName: \"componentViewerToolHelp\" */ '@components/layout/ViewerToolHelp'),\n\t\tViewerActionsDrawer: () =>\n\t\t\timport(/* webpackChunkName: \"componentViewerActionsDrawer\" */ '@components/view/ViewerActionsDrawer'),\n\t\tDicomTagsDrawer: () =>\n\t\t\timport(/* webpackChunkName: \"componentDicomTagsDrawer\" */ '@components/view/ViewerDicomTagsDrawer'),\n\t\tAstMprViewer: () => import(/* webpackChunkName: \"componentMprViewer\" */ '@components/MprViewerInterface'),\n\t},\n\tmixins: [FullScreenMixin],\n\tprops: {\n\t\tallowRelatedStudies: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tprimaryToolbarConfig: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t\tsettingsConfig: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n    clinicCode: {\n      type: String,\n      default: null\n    }\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tdefaultPrimaryToolbar: {\n\t\t\t\tThumbnails: {\n\t\t\t\t\tgroup: 'left',\n\t\t\t\t\ticon: 'menu',\n\t\t\t\t\taction: () => this.$store.dispatch('toggleDrawers'),\n\t\t\t\t},\n\t\t\t},\n\t\t\tviewerHelpItems: [\n\t\t\t\t{\n\t\t\t\t\ticonName: 'life-ring',\n\t\t\t\t\tlabel: 'Feature Tour',\n\t\t\t\t\tcommand: this.startTour,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'keyboard-outline',\n\t\t\t\t\tlabel: 'Keyboard Shortcuts',\n\t\t\t\t\tcommand: () => this.toggleHotkeyModal(true),\n\t\t\t\t},\n\t\t\t],\n\t\t\tmprInitialSlice: 0,\n\t\t\tmprInitialVoi: undefined,\n\t\t\tmprHelpItems: [\n\t\t\t\t{\n\t\t\t\t\ticonName: 'life-ring',\n\t\t\t\t\tlabel: 'Feature Tour',\n\t\t\t\t\tcommand: () => this.startMprTour(),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'keyboard-outline',\n\t\t\t\t\tlabel: 'Keyboard Shortcuts',\n\t\t\t\t\tcommand: () => this.toggleHotkeyModal(true),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ticonName: 'check-circle',\n\t\t\t\t\tlabel: 'Check MPR Performance',\n\t\t\t\t\tcommand: () => this.openMPRPerformanceModal(),\n\t\t\t\t},\n\t\t\t],\n\t\t\tisDrawerOpen: {\n\t\t\t\tmprActions: false,\n\t\t\t\tactions: false,\n\t\t\t\tabout: false,\n\t\t\t\tdicom: false,\n\t\t\t},\n\t\t\tcontextMenu: {\n\t\t\t\tisOpen: false,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t//\n\t\t\t\teventStartX: 0,\n\t\t\t\teventStartY: 0,\n\t\t\t\teventStartTime: 0,\n\t\t\t},\n\t\t\tisCineDialogOpen: false,\n\t\t\thotkeysVisible: false,\n\t\t\tshowEmailImages: false,\n\t\t\tnavPanelDraggedOver: false,\n\t\t}\n\t},\n\tcomputed: {\n\t\t...mapState({\n\t\t\tactiveCanvasIndex: state => state.viewer.activeCanvasIndex,\n\t\t\tcanvasLayout: state => state.viewer.canvasLayout,\n\t\t\thangingProtocol: state => state.viewer.hangingProtocol,\n\t\t\thideLoadingText: state => state.viewer.hideLoadingText,\n\t\t\tisHangingProtocolLoading: state => state.viewer.isHangingProtocolLoading,\n\t\t\tisModalDrawerOpen: state => state.ui.isModalDrawerOpen,\n\t\t\tisPersistentDrawerOpen: state => state.ui.isPersistentDrawerOpen,\n\t\t\tisViewerLoading: state => state.viewer.isViewerLoading,\n\t\t\tdraggingFromThumbnailList: state => state.viewer.draggingFromThumbnailList,\n\t\t\tsettings: state => state.viewer.settingsPanel,\n\t\t\tstudies: state => state.viewer.studies,\n\t\t\tstudiesNotFound: state => state.viewer.studiesNotFound,\n\t\t\ttools: state => state.toolManager.tools,\n\t\t}),\n\t\t...mapGetters([\n\t\t\t'activeCanvas',\n\t\t\t'activeSeries',\n\t\t\t'hasActiveSeries',\n\t\t\t'relatedStudies',\n\t\t\t'activeStudy',\n\t\t\t'activeImage',\n\t\t\t'allSeries',\n\t\t\t'mprActive',\n\t\t\t'visibleCanvases',\n\t\t\t'isCommunityUser',\n\t\t]),\n\t\tactiveStudySeries() {\n\t\t\treturn this.activeStudy?.imageData.series || []\n\t\t},\n\t\tisRepository() {\n\t\t\treturn ['consigner-studies-viewer', 'repository-studies-viewer'].includes(this.$route.name)\n\t\t},\n\t\tisEmail() {\n\t\t\treturn this.$route.name === 'email-share-consultant'\n\t\t},\n\t\tshowBottomNavigation() {\n\t\t\treturn this.isMobileOS || !this.mq.large\n\t\t},\n\t\tprimaryToolbar() {\n\t\t\treturn { ...this.defaultPrimaryToolbar, ...this.primaryToolbarConfig }\n\t\t},\n\t\ttoolbarLocation() {\n\t\t\tif (!this.mq.small) return 'top'\n\t\t\treturn this.settings.toolbarLocation\n\t\t},\n\t\tloadingText() {\n\t\t\tif (this.hideLoadingText) return\n\t\t\tif (this.isViewerLoading) return 'Loading images ...'\n\t\t\tif (this.isHangingProtocolLoading) return 'Loading Hanging Protocol ...'\n\t\t\tif (!this.viewerHasImages && !this.viewerHasAttachments) {\n\t\t\t\tif (this.studiesNotFound && this.studiesNotFound.length) {\n\t\t\t\t\tif (this.$route.query.clinicCode) {\n\t\t\t\t\t\t// missing study is from another clinic; user will be prompted to add the study to their clinic\n\t\t\t\t\t\treturn 'Loading images ...'\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 'The requested study was not found.'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.studies.length || this.isEmail) {\n\t\t\t\t\treturn 'The images in this study were removed and are no longer available for viewing.'\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\t\tattachments() {\n\t\t\treturn [].concat(...this.studies.map(study => study.imageData.attachments))\n\t\t},\n\t\tviewerHasAttachments() {\n\t\t\treturn this.attachments.length > 0\n\t\t},\n\t\tviewerHasImages() {\n\t\t\treturn this.allSeries.length > 0\n\t\t},\n\t\tisMultiplePatients() {\n\t\t\tif (!this.studies.length || this.studies.length === 1) return false\n\t\t\tlet firstPatientName = this.studies[0].patientName\n\t\t\treturn this.studies.some(s => s.patientName !== firstPatientName)\n\t\t},\n\t\tlayoutPaneSize() {\n\t\t\treturn {\n\t\t\t\twidth: `${100 / this.canvasLayout.canvasesPerRow}%`,\n\t\t\t\theight: `${100 / (this.canvasLayout.numCanvases / this.canvasLayout.canvasesPerRow)}%`,\n\t\t\t}\n\t\t},\n\t\tpreviewImageUrl() {\n\t\t\treturn this.activeImage ? findImageUrlFromImage(this.activeImage, this.activeSeries) : ''\n\t\t},\n\t\tactiveDicomTags() {\n\t\t\tif (!this.isDrawerOpen.dicom || !this.activeImage) return []\n\t\t\tconst result = cornerstone.metaData.get('raw', this.activeImage.imageId)\n\t\t\treturn result || []\n\t\t},\n\t\tmprLoadingReason() {\n\t\t\tif (!this.hasActiveSeries) {\n\t\t\t\treturn 'No active series detected'\n\t\t\t}\n\t\t\tif (this.isViewerLoading || !this.getCanvasSeries(this.activeCanvas)) {\n\t\t\t\treturn 'Viewer is still loading'\n\t\t\t}\n\t\t\tif (this.activeCanvas.isInitializing) {\n\t\t\t\treturn 'Please wait for images to start loading'\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\t\tmprDisabledReasons() {\n\t\t\tconst reasons = []\n\t\t\tif (!this.mq.ipadSize) {\n\t\t\t\tif (this.isMobileOS) reasons.push('mobile')\n\t\t\t\telse reasons.push('size')\n\t\t\t}\n\t\t\tconst browser = detect()\n\t\t\tif (browser.name === 'edge') {\n\t\t\t\treasons.push('edge')\n\t\t\t}\n\t\t\tif (!['CT', 'MR'].includes(this.activeSeries.modality)) {\n\t\t\t\treasons.push('modality')\n\t\t\t}\n\t\t\tif (reasons.length) return reasons\n\t\t\treturn validateMPRImages(this.activeSeries.images).disabledReasons\n\t\t},\n\t\tmprWarningReasons() {\n\t\t\tconst warnings = []\n\t\t\t//  Hide Warnings if user has disabled them\n\t\t\tif (!JSON.parse(storage.getItem('hideMPRSizeWarning'))) {\n\t\t\t\tconst numImages = this.activeSeries.images.length\n\t\t\t\tconst { rows } = cornerstone.metaData.get('imagePixelModule', this.activeImage.imageId)\n\t\t\t\tif (rows >= 1024 && numImages >= 200) {\n\t\t\t\t\twarnings.push('1024')\n\t\t\t\t} else if (rows >= 512 && numImages >= 900) {\n\t\t\t\t\twarnings.push('512')\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn warnings\n\t\t},\n\t\thelpItems() {\n\t\t\treturn this.mprActive ? this.mprHelpItems : this.viewerHelpItems\n\t\t},\n\t\tisDesktop() {\n\t\t\treturn omniDesktop.isConnected\n\t\t},\n\t},\n\twatch: {\n\t\t'studies.length'(currentCount, oldCount) {\n\t\t\tif (currentCount && !oldCount) this.onInitialStudyLoadOrReload()\n\t\t},\n\t\tisViewerLoading(isLoading) {\n\t\t\t// Just want to run the logic below ONCE after first load after window is first opened\n\t\t\tif (this.viewerHasLoaded) return\n\t\t\tthis.viewerHasLoaded = true\n\t\t\tif (this.viewerHasImages) this.tryStartTour()\n\t\t\tthis.$store.commit('resetBindings')\n\t\t\tthis.$store.commit('resetLastLoadedModalityPreset')\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.setHotkeys()\n\t\t\t\tthis.setMouseBindings()\n\t\t\t})\n\t\t},\n\t\thasActiveSeries(active) {\n\t\t\t// Set up Cornerstone state when the viewer goes from having no active series\n\t\t\t// to an active one since the settings could have changed and this window could\n\t\t\t// have been in a closed state.\n\t\t\tif (active) {\n\t\t\t\tthis.startImageViewerSync()\n\t\t\t}\n\t\t},\n\t\tmprActive(isActive) {\n\t\t\tif (isActive) {\n\t\t\t\t// Make sure player is paused so canvas can update\n\t\t\t\tthis.pauseClip()\n\t\t\t\t// Hide CINE dialog\n\t\t\t\tthis.isCineDialogOpen = false\n\t\t\t\t// Bind MPR key actions\n\t\t\t\tthis.$store.commit('resetBindings')\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tthis.setMPRHotkeys()\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t// Close any MPR notifications that may have been thrown\n\t\t\t\tthis.$store.commit('removeNotification', 'missingSlices')\n\t\t\t\tthis.$store.commit('removeNotification', 'extraSlices')\n\n\t\t\t\t// Rebind keys when mpr is inactive\n\t\t\t\tthis.$store.commit('resetBindings')\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tthis.setHotkeys()\n\t\t\t\t\t// Rebind level presets\n\t\t\t\t\tif (shouldLoadDicom('CT')) {\n\t\t\t\t\t\tthis.$store.commit('resetLastLoadedModalityPreset')\n\t\t\t\t\t\tthis.setLevelPresets()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tcanvasLayout: {\n\t\t\thandler() {\n\t\t\t\tthis.$nextTick(this.resizeCanvases)\n\t\t\t},\n\t\t\tdeep: true,\n\t\t},\n\t\t'activeSeries.seriesId': {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.updateDocumentTitle()\n\t\t\t\t// Make sure player is paused so canvas can update\n\t\t\t\tthis.pauseClip()\n\t\t\t\t// Hide CINE dialog if series doesn't have multiple images\n\t\t\t\tif (!(this.activeSeries && this.activeSeries.images && this.activeSeries.images.length > 1)) {\n\t\t\t\t\tthis.isCineDialogOpen = false\n\t\t\t\t}\n\t\t\t\tif (shouldLoadLevelPresets) this.setLevelPresets()\n\t\t\t},\n\t\t},\n\t},\n\tcreated() {\n\t\tcornerstoneTools.init({\n\t\t\tglobalToolSyncEnabled: true,\n\t\t})\n\t\tthis.addTools()\n\t\tthis.setDefaultToolsActive()\n\t\tsynchronizers.create()\n\t},\n\tmounted() {\n\t\tconst onCacheFull = () => {\n\t\t\tif (decacheInactiveStudies()) {\n\t\t\t\timageLoader.prefetch()\n\t\t\t}\n\t\t}\n\n\t\t// deselect any selected text on the page to prevent dragging of text\n\t\tif (window.getSelection && window.getSelection().empty) window.getSelection().empty()\n\n\t\tcornerstone.events.addEventListener('cornerstoneimagecachefull', onCacheFull)\n\n\t\teventBus.on('toggleDicomTags', this.toggleDicomTagsDrawer)\n\t\teventBus.on('openViewerEmail', this.openEmailAction)\n\n\t\tthis.$once('hook:beforeDestroy', () => {\n\t\t\tcornerstone.events.removeEventListener('cornerstoneimagecachefull', onCacheFull)\n\t\t\teventBus.off('toggleDicomTags', this.toggleDicomTagsDrawer)\n\t\t\teventBus.off('openViewerEmail', this.openEmailAction)\n\t\t})\n\t},\n\tbeforeDestroy() {\n\t\tif (this.isFullScreen) this.toggleFullScreen()\n\t\tthis.$api.cancelAllPendingRequests()\n\t\tsynchronizers.destroy()\n\t\tthis.removeTools()\n\t\tthis.clearAnnotations()\n\t\tthis.setMprActive(false)\n\t\timageLoader.stop()\n\t\teventBus.off('toggleDicomTags', this.toggleDicomTagsDrawer)\n\t\teventBus.off('openViewerEmail', this.openEmailAction)\n\t\tthis.$store.commit('SET_ACTIVE_IMAGE_METADATA', null)\n\t\tthis.$store.dispatch('stopImageViewerSync')\n\t},\n\tdestroyed() {\n\t\tthis.$store.commit('CLEAR_VIEWER')\n\t\tthis.$store.commit('resetBindings')\n\t\tthis.$store.commit('SET_CANVAS_LAYOUT', {\n\t\t\tcolumns: 1,\n\t\t\tnumCanvases: 1,\n\t\t})\n\t},\n\tmethods: {\n\t\t...mapActions([\n\t\t\t'clearAnnotations',\n\t\t\t'syncClearAnnotations',\n\t\t\t'copyCanvasAsync',\n\t\t\t'printCanvasAsync',\n\t\t\t'saveCanvasAsync',\n\t\t\t'setActiveCanvas',\n\t\t\t'setHangingProtocolDisplaySet',\n\t\t\t'switchSeries',\n\t\t\t'updateCanvas',\n\t\t\t'openMPRPerformanceModal',\n\t\t\t'setInitialValuesAndEnableMPR',\n\t\t\t'saveMprImageAsync',\n\t\t\t'printMprImageAsync',\n\t\t\t'copyMprImageAsync',\n\t\t\t'startImageViewerSync',\n\t\t\t'createAnnotationRenderingAsync',\n\t\t\t'createMprAnnotationRenderingAsync',\n\t\t]),\n\t\t...mapMutations({\n\t\t\tupdateThumbnailProgress: 'UPDATE_THUMBNAIL_PROGRESS',\n\t\t\tsetMprActive: 'SET_MPR_ACTIVE',\n\t\t\tclearMprActiveAnnotations: 'CLEAR_MPR_ACTIVE_ANNOTATIONS',\n\t\t}),\n\t\t...viewerCineDialog,\n\t\t...viewerDragAndDrop,\n\t\ttryStartTour,\n\t\tstartTour,\n\t\tstartMprTour,\n\t\tupdateDocumentTitle() {\n\t\t\tconst { patientName, patientId } = (this.activeSeries && this.activeSeries.overlayInformation) || {}\n\t\t\tconst patientInfo = patientName ? `${patientName} - ${patientId}` : ''\n\t\t\tconst titlePrefix = patientInfo || (this.$route.meta && this.$route.meta.title) || 'Viewer'\n\t\t\tconst omniOrCommunity = this.isCommunityUser ? 'Community' : 'Omni'\n\t\t\tdocument.title = `${titlePrefix} - Keystone ${omniOrCommunity}`\n\t\t},\n\t\tonInitialStudyLoadOrReload() {\n\t\t\t// onInitialStudyLoadOrReload is called when either the window first opens, OR opens a study from an empty state\n\t\t\tthis.setInitialCanvasLayout()\n\t\t\tthis.openInitialAttachment()\n\t\t\tif (this.viewerHasImages && this.hangingProtocol) this.setHangingProtocolDisplaySet(0)\n\t\t\tif (!this.viewerHasImages) this.$store.dispatch('toggleDrawers', true)\n\t\t},\n\t\tsetInitialCanvasLayout() {\n\t\t\tconst { layout, sid } = this.$route.query\n\t\t\tif (!layout && !sid) {\n\t\t\t\t// set layout based on modality\n\t\t\t\tthis.$store\n\t\t\t\t\t.dispatch('setCanvasLayoutForModalityAndSpread', {\n\t\t\t\t\t\tmodality: this.activeSeries.modality,\n\t\t\t\t\t\tnumSeries: this.allSeries.length,\n\t\t\t\t\t})\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\tthis.$store.commit('FILL_CANVASES')\n\t\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\topenInitialAttachment() {\n\t\t\t// check if sid query param specifies an attachment\n\t\t\tlet sid = this.$route.query.sid\n\t\t\t// check if sids query param specifies an attachment\n\t\t\tif (!sid && this.$route.query.sids) {\n\t\t\t\tlet sids = listToArray(this.$route.query.sids)\n\t\t\t\tif (sids.length === 1) {\n\t\t\t\t\tsid = sids[0]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (sid) {\n\t\t\t\tconst attachment = this.attachments.find(a => a.seriesId === sid)\n\t\t\t\tif (attachment) {\n\t\t\t\t\tthis.openAttachment(attachment)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if no attachment opened from query param, no images in viewer, and this is the primary viewer,\n\t\t\t// then open the first attachment\n\t\t\tlet isPrimaryViewer = true\n\t\t\tif (omniDesktop.isConnected && this.$store.state.windows.openStudiesInNewWindow) {\n\t\t\t\tisPrimaryViewer = omniDesktop.isFirstPrimaryViewerWindow\n\t\t\t}\n\t\t\tif (!this.viewerHasImages && this.viewerHasAttachments && isPrimaryViewer) {\n\t\t\t\tlet attachment = this.attachments[0]\n\t\t\t\tif (['.pdf', '.mp4'].includes(attachment.fileExtension.toLowerCase())) {\n\t\t\t\t\tthis.openAttachment(attachment)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tgetPrimaryToolbarGroup(group) {\n\t\t\tconst toolbarGroup = {}\n\t\t\tfor (const label in this.primaryToolbar) {\n\t\t\t\tif (this.primaryToolbar[label].group === group) {\n\t\t\t\t\ttoolbarGroup[label] = this.primaryToolbar[label]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn toolbarGroup\n\t\t},\n\t\taddTools() {\n\t\t\tthis.tools.forEach(tool => {\n\t\t\t\tconst toolClass = tool.isCustom ? CustomTools[tool.className] : cornerstoneTools[tool.className]\n\n\t\t\t\tcornerstoneTools.addTool(toolClass, tool.config)\n\t\t\t})\n\t\t},\n\t\tremoveTools() {\n\t\t\tthis.tools.forEach(tool => {\n\t\t\t\tcornerstoneTools.removeTool(tool.instanceName)\n\t\t\t})\n\t\t},\n\t\tsetDefaultToolsActive() {\n\t\t\tcornerstoneTools.setToolActive('PanMultiTouch', {})\n\t\t\tcornerstoneTools.setToolActive('ZoomTouchPinch', {})\n\t\t\t// Display Tools\n\t\t\tcornerstoneTools.setToolEnabled('AstOrientationMarkers')\n\t\t},\n\t\ttoggleDrawer(drawer) {\n\t\t\tthis.isDrawerOpen[drawer] = !this.isDrawerOpen[drawer]\n\t\t},\n\t\topenEmailAction() {\n\t\t\tif (!this.mprActive && !this.showEmailImages) this.showEmailImages = true\n\t\t},\n\t\ttoggleDicomTagsDrawer() {\n\t\t\tif (!this.mprActive) this.toggleDrawer('dicom')\n\t\t},\n\t\tresizeCanvases() {\n\t\t\tcornerstoneTools.forceEnabledElementResize()\n\t\t},\n\t\tcanvasIsVisible(canvas) {\n\t\t\treturn this.allSeries.some(x => x.seriesId === canvas.seriesId)\n\t\t},\n\t\tisUnmatchedImageView(canvas) {\n\t\t\treturn canvas.imageView && !canvas.seriesId && !canvas.imageId\n\t\t},\n\t\tgetCanvasSeries(canvas) {\n\t\t\treturn this.allSeries.find(x => x.seriesId === canvas.seriesId)\n\t\t},\n\t\tgetActiveDomCanvas() {\n\t\t\tif (this.$refs.canvases) {\n\t\t\t\tconst activeVueCanvas = this.$refs.canvases.find(\n\t\t\t\t\tcanvas => canvas.$options.propsData.index === this.activeCanvasIndex\n\t\t\t\t)\n\t\t\t\tif (activeVueCanvas && activeVueCanvas.$refs) {\n\t\t\t\t\treturn activeVueCanvas.$refs.canvas\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t\topenAttachment(file) {\n\t\t\topenAttachmentDlg(file, this.isRepository)\n\t\t},\n\t\tonImageViewerMouseDown(evt, canvasIndex) {\n\t\t\tthis.setActiveCanvas({ canvasIndex })\n\t\t\tthis.startContextMenuWatch(evt)\n\t\t},\n\t\t/*\n\t\t * Track most recent mousedown event properties, so when `contextmenu` fires\n\t\t * on mouse up, we can use the values to determine if we should open a context menu\n\t\t *\n\t\t * @param {Object} evt MouseDownEvent\n\t\t */\n\t\tstartContextMenuWatch(evt) {\n\t\t\tthis.contextMenu.eventStartX = evt.clientX\n\t\t\tthis.contextMenu.eventStartY = evt.clientY\n\t\t\tthis.contextMenu.eventStartTime = evt.timeStamp\n\t\t},\n\t\t/*\n\t\t * Open a \"related studies/series\" context menu\n\t\t *\n\t\t * @param {Object} evt ContextMenuEvent\n\t\t */\n\t\topenRelatedMenu(e) {\n\t\t\tif (e.pointerType === 'touch') return\n\t\t\tif (this.isRepository) return\n\t\t\tif (this.$store.getters.isRightClickHandledByTool) return\n\t\t\tconst tooMuchMovement =\n\t\t\t\tMath.abs(this.contextMenu.eventStartX - e.clientX) > 50 ||\n\t\t\t\tMath.abs(this.contextMenu.eventStartY - e.clientY) > 50\n\t\t\tconst tooMuchTime = Math.abs(this.contextMenu.eventStartTime - e.timeStamp) > 300\n\t\t\tif (tooMuchMovement || tooMuchTime) return\n\t\t\tthis.contextMenu.top = e.clientY\n\t\t\tthis.contextMenu.left = e.clientX\n\t\t\tthis.contextMenu.isOpen = true\n\t\t},\n\t\t/*\n\t\t * Layout Selector\n\t\t */\n\t\thandleLayoutSelected(params) {\n\t\t\tthis.$store.commit('SET_CANVAS_LAYOUT', {\n\t\t\t\tcolumns: params.c,\n\t\t\t\tnumCanvases: params.c * params.r,\n\t\t\t})\n\t\t\tif (!this.hangingProtocol) this.$store.commit('FILL_CANVASES')\n\t\t},\n\t\tsetHotkeys() {\n\t\t\tthis.$store.dispatch('setHotkeys', this.$ga)\n\t\t},\n\t\tsetMPRHotkeys() {\n\t\t\tthis.$store.dispatch('setMPRHotkeys', this.$ga)\n\t\t},\n\t\tsetMouseBindings() {\n\t\t\tthis.$store.dispatch('setMouseBindings')\n\t\t},\n\t\tcheckAndLoadMpr() {\n\t\t\t// Get current Viewer values to pass to MPR\n\t\t\ttry {\n\t\t\t\tconst canvas = this.getActiveDomCanvas()\n\t\t\t\tthis.mprInitialSlice = 0\n\t\t\t\tconst { voi } = cornerstone.getViewport(canvas)\n\t\t\t\tconst activeImage = cornerstone.getImage(canvas)\n\t\t\t\tif (!activeImage.isDicom) {\n\t\t\t\t\t// voi from cornerstone is in jpeg scale, convert back!\n\t\t\t\t\tthis.mprInitialVoi = scaleJpegVoiToDicom(voi, activeImage)\n\t\t\t\t} else {\n\t\t\t\t\tthis.mprInitialVoi = { ...voi }\n\t\t\t\t}\n\t\t\t\tconst toolState = cornerstoneTools.getToolState(canvas, 'stack')\n\t\t\t\tif (toolState && toolState.data && toolState.data.length) {\n\t\t\t\t\t// Send the % of the slice to map to the new range. Close enough\n\t\t\t\t\tthis.mprInitialSlice = (parseInt(toolState.data[0].currentImageIdIndex) + 1) / this.activeSeries.images.length\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// Use initial Values\n\t\t\t\tthis.mprInitialVoi = undefined\n\t\t\t}\n\n\t\t\tif (this.mprDisabledReasons.length || this.mprWarningReasons.length) {\n\t\t\t\t// launch modal\n\t\t\t\tshowMprDisabledDialog(this.mprDisabledReasons, this.mprWarningReasons)\n\t\t\t} else {\n\t\t\t\tthis.setMprActive(true)\n\t\t\t}\n\t\t},\n\t\ttoggleHotkeyModal(visible) {\n\t\t\tthis.hotkeysVisible = visible\n\t\t},\n\t\tsetLevelPresets() {\n\t\t\tthis.$store.dispatch('setWindowLevelPresets', this.setLevels)\n\t\t},\n\t\tsetLevels(windowWidth, windowCenter) {\n\t\t\tconst canvas = this.getActiveDomCanvas()\n\t\t\tlet viewport = cornerstone.getViewport(canvas)\n\t\t\tif (!viewport) return\n\t\t\tconst voi = { windowWidth, windowCenter }\n\t\t\tconst activeImage = cornerstone.getImage(canvas)\n\t\t\tconst isDicom = activeImage.isDicom\n\n\t\t\tif (!isDicom) {\n\t\t\t\tconst scaledLevels = scaleDicomPresetToJpeg(voi, activeImage)\n\t\t\t\tviewport.voi.windowWidth = parseInt(scaledLevels.windowWidth)\n\t\t\t\tviewport.voi.windowCenter = parseInt(scaledLevels.windowCenter)\n\t\t\t} else {\n\t\t\t\tviewport.voi.windowWidth = parseInt(voi.windowWidth)\n\t\t\t\tviewport.voi.windowCenter = parseInt(voi.windowCenter)\n\t\t\t}\n\n\t\t\tcornerstone.setViewport(canvas, viewport)\n\t\t},\n\t\tonNavDrawerDragOver(event) {\n\t\t\tconst types = event.dataTransfer.types\n\t\t\tif (\n\t\t\t\ttypes &&\n\t\t\t\ttypes.includes('text/plain') &&\n\t\t\t\t!this.draggingFromThumbnailList &&\n\t\t\t\t!this.isRepository &&\n\t\t\t\t!this.isEmail\n\t\t\t) {\n\t\t\t\tclearTimeout(this.dragTimeout)\n\t\t\t\tthis.navPanelDraggedOver = true\n\t\t\t\tevent.dataTransfer.dropEffect = 'copy'\n\t\t\t\tevent.preventDefault()\n\t\t\t\tevent.stopPropagation()\n\t\t\t}\n\t\t},\n\t\tonNavDrawerDragLeave() {\n\t\t\t// This event bubbles, so set on timeout to prevent flickering\n\t\t\tthis.dragTimeout = setTimeout(() => (this.navPanelDraggedOver = false), 60)\n\t\t},\n\t\tonNavDrawerDrop(event) {\n\t\t\tthis.navPanelDraggedOver = false\n\t\t\tconst data = JSON.parse(event.dataTransfer.getData('text'))\n\t\t\tthis.$emit('drop-study-report', data)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n@import '~intro.js/introjs.css';\n@import '~intro.js/themes/introjs-nassim.css';\n@import '~@styles/_vars.scss';\n\n/*\n * STYLES\n *\n*/\nmain.viewer-layout {\n\tdisplay: flex;\n\tflex-direction: column-reverse;\n\tcolor: var(--primary-label);\n\toverflow: hidden;\n\theight: 100%;\n}\n\n.viewer-content {\n\tdisplay: flex;\n\tflex-grow: 1;\n\talign-items: stretch;\n\toverflow: hidden;\n}\n\n.study-container {\n\tmin-width: 212px;\n}\n\n.navigation-drawer,\n.navigation-drawer .modal-content {\n\tpadding-right: 1em; // for consistent scrollbars in Chrome and Edge\n}\n\n.navigation-drawer.dragged-over {\n\tbackground-color: var(--tertiary-bg);\n}\n\n.left,\n.right {\n\tdisplay: flex;\n}\n.top-navigation {\n\tdisplay: flex !important;\n\tflex-direction: row !important;\n}\n.bottom-navigation {\n\tdisplay: flex !important;\n}\n\n.loading-text {\n\tdisplay: flex;\n\tposition: absolute;\n\ttop: 0;\n\tright: 0;\n\tleft: 0;\n\tbottom: 0;\n\ttext-align: center;\n\talign-items: center;\n\tjustify-content: center;\n\tfont-size: 2em;\n\tcolor: #fff;\n\tbackground: #000;\n}\n\n.layout-pane-container {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tbackground: #000;\n\tflex-grow: 1;\n\tpadding: 4px;\n\theight: 100%;\n\tposition: relative;\n\toverflow: hidden;\n}\n\n.icon-layout-mpr-3x1 {\n\tfont-size: 18px !important;\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Viewer.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Viewer.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Viewer.vue?vue&type=template&id=576c527a\"\nimport script from \"./Viewer.vue?vue&type=script&lang=js\"\nexport * from \"./Viewer.vue?vue&type=script&lang=js\"\nimport style0 from \"./Viewer.vue?vue&type=style&index=0&id=576c527a&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AboutCommunity.vue?vue&type=style&index=0&id=d816edec&prod&lang=scss&scoped=true\"","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Banner.vue?vue&type=style&index=0&id=0abe1cff&prod&lang=scss&scoped=true\"","/*! Hammer.JS - v2.0.7 - 2016-04-22\n * http://hammerjs.github.io/\n *\n * Copyright (c) 2016 Jorik Tangelder;\n * Licensed under the MIT license */\n(function(window, document, exportName, undefined) {\n  'use strict';\n\nvar VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\nvar TEST_ELEMENT = document.createElement('div');\n\nvar TYPE_FUNCTION = 'function';\n\nvar round = Math.round;\nvar abs = Math.abs;\nvar now = Date.now;\n\n/**\n * set a timeout with a given scope\n * @param {Function} fn\n * @param {Number} timeout\n * @param {Object} context\n * @returns {number}\n */\nfunction setTimeoutContext(fn, timeout, context) {\n    return setTimeout(bindFn(fn, context), timeout);\n}\n\n/**\n * if the argument is an array, we want to execute the fn on each entry\n * if it aint an array we don't want to do a thing.\n * this is used by all the methods that accept a single and array argument.\n * @param {*|Array} arg\n * @param {String} fn\n * @param {Object} [context]\n * @returns {Boolean}\n */\nfunction invokeArrayArg(arg, fn, context) {\n    if (Array.isArray(arg)) {\n        each(arg, context[fn], context);\n        return true;\n    }\n    return false;\n}\n\n/**\n * walk objects and arrays\n * @param {Object} obj\n * @param {Function} iterator\n * @param {Object} context\n */\nfunction each(obj, iterator, context) {\n    var i;\n\n    if (!obj) {\n        return;\n    }\n\n    if (obj.forEach) {\n        obj.forEach(iterator, context);\n    } else if (obj.length !== undefined) {\n        i = 0;\n        while (i < obj.length) {\n            iterator.call(context, obj[i], i, obj);\n            i++;\n        }\n    } else {\n        for (i in obj) {\n            obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\n        }\n    }\n}\n\n/**\n * wrap a method with a deprecation warning and stack trace\n * @param {Function} method\n * @param {String} name\n * @param {String} message\n * @returns {Function} A new function wrapping the supplied method.\n */\nfunction deprecate(method, name, message) {\n    var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\\n' + message + ' AT \\n';\n    return function() {\n        var e = new Error('get-stack-trace');\n        var stack = e && e.stack ? e.stack.replace(/^[^\\(]+?[\\n$]/gm, '')\n            .replace(/^\\s+at\\s+/gm, '')\n            .replace(/^Object.<anonymous>\\s*\\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';\n\n        var log = window.console && (window.console.warn || window.console.log);\n        if (log) {\n            log.call(window.console, deprecationMessage, stack);\n        }\n        return method.apply(this, arguments);\n    };\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} target\n * @param {...Object} objects_to_assign\n * @returns {Object} target\n */\nvar assign;\nif (typeof Object.assign !== 'function') {\n    assign = function assign(target) {\n        if (target === undefined || target === null) {\n            throw new TypeError('Cannot convert undefined or null to object');\n        }\n\n        var output = Object(target);\n        for (var index = 1; index < arguments.length; index++) {\n            var source = arguments[index];\n            if (source !== undefined && source !== null) {\n                for (var nextKey in source) {\n                    if (source.hasOwnProperty(nextKey)) {\n                        output[nextKey] = source[nextKey];\n                    }\n                }\n            }\n        }\n        return output;\n    };\n} else {\n    assign = Object.assign;\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} dest\n * @param {Object} src\n * @param {Boolean} [merge=false]\n * @returns {Object} dest\n */\nvar extend = deprecate(function extend(dest, src, merge) {\n    var keys = Object.keys(src);\n    var i = 0;\n    while (i < keys.length) {\n        if (!merge || (merge && dest[keys[i]] === undefined)) {\n            dest[keys[i]] = src[keys[i]];\n        }\n        i++;\n    }\n    return dest;\n}, 'extend', 'Use `assign`.');\n\n/**\n * merge the values from src in the dest.\n * means that properties that exist in dest will not be overwritten by src\n * @param {Object} dest\n * @param {Object} src\n * @returns {Object} dest\n */\nvar merge = deprecate(function merge(dest, src) {\n    return extend(dest, src, true);\n}, 'merge', 'Use `assign`.');\n\n/**\n * simple class inheritance\n * @param {Function} child\n * @param {Function} base\n * @param {Object} [properties]\n */\nfunction inherit(child, base, properties) {\n    var baseP = base.prototype,\n        childP;\n\n    childP = child.prototype = Object.create(baseP);\n    childP.constructor = child;\n    childP._super = baseP;\n\n    if (properties) {\n        assign(childP, properties);\n    }\n}\n\n/**\n * simple function bind\n * @param {Function} fn\n * @param {Object} context\n * @returns {Function}\n */\nfunction bindFn(fn, context) {\n    return function boundFn() {\n        return fn.apply(context, arguments);\n    };\n}\n\n/**\n * let a boolean value also be a function that must return a boolean\n * this first item in args will be used as the context\n * @param {Boolean|Function} val\n * @param {Array} [args]\n * @returns {Boolean}\n */\nfunction boolOrFn(val, args) {\n    if (typeof val == TYPE_FUNCTION) {\n        return val.apply(args ? args[0] || undefined : undefined, args);\n    }\n    return val;\n}\n\n/**\n * use the val2 when val1 is undefined\n * @param {*} val1\n * @param {*} val2\n * @returns {*}\n */\nfunction ifUndefined(val1, val2) {\n    return (val1 === undefined) ? val2 : val1;\n}\n\n/**\n * addEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction addEventListeners(target, types, handler) {\n    each(splitStr(types), function(type) {\n        target.addEventListener(type, handler, false);\n    });\n}\n\n/**\n * removeEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction removeEventListeners(target, types, handler) {\n    each(splitStr(types), function(type) {\n        target.removeEventListener(type, handler, false);\n    });\n}\n\n/**\n * find if a node is in the given parent\n * @method hasParent\n * @param {HTMLElement} node\n * @param {HTMLElement} parent\n * @return {Boolean} found\n */\nfunction hasParent(node, parent) {\n    while (node) {\n        if (node == parent) {\n            return true;\n        }\n        node = node.parentNode;\n    }\n    return false;\n}\n\n/**\n * small indexOf wrapper\n * @param {String} str\n * @param {String} find\n * @returns {Boolean} found\n */\nfunction inStr(str, find) {\n    return str.indexOf(find) > -1;\n}\n\n/**\n * split string on whitespace\n * @param {String} str\n * @returns {Array} words\n */\nfunction splitStr(str) {\n    return str.trim().split(/\\s+/g);\n}\n\n/**\n * find if a array contains the object using indexOf or a simple polyFill\n * @param {Array} src\n * @param {String} find\n * @param {String} [findByKey]\n * @return {Boolean|Number} false when not found, or the index\n */\nfunction inArray(src, find, findByKey) {\n    if (src.indexOf && !findByKey) {\n        return src.indexOf(find);\n    } else {\n        var i = 0;\n        while (i < src.length) {\n            if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {\n                return i;\n            }\n            i++;\n        }\n        return -1;\n    }\n}\n\n/**\n * convert array-like objects to real arrays\n * @param {Object} obj\n * @returns {Array}\n */\nfunction toArray(obj) {\n    return Array.prototype.slice.call(obj, 0);\n}\n\n/**\n * unique array with objects based on a key (like 'id') or just by the array's value\n * @param {Array} src [{id:1},{id:2},{id:1}]\n * @param {String} [key]\n * @param {Boolean} [sort=False]\n * @returns {Array} [{id:1},{id:2}]\n */\nfunction uniqueArray(src, key, sort) {\n    var results = [];\n    var values = [];\n    var i = 0;\n\n    while (i < src.length) {\n        var val = key ? src[i][key] : src[i];\n        if (inArray(values, val) < 0) {\n            results.push(src[i]);\n        }\n        values[i] = val;\n        i++;\n    }\n\n    if (sort) {\n        if (!key) {\n            results = results.sort();\n        } else {\n            results = results.sort(function sortUniqueArray(a, b) {\n                return a[key] > b[key];\n            });\n        }\n    }\n\n    return results;\n}\n\n/**\n * get the prefixed property\n * @param {Object} obj\n * @param {String} property\n * @returns {String|Undefined} prefixed\n */\nfunction prefixed(obj, property) {\n    var prefix, prop;\n    var camelProp = property[0].toUpperCase() + property.slice(1);\n\n    var i = 0;\n    while (i < VENDOR_PREFIXES.length) {\n        prefix = VENDOR_PREFIXES[i];\n        prop = (prefix) ? prefix + camelProp : property;\n\n        if (prop in obj) {\n            return prop;\n        }\n        i++;\n    }\n    return undefined;\n}\n\n/**\n * get a unique id\n * @returns {number} uniqueId\n */\nvar _uniqueId = 1;\nfunction uniqueId() {\n    return _uniqueId++;\n}\n\n/**\n * get the window object of an element\n * @param {HTMLElement} element\n * @returns {DocumentView|Window}\n */\nfunction getWindowForElement(element) {\n    var doc = element.ownerDocument || element;\n    return (doc.defaultView || doc.parentWindow || window);\n}\n\nvar MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\n\nvar SUPPORT_TOUCH = ('ontouchstart' in window);\nvar SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;\nvar SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\n\nvar INPUT_TYPE_TOUCH = 'touch';\nvar INPUT_TYPE_PEN = 'pen';\nvar INPUT_TYPE_MOUSE = 'mouse';\nvar INPUT_TYPE_KINECT = 'kinect';\n\nvar COMPUTE_INTERVAL = 25;\n\nvar INPUT_START = 1;\nvar INPUT_MOVE = 2;\nvar INPUT_END = 4;\nvar INPUT_CANCEL = 8;\n\nvar DIRECTION_NONE = 1;\nvar DIRECTION_LEFT = 2;\nvar DIRECTION_RIGHT = 4;\nvar DIRECTION_UP = 8;\nvar DIRECTION_DOWN = 16;\n\nvar DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\nvar DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\nvar DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\n\nvar PROPS_XY = ['x', 'y'];\nvar PROPS_CLIENT_XY = ['clientX', 'clientY'];\n\n/**\n * create new input type manager\n * @param {Manager} manager\n * @param {Function} callback\n * @returns {Input}\n * @constructor\n */\nfunction Input(manager, callback) {\n    var self = this;\n    this.manager = manager;\n    this.callback = callback;\n    this.element = manager.element;\n    this.target = manager.options.inputTarget;\n\n    // smaller wrapper around the handler, for the scope and the enabled state of the manager,\n    // so when disabled the input events are completely bypassed.\n    this.domHandler = function(ev) {\n        if (boolOrFn(manager.options.enable, [manager])) {\n            self.handler(ev);\n        }\n    };\n\n    this.init();\n\n}\n\nInput.prototype = {\n    /**\n     * should handle the inputEvent data and trigger the callback\n     * @virtual\n     */\n    handler: function() { },\n\n    /**\n     * bind the events\n     */\n    init: function() {\n        this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\n        this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\n        this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n    },\n\n    /**\n     * unbind the events\n     */\n    destroy: function() {\n        this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\n        this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\n        this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n    }\n};\n\n/**\n * create new input type manager\n * called by the Manager constructor\n * @param {Hammer} manager\n * @returns {Input}\n */\nfunction createInputInstance(manager) {\n    var Type;\n    var inputClass = manager.options.inputClass;\n\n    if (inputClass) {\n        Type = inputClass;\n    } else if (SUPPORT_POINTER_EVENTS) {\n        Type = PointerEventInput;\n    } else if (SUPPORT_ONLY_TOUCH) {\n        Type = TouchInput;\n    } else if (!SUPPORT_TOUCH) {\n        Type = MouseInput;\n    } else {\n        Type = TouchMouseInput;\n    }\n    return new (Type)(manager, inputHandler);\n}\n\n/**\n * handle input events\n * @param {Manager} manager\n * @param {String} eventType\n * @param {Object} input\n */\nfunction inputHandler(manager, eventType, input) {\n    var pointersLen = input.pointers.length;\n    var changedPointersLen = input.changedPointers.length;\n    var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));\n    var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));\n\n    input.isFirst = !!isFirst;\n    input.isFinal = !!isFinal;\n\n    if (isFirst) {\n        manager.session = {};\n    }\n\n    // source event is the normalized value of the domEvents\n    // like 'touchstart, mouseup, pointerdown'\n    input.eventType = eventType;\n\n    // compute scale, rotation etc\n    computeInputData(manager, input);\n\n    // emit secret event\n    manager.emit('hammer.input', input);\n\n    manager.recognize(input);\n    manager.session.prevInput = input;\n}\n\n/**\n * extend the data with some usable properties like scale, rotate, velocity etc\n * @param {Object} manager\n * @param {Object} input\n */\nfunction computeInputData(manager, input) {\n    var session = manager.session;\n    var pointers = input.pointers;\n    var pointersLength = pointers.length;\n\n    // store the first input to calculate the distance and direction\n    if (!session.firstInput) {\n        session.firstInput = simpleCloneInputData(input);\n    }\n\n    // to compute scale and rotation we need to store the multiple touches\n    if (pointersLength > 1 && !session.firstMultiple) {\n        session.firstMultiple = simpleCloneInputData(input);\n    } else if (pointersLength === 1) {\n        session.firstMultiple = false;\n    }\n\n    var firstInput = session.firstInput;\n    var firstMultiple = session.firstMultiple;\n    var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\n\n    var center = input.center = getCenter(pointers);\n    input.timeStamp = now();\n    input.deltaTime = input.timeStamp - firstInput.timeStamp;\n\n    input.angle = getAngle(offsetCenter, center);\n    input.distance = getDistance(offsetCenter, center);\n\n    computeDeltaXY(session, input);\n    input.offsetDirection = getDirection(input.deltaX, input.deltaY);\n\n    var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);\n    input.overallVelocityX = overallVelocity.x;\n    input.overallVelocityY = overallVelocity.y;\n    input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;\n\n    input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\n    input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\n\n    input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >\n        session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);\n\n    computeIntervalInputData(session, input);\n\n    // find the correct target\n    var target = manager.element;\n    if (hasParent(input.srcEvent.target, target)) {\n        target = input.srcEvent.target;\n    }\n    input.target = target;\n}\n\nfunction computeDeltaXY(session, input) {\n    var center = input.center;\n    var offset = session.offsetDelta || {};\n    var prevDelta = session.prevDelta || {};\n    var prevInput = session.prevInput || {};\n\n    if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\n        prevDelta = session.prevDelta = {\n            x: prevInput.deltaX || 0,\n            y: prevInput.deltaY || 0\n        };\n\n        offset = session.offsetDelta = {\n            x: center.x,\n            y: center.y\n        };\n    }\n\n    input.deltaX = prevDelta.x + (center.x - offset.x);\n    input.deltaY = prevDelta.y + (center.y - offset.y);\n}\n\n/**\n * velocity is calculated every x ms\n * @param {Object} session\n * @param {Object} input\n */\nfunction computeIntervalInputData(session, input) {\n    var last = session.lastInterval || input,\n        deltaTime = input.timeStamp - last.timeStamp,\n        velocity, velocityX, velocityY, direction;\n\n    if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\n        var deltaX = input.deltaX - last.deltaX;\n        var deltaY = input.deltaY - last.deltaY;\n\n        var v = getVelocity(deltaTime, deltaX, deltaY);\n        velocityX = v.x;\n        velocityY = v.y;\n        velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;\n        direction = getDirection(deltaX, deltaY);\n\n        session.lastInterval = input;\n    } else {\n        // use latest velocity info if it doesn't overtake a minimum period\n        velocity = last.velocity;\n        velocityX = last.velocityX;\n        velocityY = last.velocityY;\n        direction = last.direction;\n    }\n\n    input.velocity = velocity;\n    input.velocityX = velocityX;\n    input.velocityY = velocityY;\n    input.direction = direction;\n}\n\n/**\n * create a simple clone from the input used for storage of firstInput and firstMultiple\n * @param {Object} input\n * @returns {Object} clonedInputData\n */\nfunction simpleCloneInputData(input) {\n    // make a simple copy of the pointers because we will get a reference if we don't\n    // we only need clientXY for the calculations\n    var pointers = [];\n    var i = 0;\n    while (i < input.pointers.length) {\n        pointers[i] = {\n            clientX: round(input.pointers[i].clientX),\n            clientY: round(input.pointers[i].clientY)\n        };\n        i++;\n    }\n\n    return {\n        timeStamp: now(),\n        pointers: pointers,\n        center: getCenter(pointers),\n        deltaX: input.deltaX,\n        deltaY: input.deltaY\n    };\n}\n\n/**\n * get the center of all the pointers\n * @param {Array} pointers\n * @return {Object} center contains `x` and `y` properties\n */\nfunction getCenter(pointers) {\n    var pointersLength = pointers.length;\n\n    // no need to loop when only one touch\n    if (pointersLength === 1) {\n        return {\n            x: round(pointers[0].clientX),\n            y: round(pointers[0].clientY)\n        };\n    }\n\n    var x = 0, y = 0, i = 0;\n    while (i < pointersLength) {\n        x += pointers[i].clientX;\n        y += pointers[i].clientY;\n        i++;\n    }\n\n    return {\n        x: round(x / pointersLength),\n        y: round(y / pointersLength)\n    };\n}\n\n/**\n * calculate the velocity between two points. unit is in px per ms.\n * @param {Number} deltaTime\n * @param {Number} x\n * @param {Number} y\n * @return {Object} velocity `x` and `y`\n */\nfunction getVelocity(deltaTime, x, y) {\n    return {\n        x: x / deltaTime || 0,\n        y: y / deltaTime || 0\n    };\n}\n\n/**\n * get the direction between two points\n * @param {Number} x\n * @param {Number} y\n * @return {Number} direction\n */\nfunction getDirection(x, y) {\n    if (x === y) {\n        return DIRECTION_NONE;\n    }\n\n    if (abs(x) >= abs(y)) {\n        return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n    }\n    return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n}\n\n/**\n * calculate the absolute distance between two points\n * @param {Object} p1 {x, y}\n * @param {Object} p2 {x, y}\n * @param {Array} [props] containing x and y keys\n * @return {Number} distance\n */\nfunction getDistance(p1, p2, props) {\n    if (!props) {\n        props = PROPS_XY;\n    }\n    var x = p2[props[0]] - p1[props[0]],\n        y = p2[props[1]] - p1[props[1]];\n\n    return Math.sqrt((x * x) + (y * y));\n}\n\n/**\n * calculate the angle between two coordinates\n * @param {Object} p1\n * @param {Object} p2\n * @param {Array} [props] containing x and y keys\n * @return {Number} angle\n */\nfunction getAngle(p1, p2, props) {\n    if (!props) {\n        props = PROPS_XY;\n    }\n    var x = p2[props[0]] - p1[props[0]],\n        y = p2[props[1]] - p1[props[1]];\n    return Math.atan2(y, x) * 180 / Math.PI;\n}\n\n/**\n * calculate the rotation degrees between two pointersets\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} rotation\n */\nfunction getRotation(start, end) {\n    return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);\n}\n\n/**\n * calculate the scale factor between two pointersets\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} scale\n */\nfunction getScale(start, end) {\n    return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\n}\n\nvar MOUSE_INPUT_MAP = {\n    mousedown: INPUT_START,\n    mousemove: INPUT_MOVE,\n    mouseup: INPUT_END\n};\n\nvar MOUSE_ELEMENT_EVENTS = 'mousedown';\nvar MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\n\n/**\n * Mouse events input\n * @constructor\n * @extends Input\n */\nfunction MouseInput() {\n    this.evEl = MOUSE_ELEMENT_EVENTS;\n    this.evWin = MOUSE_WINDOW_EVENTS;\n\n    this.pressed = false; // mousedown state\n\n    Input.apply(this, arguments);\n}\n\ninherit(MouseInput, Input, {\n    /**\n     * handle mouse events\n     * @param {Object} ev\n     */\n    handler: function MEhandler(ev) {\n        var eventType = MOUSE_INPUT_MAP[ev.type];\n\n        // on start we want to have the left mouse button down\n        if (eventType & INPUT_START && ev.button === 0) {\n            this.pressed = true;\n        }\n\n        if (eventType & INPUT_MOVE && ev.which !== 1) {\n            eventType = INPUT_END;\n        }\n\n        // mouse must be down\n        if (!this.pressed) {\n            return;\n        }\n\n        if (eventType & INPUT_END) {\n            this.pressed = false;\n        }\n\n        this.callback(this.manager, eventType, {\n            pointers: [ev],\n            changedPointers: [ev],\n            pointerType: INPUT_TYPE_MOUSE,\n            srcEvent: ev\n        });\n    }\n});\n\nvar POINTER_INPUT_MAP = {\n    pointerdown: INPUT_START,\n    pointermove: INPUT_MOVE,\n    pointerup: INPUT_END,\n    pointercancel: INPUT_CANCEL,\n    pointerout: INPUT_CANCEL\n};\n\n// in IE10 the pointer types is defined as an enum\nvar IE10_POINTER_TYPE_ENUM = {\n    2: INPUT_TYPE_TOUCH,\n    3: INPUT_TYPE_PEN,\n    4: INPUT_TYPE_MOUSE,\n    5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\n};\n\nvar POINTER_ELEMENT_EVENTS = 'pointerdown';\nvar POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';\n\n// IE10 has prefixed support, and case-sensitive\nif (window.MSPointerEvent && !window.PointerEvent) {\n    POINTER_ELEMENT_EVENTS = 'MSPointerDown';\n    POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\n}\n\n/**\n * Pointer events input\n * @constructor\n * @extends Input\n */\nfunction PointerEventInput() {\n    this.evEl = POINTER_ELEMENT_EVENTS;\n    this.evWin = POINTER_WINDOW_EVENTS;\n\n    Input.apply(this, arguments);\n\n    this.store = (this.manager.session.pointerEvents = []);\n}\n\ninherit(PointerEventInput, Input, {\n    /**\n     * handle mouse events\n     * @param {Object} ev\n     */\n    handler: function PEhandler(ev) {\n        var store = this.store;\n        var removePointer = false;\n\n        var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\n        var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\n        var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\n\n        var isTouch = (pointerType == INPUT_TYPE_TOUCH);\n\n        // get index of the event in the store\n        var storeIndex = inArray(store, ev.pointerId, 'pointerId');\n\n        // start and mouse must be down\n        if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\n            if (storeIndex < 0) {\n                store.push(ev);\n                storeIndex = store.length - 1;\n            }\n        } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n            removePointer = true;\n        }\n\n        // it not found, so the pointer hasn't been down (so it's probably a hover)\n        if (storeIndex < 0) {\n            return;\n        }\n\n        // update the event in the store\n        store[storeIndex] = ev;\n\n        this.callback(this.manager, eventType, {\n            pointers: store,\n            changedPointers: [ev],\n            pointerType: pointerType,\n            srcEvent: ev\n        });\n\n        if (removePointer) {\n            // remove from the store\n            store.splice(storeIndex, 1);\n        }\n    }\n});\n\nvar SINGLE_TOUCH_INPUT_MAP = {\n    touchstart: INPUT_START,\n    touchmove: INPUT_MOVE,\n    touchend: INPUT_END,\n    touchcancel: INPUT_CANCEL\n};\n\nvar SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\nvar SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Touch events input\n * @constructor\n * @extends Input\n */\nfunction SingleTouchInput() {\n    this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\n    this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\n    this.started = false;\n\n    Input.apply(this, arguments);\n}\n\ninherit(SingleTouchInput, Input, {\n    handler: function TEhandler(ev) {\n        var type = SINGLE_TOUCH_INPUT_MAP[ev.type];\n\n        // should we handle the touch events?\n        if (type === INPUT_START) {\n            this.started = true;\n        }\n\n        if (!this.started) {\n            return;\n        }\n\n        var touches = normalizeSingleTouches.call(this, ev, type);\n\n        // when done, reset the started state\n        if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\n            this.started = false;\n        }\n\n        this.callback(this.manager, type, {\n            pointers: touches[0],\n            changedPointers: touches[1],\n            pointerType: INPUT_TYPE_TOUCH,\n            srcEvent: ev\n        });\n    }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction normalizeSingleTouches(ev, type) {\n    var all = toArray(ev.touches);\n    var changed = toArray(ev.changedTouches);\n\n    if (type & (INPUT_END | INPUT_CANCEL)) {\n        all = uniqueArray(all.concat(changed), 'identifier', true);\n    }\n\n    return [all, changed];\n}\n\nvar TOUCH_INPUT_MAP = {\n    touchstart: INPUT_START,\n    touchmove: INPUT_MOVE,\n    touchend: INPUT_END,\n    touchcancel: INPUT_CANCEL\n};\n\nvar TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Multi-user touch events input\n * @constructor\n * @extends Input\n */\nfunction TouchInput() {\n    this.evTarget = TOUCH_TARGET_EVENTS;\n    this.targetIds = {};\n\n    Input.apply(this, arguments);\n}\n\ninherit(TouchInput, Input, {\n    handler: function MTEhandler(ev) {\n        var type = TOUCH_INPUT_MAP[ev.type];\n        var touches = getTouches.call(this, ev, type);\n        if (!touches) {\n            return;\n        }\n\n        this.callback(this.manager, type, {\n            pointers: touches[0],\n            changedPointers: touches[1],\n            pointerType: INPUT_TYPE_TOUCH,\n            srcEvent: ev\n        });\n    }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction getTouches(ev, type) {\n    var allTouches = toArray(ev.touches);\n    var targetIds = this.targetIds;\n\n    // when there is only one touch, the process can be simplified\n    if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\n        targetIds[allTouches[0].identifier] = true;\n        return [allTouches, allTouches];\n    }\n\n    var i,\n        targetTouches,\n        changedTouches = toArray(ev.changedTouches),\n        changedTargetTouches = [],\n        target = this.target;\n\n    // get target touches from touches\n    targetTouches = allTouches.filter(function(touch) {\n        return hasParent(touch.target, target);\n    });\n\n    // collect touches\n    if (type === INPUT_START) {\n        i = 0;\n        while (i < targetTouches.length) {\n            targetIds[targetTouches[i].identifier] = true;\n            i++;\n        }\n    }\n\n    // filter changed touches to only contain touches that exist in the collected target ids\n    i = 0;\n    while (i < changedTouches.length) {\n        if (targetIds[changedTouches[i].identifier]) {\n            changedTargetTouches.push(changedTouches[i]);\n        }\n\n        // cleanup removed touches\n        if (type & (INPUT_END | INPUT_CANCEL)) {\n            delete targetIds[changedTouches[i].identifier];\n        }\n        i++;\n    }\n\n    if (!changedTargetTouches.length) {\n        return;\n    }\n\n    return [\n        // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\n        uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),\n        changedTargetTouches\n    ];\n}\n\n/**\n * Combined touch and mouse input\n *\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\n * This because touch devices also emit mouse events while doing a touch.\n *\n * @constructor\n * @extends Input\n */\n\nvar DEDUP_TIMEOUT = 2500;\nvar DEDUP_DISTANCE = 25;\n\nfunction TouchMouseInput() {\n    Input.apply(this, arguments);\n\n    var handler = bindFn(this.handler, this);\n    this.touch = new TouchInput(this.manager, handler);\n    this.mouse = new MouseInput(this.manager, handler);\n\n    this.primaryTouch = null;\n    this.lastTouches = [];\n}\n\ninherit(TouchMouseInput, Input, {\n    /**\n     * handle mouse and touch events\n     * @param {Hammer} manager\n     * @param {String} inputEvent\n     * @param {Object} inputData\n     */\n    handler: function TMEhandler(manager, inputEvent, inputData) {\n        var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),\n            isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);\n\n        if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {\n            return;\n        }\n\n        // when we're in a touch event, record touches to  de-dupe synthetic mouse event\n        if (isTouch) {\n            recordTouches.call(this, inputEvent, inputData);\n        } else if (isMouse && isSyntheticEvent.call(this, inputData)) {\n            return;\n        }\n\n        this.callback(manager, inputEvent, inputData);\n    },\n\n    /**\n     * remove the event listeners\n     */\n    destroy: function destroy() {\n        this.touch.destroy();\n        this.mouse.destroy();\n    }\n});\n\nfunction recordTouches(eventType, eventData) {\n    if (eventType & INPUT_START) {\n        this.primaryTouch = eventData.changedPointers[0].identifier;\n        setLastTouch.call(this, eventData);\n    } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n        setLastTouch.call(this, eventData);\n    }\n}\n\nfunction setLastTouch(eventData) {\n    var touch = eventData.changedPointers[0];\n\n    if (touch.identifier === this.primaryTouch) {\n        var lastTouch = {x: touch.clientX, y: touch.clientY};\n        this.lastTouches.push(lastTouch);\n        var lts = this.lastTouches;\n        var removeLastTouch = function() {\n            var i = lts.indexOf(lastTouch);\n            if (i > -1) {\n                lts.splice(i, 1);\n            }\n        };\n        setTimeout(removeLastTouch, DEDUP_TIMEOUT);\n    }\n}\n\nfunction isSyntheticEvent(eventData) {\n    var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;\n    for (var i = 0; i < this.lastTouches.length; i++) {\n        var t = this.lastTouches[i];\n        var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);\n        if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {\n            return true;\n        }\n    }\n    return false;\n}\n\nvar PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\nvar NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;\n\n// magical touchAction value\nvar TOUCH_ACTION_COMPUTE = 'compute';\nvar TOUCH_ACTION_AUTO = 'auto';\nvar TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\nvar TOUCH_ACTION_NONE = 'none';\nvar TOUCH_ACTION_PAN_X = 'pan-x';\nvar TOUCH_ACTION_PAN_Y = 'pan-y';\nvar TOUCH_ACTION_MAP = getTouchActionProps();\n\n/**\n * Touch Action\n * sets the touchAction property or uses the js alternative\n * @param {Manager} manager\n * @param {String} value\n * @constructor\n */\nfunction TouchAction(manager, value) {\n    this.manager = manager;\n    this.set(value);\n}\n\nTouchAction.prototype = {\n    /**\n     * set the touchAction value on the element or enable the polyfill\n     * @param {String} value\n     */\n    set: function(value) {\n        // find out the touch-action by the event handlers\n        if (value == TOUCH_ACTION_COMPUTE) {\n            value = this.compute();\n        }\n\n        if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {\n            this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\n        }\n        this.actions = value.toLowerCase().trim();\n    },\n\n    /**\n     * just re-set the touchAction value\n     */\n    update: function() {\n        this.set(this.manager.options.touchAction);\n    },\n\n    /**\n     * compute the value for the touchAction property based on the recognizer's settings\n     * @returns {String} value\n     */\n    compute: function() {\n        var actions = [];\n        each(this.manager.recognizers, function(recognizer) {\n            if (boolOrFn(recognizer.options.enable, [recognizer])) {\n                actions = actions.concat(recognizer.getTouchAction());\n            }\n        });\n        return cleanTouchActions(actions.join(' '));\n    },\n\n    /**\n     * this method is called on each input cycle and provides the preventing of the browser behavior\n     * @param {Object} input\n     */\n    preventDefaults: function(input) {\n        var srcEvent = input.srcEvent;\n        var direction = input.offsetDirection;\n\n        // if the touch action did prevented once this session\n        if (this.manager.session.prevented) {\n            srcEvent.preventDefault();\n            return;\n        }\n\n        var actions = this.actions;\n        var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];\n        var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];\n        var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];\n\n        if (hasNone) {\n            //do not prevent defaults if this is a tap gesture\n\n            var isTapPointer = input.pointers.length === 1;\n            var isTapMovement = input.distance < 2;\n            var isTapTouchTime = input.deltaTime < 250;\n\n            if (isTapPointer && isTapMovement && isTapTouchTime) {\n                return;\n            }\n        }\n\n        if (hasPanX && hasPanY) {\n            // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent\n            return;\n        }\n\n        if (hasNone ||\n            (hasPanY && direction & DIRECTION_HORIZONTAL) ||\n            (hasPanX && direction & DIRECTION_VERTICAL)) {\n            return this.preventSrc(srcEvent);\n        }\n    },\n\n    /**\n     * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\n     * @param {Object} srcEvent\n     */\n    preventSrc: function(srcEvent) {\n        this.manager.session.prevented = true;\n        srcEvent.preventDefault();\n    }\n};\n\n/**\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\n * @param {String} actions\n * @returns {*}\n */\nfunction cleanTouchActions(actions) {\n    // none\n    if (inStr(actions, TOUCH_ACTION_NONE)) {\n        return TOUCH_ACTION_NONE;\n    }\n\n    var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\n    var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);\n\n    // if both pan-x and pan-y are set (different recognizers\n    // for different directions, e.g. horizontal pan but vertical swipe?)\n    // we need none (as otherwise with pan-x pan-y combined none of these\n    // recognizers will work, since the browser would handle all panning\n    if (hasPanX && hasPanY) {\n        return TOUCH_ACTION_NONE;\n    }\n\n    // pan-x OR pan-y\n    if (hasPanX || hasPanY) {\n        return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\n    }\n\n    // manipulation\n    if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\n        return TOUCH_ACTION_MANIPULATION;\n    }\n\n    return TOUCH_ACTION_AUTO;\n}\n\nfunction getTouchActionProps() {\n    if (!NATIVE_TOUCH_ACTION) {\n        return false;\n    }\n    var touchMap = {};\n    var cssSupports = window.CSS && window.CSS.supports;\n    ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {\n\n        // If css.supports is not supported but there is native touch-action assume it supports\n        // all values. This is the case for IE 10 and 11.\n        touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;\n    });\n    return touchMap;\n}\n\n/**\n * Recognizer flow explained; *\n * All recognizers have the initial state of POSSIBLE when a input session starts.\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\n *\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\n * which determines with state it should be.\n *\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\n * POSSIBLE to give it another change on the next cycle.\n *\n *               Possible\n *                  |\n *            +-----+---------------+\n *            |                     |\n *      +-----+-----+               |\n *      |           |               |\n *   Failed      Cancelled          |\n *                          +-------+------+\n *                          |              |\n *                      Recognized       Began\n *                                         |\n *                                      Changed\n *                                         |\n *                                  Ended/Recognized\n */\nvar STATE_POSSIBLE = 1;\nvar STATE_BEGAN = 2;\nvar STATE_CHANGED = 4;\nvar STATE_ENDED = 8;\nvar STATE_RECOGNIZED = STATE_ENDED;\nvar STATE_CANCELLED = 16;\nvar STATE_FAILED = 32;\n\n/**\n * Recognizer\n * Every recognizer needs to extend from this class.\n * @constructor\n * @param {Object} options\n */\nfunction Recognizer(options) {\n    this.options = assign({}, this.defaults, options || {});\n\n    this.id = uniqueId();\n\n    this.manager = null;\n\n    // default is enable true\n    this.options.enable = ifUndefined(this.options.enable, true);\n\n    this.state = STATE_POSSIBLE;\n\n    this.simultaneous = {};\n    this.requireFail = [];\n}\n\nRecognizer.prototype = {\n    /**\n     * @virtual\n     * @type {Object}\n     */\n    defaults: {},\n\n    /**\n     * set options\n     * @param {Object} options\n     * @return {Recognizer}\n     */\n    set: function(options) {\n        assign(this.options, options);\n\n        // also update the touchAction, in case something changed about the directions/enabled state\n        this.manager && this.manager.touchAction.update();\n        return this;\n    },\n\n    /**\n     * recognize simultaneous with an other recognizer.\n     * @param {Recognizer} otherRecognizer\n     * @returns {Recognizer} this\n     */\n    recognizeWith: function(otherRecognizer) {\n        if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\n            return this;\n        }\n\n        var simultaneous = this.simultaneous;\n        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n        if (!simultaneous[otherRecognizer.id]) {\n            simultaneous[otherRecognizer.id] = otherRecognizer;\n            otherRecognizer.recognizeWith(this);\n        }\n        return this;\n    },\n\n    /**\n     * drop the simultaneous link. it doesnt remove the link on the other recognizer.\n     * @param {Recognizer} otherRecognizer\n     * @returns {Recognizer} this\n     */\n    dropRecognizeWith: function(otherRecognizer) {\n        if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\n            return this;\n        }\n\n        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n        delete this.simultaneous[otherRecognizer.id];\n        return this;\n    },\n\n    /**\n     * recognizer can only run when an other is failing\n     * @param {Recognizer} otherRecognizer\n     * @returns {Recognizer} this\n     */\n    requireFailure: function(otherRecognizer) {\n        if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\n            return this;\n        }\n\n        var requireFail = this.requireFail;\n        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n        if (inArray(requireFail, otherRecognizer) === -1) {\n            requireFail.push(otherRecognizer);\n            otherRecognizer.requireFailure(this);\n        }\n        return this;\n    },\n\n    /**\n     * drop the requireFailure link. it does not remove the link on the other recognizer.\n     * @param {Recognizer} otherRecognizer\n     * @returns {Recognizer} this\n     */\n    dropRequireFailure: function(otherRecognizer) {\n        if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\n            return this;\n        }\n\n        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n        var index = inArray(this.requireFail, otherRecognizer);\n        if (index > -1) {\n            this.requireFail.splice(index, 1);\n        }\n        return this;\n    },\n\n    /**\n     * has require failures boolean\n     * @returns {boolean}\n     */\n    hasRequireFailures: function() {\n        return this.requireFail.length > 0;\n    },\n\n    /**\n     * if the recognizer can recognize simultaneous with an other recognizer\n     * @param {Recognizer} otherRecognizer\n     * @returns {Boolean}\n     */\n    canRecognizeWith: function(otherRecognizer) {\n        return !!this.simultaneous[otherRecognizer.id];\n    },\n\n    /**\n     * You should use `tryEmit` instead of `emit` directly to check\n     * that all the needed recognizers has failed before emitting.\n     * @param {Object} input\n     */\n    emit: function(input) {\n        var self = this;\n        var state = this.state;\n\n        function emit(event) {\n            self.manager.emit(event, input);\n        }\n\n        // 'panstart' and 'panmove'\n        if (state < STATE_ENDED) {\n            emit(self.options.event + stateStr(state));\n        }\n\n        emit(self.options.event); // simple 'eventName' events\n\n        if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)\n            emit(input.additionalEvent);\n        }\n\n        // panend and pancancel\n        if (state >= STATE_ENDED) {\n            emit(self.options.event + stateStr(state));\n        }\n    },\n\n    /**\n     * Check that all the require failure recognizers has failed,\n     * if true, it emits a gesture event,\n     * otherwise, setup the state to FAILED.\n     * @param {Object} input\n     */\n    tryEmit: function(input) {\n        if (this.canEmit()) {\n            return this.emit(input);\n        }\n        // it's failing anyway\n        this.state = STATE_FAILED;\n    },\n\n    /**\n     * can we emit?\n     * @returns {boolean}\n     */\n    canEmit: function() {\n        var i = 0;\n        while (i < this.requireFail.length) {\n            if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\n                return false;\n            }\n            i++;\n        }\n        return true;\n    },\n\n    /**\n     * update the recognizer\n     * @param {Object} inputData\n     */\n    recognize: function(inputData) {\n        // make a new copy of the inputData\n        // so we can change the inputData without messing up the other recognizers\n        var inputDataClone = assign({}, inputData);\n\n        // is is enabled and allow recognizing?\n        if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\n            this.reset();\n            this.state = STATE_FAILED;\n            return;\n        }\n\n        // reset when we've reached the end\n        if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\n            this.state = STATE_POSSIBLE;\n        }\n\n        this.state = this.process(inputDataClone);\n\n        // the recognizer has recognized a gesture\n        // so trigger an event\n        if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\n            this.tryEmit(inputDataClone);\n        }\n    },\n\n    /**\n     * return the state of the recognizer\n     * the actual recognizing happens in this method\n     * @virtual\n     * @param {Object} inputData\n     * @returns {Const} STATE\n     */\n    process: function(inputData) { }, // jshint ignore:line\n\n    /**\n     * return the preferred touch-action\n     * @virtual\n     * @returns {Array}\n     */\n    getTouchAction: function() { },\n\n    /**\n     * called when the gesture isn't allowed to recognize\n     * like when another is being recognized or it is disabled\n     * @virtual\n     */\n    reset: function() { }\n};\n\n/**\n * get a usable string, used as event postfix\n * @param {Const} state\n * @returns {String} state\n */\nfunction stateStr(state) {\n    if (state & STATE_CANCELLED) {\n        return 'cancel';\n    } else if (state & STATE_ENDED) {\n        return 'end';\n    } else if (state & STATE_CHANGED) {\n        return 'move';\n    } else if (state & STATE_BEGAN) {\n        return 'start';\n    }\n    return '';\n}\n\n/**\n * direction cons to string\n * @param {Const} direction\n * @returns {String}\n */\nfunction directionStr(direction) {\n    if (direction == DIRECTION_DOWN) {\n        return 'down';\n    } else if (direction == DIRECTION_UP) {\n        return 'up';\n    } else if (direction == DIRECTION_LEFT) {\n        return 'left';\n    } else if (direction == DIRECTION_RIGHT) {\n        return 'right';\n    }\n    return '';\n}\n\n/**\n * get a recognizer by name if it is bound to a manager\n * @param {Recognizer|String} otherRecognizer\n * @param {Recognizer} recognizer\n * @returns {Recognizer}\n */\nfunction getRecognizerByNameIfManager(otherRecognizer, recognizer) {\n    var manager = recognizer.manager;\n    if (manager) {\n        return manager.get(otherRecognizer);\n    }\n    return otherRecognizer;\n}\n\n/**\n * This recognizer is just used as a base for the simple attribute recognizers.\n * @constructor\n * @extends Recognizer\n */\nfunction AttrRecognizer() {\n    Recognizer.apply(this, arguments);\n}\n\ninherit(AttrRecognizer, Recognizer, {\n    /**\n     * @namespace\n     * @memberof AttrRecognizer\n     */\n    defaults: {\n        /**\n         * @type {Number}\n         * @default 1\n         */\n        pointers: 1\n    },\n\n    /**\n     * Used to check if it the recognizer receives valid input, like input.distance > 10.\n     * @memberof AttrRecognizer\n     * @param {Object} input\n     * @returns {Boolean} recognized\n     */\n    attrTest: function(input) {\n        var optionPointers = this.options.pointers;\n        return optionPointers === 0 || input.pointers.length === optionPointers;\n    },\n\n    /**\n     * Process the input and return the state for the recognizer\n     * @memberof AttrRecognizer\n     * @param {Object} input\n     * @returns {*} State\n     */\n    process: function(input) {\n        var state = this.state;\n        var eventType = input.eventType;\n\n        var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\n        var isValid = this.attrTest(input);\n\n        // on cancel input and we've recognized before, return STATE_CANCELLED\n        if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\n            return state | STATE_CANCELLED;\n        } else if (isRecognized || isValid) {\n            if (eventType & INPUT_END) {\n                return state | STATE_ENDED;\n            } else if (!(state & STATE_BEGAN)) {\n                return STATE_BEGAN;\n            }\n            return state | STATE_CHANGED;\n        }\n        return STATE_FAILED;\n    }\n});\n\n/**\n * Pan\n * Recognized when the pointer is down and moved in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PanRecognizer() {\n    AttrRecognizer.apply(this, arguments);\n\n    this.pX = null;\n    this.pY = null;\n}\n\ninherit(PanRecognizer, AttrRecognizer, {\n    /**\n     * @namespace\n     * @memberof PanRecognizer\n     */\n    defaults: {\n        event: 'pan',\n        threshold: 10,\n        pointers: 1,\n        direction: DIRECTION_ALL\n    },\n\n    getTouchAction: function() {\n        var direction = this.options.direction;\n        var actions = [];\n        if (direction & DIRECTION_HORIZONTAL) {\n            actions.push(TOUCH_ACTION_PAN_Y);\n        }\n        if (direction & DIRECTION_VERTICAL) {\n            actions.push(TOUCH_ACTION_PAN_X);\n        }\n        return actions;\n    },\n\n    directionTest: function(input) {\n        var options = this.options;\n        var hasMoved = true;\n        var distance = input.distance;\n        var direction = input.direction;\n        var x = input.deltaX;\n        var y = input.deltaY;\n\n        // lock to axis?\n        if (!(direction & options.direction)) {\n            if (options.direction & DIRECTION_HORIZONTAL) {\n                direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;\n                hasMoved = x != this.pX;\n                distance = Math.abs(input.deltaX);\n            } else {\n                direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;\n                hasMoved = y != this.pY;\n                distance = Math.abs(input.deltaY);\n            }\n        }\n        input.direction = direction;\n        return hasMoved && distance > options.threshold && direction & options.direction;\n    },\n\n    attrTest: function(input) {\n        return AttrRecognizer.prototype.attrTest.call(this, input) &&\n            (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));\n    },\n\n    emit: function(input) {\n\n        this.pX = input.deltaX;\n        this.pY = input.deltaY;\n\n        var direction = directionStr(input.direction);\n\n        if (direction) {\n            input.additionalEvent = this.options.event + direction;\n        }\n        this._super.emit.call(this, input);\n    }\n});\n\n/**\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PinchRecognizer() {\n    AttrRecognizer.apply(this, arguments);\n}\n\ninherit(PinchRecognizer, AttrRecognizer, {\n    /**\n     * @namespace\n     * @memberof PinchRecognizer\n     */\n    defaults: {\n        event: 'pinch',\n        threshold: 0,\n        pointers: 2\n    },\n\n    getTouchAction: function() {\n        return [TOUCH_ACTION_NONE];\n    },\n\n    attrTest: function(input) {\n        return this._super.attrTest.call(this, input) &&\n            (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\n    },\n\n    emit: function(input) {\n        if (input.scale !== 1) {\n            var inOut = input.scale < 1 ? 'in' : 'out';\n            input.additionalEvent = this.options.event + inOut;\n        }\n        this._super.emit.call(this, input);\n    }\n});\n\n/**\n * Press\n * Recognized when the pointer is down for x ms without any movement.\n * @constructor\n * @extends Recognizer\n */\nfunction PressRecognizer() {\n    Recognizer.apply(this, arguments);\n\n    this._timer = null;\n    this._input = null;\n}\n\ninherit(PressRecognizer, Recognizer, {\n    /**\n     * @namespace\n     * @memberof PressRecognizer\n     */\n    defaults: {\n        event: 'press',\n        pointers: 1,\n        time: 251, // minimal time of the pointer to be pressed\n        threshold: 9 // a minimal movement is ok, but keep it low\n    },\n\n    getTouchAction: function() {\n        return [TOUCH_ACTION_AUTO];\n    },\n\n    process: function(input) {\n        var options = this.options;\n        var validPointers = input.pointers.length === options.pointers;\n        var validMovement = input.distance < options.threshold;\n        var validTime = input.deltaTime > options.time;\n\n        this._input = input;\n\n        // we only allow little movement\n        // and we've reached an end event, so a tap is possible\n        if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {\n            this.reset();\n        } else if (input.eventType & INPUT_START) {\n            this.reset();\n            this._timer = setTimeoutContext(function() {\n                this.state = STATE_RECOGNIZED;\n                this.tryEmit();\n            }, options.time, this);\n        } else if (input.eventType & INPUT_END) {\n            return STATE_RECOGNIZED;\n        }\n        return STATE_FAILED;\n    },\n\n    reset: function() {\n        clearTimeout(this._timer);\n    },\n\n    emit: function(input) {\n        if (this.state !== STATE_RECOGNIZED) {\n            return;\n        }\n\n        if (input && (input.eventType & INPUT_END)) {\n            this.manager.emit(this.options.event + 'up', input);\n        } else {\n            this._input.timeStamp = now();\n            this.manager.emit(this.options.event, this._input);\n        }\n    }\n});\n\n/**\n * Rotate\n * Recognized when two or more pointer are moving in a circular motion.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction RotateRecognizer() {\n    AttrRecognizer.apply(this, arguments);\n}\n\ninherit(RotateRecognizer, AttrRecognizer, {\n    /**\n     * @namespace\n     * @memberof RotateRecognizer\n     */\n    defaults: {\n        event: 'rotate',\n        threshold: 0,\n        pointers: 2\n    },\n\n    getTouchAction: function() {\n        return [TOUCH_ACTION_NONE];\n    },\n\n    attrTest: function(input) {\n        return this._super.attrTest.call(this, input) &&\n            (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\n    }\n});\n\n/**\n * Swipe\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction SwipeRecognizer() {\n    AttrRecognizer.apply(this, arguments);\n}\n\ninherit(SwipeRecognizer, AttrRecognizer, {\n    /**\n     * @namespace\n     * @memberof SwipeRecognizer\n     */\n    defaults: {\n        event: 'swipe',\n        threshold: 10,\n        velocity: 0.3,\n        direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\n        pointers: 1\n    },\n\n    getTouchAction: function() {\n        return PanRecognizer.prototype.getTouchAction.call(this);\n    },\n\n    attrTest: function(input) {\n        var direction = this.options.direction;\n        var velocity;\n\n        if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\n            velocity = input.overallVelocity;\n        } else if (direction & DIRECTION_HORIZONTAL) {\n            velocity = input.overallVelocityX;\n        } else if (direction & DIRECTION_VERTICAL) {\n            velocity = input.overallVelocityY;\n        }\n\n        return this._super.attrTest.call(this, input) &&\n            direction & input.offsetDirection &&\n            input.distance > this.options.threshold &&\n            input.maxPointers == this.options.pointers &&\n            abs(velocity) > this.options.velocity && input.eventType & INPUT_END;\n    },\n\n    emit: function(input) {\n        var direction = directionStr(input.offsetDirection);\n        if (direction) {\n            this.manager.emit(this.options.event + direction, input);\n        }\n\n        this.manager.emit(this.options.event, input);\n    }\n});\n\n/**\n * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\n * a single tap.\n *\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\n * multi-taps being recognized.\n * @constructor\n * @extends Recognizer\n */\nfunction TapRecognizer() {\n    Recognizer.apply(this, arguments);\n\n    // previous time and center,\n    // used for tap counting\n    this.pTime = false;\n    this.pCenter = false;\n\n    this._timer = null;\n    this._input = null;\n    this.count = 0;\n}\n\ninherit(TapRecognizer, Recognizer, {\n    /**\n     * @namespace\n     * @memberof PinchRecognizer\n     */\n    defaults: {\n        event: 'tap',\n        pointers: 1,\n        taps: 1,\n        interval: 300, // max time between the multi-tap taps\n        time: 250, // max time of the pointer to be down (like finger on the screen)\n        threshold: 9, // a minimal movement is ok, but keep it low\n        posThreshold: 10 // a multi-tap can be a bit off the initial position\n    },\n\n    getTouchAction: function() {\n        return [TOUCH_ACTION_MANIPULATION];\n    },\n\n    process: function(input) {\n        var options = this.options;\n\n        var validPointers = input.pointers.length === options.pointers;\n        var validMovement = input.distance < options.threshold;\n        var validTouchTime = input.deltaTime < options.time;\n\n        this.reset();\n\n        if ((input.eventType & INPUT_START) && (this.count === 0)) {\n            return this.failTimeout();\n        }\n\n        // we only allow little movement\n        // and we've reached an end event, so a tap is possible\n        if (validMovement && validTouchTime && validPointers) {\n            if (input.eventType != INPUT_END) {\n                return this.failTimeout();\n            }\n\n            var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;\n            var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\n\n            this.pTime = input.timeStamp;\n            this.pCenter = input.center;\n\n            if (!validMultiTap || !validInterval) {\n                this.count = 1;\n            } else {\n                this.count += 1;\n            }\n\n            this._input = input;\n\n            // if tap count matches we have recognized it,\n            // else it has began recognizing...\n            var tapCount = this.count % options.taps;\n            if (tapCount === 0) {\n                // no failing requirements, immediately trigger the tap event\n                // or wait as long as the multitap interval to trigger\n                if (!this.hasRequireFailures()) {\n                    return STATE_RECOGNIZED;\n                } else {\n                    this._timer = setTimeoutContext(function() {\n                        this.state = STATE_RECOGNIZED;\n                        this.tryEmit();\n                    }, options.interval, this);\n                    return STATE_BEGAN;\n                }\n            }\n        }\n        return STATE_FAILED;\n    },\n\n    failTimeout: function() {\n        this._timer = setTimeoutContext(function() {\n            this.state = STATE_FAILED;\n        }, this.options.interval, this);\n        return STATE_FAILED;\n    },\n\n    reset: function() {\n        clearTimeout(this._timer);\n    },\n\n    emit: function() {\n        if (this.state == STATE_RECOGNIZED) {\n            this._input.tapCount = this.count;\n            this.manager.emit(this.options.event, this._input);\n        }\n    }\n});\n\n/**\n * Simple way to create a manager with a default set of recognizers.\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Hammer(element, options) {\n    options = options || {};\n    options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);\n    return new Manager(element, options);\n}\n\n/**\n * @const {string}\n */\nHammer.VERSION = '2.0.7';\n\n/**\n * default settings\n * @namespace\n */\nHammer.defaults = {\n    /**\n     * set if DOM events are being triggered.\n     * But this is slower and unused by simple implementations, so disabled by default.\n     * @type {Boolean}\n     * @default false\n     */\n    domEvents: false,\n\n    /**\n     * The value for the touchAction property/fallback.\n     * When set to `compute` it will magically set the correct value based on the added recognizers.\n     * @type {String}\n     * @default compute\n     */\n    touchAction: TOUCH_ACTION_COMPUTE,\n\n    /**\n     * @type {Boolean}\n     * @default true\n     */\n    enable: true,\n\n    /**\n     * EXPERIMENTAL FEATURE -- can be removed/changed\n     * Change the parent input target element.\n     * If Null, then it is being set the to main element.\n     * @type {Null|EventTarget}\n     * @default null\n     */\n    inputTarget: null,\n\n    /**\n     * force an input class\n     * @type {Null|Function}\n     * @default null\n     */\n    inputClass: null,\n\n    /**\n     * Default recognizer setup when calling `Hammer()`\n     * When creating a new Manager these will be skipped.\n     * @type {Array}\n     */\n    preset: [\n        // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]\n        [RotateRecognizer, {enable: false}],\n        [PinchRecognizer, {enable: false}, ['rotate']],\n        [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],\n        [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],\n        [TapRecognizer],\n        [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],\n        [PressRecognizer]\n    ],\n\n    /**\n     * Some CSS properties can be used to improve the working of Hammer.\n     * Add them to this method and they will be set when creating a new Manager.\n     * @namespace\n     */\n    cssProps: {\n        /**\n         * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\n         * @type {String}\n         * @default 'none'\n         */\n        userSelect: 'none',\n\n        /**\n         * Disable the Windows Phone grippers when pressing an element.\n         * @type {String}\n         * @default 'none'\n         */\n        touchSelect: 'none',\n\n        /**\n         * Disables the default callout shown when you touch and hold a touch target.\n         * On iOS, when you touch and hold a touch target such as a link, Safari displays\n         * a callout containing information about the link. This property allows you to disable that callout.\n         * @type {String}\n         * @default 'none'\n         */\n        touchCallout: 'none',\n\n        /**\n         * Specifies whether zooming is enabled. Used by IE10>\n         * @type {String}\n         * @default 'none'\n         */\n        contentZooming: 'none',\n\n        /**\n         * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\n         * @type {String}\n         * @default 'none'\n         */\n        userDrag: 'none',\n\n        /**\n         * Overrides the highlight color shown when the user taps a link or a JavaScript\n         * clickable element in iOS. This property obeys the alpha value, if specified.\n         * @type {String}\n         * @default 'rgba(0,0,0,0)'\n         */\n        tapHighlightColor: 'rgba(0,0,0,0)'\n    }\n};\n\nvar STOP = 1;\nvar FORCED_STOP = 2;\n\n/**\n * Manager\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Manager(element, options) {\n    this.options = assign({}, Hammer.defaults, options || {});\n\n    this.options.inputTarget = this.options.inputTarget || element;\n\n    this.handlers = {};\n    this.session = {};\n    this.recognizers = [];\n    this.oldCssProps = {};\n\n    this.element = element;\n    this.input = createInputInstance(this);\n    this.touchAction = new TouchAction(this, this.options.touchAction);\n\n    toggleCssProps(this, true);\n\n    each(this.options.recognizers, function(item) {\n        var recognizer = this.add(new (item[0])(item[1]));\n        item[2] && recognizer.recognizeWith(item[2]);\n        item[3] && recognizer.requireFailure(item[3]);\n    }, this);\n}\n\nManager.prototype = {\n    /**\n     * set options\n     * @param {Object} options\n     * @returns {Manager}\n     */\n    set: function(options) {\n        assign(this.options, options);\n\n        // Options that need a little more setup\n        if (options.touchAction) {\n            this.touchAction.update();\n        }\n        if (options.inputTarget) {\n            // Clean up existing event listeners and reinitialize\n            this.input.destroy();\n            this.input.target = options.inputTarget;\n            this.input.init();\n        }\n        return this;\n    },\n\n    /**\n     * stop recognizing for this session.\n     * This session will be discarded, when a new [input]start event is fired.\n     * When forced, the recognizer cycle is stopped immediately.\n     * @param {Boolean} [force]\n     */\n    stop: function(force) {\n        this.session.stopped = force ? FORCED_STOP : STOP;\n    },\n\n    /**\n     * run the recognizers!\n     * called by the inputHandler function on every movement of the pointers (touches)\n     * it walks through all the recognizers and tries to detect the gesture that is being made\n     * @param {Object} inputData\n     */\n    recognize: function(inputData) {\n        var session = this.session;\n        if (session.stopped) {\n            return;\n        }\n\n        // run the touch-action polyfill\n        this.touchAction.preventDefaults(inputData);\n\n        var recognizer;\n        var recognizers = this.recognizers;\n\n        // this holds the recognizer that is being recognized.\n        // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\n        // if no recognizer is detecting a thing, it is set to `null`\n        var curRecognizer = session.curRecognizer;\n\n        // reset when the last recognizer is recognized\n        // or when we're in a new session\n        if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {\n            curRecognizer = session.curRecognizer = null;\n        }\n\n        var i = 0;\n        while (i < recognizers.length) {\n            recognizer = recognizers[i];\n\n            // find out if we are allowed try to recognize the input for this one.\n            // 1.   allow if the session is NOT forced stopped (see the .stop() method)\n            // 2.   allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\n            //      that is being recognized.\n            // 3.   allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\n            //      this can be setup with the `recognizeWith()` method on the recognizer.\n            if (session.stopped !== FORCED_STOP && ( // 1\n                    !curRecognizer || recognizer == curRecognizer || // 2\n                    recognizer.canRecognizeWith(curRecognizer))) { // 3\n                recognizer.recognize(inputData);\n            } else {\n                recognizer.reset();\n            }\n\n            // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\n            // current active recognizer. but only if we don't already have an active recognizer\n            if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\n                curRecognizer = session.curRecognizer = recognizer;\n            }\n            i++;\n        }\n    },\n\n    /**\n     * get a recognizer by its event name.\n     * @param {Recognizer|String} recognizer\n     * @returns {Recognizer|Null}\n     */\n    get: function(recognizer) {\n        if (recognizer instanceof Recognizer) {\n            return recognizer;\n        }\n\n        var recognizers = this.recognizers;\n        for (var i = 0; i < recognizers.length; i++) {\n            if (recognizers[i].options.event == recognizer) {\n                return recognizers[i];\n            }\n        }\n        return null;\n    },\n\n    /**\n     * add a recognizer to the manager\n     * existing recognizers with the same event name will be removed\n     * @param {Recognizer} recognizer\n     * @returns {Recognizer|Manager}\n     */\n    add: function(recognizer) {\n        if (invokeArrayArg(recognizer, 'add', this)) {\n            return this;\n        }\n\n        // remove existing\n        var existing = this.get(recognizer.options.event);\n        if (existing) {\n            this.remove(existing);\n        }\n\n        this.recognizers.push(recognizer);\n        recognizer.manager = this;\n\n        this.touchAction.update();\n        return recognizer;\n    },\n\n    /**\n     * remove a recognizer by name or instance\n     * @param {Recognizer|String} recognizer\n     * @returns {Manager}\n     */\n    remove: function(recognizer) {\n        if (invokeArrayArg(recognizer, 'remove', this)) {\n            return this;\n        }\n\n        recognizer = this.get(recognizer);\n\n        // let's make sure this recognizer exists\n        if (recognizer) {\n            var recognizers = this.recognizers;\n            var index = inArray(recognizers, recognizer);\n\n            if (index !== -1) {\n                recognizers.splice(index, 1);\n                this.touchAction.update();\n            }\n        }\n\n        return this;\n    },\n\n    /**\n     * bind event\n     * @param {String} events\n     * @param {Function} handler\n     * @returns {EventEmitter} this\n     */\n    on: function(events, handler) {\n        if (events === undefined) {\n            return;\n        }\n        if (handler === undefined) {\n            return;\n        }\n\n        var handlers = this.handlers;\n        each(splitStr(events), function(event) {\n            handlers[event] = handlers[event] || [];\n            handlers[event].push(handler);\n        });\n        return this;\n    },\n\n    /**\n     * unbind event, leave emit blank to remove all handlers\n     * @param {String} events\n     * @param {Function} [handler]\n     * @returns {EventEmitter} this\n     */\n    off: function(events, handler) {\n        if (events === undefined) {\n            return;\n        }\n\n        var handlers = this.handlers;\n        each(splitStr(events), function(event) {\n            if (!handler) {\n                delete handlers[event];\n            } else {\n                handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);\n            }\n        });\n        return this;\n    },\n\n    /**\n     * emit event to the listeners\n     * @param {String} event\n     * @param {Object} data\n     */\n    emit: function(event, data) {\n        // we also want to trigger dom events\n        if (this.options.domEvents) {\n            triggerDomEvent(event, data);\n        }\n\n        // no handlers, so skip it all\n        var handlers = this.handlers[event] && this.handlers[event].slice();\n        if (!handlers || !handlers.length) {\n            return;\n        }\n\n        data.type = event;\n        data.preventDefault = function() {\n            data.srcEvent.preventDefault();\n        };\n\n        var i = 0;\n        while (i < handlers.length) {\n            handlers[i](data);\n            i++;\n        }\n    },\n\n    /**\n     * destroy the manager and unbinds all events\n     * it doesn't unbind dom events, that is the user own responsibility\n     */\n    destroy: function() {\n        this.element && toggleCssProps(this, false);\n\n        this.handlers = {};\n        this.session = {};\n        this.input.destroy();\n        this.element = null;\n    }\n};\n\n/**\n * add/remove the css properties as defined in manager.options.cssProps\n * @param {Manager} manager\n * @param {Boolean} add\n */\nfunction toggleCssProps(manager, add) {\n    var element = manager.element;\n    if (!element.style) {\n        return;\n    }\n    var prop;\n    each(manager.options.cssProps, function(value, name) {\n        prop = prefixed(element.style, name);\n        if (add) {\n            manager.oldCssProps[prop] = element.style[prop];\n            element.style[prop] = value;\n        } else {\n            element.style[prop] = manager.oldCssProps[prop] || '';\n        }\n    });\n    if (!add) {\n        manager.oldCssProps = {};\n    }\n}\n\n/**\n * trigger dom event\n * @param {String} event\n * @param {Object} data\n */\nfunction triggerDomEvent(event, data) {\n    var gestureEvent = document.createEvent('Event');\n    gestureEvent.initEvent(event, true, true);\n    gestureEvent.gesture = data;\n    data.target.dispatchEvent(gestureEvent);\n}\n\nassign(Hammer, {\n    INPUT_START: INPUT_START,\n    INPUT_MOVE: INPUT_MOVE,\n    INPUT_END: INPUT_END,\n    INPUT_CANCEL: INPUT_CANCEL,\n\n    STATE_POSSIBLE: STATE_POSSIBLE,\n    STATE_BEGAN: STATE_BEGAN,\n    STATE_CHANGED: STATE_CHANGED,\n    STATE_ENDED: STATE_ENDED,\n    STATE_RECOGNIZED: STATE_RECOGNIZED,\n    STATE_CANCELLED: STATE_CANCELLED,\n    STATE_FAILED: STATE_FAILED,\n\n    DIRECTION_NONE: DIRECTION_NONE,\n    DIRECTION_LEFT: DIRECTION_LEFT,\n    DIRECTION_RIGHT: DIRECTION_RIGHT,\n    DIRECTION_UP: DIRECTION_UP,\n    DIRECTION_DOWN: DIRECTION_DOWN,\n    DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,\n    DIRECTION_VERTICAL: DIRECTION_VERTICAL,\n    DIRECTION_ALL: DIRECTION_ALL,\n\n    Manager: Manager,\n    Input: Input,\n    TouchAction: TouchAction,\n\n    TouchInput: TouchInput,\n    MouseInput: MouseInput,\n    PointerEventInput: PointerEventInput,\n    TouchMouseInput: TouchMouseInput,\n    SingleTouchInput: SingleTouchInput,\n\n    Recognizer: Recognizer,\n    AttrRecognizer: AttrRecognizer,\n    Tap: TapRecognizer,\n    Pan: PanRecognizer,\n    Swipe: SwipeRecognizer,\n    Pinch: PinchRecognizer,\n    Rotate: RotateRecognizer,\n    Press: PressRecognizer,\n\n    on: addEventListeners,\n    off: removeEventListeners,\n    each: each,\n    merge: merge,\n    extend: extend,\n    assign: assign,\n    inherit: inherit,\n    bindFn: bindFn,\n    prefixed: prefixed\n});\n\n// this prevents errors when Hammer is loaded in the presence of an AMD\n//  style loader but by script tag, not by the loader.\nvar freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line\nfreeGlobal.Hammer = Hammer;\n\nif (typeof define === 'function' && define.amd) {\n    define(function() {\n        return Hammer;\n    });\n} else if (typeof module != 'undefined' && module.exports) {\n    module.exports = Hammer;\n} else {\n    window[exportName] = Hammer;\n}\n\n})(window, document, 'Hammer');\n","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerThumbnailList.vue?vue&type=style&index=0&id=1f6197a4&prod&lang=scss&scoped=true\"","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersistentNavigationDrawer.vue?vue&type=style&index=0&id=6f8bee58&prod&lang=scss&scoped=true\"","// extracted by mini-css-extract-plugin\nmodule.exports = {\"small\":\"640px\",\"medium\":\"800px\",\"large\":\"1024px\",\"xLarge\":\"1280px\"};","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * isObject({})\n * // => true\n *\n * isObject([1, 2, 3])\n * // => true\n *\n * isObject(Function)\n * // => true\n *\n * isObject(null)\n * // => false\n */\nfunction isObject(value) {\n\tconst type = typeof value\n\treturn value != null && (type === 'object' || type === 'function')\n}\n\nexport default isObject\n","import isObject from './isObject.js'\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked, or until the next browser frame is drawn. The debounced function\n * comes with a `cancel` method to cancel delayed `func` invocations and a\n * `flush` method to immediately invoke them. Provide `options` to indicate\n * whether `func` should be invoked on the leading and/or trailing edge of the\n * `wait` timeout. The `func` is invoked with the last arguments provided to the\n * debounced function. Subsequent calls to the debounced function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * If `wait` is omitted in an environment with `requestAnimationFrame`, `func`\n * invocation will be deferred until the next frame is drawn (typically about\n * 16ms).\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `debounce` and `throttle`.\n *\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0]\n *  The number of milliseconds to delay; if omitted, `requestAnimationFrame` is\n *  used (if available).\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n *  Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n *  The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n *  Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', debounce(calculateLayout, 150))\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', debounce(sendMail, 300, {\n *   'leading': true,\n *   'trailing': false\n * }))\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * const debounced = debounce(batchLog, 250, { 'maxWait': 1000 })\n * const source = new EventSource('/stream')\n * jQuery(source).on('message', debounced)\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel)\n *\n * // Check for pending invocations.\n * const status = debounced.pending() ? \"Pending...\" : \"Ready\"\n */\nfunction debounce(func, wait, options) {\n\tlet lastArgs, lastThis, maxWait, result, timerId, lastCallTime\n\n\tlet lastInvokeTime = 0\n\tlet leading = false\n\tlet maxing = false\n\tlet trailing = true\n\n\t// Bypass `requestAnimationFrame` by explicitly setting `wait=0`.\n\tconst useRAF = !wait && wait !== 0 && typeof window.requestAnimationFrame === 'function'\n\n\tif (typeof func !== 'function') {\n\t\tthrow new TypeError('Expected a function')\n\t}\n\twait = +wait || 0\n\tif (isObject(options)) {\n\t\tleading = !!options.leading\n\t\tmaxing = 'maxWait' in options\n\t\tmaxWait = maxing ? Math.max(+options.maxWait || 0, wait) : maxWait\n\t\ttrailing = 'trailing' in options ? !!options.trailing : trailing\n\t}\n\n\tfunction invokeFunc(time) {\n\t\tconst args = lastArgs\n\t\tconst thisArg = lastThis\n\n\t\tlastArgs = lastThis = undefined\n\t\tlastInvokeTime = time\n\t\tresult = func.apply(thisArg, args)\n\t\treturn result\n\t}\n\n\tfunction startTimer(pendingFunc, wait) {\n\t\tif (useRAF) {\n\t\t\treturn window.requestAnimationFrame(pendingFunc)\n\t\t}\n\t\treturn setTimeout(pendingFunc, wait)\n\t}\n\n\tfunction cancelTimer(id) {\n\t\tif (useRAF) {\n\t\t\treturn window.cancelAnimationFrame(id)\n\t\t}\n\t\tclearTimeout(id)\n\t}\n\n\tfunction leadingEdge(time) {\n\t\t// Reset any `maxWait` timer.\n\t\tlastInvokeTime = time\n\t\t// Start the timer for the trailing edge.\n\t\ttimerId = startTimer(timerExpired, wait)\n\t\t// Invoke the leading edge.\n\t\treturn leading ? invokeFunc(time) : result\n\t}\n\n\tfunction remainingWait(time) {\n\t\tconst timeSinceLastCall = time - lastCallTime\n\t\tconst timeSinceLastInvoke = time - lastInvokeTime\n\t\tconst timeWaiting = wait - timeSinceLastCall\n\n\t\treturn maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting\n\t}\n\n\tfunction shouldInvoke(time) {\n\t\tconst timeSinceLastCall = time - lastCallTime\n\t\tconst timeSinceLastInvoke = time - lastInvokeTime\n\n\t\t// Either this is the first call, activity has stopped and we're at the\n\t\t// trailing edge, the system time has gone backwards and we're treating\n\t\t// it as the trailing edge, or we've hit the `maxWait` limit.\n\t\treturn (\n\t\t\tlastCallTime === undefined ||\n\t\t\ttimeSinceLastCall >= wait ||\n\t\t\ttimeSinceLastCall < 0 ||\n\t\t\t(maxing && timeSinceLastInvoke >= maxWait)\n\t\t)\n\t}\n\n\tfunction timerExpired() {\n\t\tconst time = Date.now()\n\t\tif (shouldInvoke(time)) {\n\t\t\treturn trailingEdge(time)\n\t\t}\n\t\t// Restart the timer.\n\t\ttimerId = startTimer(timerExpired, remainingWait(time))\n\t}\n\n\tfunction trailingEdge(time) {\n\t\ttimerId = undefined\n\n\t\t// Only invoke if we have `lastArgs` which means `func` has been\n\t\t// debounced at least once.\n\t\tif (trailing && lastArgs) {\n\t\t\treturn invokeFunc(time)\n\t\t}\n\t\tlastArgs = lastThis = undefined\n\t\treturn result\n\t}\n\n\tfunction cancel() {\n\t\tif (timerId !== undefined) {\n\t\t\tcancelTimer(timerId)\n\t\t}\n\t\tlastInvokeTime = 0\n\t\tlastArgs = lastCallTime = lastThis = timerId = undefined\n\t}\n\n\tfunction flush() {\n\t\treturn timerId === undefined ? result : trailingEdge(Date.now())\n\t}\n\n\tfunction pending() {\n\t\treturn timerId !== undefined\n\t}\n\n\tfunction debounced(...args) {\n\t\tconst time = Date.now()\n\t\tconst isInvoking = shouldInvoke(time)\n\n\t\tlastArgs = args\n\t\tlastThis = this\n\t\tlastCallTime = time\n\n\t\tif (isInvoking) {\n\t\t\tif (timerId === undefined) {\n\t\t\t\treturn leadingEdge(lastCallTime)\n\t\t\t}\n\t\t\tif (maxing) {\n\t\t\t\t// Handle invocations in a tight loop.\n\t\t\t\ttimerId = startTimer(timerExpired, wait)\n\t\t\t\treturn invokeFunc(lastCallTime)\n\t\t\t}\n\t\t}\n\t\tif (timerId === undefined) {\n\t\t\ttimerId = startTimer(timerExpired, wait)\n\t\t}\n\t\treturn result\n\t}\n\tdebounced.cancel = cancel\n\tdebounced.flush = flush\n\tdebounced.pending = pending\n\treturn debounced\n}\n\nexport default debounce\n","import debounce from './debounce.js'\nimport isObject from './isObject.js'\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds (or once per browser frame). The throttled function\n * comes with a `cancel` method to cancel delayed `func` invocations and a\n * `flush` method to immediately invoke them. Provide `options` to indicate\n * whether `func` should be invoked on the leading and/or trailing edge of the\n * `wait` timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * If `wait` is omitted in an environment with `requestAnimationFrame`, `func`\n * invocation will be deferred until the next frame is drawn (typically about\n * 16ms).\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `throttle` and `debounce`.\n *\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0]\n *  The number of milliseconds to throttle invocations to; if omitted,\n *  `requestAnimationFrame` is used (if available).\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n *  Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n *  Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', throttle(updatePosition, 100))\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * const throttled = throttle(renewToken, 300000, { 'trailing': false })\n * jQuery(element).on('click', throttled)\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel)\n */\nfunction throttle(func, wait, options) {\n  let leading = true\n  let trailing = true\n\n  if (typeof func !== 'function') {\n    throw new TypeError('Expected a function')\n  }\n  if (isObject(options)) {\n    leading = 'leading' in options ? !!options.leading : leading\n    trailing = 'trailing' in options ? !!options.trailing : trailing\n  }\n  return debounce(func, wait, {\n    leading,\n    trailing,\n    maxWait: wait,\n  })\n}\n\nexport default throttle\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"persistent-drawer\"},[_c('div',{staticClass:\"persistent-drawer-main\"},[_vm._t(\"default\")],2),_c('div',{staticClass:\"persistent-drawer-footer\"},[_vm._t(\"footer\")],2)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<div class=\"persistent-drawer\">\n\t\t<div class=\"persistent-drawer-main\">\n\t\t\t<slot></slot>\n\t\t</div>\n\t\t<div class=\"persistent-drawer-footer\">\n\t\t\t<slot name=\"footer\"></slot>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'PersistentNavigationDrawer',\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.persistent-drawer {\n\tposition: relative;\n\tbackground: var(--secondary-bg);\n\tborder-right: 1px solid var(--secondary-border);\n\t& select {\n\t\twidth: 200px;\n\t\tpadding: 5px;\n\t\tmargin: 5px 10px;\n\t}\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: stretch;\n\tz-index: 2;\n\toverflow-y: overlay; // needed for consistent scrollbars in Chrome and Edge\n\toverflow-x: hidden;\n\tflex-shrink: 0;\n\tbox-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n}\n.persistent-drawer-main {\n\tflex-grow: 1;\n}\n.persistent-drawer-footer {\n\tflex-grow: 0;\n\tflex-shrink: 0;\n}\n.stop-drawer-anim .persistent-drawer {\n\ttransition: none !important;\n\tanimation: none !important;\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersistentNavigationDrawer.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersistentNavigationDrawer.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./PersistentNavigationDrawer.vue?vue&type=template&id=6f8bee58&scoped=true\"\nimport script from \"./PersistentNavigationDrawer.vue?vue&type=script&lang=js\"\nexport * from \"./PersistentNavigationDrawer.vue?vue&type=script&lang=js\"\nimport style0 from \"./PersistentNavigationDrawer.vue?vue&type=style&index=0&id=6f8bee58&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"6f8bee58\",\n  null\n  \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ViewerStudy.vue?vue&type=style&index=0&id=57701a2f&prod&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprViewerLayoutSelector.vue?vue&type=style&index=0&id=f3d3b0cc&prod&lang=scss&scoped=true\"","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MprDisabledDlg.vue?vue&type=style&index=0&id=7097eca2&prod&lang=scss&scoped=true\""],"sourceRoot":""}