-
Notifications
You must be signed in to change notification settings - Fork 0
/
21.bundle.7e0f7b2e8ec1cb450227.js
3 lines (3 loc) · 101 KB
/
21.bundle.7e0f7b2e8ec1cb450227.js
1
2
3
/*! For license information please see 21.bundle.7e0f7b2e8ec1cb450227.js.LICENSE */
(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{1066:function(e,t,n){(function(e){(function(t,n,r,o,i,a,s){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n,r=r&&r.hasOwnProperty("default")?r.default:r,o=o&&o.hasOwnProperty("default")?o.default:o;var u="default"in i?i.default:i;a=a&&a.hasOwnProperty("default")?a.default:a,s=s&&s.hasOwnProperty("default")?s.default:s;var c=r.wadors.metaData,l=c.getNumberValue,d=c.getValue;n.metaData.addProvider((function(e,t){var n=r.wadors.metaDataManager.get(t);if(n){if(void 0!==n[e]&&void 0!==n[e].Value&&n[e].Value.length)return n[e].Value[0];var o=e.replace("x","");return void 0!==n[o]&&void 0!==n[o].Value&&n[o].Value.length?n[o].Value[0]:"generalImageModule"===e?{sopInstanceUid:d(n["00080018"]),instanceNumber:l(n["00200013"]),lossyImageCompression:d(n["00282110"]),lossyImageCompressionRatio:d(n["00282112"]),lossyImageCompressionMethod:d(n["00282114"])}:"patientModule"===e?{patientName:d(n["00100010"]),patientId:d(n["00100020"]),patientSex:d(n["00100040"]),patientBirthDate:d(n["00100030"])}:"spacingBetweenSlices"===e?d(n["00180088"]):"generalStudyModule"===e?{studyDescription:d(n["00081030"]),studyDate:d(n["00080020"]),studyTime:d(n["00080030"]),accessionNumber:d(n["00080050"])}:"cineModule"===e?{frameTime:l(n["00181063"])}:void 0}})),n.metaData.addProvider((function(e,t){var n=r.wadouri,i=n.parseImageId,a=n.dataSetCacheManager,s=i(t),u=a.get(s.url);if(u){if("generalImageModule"===e)return{sopInstanceUid:u.string("x00080018"),instanceNumber:u.intString("x00200013"),lossyImageCompression:u.string("x00282110"),lossyImageCompressionRatio:u.string("x00282112"),lossyImageCompressionMethod:u.string("x00282114")};if("patientModule"===e)return{patientName:u.string("x00100010"),patientId:u.string("x00100020")};if("generalStudyModule"===e)return{studyDescription:u.string("x00081030"),studyDate:u.string("x00080020"),studyTime:u.string("x00080030")};if("cineModule"===e)return{frameTime:u.float("x00181063")};if(void 0!==u.elements[e]){var c=u.elements[e];if(!c.vr)return;return o.explicitElementToString(u,c)}}}));var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function p(e,t){return e(t={exports:{}},t.exports),t.exports}var m=p((function(e){!function(t){var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag",c=t.regeneratorRuntime;if(c)e.exports=c;else{(c=t.regeneratorRuntime=e.exports).wrap=w;var l="suspendedStart",d="suspendedYield",f="executing",h="completed",p={},m={};m[a]=function(){return this};var g=Object.getPrototypeOf,v=g&&g(g(D([])));v&&v!==r&&o.call(v,a)&&(m=v);var y=E.prototype=T.prototype=Object.create(m);x.prototype=y.constructor=E,E.constructor=x,E[u]=x.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(y),e},c.awrap=function(e){return{__await:e}},O(C.prototype),C.prototype[s]=function(){return this},c.AsyncIterator=C,c.async=function(e,t,n,r){var o=new C(w(e,t,n,r));return c.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},O(y),y[u]="Generator",y[a]=function(){return this},y.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},c.values=D,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(M),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,o){return s.type="throw",s.arg=e,t.next=r,o&&(t.method="next",t.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:D(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),p}}}function w(e,t,n,r){var o=t&&t.prototype instanceof T?t:T,i=Object.create(o.prototype),a=new _(r||[]);return i._invoke=function(e,t,n){var r=l;return function(o,i){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return P()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=b(e,t,n);if("normal"===u.type){if(r=n.done?h:d,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function b(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function T(){}function x(){}function E(){}function O(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function C(e){var t;this._invoke=function(n,r){function i(){return new Promise((function(t,i){!function t(n,r,i,a){var s=b(e[n],e,r);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&o.call(c,"__await")?Promise.resolve(c.__await).then((function(e){t("next",e,i,a)}),(function(e){t("throw",e,i,a)})):Promise.resolve(c).then((function(e){u.value=e,i(u)}),(function(e){return t("throw",e,i,a)}))}a(s.arg)}(n,r,t,i)}))}return t=t?t.then(i,i):i()}}function S(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,S(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=b(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function D(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(o.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=n,t.done=!0,t};return i.next=i}}return{next:P}}function P(){return{value:n,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())})),g=function(){return this||"object"==typeof self&&self}()||Function("return this")(),v=g.regeneratorRuntime&&Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime")>=0,y=v&&g.regeneratorRuntime;g.regeneratorRuntime=void 0;var w=m;if(v)g.regeneratorRuntime=y;else try{delete g.regeneratorRuntime}catch(e){g.regeneratorRuntime=void 0}var b=w,T=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}},x=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)},E=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")},O=function(e){return T(e)||x(e)||E()};function C(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}var S=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){C(i,r,o,a,s,"next",e)}function s(e){C(i,r,o,a,s,"throw",e)}a(void 0)}))}},k=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var _=function(e,t,n){return t&&M(e.prototype,t),n&&M(e,n),e},D=p((function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(r){return"function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?e.exports=n=function(e){return t(e)}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},n(r)}e.exports=n})),P=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},I=function(e,t){return!t||"object"!==D(t)&&"function"!=typeof t?P(e):t},L=p((function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t})),N=p((function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t})),j=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&N(e,t)},R=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},U=p((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case d:case i:case s:case a:case h:return e;default:switch(e=e&&e.$$typeof){case c:case f:case u:return e;default:return t}}case g:case m:case o:return t}}}function T(e){return b(e)===d}t.typeOf=b,t.AsyncMode=l,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=u,t.Element=r,t.ForwardRef=f,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=h,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===s||e===a||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===u||e.$$typeof===c||e.$$typeof===f||e.$$typeof===v||e.$$typeof===y||e.$$typeof===w)},t.isAsyncMode=function(e){return T(e)||b(e)===l},t.isConcurrentMode=T,t.isContextConsumer=function(e){return b(e)===c},t.isContextProvider=function(e){return b(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return b(e)===f},t.isFragment=function(e){return b(e)===i},t.isLazy=function(e){return b(e)===g},t.isMemo=function(e){return b(e)===m},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===s},t.isStrictMode=function(e){return b(e)===a},t.isSuspense=function(e){return b(e)===h}}));h(U),U.typeOf,U.AsyncMode,U.ConcurrentMode,U.ContextConsumer,U.ContextProvider,U.Element,U.ForwardRef,U.Fragment,U.Lazy,U.Memo,U.Portal,U.Profiler,U.StrictMode,U.Suspense,U.isValidElementType,U.isAsyncMode,U.isConcurrentMode,U.isContextConsumer,U.isContextProvider,U.isElement,U.isForwardRef,U.isFragment,U.isLazy,U.isMemo,U.isPortal,U.isProfiler,U.isStrictMode,U.isSuspense;var q=p((function(e,t){}));h(q),q.typeOf,q.AsyncMode,q.ConcurrentMode,q.ContextConsumer,q.ContextProvider,q.Element,q.ForwardRef,q.Fragment,q.Lazy,q.Memo,q.Portal,q.Profiler,q.StrictMode,q.Suspense,q.isValidElementType,q.isAsyncMode,q.isConcurrentMode,q.isContextConsumer,q.isContextProvider,q.isElement,q.isForwardRef,q.isFragment,q.isLazy,q.isMemo,q.isPortal,q.isProfiler,q.isStrictMode,q.isSuspense,p((function(e){e.exports=U}));Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}})()&&Object.assign;var H="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function F(e,t,n,r,o){}function z(){}function W(){}F.resetWarningCache=function(){},Function.call.bind(Object.prototype.hasOwnProperty),W.resetWarningCache=z;var A=p((function(e){e.exports=function(){function e(e,t,n,r,o,i){if(i!==H){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:W,resetWarningCache:z};return n.PropTypes=n,n}()})),V=p((function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)&&o.length){var a=n.apply(null,o);a&&e.push(a)}else if("object"===i)for(var s in o)t.call(o,s)&&o[s]&&e.push(s)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}));function Y(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}Y(".scroll {\n height: 100%;\n padding: 5px;\n position: absolute;\n right: 0;\n top: 0;\n}\n.scroll .scroll-holder {\n height: calc(100% - 20px);\n margin-top: 5px;\n position: relative;\n width: 12px;\n}\n.scroll .scroll-holder .imageSlider {\n height: 12px;\n left: 12px;\n padding: 0;\n position: absolute;\n top: 0;\n transform: rotate(90deg);\n transform-origin: top left;\n -webkit-appearance: none;\n background-color: rgba(0, 0, 0, 0);\n}\n.scroll .scroll-holder .imageSlider:focus {\n outline: none;\n}\n.scroll .scroll-holder .imageSlider::-moz-focus-outer {\n border: none;\n}\n.scroll .scroll-holder .imageSlider::-webkit-slider-runnable-track {\n background-color: rgba(0, 0, 0, 0);\n border: none;\n cursor: pointer;\n height: 5px;\n z-index: 6;\n}\n.scroll .scroll-holder .imageSlider::-moz-range-track {\n background-color: rgba(0, 0, 0, 0);\n border: none;\n cursor: pointer;\n height: 2px;\n z-index: 6;\n}\n.scroll .scroll-holder .imageSlider::-ms-track {\n animate: 0.2s;\n background: transparent;\n border: none;\n border-width: 15px 0;\n color: rgba(0, 0, 0, 0);\n cursor: pointer;\n height: 12px;\n width: 100%;\n}\n.scroll .scroll-holder .imageSlider::-ms-fill-lower {\n background: rgba(0, 0, 0, 0);\n}\n.scroll .scroll-holder .imageSlider::-ms-fill-upper {\n background: rgba(0, 0, 0, 0);\n}\n.scroll .scroll-holder .imageSlider::-webkit-slider-thumb {\n -webkit-appearance: none !important;\n background-color: #163239;\n border: none;\n border-radius: 57px;\n cursor: -webkit-grab;\n height: 12px;\n margin-top: -4px;\n width: 39px;\n}\n.scroll .scroll-holder .imageSlider::-webkit-slider-thumb:active {\n background-color: #20a5d6;\n cursor: -webkit-grabbing;\n}\n.scroll .scroll-holder .imageSlider::-moz-range-thumb {\n background-color: #163239;\n border: none;\n border-radius: 57px;\n cursor: -moz-grab;\n height: 12px;\n width: 39px;\n z-index: 7;\n}\n.scroll .scroll-holder .imageSlider::-moz-range-thumb:active {\n background-color: #20a5d6;\n cursor: -moz-grabbing;\n}\n.scroll .scroll-holder .imageSlider::-ms-thumb {\n background-color: #163239;\n border: none;\n border-radius: 57px;\n cursor: ns-resize;\n height: 12px;\n width: 39px;\n}\n.scroll .scroll-holder .imageSlider::-ms-thumb:active {\n background-color: #20a5d6;\n}\n.scroll .scroll-holder .imageSlider::-ms-tooltip {\n display: none;\n}\n@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n .imageSlider {\n left: 50px;\n }\n}\n");var G=function(e){function t(){var e,n;k(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=I(this,(e=L(t)).call.apply(e,[this].concat(o))),R(P(n),"onChange",(function(e){var t=parseInt(e.target.value,10);n.props.onInputCallback(t)})),R(P(n),"onKeyDown",(function(e){var t=40,n=38;e.which===t?e.preventDefault():e.which===n&&e.preventDefault()})),n}return j(t,e),_(t,[{key:"render",value:function(){return 0===this.props.max?null:(this.style={width:"".concat(this.props.height)},u.createElement("div",{className:"scroll"},u.createElement("div",{className:"scroll-holder"},u.createElement("input",{className:"imageSlider",style:this.style,type:"range",min:"0",max:this.props.max,step:"1",value:this.props.value,onChange:this.onChange,onKeyDown:this.onKeyDown}))))}}]),t}(i.PureComponent);function Q(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function B(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}R(G,"propTypes",{value:A.number.isRequired,max:A.number.isRequired,height:A.string.isRequired,onInputCallback:A.func.isRequired});var X=6e4;function $(e){var t=new Date(e.getTime()),n=t.getTimezoneOffset();t.setSeconds(0,0);var r=t.getTime()%X;return n*X+r}var K={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function J(e){return function(t){var n=t||{},r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var Z={date:J({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:J({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:J({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ee={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function te(e){return function(t,n){var r,o=n||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=o.width?String(o.width):i;r=e.formattingValues[a]||e.formattingValues[i]}else{var s=e.defaultWidth,u=o.width?String(o.width):e.defaultWidth;r=e.values[u]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function ne(e){return function(t,n){var r=String(t),o=n||{},i=o.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=r.match(a);if(!s)return null;var u,c=s[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth];return u="[object Array]"===Object.prototype.toString.call(l)?l.findIndex((function(e){return e.test(r)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(l,(function(e){return e.test(r)})),u=e.valueCallback?e.valueCallback(u):u,{value:u=o.valueCallback?o.valueCallback(u):u,rest:r.slice(c.length)}}}var re,oe={formatDistance:function(e,t,n){var r;return n=n||{},r="string"==typeof K[e]?K[e]:1===t?K[e].one:K[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:Z,formatRelative:function(e,t,n,r){return ee[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:te({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:te({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:te({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:te({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:te({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(re={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var n=String(e),r=t||{},o=n.match(re.matchPattern);if(!o)return null;var i=o[0],a=n.match(re.parsePattern);if(!a)return null;var s=re.valueCallback?re.valueCallback(a[0]):a[0];return{value:s=r.valueCallback?r.valueCallback(s):s,rest:n.slice(i.length)}}),era:ne({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ne({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:ne({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ne({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ne({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ie(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return function(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=Q(e).getTime(),r=B(t);return new Date(n+r)}(e,-B(t))}function ae(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var se=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return ae("yy"===t?r%100:r,t.length)},ue=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):ae(n+1,2)},ce=function(e,t){return ae(e.getUTCDate(),t.length)},le=function(e,t){return ae(e.getUTCHours()%12||12,t.length)},de=function(e,t){return ae(e.getUTCHours(),t.length)},fe=function(e,t){return ae(e.getUTCMinutes(),t.length)},he=function(e,t){return ae(e.getUTCSeconds(),t.length)},pe=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return ae(Math.floor(r*Math.pow(10,n-3)),t.length)},me=864e5;function ge(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Q(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function ve(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Q(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=ge(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=ge(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}var ye=6048e5;function we(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Q(e),n=ge(t).getTime()-function(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=ve(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),ge(n)}(t).getTime();return Math.round(n/ye)+1}function be(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=t||{},r=n.locale,o=r&&r.options&&r.options.weekStartsOn,i=null==o?0:B(o),a=null==n.weekStartsOn?i:B(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Q(e),u=s.getUTCDay(),c=(u<a?7:0)+u-a;return s.setUTCDate(s.getUTCDate()-c),s.setUTCHours(0,0,0,0),s}function Te(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Q(e,t),r=n.getUTCFullYear(),o=t||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,s=null==a?1:B(a),u=null==o.firstWeekContainsDate?s:B(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(r+1,0,u),c.setUTCHours(0,0,0,0);var l=be(c,t),d=new Date(0);d.setUTCFullYear(r,0,u),d.setUTCHours(0,0,0,0);var f=be(d,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}var xe=6048e5;function Ee(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Q(e),r=be(n,t).getTime()-function(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=t||{},r=n.locale,o=r&&r.options&&r.options.firstWeekContainsDate,i=null==o?1:B(o),a=null==n.firstWeekContainsDate?i:B(n.firstWeekContainsDate),s=Te(e,t),u=new Date(0);return u.setUTCFullYear(s,0,a),u.setUTCHours(0,0,0,0),be(u,t)}(n,t).getTime();return Math.round(r/xe)+1}var Oe="midnight",Ce="noon",Se="morning",ke="afternoon",Me="evening",_e="night",De={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return se(e,t)},Y:function(e,t,n,r){var o=Te(e,r),i=o>0?o:1-o;return"YY"===t?ae(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):ae(i,t.length)},R:function(e,t){return ae(ve(e),t.length)},u:function(e,t){return ae(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ae(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ae(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return ue(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return ae(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=Ee(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):ae(o,t.length)},I:function(e,t,n){var r=we(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):ae(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):ce(e,t)},D:function(e,t,n){var r=function(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Q(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/me)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):ae(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return ae(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return ae(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return ae(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?Ce:0===o?Oe:o/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?Me:o>=12?ke:o>=4?Se:_e,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return le(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):de(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):ae(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):ae(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):fe(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):he(e,t)},S:function(e,t){return pe(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Ie(o);case"XXXX":case"XX":return Le(o);case"XXXXX":case"XXX":default:return Le(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return Ie(o);case"xxxx":case"xx":return Le(o);case"xxxxx":case"xxx":default:return Le(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Pe(o,":");case"OOOO":default:return"GMT"+Le(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Pe(o,":");case"zzzz":default:return"GMT"+Le(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return ae(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return ae((r._originalDate||e).getTime(),t.length)}};function Pe(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=t||"";return n+String(o)+a+ae(i,2)}function Ie(e,t){return e%60==0?(e>0?"-":"+")+ae(Math.abs(e)/60,2):Le(e,t)}function Le(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+ae(Math.floor(o/60),2)+n+ae(o%60,2)}function Ne(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function je(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var Re={p:je,P:function(e,t){var n,r=e.match(/(P+)(p+)?/),o=r[1],i=r[2];if(!i)return Ne(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Ne(o,t)).replace("{{time}}",je(i,t))}},Ue=["D","DD"],qe=["YY","YYYY"];function He(e){return-1!==Ue.indexOf(e)}function Fe(e){return-1!==qe.indexOf(e)}function ze(e){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr");if("YY"===e)throw new RangeError("Use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr");if("D"===e)throw new RangeError("Use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr");if("DD"===e)throw new RangeError("Use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr")}var We=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ae=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ve=/^'([^]*?)'?$/,Ye=/''/g,Ge=/[a-zA-Z]/;function Qe(e,t,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=String(t),o=n||{},i=o.locale||oe,a=i.options&&i.options.firstWeekContainsDate,s=null==a?1:B(a),u=null==o.firstWeekContainsDate?s:B(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=i.options&&i.options.weekStartsOn,l=null==c?0:B(c),d=null==o.weekStartsOn?l:B(o.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!i.localize)throw new RangeError("locale must contain localize property");if(!i.formatLong)throw new RangeError("locale must contain formatLong property");var f=Q(e);if(!function(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Q(e);return!isNaN(t)}(f))throw new RangeError("Invalid time value");var h=ie(f,$(f)),p={firstWeekContainsDate:u,weekStartsOn:d,locale:i,_originalDate:f};return r.match(Ae).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,Re[t])(e,i.formatLong,p):e})).join("").match(We).map((function(e){if("''"===e)return"'";var t=e[0];if("'"===t)return e.match(Ve)[1].replace(Ye,"'");var n=De[t];if(n)return!o.useAdditionalWeekYearTokens&&Fe(e)&&ze(e),!o.useAdditionalDayOfYearTokens&&He(e)&&ze(e),n(h,e,i.localize,p);if(t.match(Ge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return e})).join("")}function Be(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t=t||{})t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function Xe(e,t,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=n||{},o=r.locale,i=o&&o.options&&o.options.weekStartsOn,a=null==i?0:B(i),s=null==r.weekStartsOn?a:B(r.weekStartsOn);if(!(s>=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Q(e),c=B(t),l=((c%7+7)%7<s?7:0)+c-u.getUTCDay();return u.setUTCDate(u.getUTCDate()+l),u}var $e=36e5,Ke=6e4,Je=1e3,Ze={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},et=/^([+-])(\d{2})(\d{2})?|Z/,tt=/^([+-])(\d{2})(\d{2})|Z/,nt=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,rt=/^([+-])(\d{2}):(\d{2})|Z/,ot=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function it(e,t,n){var r=t.match(e);if(!r)return null;var o=parseInt(r[0],10);return{value:n?n(o):o,rest:t.slice(r[0].length)}}function at(e,t){var n=t.match(e);if(!n)return null;if("Z"===n[0])return{value:0,rest:t.slice(1)};var r="+"===n[1]?1:-1,o=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:r*(o*$e+i*Ke+a*Je),rest:t.slice(n[0].length)}}function st(e,t){return it(Ze.anyDigitsSigned,e,t)}function ut(e,t,n){switch(e){case 1:return it(Ze.singleDigit,t,n);case 2:return it(Ze.twoDigits,t,n);case 3:return it(Ze.threeDigits,t,n);case 4:return it(Ze.fourDigits,t,n);default:return it(new RegExp("^\\d{1,"+e+"}"),t,n)}}function ct(e,t,n){switch(e){case 1:return it(Ze.singleDigitSigned,t,n);case 2:return it(Ze.twoDigitsSigned,t,n);case 3:return it(Ze.threeDigitsSigned,t,n);case 4:return it(Ze.fourDigitsSigned,t,n);default:return it(new RegExp("^-?\\d{1,"+e+"}"),t,n)}}function lt(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function dt(e,t){var n,r=t>0,o=r?t:1-t;if(o<=50)n=e||100;else{var i=o+50;n=e+100*Math.floor(i/100)-(e>=i%100?100:0)}return r?n:1-n}var ft=[31,28,31,30,31,30,31,31,30,31,30,31],ht=[31,29,31,30,31,30,31,31,30,31,30,31];function pt(e){return e%400==0||e%4==0&&e%100!=0}var mt={G:{priority:140,parse:function(e,t,n,r){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});case"GGGG":default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}},set:function(e,t,n,r){return t.era=n,e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(e,t,n,r){var o=function(e){return{year:e,isTwoDigitYear:"yy"===t}};switch(t){case"y":return ut(4,e,o);case"yo":return n.ordinalNumber(e,{unit:"year",valueCallback:o});default:return ut(t.length,e,o)}},validate:function(e,t,n){return t.isTwoDigitYear||t.year>0},set:function(e,t,n,r){var o=e.getUTCFullYear();if(n.isTwoDigitYear){var i=dt(n.year,o);return e.setUTCFullYear(i,0,1),e.setUTCHours(0,0,0,0),e}var a="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(a,0,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(e,t,n,r){var o=function(e){return{year:e,isTwoDigitYear:"YY"===t}};switch(t){case"Y":return ut(4,e,o);case"Yo":return n.ordinalNumber(e,{unit:"year",valueCallback:o});default:return ut(t.length,e,o)}},validate:function(e,t,n){return t.isTwoDigitYear||t.year>0},set:function(e,t,n,r){var o=Te(e,r);if(n.isTwoDigitYear){var i=dt(n.year,o);return e.setUTCFullYear(i,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),be(e,r)}var a="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(a,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),be(e,r)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(e,t,n,r){return ct("R"===t?4:t.length,e)},set:function(e,t,n,r){var o=new Date(0);return o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0),ge(o)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(e,t,n,r){return ct("u"===t?4:t.length,e)},set:function(e,t,n,r){return e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(e,t,n,r){switch(t){case"Q":case"QQ":return ut(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=1&&t<=4},set:function(e,t,n,r){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(e,t,n,r){switch(t){case"q":case"qq":return ut(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,n){return t>=1&&t<=4},set:function(e,t,n,r){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(e,t,n,r){var o=function(e){return e-1};switch(t){case"M":return it(Ze.month,e,o);case"MM":return ut(2,e,o);case"Mo":return n.ordinalNumber(e,{unit:"month",valueCallback:o});case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=0&&t<=11},set:function(e,t,n,r){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(e,t,n,r){var o=function(e){return e-1};switch(t){case"L":return it(Ze.month,e,o);case"LL":return ut(2,e,o);case"Lo":return n.ordinalNumber(e,{unit:"month",valueCallback:o});case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,n){return t>=0&&t<=11},set:function(e,t,n,r){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(e,t,n,r){switch(t){case"w":return it(Ze.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return ut(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=53},set:function(e,t,n,r){return be(function(e,t,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Q(e),o=B(t),i=Ee(r,n)-o;return r.setUTCDate(r.getUTCDate()-7*i),r}(e,n,r),r)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(e,t,n,r){switch(t){case"I":return it(Ze.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return ut(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=53},set:function(e,t,n,r){return ge(function(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=Q(e),r=B(t),o=we(n)-r;return n.setUTCDate(n.getUTCDate()-7*o),n}(e,n,r),r)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,parse:function(e,t,n,r){switch(t){case"d":return it(Ze.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return ut(t.length,e)}},validate:function(e,t,n){var r=pt(e.getUTCFullYear()),o=e.getUTCMonth();return r?t>=1&&t<=ht[o]:t>=1&&t<=ft[o]},set:function(e,t,n,r){return e.setUTCDate(n),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,parse:function(e,t,n,r){switch(t){case"D":case"DD":return it(Ze.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return ut(t.length,e)}},validate:function(e,t,n){return pt(e.getUTCFullYear())?t>=1&&t<=366:t>=1&&t<=365},set:function(e,t,n,r){return e.setUTCMonth(0,n),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(e,t,n,r){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=0&&t<=6},set:function(e,t,n,r){return(e=Xe(e,n,r)).setUTCHours(0,0,0,0),e},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return ut(t.length,e,o);case"eo":return n.ordinalNumber(e,{unit:"day",valueCallback:o});case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=0&&t<=6},set:function(e,t,n,r){return(e=Xe(e,n,r)).setUTCHours(0,0,0,0),e},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return ut(t.length,e,o);case"co":return n.ordinalNumber(e,{unit:"day",valueCallback:o});case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,n){return t>=0&&t<=6},set:function(e,t,n,r){return(e=Xe(e,n,r)).setUTCHours(0,0,0,0),e},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(e,t,n,r){var o=function(e){return 0===e?7:e};switch(t){case"i":case"ii":return ut(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return n.day(e,{width:"abbreviated",context:"formatting",valueCallback:o})||n.day(e,{width:"short",context:"formatting",valueCallback:o})||n.day(e,{width:"narrow",context:"formatting",valueCallback:o});case"iiiii":return n.day(e,{width:"narrow",context:"formatting",valueCallback:o});case"iiiiii":return n.day(e,{width:"short",context:"formatting",valueCallback:o})||n.day(e,{width:"narrow",context:"formatting",valueCallback:o});case"iiii":default:return n.day(e,{width:"wide",context:"formatting",valueCallback:o})||n.day(e,{width:"abbreviated",context:"formatting",valueCallback:o})||n.day(e,{width:"short",context:"formatting",valueCallback:o})||n.day(e,{width:"narrow",context:"formatting",valueCallback:o})}},validate:function(e,t,n){return t>=1&&t<=7},set:function(e,t,n,r){return(e=function(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=B(t);n%7==0&&(n-=7);var r=Q(e),o=((n%7+7)%7<1?7:0)+n-r.getUTCDay();return r.setUTCDate(r.getUTCDate()+o),r}(e,n,r)).setUTCHours(0,0,0,0),e},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(e,t,n,r){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,n,r){return e.setUTCHours(lt(n),0,0,0),e},incompatibleTokens:["b","B","H","K","k","t","T"]},b:{priority:80,parse:function(e,t,n,r){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,n,r){return e.setUTCHours(lt(n),0,0,0),e},incompatibleTokens:["a","B","H","K","k","t","T"]},B:{priority:80,parse:function(e,t,n,r){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,n,r){return e.setUTCHours(lt(n),0,0,0),e},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(e,t,n,r){switch(t){case"h":return it(Ze.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return ut(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=12},set:function(e,t,n,r){var o=e.getUTCHours()>=12;return o&&n<12?e.setUTCHours(n+12,0,0,0):o||12!==n?e.setUTCHours(n,0,0,0):e.setUTCHours(0,0,0,0),e},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(e,t,n,r){switch(t){case"H":return it(Ze.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return ut(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=23},set:function(e,t,n,r){return e.setUTCHours(n,0,0,0),e},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(e,t,n,r){switch(t){case"K":return it(Ze.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return ut(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=11},set:function(e,t,n,r){return e.getUTCHours()>=12&&n<12?e.setUTCHours(n+12,0,0,0):e.setUTCHours(n,0,0,0),e},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(e,t,n,r){switch(t){case"k":return it(Ze.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return ut(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=24},set:function(e,t,n,r){var o=n<=24?n%24:n;return e.setUTCHours(o,0,0,0),e},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(e,t,n,r){switch(t){case"m":return it(Ze.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return ut(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=59},set:function(e,t,n,r){return e.setUTCMinutes(n,0,0),e},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(e,t,n,r){switch(t){case"s":return it(Ze.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return ut(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=59},set:function(e,t,n,r){return e.setUTCSeconds(n,0),e},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(e,t,n,r){return ut(t.length,e,(function(e){return Math.floor(e*Math.pow(10,3-t.length))}))},set:function(e,t,n,r){return e.setUTCMilliseconds(n),e},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(e,t,n,r){switch(t){case"X":return at(et,e);case"XX":return at(tt,e);case"XXXX":return at(nt,e);case"XXXXX":return at(ot,e);case"XXX":default:return at(rt,e)}},set:function(e,t,n,r){return t.timestampIsSet?e:new Date(e.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(e,t,n,r){switch(t){case"x":return at(et,e);case"xx":return at(tt,e);case"xxxx":return at(nt,e);case"xxxxx":return at(ot,e);case"xxx":default:return at(rt,e)}},set:function(e,t,n,r){return t.timestampIsSet?e:new Date(e.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(e,t,n,r){return st(e)},set:function(e,t,n,r){return[new Date(1e3*n),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(e,t,n,r){return st(e)},set:function(e,t,n,r){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}},gt=10,vt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wt=/^'([^]*?)'?$/,bt=/''/g,Tt=/\S/,xt=/[a-zA-Z]/;function Et(e,t,n,r){if(arguments.length<3)throw new TypeError("3 arguments required, but only "+arguments.length+" present");var o=String(e),i=String(t),a=r||{},s=a.locale||oe;if(!s.match)throw new RangeError("locale must contain match property");var u=s.options&&s.options.firstWeekContainsDate,c=null==u?1:B(u),l=null==a.firstWeekContainsDate?c:B(a.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=s.options&&s.options.weekStartsOn,f=null==d?0:B(d),h=null==a.weekStartsOn?f:B(a.weekStartsOn);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===i)return""===o?Q(n):new Date(NaN);var p,m={firstWeekContainsDate:l,weekStartsOn:h,locale:s},g=[{priority:gt,set:Ot,index:0}],v=i.match(yt).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,Re[t])(e,s.formatLong,m):e})).join("").match(vt),y=[];for(p=0;p<v.length;p++){var w=v[p];!a.useAdditionalWeekYearTokens&&Fe(w)&&ze(w),!a.useAdditionalDayOfYearTokens&&He(w)&&ze(w);var b=w[0],T=mt[b];if(T){var x=T.incompatibleTokens;if(Array.isArray(x)){for(var E=void 0,O=0;O<y.length;O++){var C=y[O].token;if(-1!==x.indexOf(C)||C===b){E=y[O];break}}if(E)throw new RangeError("The format string mustn't contain `".concat(E.fullToken,"` and `").concat(w,"` at the same time"))}else if("*"===T.incompatibleTokens&&y.length)throw new RangeError("The format string mustn't contain `".concat(w,"` and any other token at the same time"));y.push({token:b,fullToken:w});var S=T.parse(o,w,s.match,m);if(!S)return new Date(NaN);g.push({priority:T.priority,set:T.set,validate:T.validate,value:S.value,index:g.length}),o=S.rest}else{if(b.match(xt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if("''"===w?w="'":"'"===b&&(w=w.match(wt)[1].replace(bt,"'")),0!==o.indexOf(w))return new Date(NaN);o=o.slice(w.length)}}if(o.length>0&&Tt.test(o))return new Date(NaN);var k=g.map((function(e){return e.priority})).sort((function(e,t){return t-e})).filter((function(e,t,n){return n.indexOf(e)===t})).map((function(e){return g.filter((function(t){return t.priority===e})).reverse()})).map((function(e){return e[0]})),M=Q(n);if(isNaN(M))return new Date(NaN);var _=ie(M,$(M)),D={};for(p=0;p<k.length;p++){var P=k[p];if(P.validate&&!P.validate(_,P.value,m))return new Date(NaN);var I=P.set(_,D,P.value,m);I[0]?(_=I[0],Be(D,I[1])):_=I}return _}function Ot(e,t){if(t.timestampIsSet)return e;var n=new Date(0);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}var Ct=function(e){if(e)return e.replace("^",", ").replace(/\^/g," ").trim()},St=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MMM d, yyyy";if(e)try{return Qe(Et(e,"yyyyMMdd",new Date),t)}catch(e){}},kt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HH:mm:ss";if(e)try{return Qe(Et(e.toString().substring(0,"HHmmss.SSS".length),"HHmmss.SSS",new Date(0)),t)}catch(e){}},Mt=function(e,t){if(null!==e)return parseFloat(e).toFixed(t)},_t=function(e){return"number"==typeof e&&!isNaN(e)};Y(".imageViewerViewport.empty ~ .ViewportOverlay {\n display: none;\n}\n.ViewportOverlay {\n color: #9ccef9;\n}\n.ViewportOverlay .overlay-element {\n position: absolute;\n font-weight: 400;\n text-shadow: 1px 1px #000;\n pointer-events: none;\n}\n.ViewportOverlay .top-left {\n top: 20px;\n left: 20px;\n}\n.ViewportOverlay .top-center {\n top: 20px;\n padding-top: 20px;\n width: 100%;\n text-align: center;\n}\n.ViewportOverlay .top-right {\n top: 20px;\n right: 20px;\n text-align: right;\n}\n.ViewportOverlay .bottom-left {\n bottom: 20px;\n left: 20px;\n}\n.ViewportOverlay .bottom-right {\n bottom: 20px;\n right: 20px;\n text-align: right;\n}\n.ViewportOverlay.controlsVisible .topright,\n.ViewportOverlay.controlsVisible .bottomright {\n right: calc(20px + 19px);\n}\n.ViewportOverlay svg {\n color: #9ccef9;\n fill: #9ccef9;\n stroke: #9ccef9;\n background-color: transparent;\n margin: 2px;\n width: 18px;\n height: 18px;\n}\n");var Dt=Ct,Pt=St,It=Mt,Lt=kt,Nt=_t,jt=function(e){function t(){return k(this,t),I(this,L(t).apply(this,arguments))}return j(t,e),_(t,[{key:"render",value:function(){var e=this.props,t=e.imageId,r=e.scale,o=e.windowWidth,i=e.windowCenter;if(!t)return null;var a=It(100*r,0),s=n.metaData.get("generalSeriesModule",t)||{},c=n.metaData.get("imagePlaneModule",t)||{},l=c.rows,d=c.columns,f=c.sliceThickness,h=c.sliceLocation,p=s.seriesNumber,m=s.seriesDescription,g=n.metaData.get("generalStudyModule",t)||{},v=g.studyDate,y=g.studyTime,w=g.studyDescription,b=n.metaData.get("patientModule",t)||{},T=b.patientId,x=b.patientName,E=(n.metaData.get("generalImageModule",t)||{}).instanceNumber,O=(n.metaData.get("cineModule",t)||{}).frameTime,C=It(1e3/O,1),S=function(e){var t=n.metaData.get("generalImageModule",e)||{},r=t.lossyImageCompression,o=t.lossyImageCompressionRatio,i=t.lossyImageCompressionMethod;return"01"===r&&""!==o?(i||"Lossy: ")+It(o,2)+" : 1":"Lossless / Uncompressed"}(t),k="W: ".concat(o.toFixed?o.toFixed(0):o," L: ").concat(o.toFixed?i.toFixed(0):i),M="".concat(d," x ").concat(l),_=this.props,D=_.imageIndex,P=_.stackSize,I=u.createElement(u.Fragment,null,u.createElement("div",{className:"top-left overlay-element"},u.createElement("div",null,Dt(x)),u.createElement("div",null,T)),u.createElement("div",{className:"top-right overlay-element"},u.createElement("div",null,w),u.createElement("div",null,Pt(v)," ",Lt(y))),u.createElement("div",{className:"bottom-right overlay-element"},u.createElement("div",null,"Zoom: ",a,"%"),u.createElement("div",null,k),u.createElement("div",{className:"compressionIndicator"},S)),u.createElement("div",{className:"bottom-left overlay-element"},u.createElement("div",null,p>=0?"Ser: ".concat(p):""),u.createElement("div",null,P>1?"Img: ".concat(E," ").concat(D,"/").concat(P):""),u.createElement("div",null,C>=0?"".concat(It(C,2)," FPS"):"",u.createElement("div",null,M),u.createElement("div",null,Nt(h)?"Loc: ".concat(It(h,2)," mm "):"",f?"Thick: ".concat(It(f,2)," mm"):""),u.createElement("div",null,m))));return u.createElement("div",{className:"ViewportOverlay"},I)}}]),t}(i.PureComponent);R(jt,"propTypes",{scale:A.number.isRequired,windowWidth:A.oneOfType([A.number.isRequired,A.string.isRequired]),windowCenter:A.oneOfType([A.number.isRequired,A.string.isRequired]),imageId:A.string.isRequired,imageIndex:A.number.isRequired,stackSize:A.number.isRequired}),Y(".imageViewerLoadingIndicator {\n color: #91b9cd;\n}\n\n.faded {\n opacity: 0.5;\n}\n\n.imageViewerErrorLoadingIndicator {\n color: #e29e4a;\n}\n\n.imageViewerErrorLoadingIndicator p,\n.imageViewerErrorLoadingIndicator h4 {\n padding: 4px 0;\n text-align: center;\n word-wrap: break-word;\n}\n\n.imageViewerErrorLoadingIndicator p {\n font-size: 11pt;\n}\n\n.loadingIndicator {\n background-color: rgba(0, 0, 0, 0.75);\n font-size: 18px;\n height: 100%;\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n z-index: 1;\n}\n\n.loadingIndicator .indicatorContents {\n font-weight: 300;\n position: absolute;\n text-align: center;\n top: 50%;\n transform: translateY(-50%);\n width: 100%;\n}\n");var Rt=function(e){function t(){return k(this,t),I(this,L(t).apply(this,arguments))}return j(t,e),_(t,[{key:"render",value:function(){var e=this.props.percentComplete;return u.createElement(u.Fragment,null,this.props.error?u.createElement("div",{className:"imageViewerErrorLoadingIndicator loadingIndicator"},u.createElement("div",{className:"indicatorContents"},u.createElement("h4",null,"Error Loading Image"),u.createElement("p",{className:"description"},"An error has occurred."),u.createElement("p",{className:"details"},this.props.error.message))):u.createElement("div",{className:"imageViewerLoadingIndicator loadingIndicator"},u.createElement("div",{className:"indicatorContents"},u.createElement("h2",null,e<100?"Loading...":"Loaded -",u.createElement("i",{className:"fa fa-spin fa-circle-o-notch fa-fw"})," "),100===e&&u.createElement("p",null,"Processing..."))))}}]),t}(i.PureComponent);R(Rt,"propTypes",{percentComplete:A.number.isRequired,error:A.object}),R(Rt,"defaultProps",{percentComplete:0,error:null}),Y(".ViewportOrientationMarkers {\n pointer-events: none;\n font-size: 15px;\n color: #ccc;\n line-height: 18px;\n}\n.ViewportOrientationMarkers .orientation-marker {\n position: absolute;\n}\n.ViewportOrientationMarkers .top-mid {\n top: 5px;\n left: 50%;\n}\n.ViewportOrientationMarkers .left-mid {\n top: 47%;\n left: 5px;\n}\n");var Ut=function(e){function t(){return k(this,t),I(this,L(t).apply(this,arguments))}return j(t,e),_(t,[{key:"render",value:function(){var e=this.props,t=e.rowCosines,n=e.columnCosines,r=e.rotationDegrees,o=e.isFlippedVertically,i=e.isFlippedHorizontally;if(!t||!n)return"";var s=function(e,t,n,r,o){var i=a.orientation,s=i.getOrientationString,u=i.invertOrientationString,c=s(e),l=s(t),d=u(c),f={top:u(l),left:d};return r&&(f.top=u(f.top)),o&&(f.left=u(f.left)),90===n||-270===n?{top:f.left,left:u(f.top)}:-90===n||270===n?{top:u(f.left),left:f.top}:180===n||-180===n?{top:u(f.top),left:u(f.left)}:f}(t,n,r,o,i);return u.createElement("div",{className:"ViewportOrientationMarkers noselect"},u.createElement("div",{className:"top-mid orientation-marker"},s.top),u.createElement("div",{className:"left-mid orientation-marker"},s.left))}}]),t}(i.PureComponent);R(Ut,"propTypes",{rowCosines:A.array.isRequired,columnCosines:A.array.isRequired,rotationDegrees:A.number.isRequired,isFlippedVertically:A.bool.isRequired,isFlippedHorizontally:A.bool.isRequired});var qt=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return(function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(t,o[1],o[0])}},t}())}(),Ht="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,Ft=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),zt="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(Ft):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},Wt=2,At=20,Vt=["top","right","bottom","left","width","height","size","weight"],Yt="undefined"!=typeof MutationObserver,Gt=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){zt(i)}function s(){var e=Date.now();if(n){if(e-o<Wt)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=e}return s}(this.refresh.bind(this),At)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){Ht&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Yt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){Ht&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;Vt.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Qt=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Bt=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||Ft},Xt=tn(0,0,0,0);function $t(e){return parseFloat(e)||0}function Kt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+$t(e["border-"+n+"-width"])}),0)}function Jt(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Xt;var r=Bt(e).getComputedStyle(e),o=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=e["padding-"+o];t[o]=$t(i)}return t}(r),i=o.left+o.right,a=o.top+o.bottom,s=$t(r.width),u=$t(r.height);if("border-box"===r.boxSizing&&(Math.round(s+i)!==t&&(s-=Kt(r,"left","right")+i),Math.round(u+a)!==n&&(u-=Kt(r,"top","bottom")+a)),!function(e){return e===Bt(e).document.documentElement}(e)){var c=Math.round(s+i)-t,l=Math.round(u+a)-n;1!==Math.abs(c)&&(s-=c),1!==Math.abs(l)&&(u-=l)}return tn(o.left,o.top,s,u)}var Zt="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof Bt(e).SVGGraphicsElement}:function(e){return e instanceof Bt(e).SVGElement&&"function"==typeof e.getBBox};function en(e){return Ht?Zt(e)?function(e){var t=e.getBBox();return tn(0,0,t.width,t.height)}(e):Jt(e):Xt}function tn(e,t,n,r){return{x:e,y:t,width:n,height:r}}var nn=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=tn(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=en(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),rn=function(e,t){var n,r,o,i,a,s,u,c=(r=(n=t).x,o=n.y,i=n.width,a=n.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,u=Object.create(s.prototype),Qt(u,{x:r,y:o,width:i,height:a,top:o,right:r+i,bottom:a+o,left:r}),u);Qt(this,{target:e,contentRect:c})},on=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new qt,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof Bt(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new nn(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof Bt(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new rn(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),an="undefined"!=typeof WeakMap?new WeakMap:new qt,sn=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Gt.getInstance(),r=new on(t,n,this);an.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){sn.prototype[e]=function(){var t;return(t=an.get(this))[e].apply(t,arguments)}}));var un=void 0!==Ft.ResizeObserver?Ft.ResizeObserver:sn,cn=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t=o,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r},ln=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},dn="object"==typeof f&&f&&f.Object===Object&&f,fn="object"==typeof self&&self&&self.Object===Object&&self,hn=dn||fn||Function("return this")(),pn=function(){return hn.Date.now()},mn=hn.Symbol,gn=Object.prototype,vn=gn.hasOwnProperty,yn=gn.toString,wn=mn?mn.toStringTag:void 0,bn=function(e){var t=vn.call(e,wn),n=e[wn];try{e[wn]=void 0;var r=!0}catch(e){}var o=yn.call(e);return r&&(t?e[wn]=n:delete e[wn]),o},Tn=Object.prototype.toString,xn=function(e){return Tn.call(e)},En="[object Null]",On="[object Undefined]",Cn=mn?mn.toStringTag:void 0,Sn=function(e){return null==e?void 0===e?On:En:Cn&&Cn in Object(e)?bn(e):xn(e)},kn=function(e){return null!=e&&"object"==typeof e},Mn="[object Symbol]",_n=function(e){return"symbol"==typeof e||kn(e)&&Sn(e)==Mn},Dn=NaN,Pn=/^\s+|\s+$/g,In=/^[-+]0x[0-9a-f]+$/i,Ln=/^0b[01]+$/i,Nn=/^0o[0-7]+$/i,jn=parseInt,Rn=function(e){if("number"==typeof e)return e;if(_n(e))return Dn;if(ln(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ln(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Pn,"");var n=Ln.test(e);return n||Nn.test(e)?jn(e.slice(2),n?2:8):In.test(e)?Dn:+e},Un="Expected a function",qn=Math.max,Hn=Math.min,Fn=function(e,t,n){var r,o,i,a,s,u,c=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(Un);function h(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function p(e){var n=e-u;return void 0===u||n>=t||n<0||d&&e-c>=i}function m(){var e=pn();if(p(e))return g(e);s=setTimeout(m,function(e){var n=t-(e-u);return d?Hn(n,i-(e-c)):n}(e))}function g(e){return s=void 0,f&&r?h(e):(r=o=void 0,a)}function v(){var e=pn(),n=p(e);if(r=arguments,o=this,u=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),l?h(e):a}(u);if(d)return clearTimeout(s),s=setTimeout(m,t),h(u)}return void 0===s&&(s=setTimeout(m,t)),a}return t=Rn(t)||0,ln(n)&&(l=!!n.leading,i=(d="maxWait"in n)?qn(Rn(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=u=o=s=void 0},v.flush=function(){return void 0===s?a:g(pn())},v},zn="Expected a function",Wn=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError(zn);return ln(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Fn(e,t,{leading:r,maxWait:t,trailing:o})},An=p((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDOMElement=t.isSSR=t.isFunction=t.getHandle=t.listHandle=void 0;var n=o(Fn),r=o(Wn);function o(e){return e&&e.__esModule?e:{default:e}}var i={debounce:n.default,throttle:r.default};t.listHandle=i,t.getHandle=function(e){return i[e]},t.isFunction=function(e){return"function"==typeof e},t.isSSR=function(){return"undefined"==typeof window},t.isDOMElement=function(e){return e instanceof Element||e instanceof HTMLDocument}}));h(An),An.isDOMElement,An.isSSR,An.isFunction,An.getHandle,An.listHandle;var Vn=p((function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o(this,i(t).apply(this,arguments))}var n,s,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,e),n=t,(s=[{key:"render",value:function(){return this.props.children}}])&&r(n.prototype,s),u&&r(n,u),t}(u.PureComponent);t.default=s}));h(Vn);var Yn=p((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;var t=c();if(t&&t.has(e))return t.get(e);var n={};if(null!=e){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}}return n.default=e,t&&t.set(e,n),n}(u),r=a(un),o=a(cn),i=a(Vn);function a(e){return e&&e.__esModule?e:{default:e}}function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=function(e){function t(e){var i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i=function(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?h(e):t}(this,f(t).call(this,e)),m(h(i),"cancelHandler",(function(){i.resizeHandler&&i.resizeHandler.cancel&&(i.resizeHandler.cancel(),i.resizeHandler=null)})),m(h(i),"rafClean",(function(){i.raf&&i.raf.cancel&&(i.raf.cancel(),i.raf=null)})),m(h(i),"toggleObserver",(function(e){var t=i.getElement();t&&i.resizeObserver[e]&&i.resizeObserver[e](t)})),m(h(i),"getElement",(function(){var e=i.props,t=e.querySelector,n=e.targetDomEl;if(!(0,An.isSSR)()){if(t)return document.querySelector(t);if(n&&(0,An.isDOMElement)(n))return n;var r=i.element&&(0,s.findDOMNode)(i.element);if(r)return r.parentElement}})),m(h(i),"createUpdater",(function(){return i.rafClean(),i.raf=(0,o.default)((function(e){var t=e.width,n=e.height,r=i.props.onResize;(0,An.isFunction)(r)&&r(t,n),i.setState({width:t,height:n})})),i.raf})),m(h(i),"createResizeHandler",(function(e){var t=i.state,n=t.width,r=t.height,o=i.props,a=o.handleWidth,s=o.handleHeight;if(a||s){var u=i.createUpdater();e.forEach((function(e){var t=e&&e.contentRect||{},o=t.width,c=t.height,l=a&&n!==o||s&&r!==c;!i.skipOnMount&&l&&!(0,An.isSSR)()&&u({width:o,height:c}),i.skipOnMount=!1}))}})),m(h(i),"onRef",(function(e){i.element=e})),m(h(i),"getRenderType",(function(){var e=i.props,t=e.render,r=e.children;return(0,An.isFunction)(t)?"renderProp":(0,An.isFunction)(r)?"childFunction":(0,n.isValidElement)(r)?"child":Array.isArray(r)?"childArray":"parent"})),m(h(i),"getTargetComponent",(function(){var e=i.props,t=e.render,r=e.children,o=e.nodeType,a=i.state,s={width:a.width,height:a.height};switch(i.getRenderType()){case"renderProp":return(0,n.cloneElement)(t(s),{key:"resize-detector"});case"childFunction":return(0,n.cloneElement)(r(s));case"child":return(0,n.cloneElement)(r,s);case"childArray":return r.map((function(e){return!!e&&(0,n.cloneElement)(e,s)}));default:return(0,n.createElement)(o)}}));var a=e.skipOnMount,u=e.refreshMode,c=e.refreshRate,d=e.refreshOptions;i.state={width:void 0,height:void 0},i.skipOnMount=a,i.raf=null,i.element=null,i.unmounted=!1;var p=(0,An.getHandle)(u);return i.resizeHandler=p?p(i.createResizeHandler,c,d):i.createResizeHandler,i.resizeObserver=new r.default(i.resizeHandler),i}var a,u,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),a=t,(u=[{key:"componentDidMount",value:function(){this.toggleObserver("observe")}},{key:"componentWillUnmount",value:function(){this.toggleObserver("unobserve"),this.rafClean(),this.cancelHandler(),this.unmounted=!0}},{key:"render",value:function(){return n.default.createElement(i.default,{ref:this.onRef},this.getTargetComponent())}}])&&d(a.prototype,u),c&&d(a,c),t}(n.PureComponent);g.propTypes={handleWidth:A.bool,handleHeight:A.bool,skipOnMount:A.bool,refreshRate:A.number,refreshMode:A.string,refreshOptions:(0,A.shape)({leading:A.bool,trailing:A.bool}),querySelector:A.string,targetDomEl:A.any,onResize:A.func,render:A.func,children:A.any,nodeType:A.node},g.defaultProps={handleWidth:!1,handleHeight:!1,skipOnMount:!1,refreshRate:1e3,refreshMode:void 0,refreshOptions:void 0,querySelector:null,targetDomEl:null,onResize:null,render:void 0,children:null,nodeType:"div"};var v=g;t.default=v}));h(Yn);var Gn=p((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=function(e){if(e&&e.__esModule)return e;var t=i();if(t&&t.has(e))return t.get(e);var n={};if(null!=e){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}}return n.default=e,t&&t.set(e,n),n}(u),o=(n=Yn)&&n.__esModule?n:{default:n};function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function d(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handleWidth:!0,handleHeight:!0};return(function(n){function i(){return s(this,i),d(this,f(i).apply(this,arguments))}return h(i,n),l(i,[{key:"render",value:function(){return r.default.createElement(o.default,t,r.default.createElement(e,this.props))}}]),i}(r.Component))};t.default=m}));h(Gn);var Qn=h(p((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"withResizeDetector",{enumerable:!0,get:function(){return r.default}}),t.default=void 0;var n=o(Yn),r=o(Gn);function o(e){return e&&e.__esModule?e:{default:e}}var i=n.default;t.default=i}))),Bn="Expected a function",Xn=NaN,$n="[object Symbol]",Kn=/^\s+|\s+$/g,Jn=/^[-+]0x[0-9a-f]+$/i,Zn=/^0b[01]+$/i,er=/^0o[0-7]+$/i,tr=parseInt,nr="object"==typeof f&&f&&f.Object===Object&&f,rr="object"==typeof self&&self&&self.Object===Object&&self,or=nr||rr||Function("return this")(),ir=Object.prototype.toString,ar=Math.max,sr=Math.min,ur=function(){return or.Date.now()};function cr(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lr(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&ir.call(e)==$n}(e))return Xn;if(cr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=cr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Kn,"");var n=Zn.test(e);return n||er.test(e)?tr(e.slice(2),n?2:8):Jn.test(e)?Xn:+e}var dr=function(e,t,n){var r,o,i,a,s,u,c=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(Bn);function h(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function p(e){var n=e-u;return void 0===u||n>=t||n<0||d&&e-c>=i}function m(){var e=ur();if(p(e))return g(e);s=setTimeout(m,function(e){var n=t-(e-u);return d?sr(n,i-(e-c)):n}(e))}function g(e){return s=void 0,f&&r?h(e):(r=o=void 0,a)}function v(){var e=ur(),n=p(e);if(r=arguments,o=this,u=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),l?h(e):a}(u);if(d)return s=setTimeout(m,t),h(u)}return void 0===s&&(s=setTimeout(m,t)),a}return t=lr(t)||0,cr(n)&&(l=!!n.leading,i=(d="maxWait"in n)?ar(lr(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=u=o=s=void 0},v.flush=function(){return void 0===s?a:g(ur())},v};function fr(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}Y(".viewport-wrapper {\n width: 100%;\n height: 100%; /* MUST have `height` to prevent resize infinite loop */\n position: relative;\n}\n\n.viewport-element {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: black;\n\n /* Prevent the blue outline in Chrome when a viewport is selected */\n outline: 0 !important;\n\n /* Prevents the entire page from getting larger\n when the magnify tool is near the sides/corners of the page */\n overflow: hidden;\n}\n");var hr=a.importInternal("util/scrollToIndex"),pr=a.loadHandlerManager,mr=function(e){function t(e){var r;k(this,t),r=I(this,L(t).call(this,e)),R(P(r),"_handleOnElementEnabledEvent",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=function(e){e.detail.element===r.element&&r.props.onElementEnabled(e)};r.props.onElementEnabled&&!e&&n.events.addEventListener(n.EVENTS.ELEMENT_ENABLED,t),e&&n.events.removeEventListener(n.EVENTS.ELEMENT_ENABLED,t)})),R(P(r),"onImageRendered",(function(e){var t=e.detail.viewport;r.setState({scale:t.scale,windowCenter:t.voi.windowCenter,windowWidth:t.voi.windowWidth,rotationDegrees:t.rotation,isFlippedVertically:t.vflip,isFlippedHorizontally:t.hflip})})),R(P(r),"onNewImageHandler",(function(e,t){var o=e.detail.image.imageId,i=(n.metaData.get("generalImageModule",o)||{}).sopInstanceUid,a=r.props.imageIds.indexOf(o);r.setState({imageIdIndex:a}),t&&t({currentImageIdIndex:a,sopInstanceUid:i})})),R(P(r),"onNewImage",(function(e){return r.onNewImageHandler(e,r.props.onNewImage)})),R(P(r),"onNewImageDebounced",dr((function(e){r.onNewImageHandler(e,r.props.onNewImageDebounced)}),r.props.onNewImageDebounceTime)),R(P(r),"onImageLoaded",(function(){r.numImagesLoaded++})),R(P(r),"onImageProgress",(function(e){r.setState({imageProgress:e.detail.percentComplete})})),R(P(r),"imageSliderOnInputCallback",(function(e){r.setViewportActive(),hr(r.element,e)})),R(P(r),"setViewportActive",(function(){r.props.setViewportActive&&r.props.setViewportActive()})),R(P(r),"onResize",(function(){n.resize(r.element)}));var o=e.imageIdIndex,i=e.imageIds[o],a=e.isOverlayVisible;return r.state={imageId:i,imageIdIndex:o,imageProgress:0,isLoading:!0,error:null,scale:void 0,windowWidth:void 0,windowCenter:void 0,isOverlayVisible:a,rotationDegrees:void 0,isFlippedVertically:void 0,isFlippedHorizontally:void 0},r._validateExternalEventsListeners(),r.startLoadHandler=r.props.startLoadHandler,r.endLoadHandler=r.props.endLoadHandler,r.loadHandlerTimeout=void 0,r.numImagesLoaded=0,r}var r,o;return j(t,e),_(t,[{key:"componentDidMount",value:(o=S(b.mark((function e(){var t,r,o,i,s,u,c,l,d,f,h;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,r=t.tools,o=t.isStackPrefetchEnabled,i=t.cornerstoneOptions,s=t.imageIds,u=t.isPlaying,c=t.frameRate,l=this.state.imageIdIndex,d=s[l],this._handleOnElementEnabledEvent(),this._bindInternalCornerstoneEventListeners(),this._bindExternalEventListeners("cornerstone"),n.enable(this.element,i),this._bindInternalElementEventListeners(),this._bindExternalEventListeners("element"),this._setupLoadHandlers(),e.prev=10,a.clearToolState(this.element,"stack"),a.addStackStateManager(this.element,["stack","playClip","referenceLines"]),a.addToolState(this.element,"stack",{imageIds:O(s),currentImageIdIndex:l}),e.next=16,n.loadAndCacheImage(d);case 16:f=e.sent,n.displayImage(this.element,f),o&&a.stackPrefetch.enable(this.element),u&&(h=Math.max(c,1),a.playClip(this.element,h)),vr(r,this.element),gr(this.element,this.props.activeTool),this.setState({isLoading:!1}),e.next=28;break;case 25:e.prev=25,e.t0=e.catch(10),this.setState({error:e.t0,isLoading:!1});case 28:case"end":return e.stop()}}),e,this,[[10,25]])}))),function(){return o.apply(this,arguments)})},{key:"componentDidUpdate",value:(r=S(b.mark((function e(t,r){var o,i,s,u,c,l,d,f,h,p,m,g,v,y,w,T,x,E,C,S,k,M,_,D;return b.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.props,i=o.imageIds,s=o.imageIdIndex,u=o.isStackPrefetchEnabled,c=t.imageIds,l=t.imageIdIndex,d=t.isStackPrefetchEnabled,f=!fr(c,i),h=null!=s&&s!==l,p={},!f){e.next=24;break}return a.clearToolState(this.element,"stack"),a.addToolState(this.element,"stack",{imageIds:O(i),currentImageIdIndex:s||0}),p.numImagesLoaded=0,p.error=null,e.prev=10,m=i[s||0],a.stopClip(this.element),e.next=15,n.loadAndCacheImage(m);case 15:g=e.sent,n.displayImage(this.element,g),n.reset(this.element),e.next=22;break;case 20:e.prev=20,e.t0=e.catch(10);case 22:e.next=25;break;case 24:!f&&h&&hr(this.element,s);case 25:(u&&f||!d&&!0===u)&&a.stackPrefetch.enable(this.element),v=this.props.activeTool,y=t.activeTool,v!==y&&gr(this.element,v),w=this.props,T=w.frameRate,x=w.isPlaying,E=w.isOverlayVisible,C=t.frameRate,S=t.isPlaying,k=t.isOverlayVisible,M=Math.max(T,1),_=x!==S&&!x,D=x&&T!==C,x!==S&&x||x&&f||D?a.playClip(this.element,M):_&&a.stopClip(this.element),E!==k&&(p.isOverlayVisible=E),Object.keys(p).length>0&&this.setState(p),this._validateExternalEventsListeners();case 41:case"end":return e.stop()}}),e,this,[[10,20]])}))),function(e,t){return r.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){this._handleOnElementEnabledEvent(!0),this._bindInternalCornerstoneEventListeners(!0),this._bindInternalElementEventListeners(!0),this._bindExternalEventListeners("cornerstone",!0),this._bindExternalEventListeners("element",!0),this._setupLoadHandlers(!0),this.props.isStackPrefetchEnabled&&a.stackPrefetch.disable(this.element),a.clearToolState(this.element,"stackPrefetch"),a.stopClip(this.element),n.disable(this.element)}},{key:"getLoadingIndicator",value:function(){var e=this.props.loadingIndicatorComponent,t=this.state,n=t.error,r=t.imageProgress;return u.createElement(e,{error:n,percentComplete:r})}},{key:"getOverlay",value:function(){var e=this.props,t=e.viewportOverlayComponent,n=e.imageIds,r=this.state,o=r.imageIdIndex,i=r.scale,a=r.windowWidth,s=r.windowCenter,c=r.isOverlayVisible,l=n[o];return l&&a&&c&&u.createElement(t,{imageIndex:o+1,stackSize:n.length,scale:i,windowWidth:a,windowCenter:s,imageId:l})}},{key:"getOrientationMarkersOverlay",value:function(){var e=this.props.imageIds,t=this.state,r=t.imageIdIndex,o=t.rotationDegrees,i=t.isFlippedVertically,a=t.isFlippedHorizontally,s=e[r];if(!s)return!1;var c=n.metaData.get("imagePlaneModule",s)||{},l=c.rowCosines,d=c.columnCosines;return!(!l||!d||void 0===o)&&u.createElement(Ut,{rowCosines:l,columnCosines:d,rotationDegrees:o,isFlippedVertically:i,isFlippedHorizontally:a})}},{key:"_bindInternalCornerstoneEventListeners",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?"removeEventListener":"addEventListener";n.events[t]("cornerstoneimageloadprogress",this.onImageProgress),n.events[t](n.EVENTS.IMAGE_LOADED,this.onImageLoaded)}},{key:"_bindInternalElementEventListeners",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?"removeEventListener":"addEventListener";this.element[t](n.EVENTS.NEW_IMAGE,this.onNewImage),this.element[t](n.EVENTS.NEW_IMAGE,this.onNewImageDebounced),this.element[t](n.EVENTS.IMAGE_RENDERED,this.onImageRendered),this.element[t](a.EVENTS.MOUSE_CLICK,this.setViewportActive),this.element[t](a.EVENTS.MOUSE_DOWN,this.setViewportActive),this.element[t](a.EVENTS.TOUCH_PRESS,this.setViewportActive),this.element[t](a.EVENTS.TOUCH_START,this.setViewportActive),this.element[t](a.EVENTS.STACK_SCROLL,this.setViewportActive)}},{key:"_bindExternalEventListeners",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t?"removeEventListener":"addEventListener",o=Object.values(n.EVENTS),i=Object.values(a.EVENTS),s=o.concat(i),u="element"===e?this.element:n.events,c=this._handleExternalEventListeners.bind(this),l=0;l<s.length;l++)u[r](s[l],c)}},{key:"_validateExternalEventsListeners",value:function(){if(this.props.eventListeners)for(var e=Object.values(n.EVENTS),t=Object.values(a.EVENTS),r=0;r<this.props.eventListeners.length;r++){var o=this.props.eventListeners[r],i=(o.target,o.eventName);o.handler,e.includes(i)||t.includes(i)||console.warn("No cornerstone or cornerstone-tools event exists for event name: ".concat(i))}}},{key:"_handleExternalEventListeners",value:function(e){if(this.props.eventListeners)for(var t=0;t<this.props.eventListeners.length;t++){var n=this.props.eventListeners[t],r=n.eventName,o=n.handler;e.type===r&&o(e)}}},{key:"_setupLoadHandlers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t)pr.removeHandlers(this.element);else{var n=function(t){clearTimeout(e.loadHandlerTimeout),e.startLoadHandler&&e.startLoadHandler(t),e.loadHandlerTimeout=setTimeout((function(){e.setState({isLoading:!0})}),e.props.loadIndicatorDelay)},r=function(t,n){clearTimeout(e.loadHandlerTimeout),e.endLoadHandler&&e.endLoadHandler(t,n),e.state.isLoading&&e.setState({isLoading:!1})};pr.setStartLoadHandler(n,this.element),pr.setEndLoadHandler(r,this.element)}}},{key:"render",value:function(){var e=this,t=this.state.isLoading||this.state.error,n=this.props.imageIds.length-1,r=this.element?"".concat(this.element.clientHeight-20,"px"):"100px";return u.createElement("div",{style:this.props.style,className:V("viewport-wrapper",this.props.className)},this.props.enableResizeDetector&&u.createElement(Qn,{handleWidth:!0,handleHeight:!0,skipOnMount:!0,refreshMode:this.props.resizeRefreshMode,refreshRate:this.props.resizeRefreshRateMs,onResize:this.onResize}),u.createElement("div",{className:"viewport-element",onContextMenu:function(e){return e.preventDefault()},onMouseDown:function(e){return e.preventDefault()},ref:function(t){e.element=t}},t&&this.getLoadingIndicator(),u.createElement("canvas",{className:"cornerstone-canvas"}),this.getOverlay(),this.getOrientationMarkersOverlay()),u.createElement(G,{onInputCallback:this.imageSliderOnInputCallback,max:n,height:r,value:this.state.imageIdIndex}),this.props.children)}}]),t}(i.Component);function gr(e,t){if(e&&t){var n=a.store.state.tools.filter((function(t){return t.element===e})).map((function(e){return e.name}));n.includes(t)||console.warn('Trying to set a tool active that is not "added". Available tools include: '.concat(n.join(", "))),a.setToolActiveForElement(e,t,{mouseButtonMask:1})}}function vr(e,t){for(var n=0;n<e.length;n++){var r="string"==typeof e[n]?{name:e[n]}:Object.assign({},e[n]),o="".concat(r.name,"Tool");r.toolClass=r.toolClass||a[o],r.toolClass?(a.addToolForElement(t,r.toolClass,r.props||{}),r.mode&&yr.includes(r.mode)&&(0,wr[r.mode])(t,r.name,r.modeOptions||{})):console.warn("Unable to add tool with name '".concat(r.name,"'."))}}R(mr,"propTypes",{imageIds:A.arrayOf(A.string).isRequired,imageIdIndex:A.number,activeTool:A.string,tools:A.arrayOf(A.oneOfType([A.string,A.shape({name:A.string,toolClass:A.func,props:A.Object,mode:A.string,modeOptions:A.Object})])),children:A.node,cornerstoneOptions:A.object,isStackPrefetchEnabled:A.bool,isPlaying:A.bool,frameRate:A.number,setViewportActive:A.func,onNewImage:A.func,onNewImageDebounced:A.func,onNewImageDebounceTime:A.number,viewportOverlayComponent:A.oneOfType([A.string,A.func]),onElementEnabled:A.func,eventListeners:A.arrayOf(A.shape({target:A.oneOf(["element","cornerstone"]).isRequired,eventName:A.string.isRequired,handler:A.func.isRequired})),startLoadHandler:A.func,endLoadHandler:A.func,loadIndicatorDelay:A.number,loadingIndicatorComponent:A.oneOfType([A.element,A.func]),enableResizeDetector:A.bool,resizeRefreshRateMs:A.number,resizeRefreshMode:A.oneOf(["throttle","debounce"]),style:A.object,className:A.string,isOverlayVisible:A.bool}),R(mr,"defaultProps",{imageIdIndex:0,isPlaying:!1,cineFrameRate:24,viewportOverlayComponent:jt,imageIds:["no-id://"],cornerstoneOptions:{},isStackPrefetchEnabled:!1,isOverlayVisible:!0,loadIndicatorDelay:45,loadingIndicatorComponent:Rt,enableResizeDetector:!0,resizeRefreshRateMs:200,resizeRefreshMode:"debounce",tools:[],onNewImageDebounceTime:0});var yr=["active","passive","enabled","disabled"],wr={active:a.setToolActiveForElement,passive:a.setToolPassiveForElement,enabled:a.setToolEnabledForElement,disabled:a.setToolDisabledForElement};t.ViewportOverlay=jt,t.default=mr,Object.defineProperty(t,"__esModule",{value:!0})})(t,n(9),n(54),n(133),n(0),n(7),n(22))}).call(this,n(49))}}]);
//# sourceMappingURL=21.bundle.7e0f7b2e8ec1cb450227.js.map