!function(e){function t(t){for(var n,i,o=t[0],a=t[1],s=0,u=[];s=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t,n){"use strict";var r=n(1),i=n(1119),o=n(121);t.a=function(e,t){return Object(i.a)(e,Object(r.a)({defaultTheme:o.a},t))}},function(e,t,n){"use strict";t.a={ADD_COMPANION_WINDOW:"mirador/ADD_COMPANION_WINDOW",UPDATE_COMPANION_WINDOW:"mirador/UPDATE_COMPANION_WINDOW",REMOVE_COMPANION_WINDOW:"mirador/REMOVE_COMPANION_WINDOW",TOGGLE_TOC_NODE:"mirador/TOGGLE_TOC_NODE",UPDATE_WINDOW:"mirador/UPDATE_WINDOW",REQUEST_CANVAS_ANNOTATIONS:"mirador/REQUEST_CANVAS_ANNOTATIONS",HOVER_ANNOTATION:"mirador/HOVER_ANNOTATION",REQUEST_ANNOTATION:"mirador/REQUEST_ANNOTATION",RECEIVE_ANNOTATION:"mirador/RECEIVE_ANNOTATION",RECEIVE_ANNOTATION_FAILURE:"mirador/RECEIVE_ANNOTATION_FAILURE",DESELECT_ANNOTATION:"mirador/DESELECT_ANNOTATION",SELECT_ANNOTATION:"mirador/SELECT_ANNOTATION",TOGGLE_ANNOTATION_DISPLAY:"mirador/TOGGLE_ANNOTATION_DISPLAY",FOCUS_WINDOW:"mirador/FOCUS_WINDOW",SET_WORKSPACE_FULLSCREEN:"mirador/SET_WORKSPACE_FULLSCREEN",SET_WORKSPACE_VIEWPORT_POSITION:"mirador/SET_WORKSPACE_VIEWPORT_POSITION",ADD_MANIFEST:"mirador/ADD_MANIFEST",ADD_WINDOW:"mirador/ADD_WINDOW",ADD_ERROR:"mirador/ADD_ERROR",IMPORT_CONFIG:"mirador/IMPORT_CONFIG",IMPORT_MIRADOR_STATE:"mirador/IMPORT_MIRADOR_STATE",SET_CANVAS:"mirador/SET_CANVAS",MAXIMIZE_WINDOW:"mirador/MAXIMIZE_WINDOW",MINIMIZE_WINDOW:"mirador/MINIMIZE_WINDOW",UPDATE_WINDOW_POSITION:"mirador/UPDATE_WINDOW_POSITION",SET_WINDOW_SIZE:"mirador/SET_WINDOW_SIZE",REMOVE_WINDOW:"mirador/REMOVE_WINDOW",PICK_WINDOWING_SYSTEM:"mirador/PICK_WINDOWING_SYSTEM",REQUEST_MANIFEST:"mirador/REQUEST_MANIFEST",RECEIVE_MANIFEST:"mirador/RECEIVE_MANIFEST",RECEIVE_MANIFEST_FAILURE:"mirador/RECEIVE_MANIFEST_FAILURE",REMOVE_ERROR:"mirador/REMOVE_ERROR",SET_CONFIG:"mirador/SET_CONFIG",UPDATE_WORKSPACE:"mirador/UPDATE_WORKSPACE",SET_WINDOW_THUMBNAIL_POSITION:"mirador/SET_WINDOW_THUMBNAIL_POSITION",SET_WINDOW_VIEW_TYPE:"mirador/SET_WINDOW_VIEW_TYPE",SET_WORKSPACE_ADD_VISIBILITY:"mirador/SET_WORKSPACE_ADD_VISIBILITY",TOGGLE_WINDOW_SIDE_BAR:"mirador/TOGGLE_WINDOW_SIDE_BAR",TOGGLE_DRAGGING:"mirador/TOGGLE_DRAGGING",TOGGLE_ZOOM_CONTROLS:"mirador/TOGGLE_ZOOM_CONTROLS",UPDATE_CONFIG:"mirador/UPDATE_CONFIG",REMOVE_MANIFEST:"mirador/REMOVE_MANIFEST",REQUEST_INFO_RESPONSE:"mirador/REQUEST_INFO_RESPONSE",RECEIVE_INFO_RESPONSE:"mirador/RECEIVE_INFO_RESPONSE",RECEIVE_DEGRADED_INFO_RESPONSE:"mirador/RECEIVE_DEGRADED_INFO_RESPONSE",RECEIVE_INFO_RESPONSE_FAILURE:"mirador/RECEIVE_INFO_RESPONSE_FAILURE",REMOVE_INFO_RESPONSE:"mirador/REMOVE_INFO_RESPONSE",UPDATE_WORKSPACE_MOSAIC_LAYOUT:"mirador/UPDATE_WORKSPACE_MOSAIC_LAYOUT",UPDATE_VIEWPORT:"mirador/UPDATE_VIEWPORT",UPDATE_ELASTIC_WINDOW_LAYOUT:"mirador/UPDATE_ELASTIC_WINDOW_LAYOUT",ADD_AUTHENTICATION_REQUEST:"mirador/ADD_AUTHENTICATION_REQUEST",RESOLVE_AUTHENTICATION_REQUEST:"mirador/RESOLVE_AUTHENTICATION_REQUEST",REQUEST_ACCESS_TOKEN:"mirador/REQUEST_ACCESS_TOKEN",RECEIVE_ACCESS_TOKEN:"mirador/RECEIVE_ACCESS_TOKEN",RECEIVE_ACCESS_TOKEN_FAILURE:"mirador/RECEIVE_ACCESS_TOKEN_FAILURE",RESET_AUTHENTICATION_STATE:"mirador/RESET_AUTHENTICATION_STATE",CLEAR_ACCESS_TOKEN_QUEUE:"mirador/CLEAR_ACCESS_TOKEN_QUEUE",REQUEST_SEARCH:"mirador/REQUEST_SEARCH",RECEIVE_SEARCH:"mirador/RECEIVE_SEARCH",RECEIVE_SEARCH_FAILURE:"mirador/RECEIVE_SEARCH_FAILURE",REMOVE_SEARCH:"mirador/REMOVE_SEARCH",SET_CONTENT_SEARCH_CURRENT_ANNOTATIONS:"mirador/SET_CONTENT_SEARCH_CURRENT_ANNOTATIONS",UPDATE_LAYERS:"mirador/UPDATE_LAYERS",ADD_RESOURCE:"mirador/ADD_RESOURCE",REMOVE_RESOURCE:"mirador/REMOVE_RESOURCE",SHOW_COLLECTION_DIALOG:"mirador/SHOW_COLLECTION_DIALOG",HIDE_COLLECTION_DIALOG:"mirador/HIDE_COLLECTION_DIALOG"}},function(e,t,n){"use strict";n.r(t),n.d(t,"__DO_NOT_USE__ActionTypes",(function(){return u})),n.d(t,"applyMiddleware",(function(){return v})),n.d(t,"bindActionCreators",(function(){return h})),n.d(t,"combineReducers",(function(){return d})),n.d(t,"compose",(function(){return g})),n.d(t,"createStore",(function(){return f}));var r=n(27);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function H(e,t){return e===t}function V(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?C:n,i=t.mapStateToPropsFactories,o=void 0===i?A:i,a=t.mapDispatchToPropsFactories,s=void 0===a?R:a,c=t.mergePropsFactories,u=void 0===c?D:c,l=t.selectorFactory,f=void 0===l?B:l;return function(e,t,n,i){void 0===i&&(i={});var a=i,c=a.pure,l=void 0===c||c,h=a.areStatesEqual,g=void 0===h?H:h,v=a.areOwnPropsEqual,m=void 0===v?T:v,y=a.areStatePropsEqual,b=void 0===y?T:y,w=a.areMergedPropsEqual,_=void 0===w?T:w,x=Object(p.a)(a,F),O=W(e,o,"mapStateToProps"),S=W(t,s,"mapDispatchToProps"),E=W(n,u,"mergeProps");return r(f,Object(d.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:O,initMapDispatchToProps:S,initMergeProps:E,pure:l,areStatesEqual:g,areOwnPropsEqual:m,areStatePropsEqual:b,areMergedPropsEqual:_},x))}}var U=V();var q,G=n(33);q=G.unstable_batchedUpdates,a=q},function(e,t,n){"use strict";n.r(t),n.d(t,"defaultMemoize",(function(){return i})),n.d(t,"defaultEqualityCheck",(function(){return r})),n.d(t,"createSelectorCreator",(function(){return a})),n.d(t,"createSelector",(function(){return s})),n.d(t,"createStructuredSelector",(function(){return c}));var r=function(e,t){return e===t};function i(e,t){var n,i,o="object"==typeof t?t:{equalityCheck:t},a=o.equalityCheck,s=void 0===a?r:a,c=o.maxSize,u=void 0===c?1:c,l=o.resultEqualityCheck,f=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,i=0;i-1){var i=n[r];return r>0&&(n.splice(r,1),n.unshift(i)),i.value}return"NOT_FOUND"}return{get:r,put:function(t,i){"NOT_FOUND"===r(t)&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(u,f);function p(){var t=d.get(arguments);if("NOT_FOUND"===t){if(t=e.apply(null,arguments),l){var n=d.getEntries(),r=n.find((function(e){return l(e.value,t)}));r&&(t=r.value)}d.put(arguments,t)}return t}return p.clearCache=function(){return d.clear()},p}function o(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function a(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),a=1;a2?n-2:0),i=2;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function o(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}function a(e){if(0===e.indexOf("#"))return e;var t=c(e).values;return"#".concat(t.map((function(e){return 1===(t=e.toString(16)).length?"0".concat(t):t;var t})).join(""))}function s(e){var t=(e=c(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),u({type:s,values:l})}function c(e){if(e.type)return e;if("#"===e.charAt(0))return c(o(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function u(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function l(e,t){var n=f(e),r=f(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function f(e){var t="hsl"===(e=c(e)).type?c(s(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return f(e)>.5?g(e,t):v(e,t)}function p(e,t){return h(e,t)}function h(e,t){return e=c(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,u(e)}function g(e,t){if(e=c(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return u(e)}function v(e,t){if(e=c(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return u(e)}},function(e,t,n){"use strict";function r(e,t){return function(){return null}}n.r(t),n.d(t,"chainPropTypes",(function(){return r})),n.d(t,"deepmerge",(function(){return i.a})),n.d(t,"elementAcceptingRef",(function(){return c})),n.d(t,"elementTypeAcceptingRef",(function(){return u})),n.d(t,"exactProp",(function(){return l})),n.d(t,"formatMuiErrorMessage",(function(){return f.a})),n.d(t,"getDisplayName",(function(){return y})),n.d(t,"HTMLElementType",(function(){return b})),n.d(t,"ponyfillGlobal",(function(){return w})),n.d(t,"refType",(function(){return _}));var i=n(331),o=n(2),a=n.n(o);var s=(a.a.element,function(){return null});s.isRequired=(a.a.element.isRequired,function(){return null});var c=s;var u=(o.elementType,function(){return null});n(27),n(1);function l(e){return e}var f=n(247),d=n(70),p=n(67),h=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function g(e){var t="".concat(e).match(h);return t&&t[1]||""}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.displayName||e.name||g(e)||t}function m(e,t,n){var r=v(t);return e.displayName||(""!==r?"".concat(n,"(").concat(r,")"):n)}function y(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return v(e,"Component");if("object"===Object(d.a)(e))switch(e.$$typeof){case p.ForwardRef:return m(e,e.render,"ForwardRef");case p.Memo:return m(e,e.type,"memo");default:return}}}function b(e,t,n,r,i){return null}var w="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),_=a.a.oneOfType([a.a.func,a.a.object])},function(e,t,n){"use strict";n.r(t);var r=n(531);n.d(t,"addCompanionWindow",(function(){return r.a})),n.d(t,"addOrUpdateCompanionWindow",(function(){return r.b})),n.d(t,"updateCompanionWindow",(function(){return r.e})),n.d(t,"removeCompanionWindow",(function(){return r.c})),n.d(t,"toggleNode",(function(){return r.d}));var i=n(320);n.d(t,"importConfig",(function(){return i.a})),n.d(t,"setConfig",(function(){return i.c})),n.d(t,"updateConfig",(function(){return i.d})),n.d(t,"importMiradorState",(function(){return i.b}));var o=n(554);n.d(t,"addError",(function(){return o.a})),n.d(t,"removeError",(function(){return o.b}));var a=n(555);n.d(t,"focusWindow",(function(){return a.b})),n.d(t,"addWindow",(function(){return a.a})),n.d(t,"updateWindow",(function(){return a.l})),n.d(t,"maximizeWindow",(function(){return a.d})),n.d(t,"minimizeWindow",(function(){return a.e})),n.d(t,"setCompanionAreaOpen",(function(){return a.g})),n.d(t,"removeWindow",(function(){return a.f})),n.d(t,"toggleWindowSideBar",(function(){return a.k})),n.d(t,"setWindowThumbnailPosition",(function(){return a.h})),n.d(t,"setWindowViewType",(function(){return a.i})),n.d(t,"showCollectionDialog",(function(){return a.j})),n.d(t,"hideCollectionDialog",(function(){return a.c}));var s=n(556);n.d(t,"requestManifest",(function(){return s.e})),n.d(t,"receiveManifest",(function(){return s.b})),n.d(t,"receiveManifestFailure",(function(){return s.c})),n.d(t,"fetchManifest",(function(){return s.a})),n.d(t,"removeManifest",(function(){return s.d}));var c=n(557);n.d(t,"requestInfoResponse",(function(){return c.f})),n.d(t,"receiveInfoResponse",(function(){return c.c})),n.d(t,"receiveDegradedInfoResponse",(function(){return c.b})),n.d(t,"receiveInfoResponseFailure",(function(){return c.d})),n.d(t,"fetchInfoResponse",(function(){return c.a})),n.d(t,"removeInfoResponse",(function(){return c.e}));var u=n(558);n.d(t,"setCanvas",(function(){return u.a})),n.d(t,"setNextCanvas",(function(){return u.b})),n.d(t,"setPreviousCanvas",(function(){return u.c})),n.d(t,"updateViewport",(function(){return u.d}));var l=n(559);n.d(t,"updateWorkspace",(function(){return l.g})),n.d(t,"setWorkspaceFullscreen",(function(){return l.b})),n.d(t,"toggleZoomControls",(function(){return l.f})),n.d(t,"updateWorkspaceMosaicLayout",(function(){return l.h})),n.d(t,"setWorkspaceAddVisibility",(function(){return l.a})),n.d(t,"setWorkspaceViewportPosition",(function(){return l.d})),n.d(t,"setWorkspaceViewportDimensions",(function(){return l.c})),n.d(t,"toggleDraggingEnabled",(function(){return l.e}));var f=n(560);n.d(t,"requestCanvasAnnotations",(function(){return f.f})),n.d(t,"requestAnnotation",(function(){return f.e})),n.d(t,"receiveAnnotation",(function(){return f.c})),n.d(t,"receiveAnnotationFailure",(function(){return f.d})),n.d(t,"selectAnnotation",(function(){return f.g})),n.d(t,"deselectAnnotation",(function(){return f.a})),n.d(t,"toggleAnnotationDisplay",(function(){return f.h})),n.d(t,"hoverAnnotation",(function(){return f.b}));var d=n(561);n.d(t,"addAuthenticationRequest",(function(){return d.a})),n.d(t,"resolveAuthenticationRequest",(function(){return d.g})),n.d(t,"requestAccessToken",(function(){return d.d})),n.d(t,"receiveAccessToken",(function(){return d.b})),n.d(t,"receiveAccessTokenFailure",(function(){return d.c})),n.d(t,"resolveAccessTokenRequest",(function(){return d.f})),n.d(t,"resetAuthenticationState",(function(){return d.e}));var p=n(562);n.d(t,"updateElasticWindowLayout",(function(){return p.a}));var h=n(563);n.d(t,"requestSearch",(function(){return h.e})),n.d(t,"receiveSearch",(function(){return h.b})),n.d(t,"receiveSearchFailure",(function(){return h.c})),n.d(t,"removeSearch",(function(){return h.d})),n.d(t,"fetchSearch",(function(){return h.a})),n.d(t,"setContentSearchCurrentAnnotation",(function(){return h.f}));var g=n(564);n.d(t,"updateLayers",(function(){return g.a}));var v=n(565);n.d(t,"addResource",(function(){return v.a})),n.d(t,"removeResource",(function(){return v.b}))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.r(t),n.d(t,"hexToRgb",(function(){return r.h})),n.d(t,"rgbToHex",(function(){return r.l})),n.d(t,"hslToRgb",(function(){return r.i})),n.d(t,"decomposeColor",(function(){return r.c})),n.d(t,"recomposeColor",(function(){return r.k})),n.d(t,"getContrastRatio",(function(){return r.f})),n.d(t,"getLuminance",(function(){return r.g})),n.d(t,"emphasize",(function(){return r.d})),n.d(t,"fade",(function(){return r.e})),n.d(t,"alpha",(function(){return r.a})),n.d(t,"darken",(function(){return r.b})),n.d(t,"lighten",(function(){return r.j})),n.d(t,"createTheme",(function(){return i.b})),n.d(t,"createMuiTheme",(function(){return i.a})),n.d(t,"unstable_createMuiStrictModeTheme",(function(){return a})),n.d(t,"createStyles",(function(){return c})),n.d(t,"makeStyles",(function(){return d})),n.d(t,"responsiveFontSizes",(function(){return _})),n.d(t,"styled",(function(){return x.a})),n.d(t,"easing",(function(){return O.c})),n.d(t,"duration",(function(){return O.b})),n.d(t,"useTheme",(function(){return S.a})),n.d(t,"withStyles",(function(){return E.a})),n.d(t,"withTheme",(function(){return k})),n.d(t,"createGenerateClassName",(function(){return T.a})),n.d(t,"jssPreset",(function(){return j.a})),n.d(t,"ServerStyleSheets",(function(){return P.a})),n.d(t,"StylesProvider",(function(){return I.b})),n.d(t,"MuiThemeProvider",(function(){return R.a})),n.d(t,"ThemeProvider",(function(){return R.a}));var r=n(24),i=n(178),o=n(331);function a(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};return Object(l.a)(e,Object(u.a)({defaultTheme:f.a},t))},p=n(247),h=n(27);function g(e){return String(parseFloat(e)).length===String(e).length}function v(e){return parseFloat(e)}function m(e){return function(t,n){var r=String(t).match(/[\d.\-+]*\s*(.*)/)[1]||"";if(r===n)return t;var i=v(t);if("px"!==r)if("em"===r)i=v(t)*v(e);else if("rem"===r)return i=v(t)*v(e),t;var o=i;if("px"!==n)if("em"===n)o=i/v(e);else{if("rem"!==n)return t;o=i/v(e)}return parseFloat(o.toFixed(5))+n}}function y(e){var t=e.size,n=e.grid,r=t-t%n,i=r+n;return t-r1&&void 0!==arguments[1]?arguments[1]:{},n=t.breakpoints,r=void 0===n?["sm","md","lg"]:n,i=t.disableAlign,o=void 0!==i&&i,a=t.factor,s=void 0===a?2:a,c=t.variants,l=void 0===c?["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]:c,f=Object(u.a)({},e);f.typography=Object(u.a)({},f.typography);var d=f.typography,h=m(d.htmlFontSize),v=r.map((function(e){return f.breakpoints.values[e]}));return l.forEach((function(e){var t=d[e],n=parseFloat(h(t.fontSize,"rem"));if(!(n<=1)){var r=n,i=1+(r-1)/s,a=t.lineHeight;if(!g(a)&&!o)throw new Error(Object(p.a)(6));g(a)||(a=parseFloat(h(a,"rem"))/parseFloat(n));var c=null;o||(c=function(e){return y({size:e,grid:b({pixels:4,lineHeight:a,htmlFontSize:d.htmlFontSize})})}),d[e]=Object(u.a)({},t,w({cssProperty:"fontSize",min:i,max:r,unit:"rem",breakpoints:v,transform:c}))}})),f}var x=n(322),O=n(49),S=n(36),E=n(5),C=n(290),k=Object(C.b)({defaultTheme:f.a}),T=n(756),j=n(762),P=n(1150),I=n(242),R=n(1151)},function(e,t,n){var r=n(203);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},function(e,t,n){"use strict";n.r(t);var r=n(96);n.d(t,"default",(function(){return r.a}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(64);function o(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(i.a)(e,n),Object(i.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return c}));var r={UNSTYLED:"unstyled",HEADER_ONE:"header-one",HEADER_TWO:"header-two",HEADER_THREE:"header-three",HEADER_FOUR:"header-four",HEADER_FIVE:"header-five",HEADER_SIX:"header-six",UNORDERED_LIST_ITEM:"unordered-list-item",ORDERED_LIST_ITEM:"ordered-list-item",BLOCKQUOTE:"blockquote",PULLQUOTE:"pullquote",CODE:"code-block",ATOMIC:"atomic"},i={LINK:"LINK",IMAGE:"IMAGE",EMBED:"embed"},o={BOLD:"BOLD",CODE:"CODE",ITALIC:"ITALIC",STRIKETHROUGH:"STRIKETHROUGH",UNDERLINE:"UNDERLINE"},a=n(127),s=new a.OrderedSet;function c(e,t){for(var n=null,r=null,i=[],o=0,a=0,s=e.length;a0&&n!==r&&(i.push([r,u(e.slice(o,a),t.slice(o,a))]),o=a)}return i.push([n,u(e.slice(o),t.slice(o))]),i}function u(e,t){for(var n=s,r=s,i=[],o=0,c=0,u=e.length;c0&&!Object(a.is)(n,r)&&(i.push([e.slice(o,c),r]),o=c)}return i.push([e.slice(o),n]),i}n(105)},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(849)},function(e,t,n){"use strict";var r=n(7),i=n(9),o=n(8),a=n(101),s=n(88),c=Object(r.compose)(Object(i.b)((function(e){return{containerId:Object(s.b)(e)}}),null),Object(o.a)("MiradorMenuButton"));t.a=c(a.MiradorMenuButton)},function(e,t,n){"use strict";n.d(t,"a",(function(){return C})),n.d(t,"b",(function(){return B})),n.d(t,"c",(function(){return re})),n.d(t,"d",(function(){return D}));var r,i,o=function(){function e(e){this.__jsonld=e,this.context=this.getProperty("context"),this.id=this.getProperty("id")}return e.prototype.getProperty=function(e){var t=null;return this.__jsonld&&((t=this.__jsonld[e])||(t=this.__jsonld["@"+e])),t},e}(),a=n(16),s=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=function(e){function t(t,n){var r=e.call(this,t)||this;return r.options=n,r}return s(t,e),t.prototype.getIIIFResourceType=function(){return D.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){var e=this.getProperty("label");return e?B.parse(e,this.options.locale):new B([],this.options.locale)},t.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},t.prototype.getMetadata=function(){var e=this.getProperty("metadata"),t=[];if(!e)return t;for(var n=0;n-1||this.externalResource.data["@context"].indexOf("/1.1/context.json")>-1||this.externalResource.data["@context"].indexOf("/1/context.json")>-1)&&(r="native");else{var o=this.getImages();if(o&&o.length){var a=o[0].getResource(),s=a.getServices();if(i||(i=a.getWidth()),s.length){var c=s[0];n=c.id,r=D.getImageQuality(c.getProfile())}else if(i===a.getWidth())return a.id}if(!n){var u=this.getProperty("thumbnail");if(u){if("string"==typeof u)return u;if(u["@id"])return u["@id"];if(u.length)return u[0].id}}}return t=i+",",n&&n.endsWith("/")&&(n=n.substr(0,n.length-1)),[n,"full",t,0,r+".jpg"].join("/")},t.prototype.getMaxDimensions=function(){var e,t=null;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(e=this.externalResource.data.profile,Array.isArray(e)&&(e=e.filter((function(e){return e.maxWidth}))[0])&&(t=new Y(e.maxWidth,e.maxHeight?e.maxHeight:e.maxWidth))),t},t.prototype.getContent=function(){var e=[],t=this.__jsonld.items||this.__jsonld.content;if(!t)return e;var n=null;if(t.length&&(n=new w(t[0],this.options)),!n)return e;for(var r=n.getItems(),i=0;i"),null===this.value?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValue(e||this.defaultLocale,t))},e.prototype.getValues=function(e){return null===this.value?[]:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValues(e||this.defaultLocale))},e.prototype.setValue=function(e){null===this.value&&(this.value=new B([])),this.value.setValue(e,this.defaultLocale)},e}(),I=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),R=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}I(t,e),t.getValue=function(e,t){return e.getValue(t,"
")},t.getValues=function(e,t){return e.getValues(t)}}(Array),n(97)),A=(n(453),function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}),M=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]"):this._value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locale",{get:function(){return void 0===this._locale?this._defaultLocale:this._locale},enumerable:!0,configurable:!0}),e.prototype.addValue=function(e){Array.isArray(this._value)||(this._value=[this._value]),Array.isArray(e)?this._value=this._value.concat(e):this._value.push(e)},e}(),B=function(e){function t(n,r){void 0===n&&(n=[]);var i=e.apply(this,n)||this;return i.__proto__=t.prototype,i._defaultLocale=r,i}return N(t,e),t.parse=function(e,n){if(!e)return new t([],n);if(Array.isArray(e)){var r=(i=e.map((function(e){return z.parseV2Value(e,n)})).filter((function(e){return null!==e}))).reduce((function(e,t){var n=t._locale;return n||(n="none"),e[n]?e[n].addValue(t._value):e[n]=t,e}),{});return new t(Object.values(r),n)}return"string"==typeof e?new t([new z(e,void 0,n)],n):e["@language"]?new t(null!==(i=z.parseV2Value(e))?[i]:[],n):new t(Object.keys(e).map((function(t){var r=e[t];if(!Array.isArray(r))throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");return new z(r,t,n)})),n);var i},t.prototype.getSuitableLocale=function(e){for(var t=L(this).map((function(e){return e._locale})).filter((function(e){return void 0!==e})),n=function(e){var n=t.find((function(t){return t===e}));if(n)return{value:n}},r=0,i=e;r1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();if(e)return e===a.ViewingHint.PAGED;var t=this.getBehavior();return!!t&&t===a.Behavior.PAGED},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t}(d);!function(e){e.EMPTY="",e.MANUSCRIPT="manuscript",e.MONOGRAPH="monograph"}(i||(i={}));var H,V=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),U=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._ranges=null,r.canvases=null,r.items=[],r}return V(t,e),t.prototype.getCanvasIds=function(){return this.__jsonld.canvases?this.__jsonld.canvases:this.canvases?this.canvases:[]},t.prototype.getDuration=function(){if(this.canvases&&this.canvases.length){for(var e=[],t=[],n=0,r=this.canvases;n1&&(0===d&&(l=Number(h[0])),d===this.canvases.length-1&&(f=Number(h[1])))}else{var g=this.getRanges();for(d=0;d=t.start&&e<=t.end)},t.prototype._parseTreeNode=function(e,t){e.label=t.getLabel().getValue(this.options.locale),e.data=t,e.data.type=D.normaliseType(J.RANGE),t.treeNode=e;var n=t.getRanges();if(n&&n.length)for(var r=0;r=0;t--){var n=this.getCanvasByIndex(t).getLabel().getValue(this.options.locale);if(e){if(/^[a-zA-Z0-9]*$/.test(n))return n}else if(n)return n}return this.options.defaultLabel},t.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},t.prototype.getNextPageIndex=function(e,t){var n;if(t){var r=this.getPagedIndices(e),i=this.getViewingDirection();n=i&&i===a.ViewingDirection.RIGHT_TO_LEFT?r[0]+1:r[r.length-1]+1}else n=e+1;return n>this.getLastPageIndex()?-1:n},t.prototype.getPagedIndices=function(e,t){var n=[];if(t){n=this.isFirstCanvas(e)||this.isLastCanvas(e)?[e]:e%2?[e,e+1]:[e-1,e];var r=this.getViewingDirection();r&&r===a.ViewingDirection.RIGHT_TO_LEFT&&(n=n.reverse())}else n.push(e);return n},t.prototype.getPrevPageIndex=function(e,t){var n;if(t){var r=this.getPagedIndices(e),i=this.getViewingDirection();n=i&&i===a.ViewingDirection.RIGHT_TO_LEFT?r[r.length-1]-1:r[0]-1}else n=e-1;return n},t.prototype.getStartCanvasIndex=function(){var e=this.getStartCanvas();if(e)for(var t=0;tthis.getTotalCanvases()-1},t.prototype.isFirstCanvas=function(e){return 0===e},t.prototype.isLastCanvas=function(e){return e===this.getTotalCanvases()-1},t.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();return!!e&&e===a.ViewingHint.PAGED},t.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2==0},t}(c),Z=function(){function e(){}return e.parse=function(e,t){return"string"==typeof e&&(e=JSON.parse(e)),this.parseJson(e,t)},e.parseJson=function(e,t){var n;if(t&&t.navDate&&!isNaN(t.navDate.getTime())&&(e.navDate=t.navDate.toString()),e["@type"])switch(e["@type"]){case"sc:Collection":n=this.parseCollection(e,t);break;case"sc:Manifest":n=this.parseManifest(e,t);break;default:return null}else switch(e.type){case"Collection":n=this.parseCollection(e,t);break;case"Manifest":n=this.parseManifest(e,t);break;default:return null}return n.isLoaded=!0,n},e.parseCollection=function(e,t){var n=new T(e,t);return t?(n.index=t.index||0,t.resource&&(n.parentCollection=t.resource.parentCollection)):n.index=0,this.parseCollections(n,t),this.parseManifests(n,t),this.parseItems(n,t),n},e.parseCollections=function(e,t){var n;if(e.__jsonld.collections?n=e.__jsonld.collections:e.__jsonld.items&&(n=e.__jsonld.items.filter((function(e){return"collection"===e.type.toLowerCase()}))),n)for(var r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=i.a.forwardRef((function(e,t){var n=e.PluginComponents,r=(e.classes,u(e,o));return n?n.map((function(e,n){return i.a.isValidElement(e)?i.a.cloneElement(e,s(s({},r),{},{ref:t})):i.a.createElement(e,Object.assign({ref:t},r,{key:n}))})):null}))},function(e,t,n){"use strict";n.d(t,"g",(function(){return o})),n.d(t,"h",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"i",(function(){return u})),n.d(t,"f",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return p}));var r=n(10),i=n(46);function o(e){return Object.values(Object(i.a)(e).windows).map((function(e){return e.manifestId}))}function a(e){return Object(i.a)(e).windows||{}}function s(e,t){var n=t.windowId;return a(e)[n]}var c=Object(r.createSelector)([function(e){return Object(i.a)(e).viewers},function(e,t){return t.windowId}],(function(e,t){return e[t]}));function u(e){return Object(i.a)(e).workspace}var l=Object(r.createSelector)([u],(function(e){return e.windowIds||[]}));function f(e){return Object(i.a)(e).manifests||{}}function d(e,t){var n=t.manifestId,r=t.windowId,i=f(e);return i&&i[n||r&&(s(e,{windowId:r})||{}).manifestId]}function p(e){return Object(i.a)(e).catalog||{}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function o(e){var t=r.useRef(e);return i((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:H(e)}function r(e){return s(e)?e:V(e)}function i(e){return c(e)?e:U(e)}function o(e){return a(e)&&!u(e)?e:q(e)}function a(e){return!(!e||!e[f])}function s(e){return!(!e||!e[d])}function c(e){return!(!e||!e[p])}function u(e){return s(e)||c(e)}function l(e){return!(!e||!e[h])}t(r,n),t(i,n),t(o,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=c,n.isAssociative=u,n.isOrdered=l,n.Keyed=r,n.Indexed=i,n.Set=o;var f="@@__IMMUTABLE_ITERABLE__@@",d="@@__IMMUTABLE_KEYED__@@",p="@@__IMMUTABLE_INDEXED__@@",h="@@__IMMUTABLE_ORDERED__@@",g={},v={value:!1},m={value:!1};function y(e){return e.value=!1,e}function b(e){e&&(e.value=!0)}function w(){}function _(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?x(e)+t:t}function S(){return!0}function E(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function C(e,t){return T(e,t,0)}function k(e,t){return T(e,t,t)}function T(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var j,P,I,R="function"==typeof Symbol&&Symbol.iterator,A=R||"@@iterator";function M(e){this.next=e}function D(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function N(){return{value:void 0,done:!0}}function L(e){return!!F(e)}function z(e){return e&&"function"==typeof e.next}function B(e){var t=F(e);return t&&t.call(e)}function F(e){var t=e&&(R&&e[R]||e["@@iterator"]);if("function"==typeof t)return t}function W(e){return e&&"number"==typeof e.length}function H(e){return null==e?Q():a(e)?e.toSeq():function(e){var t=ee(e)||"object"==typeof e&&new K(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function V(e){return null==e?Q().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():Y(e)}function U(e){return null==e?Q():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():J(e)}function q(e){return(null==e?Q():a(e)?s(e)?e.entrySeq():e:J(e)).toSetSeq()}function G(e){this._array=e,this.size=e.length}function K(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function $(e){this._iterable=e,this.size=e.length||e.size}function Z(e){this._iterator=e,this._iteratorCache=[]}function X(e){return!(!e||!e["@@__IMMUTABLE_SEQ__@@"])}function Q(){return j||(j=new G([]))}function Y(e){var t=Array.isArray(e)?new G(e).fromEntrySeq():z(e)?new Z(e).fromEntrySeq():L(e)?new $(e).fromEntrySeq():"object"==typeof e?new K(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function J(e){var t=ee(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ee(e){return W(e)?new G(e):z(e)?new Z(e):L(e)?new $(e):void 0}function te(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function ne(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new M((function(){var e=i[n?o-a:a];return a++>o?{value:void 0,done:!0}:D(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function re(e,t){return t?function e(t,n,r,i){return Array.isArray(n)?t.call(i,r,U(n).map((function(r,i){return e(t,r,i,n)}))):oe(n)?t.call(i,r,V(n).map((function(r,i){return e(t,r,i,n)}))):n}(t,e,"",{"":e}):ie(e)}function ie(e){return Array.isArray(e)?U(e).map(ie).toList():oe(e)?V(e).map(ie).toMap():e}function oe(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ae(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function se(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||c(e)!==c(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!u(e);if(l(e)){var r=e.entries();return t.every((function(e,t){var i=r.next().value;return i&&ae(i[1],e)&&(n||ae(i[0],t))}))&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var f=!0,d=t.__iterate((function(t,r){if(n?!e.has(t):i?!ae(t,e.get(r,g)):!ae(e.get(r,g),t))return f=!1,!1}));return f&&e.size===d}function ce(e,t){if(!(this instanceof ce))return new ce(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(P)return P;P=this}}function ue(e,t){if(!e)throw new Error(t)}function le(e,t,n){if(!(this instanceof le))return new le(e,t,n);if(ue(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),tr?{value:void 0,done:!0}:D(e,i,n[t?r-i++:i++])}))},t(K,V),K.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},K.prototype.has=function(e){return this._object.hasOwnProperty(e)},K.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},K.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new M((function(){var a=r[t?i-o:o];return o++>i?{value:void 0,done:!0}:D(e,a,n[a])}))},K.prototype[h]=!0,t($,U),$.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=B(this._iterable),r=0;if(z(n))for(var i;!(i=n.next()).done&&!1!==e(i.value,r++,this););return r},$.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=B(this._iterable);if(!z(n))return new M(N);var r=0;return new M((function(){var t=n.next();return t.done?t:D(e,r++,t.value)}))},t(Z,U),Z.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,i=this._iteratorCache,o=0;o=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return D(e,i,r[i++])}))},t(ce,U),ce.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},ce.prototype.get=function(e,t){return this.has(e)?this._value:t},ce.prototype.includes=function(e){return ae(this._value,e)},ce.prototype.slice=function(e,t){var n=this.size;return E(e,t,n)?this:new ce(this._value,k(t,n)-C(e,n))},ce.prototype.reverse=function(){return this},ce.prototype.indexOf=function(e){return ae(this._value,e)?0:-1},ce.prototype.lastIndexOf=function(e){return ae(this._value,e)?this.size:-1},ce.prototype.__iterate=function(e,t){for(var n=0;n1?" by "+this._step:"")+" ]"},le.prototype.get=function(e,t){return this.has(e)?this._start+O(this,e)*this._step:t},le.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t=0&&nn?{value:void 0,done:!0}:D(e,o++,a)}))},le.prototype.equals=function(e){return e instanceof le?this._start===e._start&&this._end===e._end&&this._step===e._step:se(this,e)},t(fe,n),t(de,fe),t(pe,fe),t(he,fe),fe.Keyed=de,fe.Indexed=pe,fe.Set=he;var ge="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function ve(e){return e>>>1&1073741824|3221225471&e}function me(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return ve(n)}if("string"===t)return e.length>Ee?function(e){var t=Te[e];return void 0===t&&(t=ye(e),ke===Ce&&(ke=0,Te={}),ke++,Te[e]=t),t}(e):ye(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(xe&&void 0!==(t=be.get(e)))return t;if(void 0!==(t=e[Se]))return t;if(!_e){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Se]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Oe,1073741824&Oe&&(Oe=0),xe)be.set(e,t);else{if(void 0!==we&&!1===we(e))throw new Error("Non-extensible objects are not allowed as keys.");if(_e)Object.defineProperty(e,Se,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Se]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Se]=t}}return t}(e);if("function"==typeof e.toString)return ye(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ye(e){for(var t=0,n=0;n>>n),s=31&(0===n?r:r>>>n);return new Ne(t,1<>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function et(e,t,n,r){var i=r?e:_(e);return i[t]=n,i}Me[Ae]=!0,Me.delete=Me.remove,Me.removeIn=Me.deleteIn,De.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o=tt)return function(e,t,n,r){e||(e=new w);for(var i=new Be(e,me(n),[n,r]),o=0;o>>e)),o=this.bitmap;return 0==(o&i)?r:this.nodes[Je(o&i-1)].get(e+5,t,n,r)},Ne.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=me(r));var s=31&(0===t?n:n>>>t),c=1<=nt)return function(e,t,n,r,i){for(var o=0,a=new Array(32),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new Le(e,o+1,a)}(e,d,u,s,h);if(l&&!h&&2===d.length&&Ke(d[1^f]))return d[1^f];if(l&&h&&1===d.length&&Ke(h))return h;var v=e&&e===this.ownerID,m=l?h?u:u^c:u|c,y=l?h?et(d,f,h,v):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,a=0;a>>e),o=this.nodes[i];return o?o.get(e+5,t,n,r):r},Le.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=me(r));var s=31&(0===t?n:n>>>t),c=i===g,u=this.nodes,l=u[s];if(c&&!l)return this;var f=Ge(l,e,t+5,n,r,i,o,a);if(f===l)return this;var d=this.count;if(l){if(!f&&--d0&&r<32?pt(0,r,5,null,new ct(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function ot(e){return!(!e||!e[at])}t(it,pe),it.of=function(){return this(arguments)},it.prototype.toString=function(){return this.__toString("List [","]")},it.prototype.get=function(e,t){if((e=O(this,e))>=0&&e=e.size||t<0)return e.withMutations((function(e){t<0?yt(e,t).set(0,n):yt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,i=e._root,o=y(m);return t>=wt(e._capacity)?r=gt(r,e.__ownerID,0,t,n,o):i=gt(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):pt(e._origin,e._capacity,e._level,i,r):e}(this,e,t)},it.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},it.prototype.insert=function(e,t){return this.splice(e,0,t)},it.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):ht()},it.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){yt(n,0,t+e.length);for(var r=0;r>>t&31;if(r>=this.array.length)return new ct([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-5,n))===a&&o)return this}if(o&&!i)return this;var s=vt(this,e);if(!o)for(var c=0;c>>t&31;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((r=o&&o.removeAfter(e,t-5,n))===o&&i===this.array.length-1)return this}var a=vt(this,e);return a.array.splice(i+1),r&&(a.array[i]=r),a};var ut,lt,ft={};function dt(e,t){var n=e._origin,r=e._capacity,i=wt(r),o=e._tail;return a(e._root,e._level,0);function a(e,s,c){return 0===s?function(e,a){var s=a===i?o&&o.array:e&&e.array,c=a>n?0:n-a,u=r-a;return u>32&&(u=32),function(){if(c===u)return ft;var e=t?--u:c++;return s&&s[e]}}(e,c):function(e,i,o){var s,c=e&&e.array,u=o>n?0:n-o>>i,l=1+(r-o>>i);return l>32&&(l=32),function(){for(;;){if(s){var e=s();if(e!==ft)return e;s=null}if(u===l)return ft;var n=t?--l:u++;s=a(c&&c[n],i-5,o+(n<>>n&31,c=e&&s0){var u=e&&e.array[s],l=gt(u,t,n-5,r,i,o);return l===u?e:((a=vt(e,t)).array[s]=l,a)}return c&&e.array[s]===i?e:(b(o),a=vt(e,t),void 0===i&&s===a.array.length-1?a.array.pop():a.array[s]=i,a)}function vt(e,t){return t&&e&&t===e.ownerID?e:new ct(e?e.array.slice():[],t)}function mt(e,t){if(t>=wt(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&31],r-=5;return n}}function yt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new w,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var c=e._level,u=e._root,l=0;a+l<0;)u=new ct(u&&u.array.length?[void 0,u]:[],r),l+=1<<(c+=5);l&&(a+=l,i+=l,s+=l,o+=l);for(var f=wt(o),d=wt(s);d>=1<f?new ct([],r):p;if(p&&d>f&&a5;v-=5){var m=f>>>v&31;g=g.array[m]=vt(g.array[m],r)}g.array[f>>>5&31]=p}if(s=d)a-=d,s-=d,c=5,u=null,h=h&&h.removeBefore(r,0,a);else if(a>i||d>>c&31;if(y!==d>>>c&31)break;y&&(l+=(1<i&&(u=u.removeBefore(r,c,a-l)),u&&do&&(o=u.size),a(c)||(u=u.map((function(e){return re(e)}))),r.push(u)}return o>e.size&&(e=e.setSize(o)),Ye(e,t,r)}function wt(e){return e<32?0:e-1>>>5<<5}function _t(e){return null==e?St():xt(e)?e:St().withMutations((function(t){var n=r(e);je(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function xt(e){return Ie(e)&&l(e)}function Ot(e,t,n,r){var i=Object.create(_t.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=n,i.__hash=r,i}function St(){return lt||(lt=Ot(Ue(),ht()))}function Et(e,t,n){var r,i,o=e._map,a=e._list,s=o.get(t),c=void 0!==s;if(n===g){if(!c)return e;a.size>=32&&a.size>=2*o.size?(r=(i=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(c){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):Ot(r,i)}function Ct(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function kt(e){this._iter=e,this.size=e.size}function Tt(e){this._iter=e,this.size=e.size}function jt(e){this._iter=e,this.size=e.size}function Pt(e){var t=Gt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Kt,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(2===t){var r=e.__iterator(t,n);return new M((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,n)},t}function It(e,t,n){var r=Gt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,g);return o===g?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate((function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)}),i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(2,i);return new M((function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return D(r,s,t.call(n,a[1],s,e),i)}))},r}function Rt(e,t){var n=Gt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Pt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Kt,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function At(e,t,n,r){var i=Gt(e);return r&&(i.has=function(r){var i=e.get(r,g);return i!==g&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,g);return o!==g&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate((function(e,o,c){if(t.call(n,e,o,c))return s++,i(e,r?o:s-1,a)}),o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(2,o),s=0;return new M((function(){for(;;){var o=a.next();if(o.done)return o;var c=o.value,u=c[0],l=c[1];if(t.call(n,l,u,e))return D(i,r?u:s++,l,o)}}))},i}function Mt(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n|=0),E(t,n,i))return e;var o=C(t,i),a=k(n,i);if(o!=o||a!=a)return Mt(e.toSeq().cacheResult(),t,n,r);var s,c=a-o;c==c&&(s=c<0?0:c);var u=Gt(e);return u.size=0===s?s:e.size&&s||void 0,!r&&X(e)&&s>=0&&(u.get=function(t,n){return(t=O(this,t))>=0&&ts)return{value:void 0,done:!0};var e=i.next();return r||1===t?e:D(t,c-1,0===t?void 0:e.value[1],e)}))},u}function Dt(e,t,n,r){var i=Gt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,c=0;return e.__iterate((function(e,o,u){if(!s||!(s=t.call(n,e,o,u)))return c++,i(e,r?o:c-1,a)})),c},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(2,o),c=!0,u=0;return new M((function(){var e,o,l;do{if((e=s.next()).done)return r||1===i?e:D(i,u++,0===i?void 0:e.value[1],e);var f=e.value;o=f[0],l=f[1],c&&(c=t.call(n,l,o,a))}while(c);return 2===i?e:D(i,o,l,e)}))},i}function Nt(e,t){var n=s(e),i=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?Y(e):J(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===i.length)return e;if(1===i.length){var o=i[0];if(o===e||n&&s(o)||c(e)&&c(o))return o}var u=new G(i);return n?u=u.toKeyedSeq():c(e)||(u=u.toSetSeq()),(u=u.flatten(!0)).size=i.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),u}function Lt(e,t,n){var r=Gt(e);return r.__iterateUncached=function(r,i){var o=0,s=!1;return function e(c,u){var l=this;c.__iterate((function(i,c){return(!t||u0}function Wt(e,t,r){var i=Gt(e);return i.size=new G(r).map((function(e){return e.size})).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(1,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map((function(e){return e=n(e),B(i?e.reverse():e)})),a=0,s=!1;return new M((function(){var n;return s||(n=o.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?{value:void 0,done:!0}:D(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},i}function Ht(e,t){return X(e)?t:e.constructor(t)}function Vt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Ut(e){return je(e.size),x(e)}function qt(e){return s(e)?r:c(e)?i:o}function Gt(e){return Object.create((s(e)?V:c(e)?U:q).prototype)}function Kt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):H.prototype.cacheResult.call(this)}function $t(e,t){return e>t?1:e=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):_n(e,t)},vn.prototype.pushAll=function(e){if(0===(e=i(e)).size)return this;je(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):_n(t,n)},vn.prototype.pop=function(){return this.slice(1)},vn.prototype.unshift=function(){return this.push.apply(this,arguments)},vn.prototype.unshiftAll=function(e){return this.pushAll(e)},vn.prototype.shift=function(){return this.pop.apply(this,arguments)},vn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):xn()},vn.prototype.slice=function(e,t){if(E(e,t,this.size))return this;var n=C(e,this.size);if(k(t,this.size)!==this.size)return pe.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):_n(r,i)},vn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?_n(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},vn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},vn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new M((function(){if(r){var t=r.value;return r=r.next,D(e,n++,t)}return{value:void 0,done:!0}}))},vn.isStack=mn;var yn,bn="@@__IMMUTABLE_STACK__@@",wn=vn.prototype;function _n(e,t,n,r){var i=Object.create(wn);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function xn(){return yn||(yn=_n(0))}function On(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}wn[bn]=!0,wn.withMutations=Me.withMutations,wn.asMutable=Me.asMutable,wn.asImmutable=Me.asImmutable,wn.wasAltered=Me.wasAltered,n.Iterator=M,On(n,{toArray:function(){je(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new kt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new Ct(this,!0)},toMap:function(){return Pe(this.toKeyedSeq())},toObject:function(){je(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return _t(this.toKeyedSeq())},toOrderedSet:function(){return ln(s(this)?this.valueSeq():this)},toSet:function(){return tn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Tt(this)},toSeq:function(){return c(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return vn(s(this)?this.valueSeq():this)},toList:function(){return it(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return Ht(this,Nt(this,t))},includes:function(e){return this.some((function(t){return ae(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){je(this.size);var n=!0;return this.__iterate((function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1})),n},filter:function(e,t){return Ht(this,At(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},findEntry:function(e,t){var n;return this.__iterate((function(r,i,o){if(e.call(t,r,i,o))return n=[i,r],!1})),n},findLastEntry:function(e,t){return this.toSeq().reverse().findEntry(e,t)},forEach:function(e,t){return je(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){je(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return Ht(this,It(this,e,t))},reduce:function(e,t,n){var r,i;return je(this.size),arguments.length<2?i=!0:r=t,this.__iterate((function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Ht(this,Rt(this,!0))},slice:function(e,t){return Ht(this,Mt(this,e,t,!0))},some:function(e,t){return!this.every(Tn(e),t)},sort:function(e){return Ht(this,zt(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return x(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Pe().asMutable();return e.__iterate((function(i,o){r.update(t.call(n,i,o,e),0,(function(e){return e+1}))})),r.asImmutable()}(this,e,t)},equals:function(e){return se(this,e)},entrySeq:function(){var e=this;if(e._cache)return new G(e._cache);var t=e.toSeq().map(kn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Tn(e),t)},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},first:function(){return this.find(S)},flatMap:function(e,t){return Ht(this,function(e,t,n){var r=qt(e);return e.toSeq().map((function(i,o){return r(t.call(n,i,o,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Ht(this,Lt(this,e,!0))},fromEntrySeq:function(){return new jt(this)},get:function(e,t){return this.find((function(t,n){return ae(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,i=Zt(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,g):g)===g)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),i=(l(e)?_t():Pe()).asMutable();e.__iterate((function(o,a){i.update(t.call(n,o,a,e),(function(e){return(e=e||[]).push(r?[a,o]:o),e}))}));var o=qt(e);return i.map((function(t){return Ht(e,o(t))}))}(this,e,t)},has:function(e){return this.get(e,g)!==g},hasIn:function(e){return this.getIn(e,g)!==g},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keySeq:function(){return this.toSeq().map(Cn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(e){return Bt(this,e)},maxBy:function(e,t){return Bt(this,t,e)},min:function(e){return Bt(this,e?jn(e):Rn)},minBy:function(e,t){return Bt(this,t?jn(t):Rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Ht(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Ht(this,Dt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Tn(e),t)},sortBy:function(e,t){return Ht(this,zt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Ht(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Ht(this,function(e,t,n){var r=Gt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate((function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)})),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(2,i),s=!0;return new M((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var i=e.value,c=i[0],u=i[1];return t.call(n,u,c,o)?2===r?e:D(r,c,u,e):(s=!1,{value:void 0,done:!0})}))},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Tn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=l(e),n=s(e),r=t?1:0;return function(e,t){return t=ge(t,3432918353),t=ge(t<<15|t>>>-15,461845907),t=ge(t<<13|t>>>-13,5),t=ge((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=ve((t=ge(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+An(me(e),me(t))|0}:function(e,t){r=r+An(me(e),me(t))|0}:t?function(e){r=31*r+me(e)|0}:function(e){r=r+me(e)|0}),r)}(this))}});var Sn=n.prototype;Sn[f]=!0,Sn[A]=Sn.values,Sn.__toJS=Sn.toArray,Sn.__toStringMapper=Pn,Sn.inspect=Sn.toSource=function(){return this.toString()},Sn.chain=Sn.flatMap,Sn.contains=Sn.includes,function(){try{Object.defineProperty(Sn,"length",{get:function(){if(!n.noLengthWarning){var e;try{throw new Error}catch(t){e=t.stack}if(-1===e.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+e),this.size}}})}catch(e){}}(),On(r,{flip:function(){return Ht(this,Pt(this))},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLastKey:function(e,t){return this.toSeq().reverse().findKey(e,t)},keyOf:function(e){return this.findKey((function(t){return ae(t,e)}))},lastKeyOf:function(e){return this.findLastKey((function(t){return ae(t,e)}))},mapEntries:function(e,t){var n=this,r=0;return Ht(this,this.toSeq().map((function(i,o){return e.call(t,[o,i],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Ht(this,this.toSeq().flip().map((function(r,i){return e.call(t,r,i,n)})).flip())}});var En=r.prototype;function Cn(e,t){return t}function kn(e,t){return[t,e]}function Tn(e){return function(){return!e.apply(this,arguments)}}function jn(e){return function(){return-e.apply(this,arguments)}}function Pn(e){return"string"==typeof e?JSON.stringify(e):e}function In(){return _(arguments)}function Rn(e,t){return et?-1:0}function An(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return En[d]=!0,En[A]=Sn.entries,En.__toJS=Sn.toObject,En.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Pn(e)},On(i,{toKeyedSeq:function(){return new Ct(this,!1)},filter:function(e,t){return Ht(this,At(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.toKeyedSeq().keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.toKeyedSeq().reverse().keyOf(e);return void 0===t?-1:t},reverse:function(){return Ht(this,Rt(this,!1))},slice:function(e,t){return Ht(this,Mt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=C(e,e<0?this.count():this.size);var r=this.slice(0,e);return Ht(this,1===n?r:r.concat(_(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.toKeyedSeq().findLastKey(e,t);return void 0===n?-1:n},first:function(){return this.get(0)},flatten:function(e){return Ht(this,Lt(this,e,!1))},get:function(e,t){return(e=O(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=O(this,e))>=0&&(void 0!==this.size?this.size===1/0||e2?n-2:0),o=2;o :not(:first-child)":{marginLeft:8}}},{name:"MuiAccordionActions"})(h),v=n(1153),m=n(1154),y=n(1155),b=n(1176),w=n(759),_=n(1120),x=(n(67),u.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.className,o=e.component,a=void 0===o?"div":o,l=e.onChange,f=e.showLabels,p=void 0!==f&&f,h=e.value,g=Object(c.a)(e,["children","classes","className","component","onChange","showLabels","value"]);return u.createElement(a,Object(s.a)({className:Object(d.a)(r.root,i),ref:t},g),u.Children.map(n,(function(e,t){if(!u.isValidElement(e))return null;var n=void 0===e.props.value?t:e.props.value;return u.cloneElement(e,{selected:n===h,showLabel:void 0!==e.props.showLabel?e.props.showLabel:p,value:n,onChange:l})})))}))),O=Object(p.a)((function(e){return{root:{display:"flex",justifyContent:"center",height:56,backgroundColor:e.palette.background.paper}}}),{name:"MuiBottomNavigation"})(x),S=n(190),E=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.icon,o=e.label,a=e.onChange,l=e.onClick,f=e.selected,p=e.showLabel,h=e.value,g=Object(c.a)(e,["classes","className","icon","label","onChange","onClick","selected","showLabel","value"]);return u.createElement(S.a,Object(s.a)({ref:t,className:Object(d.a)(n.root,r,f?n.selected:!p&&n.iconOnly),focusRipple:!0,onClick:function(e){a&&a(e,h),l&&l(e)}},g),u.createElement("span",{className:n.wrapper},i,u.createElement("span",{className:Object(d.a)(n.label,f?n.selected:!p&&n.iconOnly)},o)))})),C=Object(p.a)((function(e){return{root:{transition:e.transitions.create(["color","padding-top"],{duration:e.transitions.duration.short}),padding:"6px 12px 8px",minWidth:80,maxWidth:168,color:e.palette.text.secondary,flex:"1","&$iconOnly":{paddingTop:16},"&$selected":{paddingTop:6,color:e.palette.primary.main}},selected:{},iconOnly:{},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"},label:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(12),opacity:1,transition:"font-size 0.2s, opacity 0.2s",transitionDelay:"0.1s","&$iconOnly":{opacity:0,transitionDelay:"0s"},"&$selected":{fontSize:e.typography.pxToRem(14)}}}}),{name:"MuiBottomNavigationAction"})(E),k=n(291),T=n(69),j=n(292),P=n(580),I=n(293),R=n(294),A=n(295),M=n(296),D=n(581),N=n(297),L=n(318),z=n(298),B=n(322),F=Object(k.b)(Object(T.a)(j.h,P.a,I.d,R.a,A.b,M.c,D.a,N.b,L.b,z.a)),W=Object(B.a)("div")(F,{name:"MuiBox"}),H=n(50),V=n(96),U=n(24),q=n(43),G=Object(q.a)(u.createElement("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz");var K=Object(p.a)((function(e){return{root:{display:"flex",marginLeft:e.spacing(.5),marginRight:e.spacing(.5),backgroundColor:e.palette.grey[100],color:e.palette.grey[700],borderRadius:2,cursor:"pointer","&:hover, &:focus":{backgroundColor:e.palette.grey[200]},"&:active":{boxShadow:e.shadows[0],backgroundColor:Object(U.d)(e.palette.grey[200],.12)}},icon:{width:24,height:16}}}),{name:"PrivateBreadcrumbCollapsed"})((function(e){var t=e.classes,n=Object(c.a)(e,["classes"]);return u.createElement(S.a,Object(s.a)({component:"li",className:t.root,focusRipple:!0},n),u.createElement(G,{className:t.icon}))}));var $=u.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.className,o=e.component,a=void 0===o?"nav":o,l=e.expandText,f=void 0===l?"Show path":l,p=e.itemsAfterCollapse,h=void 0===p?1:p,g=e.itemsBeforeCollapse,v=void 0===g?1:g,m=e.maxItems,y=void 0===m?8:m,b=e.separator,w=void 0===b?"/":b,_=Object(c.a)(e,["children","classes","className","component","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"]),x=u.useState(!1),O=x[0],S=x[1],E=u.Children.toArray(n).filter((function(e){return u.isValidElement(e)})).map((function(e,t){return u.createElement("li",{className:r.li,key:"child-".concat(t)},e)}));return u.createElement(V.a,Object(s.a)({ref:t,component:a,color:"textSecondary",className:Object(d.a)(r.root,i)},_),u.createElement("ol",{className:r.ol},function(e,t,n){return e.reduce((function(r,i,o){return o=e.length?e:[].concat(Object(H.a)(e.slice(0,v)),[u.createElement(K,{"aria-label":f,key:"ellipsis",onClick:function(e){S(!0);var t=e.currentTarget.parentNode.querySelector("a[href],button,[tabindex]");t&&t.focus()}})],Object(H.a)(e.slice(e.length-h,e.length)))}(E),r.separator,w)))})),Z=Object(p.a)({root:{},ol:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"},li:{},separator:{display:"flex",userSelect:"none",marginLeft:8,marginRight:8}},{name:"MuiBreadcrumbs"})($),X=n(571),Q=n(11);X.a.styles;var Y=u.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.className,o=e.color,a=void 0===o?"default":o,l=e.component,f=void 0===l?"div":l,p=e.disabled,h=void 0!==p&&p,g=e.disableElevation,v=void 0!==g&&g,m=e.disableFocusRipple,y=void 0!==m&&m,b=e.disableRipple,w=void 0!==b&&b,_=e.fullWidth,x=void 0!==_&&_,O=e.orientation,S=void 0===O?"horizontal":O,E=e.size,C=void 0===E?"medium":E,k=e.variant,T=void 0===k?"outlined":k,j=Object(c.a)(e,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","disableRipple","fullWidth","orientation","size","variant"]),P=Object(d.a)(r.grouped,r["grouped".concat(Object(Q.a)(S))],r["grouped".concat(Object(Q.a)(T))],r["grouped".concat(Object(Q.a)(T)).concat(Object(Q.a)(S))],r["grouped".concat(Object(Q.a)(T)).concat("default"!==a?Object(Q.a)(a):"")],h&&r.disabled);return u.createElement(f,Object(s.a)({role:"group",className:Object(d.a)(r.root,i,x&&r.fullWidth,v&&r.disableElevation,"contained"===T&&r.contained,"vertical"===S&&r.vertical),ref:t},j),u.Children.map(n,(function(e){return u.isValidElement(e)?u.cloneElement(e,{className:Object(d.a)(P,e.props.className),color:e.props.color||a,disabled:e.props.disabled||h,disableElevation:e.props.disableElevation||v,disableFocusRipple:y,disableRipple:w,fullWidth:x,size:e.props.size||C,variant:e.props.variant||T}):null})))})),J=Object(p.a)((function(e){return{root:{display:"inline-flex",borderRadius:e.shape.borderRadius},contained:{boxShadow:e.shadows[2]},disableElevation:{boxShadow:"none"},disabled:{},fullWidth:{width:"100%"},vertical:{flexDirection:"column"},grouped:{minWidth:40},groupedHorizontal:{"&:not(:first-child)":{borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-child)":{borderTopRightRadius:0,borderBottomRightRadius:0}},groupedVertical:{"&:not(:first-child)":{borderTopRightRadius:0,borderTopLeftRadius:0},"&:not(:last-child)":{borderBottomRightRadius:0,borderBottomLeftRadius:0}},groupedText:{},groupedTextHorizontal:{"&:not(:last-child)":{borderRight:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")}},groupedTextVertical:{"&:not(:last-child)":{borderBottom:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")}},groupedTextPrimary:{"&:not(:last-child)":{borderColor:Object(U.a)(e.palette.primary.main,.5)}},groupedTextSecondary:{"&:not(:last-child)":{borderColor:Object(U.a)(e.palette.secondary.main,.5)}},groupedOutlined:{},groupedOutlinedHorizontal:{"&:not(:first-child)":{marginLeft:-1},"&:not(:last-child)":{borderRightColor:"transparent"}},groupedOutlinedVertical:{"&:not(:first-child)":{marginTop:-1},"&:not(:last-child)":{borderBottomColor:"transparent"}},groupedOutlinedPrimary:{"&:hover":{borderColor:e.palette.primary.main}},groupedOutlinedSecondary:{"&:hover":{borderColor:e.palette.secondary.main}},groupedContained:{boxShadow:"none"},groupedContainedHorizontal:{"&:not(:last-child)":{borderRight:"1px solid ".concat(e.palette.grey[400]),"&$disabled":{borderRight:"1px solid ".concat(e.palette.action.disabled)}}},groupedContainedVertical:{"&:not(:last-child)":{borderBottom:"1px solid ".concat(e.palette.grey[400]),"&$disabled":{borderBottom:"1px solid ".concat(e.palette.action.disabled)}}},groupedContainedPrimary:{"&:not(:last-child)":{borderColor:e.palette.primary.dark}},groupedContainedSecondary:{"&:not(:last-child)":{borderColor:e.palette.secondary.dark}}}}),{name:"MuiButtonGroup"})(Y),ee=n(1156),te=u.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.className,o=e.focusVisibleClassName,a=Object(c.a)(e,["children","classes","className","focusVisibleClassName"]);return u.createElement(S.a,Object(s.a)({className:Object(d.a)(r.root,i),focusVisibleClassName:Object(d.a)(o,r.focusVisible),ref:t},a),n,u.createElement("span",{className:r.focusHighlight}))})),ne=Object(p.a)((function(e){return{root:{display:"block",textAlign:"inherit",width:"100%","&:hover $focusHighlight":{opacity:e.palette.action.hoverOpacity},"&$focusVisible $focusHighlight":{opacity:.12}},focusVisible:{},focusHighlight:{overflow:"hidden",pointerEvents:"none",position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:"inherit",opacity:0,backgroundColor:"currentcolor",transition:e.transitions.create("opacity",{duration:e.transitions.duration.short})}}}),{name:"MuiCardActionArea"})(te),re=u.forwardRef((function(e,t){var n=e.disableSpacing,r=void 0!==n&&n,i=e.classes,o=e.className,a=Object(c.a)(e,["disableSpacing","classes","className"]);return u.createElement("div",Object(s.a)({className:Object(d.a)(i.root,o,!r&&i.spacing),ref:t},a))})),ie=Object(p.a)({root:{display:"flex",alignItems:"center",padding:8},spacing:{"& > :not(:first-child)":{marginLeft:8}}},{name:"MuiCardActions"})(re),oe=n(1157),ae=u.forwardRef((function(e,t){var n=e.action,r=e.avatar,i=e.classes,o=e.className,a=e.component,l=void 0===a?"div":a,f=e.disableTypography,p=void 0!==f&&f,h=e.subheader,g=e.subheaderTypographyProps,v=e.title,m=e.titleTypographyProps,y=Object(c.a)(e,["action","avatar","classes","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"]),b=v;null==b||b.type===V.a||p||(b=u.createElement(V.a,Object(s.a)({variant:r?"body2":"h5",className:i.title,component:"span",display:"block"},m),b));var w=h;return null==w||w.type===V.a||p||(w=u.createElement(V.a,Object(s.a)({variant:r?"body2":"body1",className:i.subheader,color:"textSecondary",component:"span",display:"block"},g),w)),u.createElement(l,Object(s.a)({className:Object(d.a)(i.root,o),ref:t},y),r&&u.createElement("div",{className:i.avatar},r),u.createElement("div",{className:i.content},b,w),n&&u.createElement("div",{className:i.action},n))})),se=Object(p.a)({root:{display:"flex",alignItems:"center",padding:16},avatar:{flex:"0 0 auto",marginRight:16},action:{flex:"0 0 auto",alignSelf:"flex-start",marginTop:-8,marginRight:-8},content:{flex:"1 1 auto"},title:{},subheader:{}},{name:"MuiCardHeader"})(ae),ce=["video","audio","picture","iframe","img"],ue=u.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.className,o=e.component,a=void 0===o?"div":o,l=e.image,f=e.src,p=e.style,h=Object(c.a)(e,["children","classes","className","component","image","src","style"]),g=-1!==ce.indexOf(a),v=!g&&l?Object(s.a)({backgroundImage:'url("'.concat(l,'")')},p):p;return u.createElement(a,Object(s.a)({className:Object(d.a)(r.root,i,g&&r.media,-1!=="picture img".indexOf(a)&&r.img),ref:t,style:v,src:g?l||f:void 0},h),n)})),le=Object(p.a)({root:{display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},media:{width:"100%"},img:{objectFit:"cover"}},{name:"MuiCardMedia"})(ue),fe=n(41),de=n(75),pe=n(81),he=n(757),ge=u.forwardRef((function(e,t){var n=e.autoFocus,r=e.checked,i=e.checkedIcon,o=e.classes,a=e.className,l=e.defaultChecked,f=e.disabled,p=e.icon,h=e.id,g=e.inputProps,v=e.inputRef,m=e.name,y=e.onBlur,b=e.onChange,w=e.onFocus,_=e.readOnly,x=e.required,O=e.tabIndex,S=e.type,E=e.value,C=Object(c.a)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),k=Object(de.a)({controlled:r,default:Boolean(l),name:"SwitchBase",state:"checked"}),T=Object(fe.a)(k,2),j=T[0],P=T[1],I=Object(pe.a)(),R=f;I&&void 0===R&&(R=I.disabled);var A="checkbox"===S||"radio"===S;return u.createElement(he.a,Object(s.a)({component:"span",className:Object(d.a)(o.root,a,j&&o.checked,R&&o.disabled),disabled:R,tabIndex:null,role:void 0,onFocus:function(e){w&&w(e),I&&I.onFocus&&I.onFocus(e)},onBlur:function(e){y&&y(e),I&&I.onBlur&&I.onBlur(e)},ref:t},C),u.createElement("input",Object(s.a)({autoFocus:n,checked:r,defaultChecked:l,className:o.input,disabled:R,id:A&&h,name:m,onChange:function(e){var t=e.target.checked;P(t),b&&b(e,t)},readOnly:_,ref:v,required:x,tabIndex:O,type:S,value:E},g)),j?i:p)})),ve=Object(p.a)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(ge),me=Object(q.a)(u.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),ye=Object(q.a)(u.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),be=Object(q.a)(u.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox"),we=u.createElement(ye,null),_e=u.createElement(me,null),xe=u.createElement(be,null),Oe=u.forwardRef((function(e,t){var n=e.checkedIcon,r=void 0===n?we:n,i=e.classes,o=e.color,a=void 0===o?"secondary":o,l=e.icon,f=void 0===l?_e:l,p=e.indeterminate,h=void 0!==p&&p,g=e.indeterminateIcon,v=void 0===g?xe:g,m=e.inputProps,y=e.size,b=void 0===y?"medium":y,w=Object(c.a)(e,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),_=h?v:f,x=h?v:r;return u.createElement(ve,Object(s.a)({type:"checkbox",classes:{root:Object(d.a)(i.root,i["color".concat(Object(Q.a)(a))],h&&i.indeterminate),checked:i.checked,disabled:i.disabled},color:a,inputProps:Object(s.a)({"data-indeterminate":h},m),icon:u.cloneElement(_,{fontSize:void 0===_.props.fontSize&&"small"===b?b:_.props.fontSize}),checkedIcon:u.cloneElement(x,{fontSize:void 0===x.props.fontSize&&"small"===b?b:x.props.fontSize}),ref:t},w))})),Se=Object(p.a)((function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(U.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(U.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiCheckbox"})(Oe),Ee=n(1177),Ce=n(1158),ke=n(455),Te=n(1127),je=n(27),Pe=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"div":i,a=e.disableGutters,l=void 0!==a&&a,f=e.fixed,p=void 0!==f&&f,h=e.maxWidth,g=void 0===h?"lg":h,v=Object(c.a)(e,["classes","className","component","disableGutters","fixed","maxWidth"]);return u.createElement(o,Object(s.a)({className:Object(d.a)(n.root,r,p&&n.fixed,l&&n.disableGutters,!1!==g&&n["maxWidth".concat(Object(Q.a)(String(g)))]),ref:t},v))})),Ie=Object(p.a)((function(e){return{root:Object(je.a)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),display:"block"},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),disableGutters:{paddingLeft:0,paddingRight:0},fixed:Object.keys(e.breakpoints.values).reduce((function(t,n){var r=e.breakpoints.values[n];return 0!==r&&(t[e.breakpoints.up(n)]={maxWidth:r}),t}),{}),maxWidthXs:Object(je.a)({},e.breakpoints.up("xs"),{maxWidth:Math.max(e.breakpoints.values.xs,444)}),maxWidthSm:Object(je.a)({},e.breakpoints.up("sm"),{maxWidth:e.breakpoints.values.sm}),maxWidthMd:Object(je.a)({},e.breakpoints.up("md"),{maxWidth:e.breakpoints.values.md}),maxWidthLg:Object(je.a)({},e.breakpoints.up("lg"),{maxWidth:e.breakpoints.values.lg}),maxWidthXl:Object(je.a)({},e.breakpoints.up("xl"),{maxWidth:e.breakpoints.values.xl})}}),{name:"MuiContainer"})(Pe),Re={WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box"},Ae=function(e){return Object(s.a)({color:e.palette.text.primary},e.typography.body2,{backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}})};var Me=Object(p.a)((function(e){return{"@global":{html:Re,"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:Object(s.a)({margin:0},Ae(e),{"&::backdrop":{backgroundColor:e.palette.background.default}})}}}),{name:"MuiCssBaseline"})((function(e){var t=e.children,n=void 0===t?null:t;return e.classes,u.createElement(u.Fragment,null,n)})),De=n(572),Ne=n(573),Le=n(574),ze=n(575),Be=n(576),Fe=n(582),We=n(106),He=n(339),Ve=n(140);var Ue=u.createContext({}),qe=u.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.className,o=e.defaultExpanded,a=void 0!==o&&o,l=e.disabled,f=void 0!==l&&l,p=e.expanded,h=e.onChange,g=e.square,v=void 0!==g&&g,m=e.TransitionComponent,y=void 0===m?Te.a:m,b=e.TransitionProps,w=Object(c.a)(e,["children","classes","className","defaultExpanded","disabled","expanded","onChange","square","TransitionComponent","TransitionProps"]),_=Object(de.a)({controlled:p,default:a,name:"ExpansionPanel",state:"expanded"}),x=Object(fe.a)(_,2),O=x[0],S=x[1],E=u.useCallback((function(e){S(!O),h&&h(e,!O)}),[O,h,S]),C=u.Children.toArray(n),k=Object(He.a)(C),T=k[0],j=k.slice(1),P=u.useMemo((function(){return{expanded:O,disabled:f,toggle:E}}),[O,f,E]);return u.createElement(Ve.a,Object(s.a)({className:Object(d.a)(r.root,i,O&&r.expanded,f&&r.disabled,!v&&r.rounded),ref:t,square:v},w),u.createElement(Ue.Provider,{value:P},T),u.createElement(y,Object(s.a)({in:O,timeout:"auto"},b),u.createElement("div",{"aria-labelledby":T.props.id,id:T.props["aria-controls"],role:"region"},j)))})),Ge=Object(p.a)((function(e){var t={duration:e.transitions.duration.shortest};return{root:{position:"relative",transition:e.transitions.create(["margin"],t),"&:before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:e.palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-child":{"&:before":{display:"none"}},"&$expanded":{margin:"16px 0","&:first-child":{marginTop:0},"&:last-child":{marginBottom:0},"&:before":{opacity:0}},"&$expanded + &":{"&:before":{display:"none"}},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},rounded:{borderRadius:0,"&:first-child":{borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius},"&:last-child":{borderBottomLeftRadius:e.shape.borderRadius,borderBottomRightRadius:e.shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},expanded:{},disabled:{}}}),{name:"MuiExpansionPanel"})(qe),Ke=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.disableSpacing,o=void 0!==i&&i,a=Object(c.a)(e,["classes","className","disableSpacing"]);return u.createElement("div",Object(s.a)({className:Object(d.a)(n.root,r,!o&&n.spacing),ref:t},a))})),$e=Object(p.a)({root:{display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end"},spacing:{"& > :not(:first-child)":{marginLeft:8}}},{name:"MuiExpansionPanelActions"})(Ke),Ze=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=Object(c.a)(e,["classes","className"]);return u.createElement("div",Object(s.a)({className:Object(d.a)(n.root,r),ref:t},i))})),Xe=Object(p.a)((function(e){return{root:{display:"flex",padding:e.spacing(1,2,2)}}}),{name:"MuiExpansionPanelDetails"})(Ze),Qe=u.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.className,o=e.expandIcon,a=e.IconButtonProps,l=e.onBlur,f=e.onClick,p=e.onFocusVisible,h=Object(c.a)(e,["children","classes","className","expandIcon","IconButtonProps","onBlur","onClick","onFocusVisible"]),g=u.useState(!1),v=g[0],m=g[1],y=u.useContext(Ue),b=y.disabled,w=void 0!==b&&b,_=y.expanded,x=y.toggle;return u.createElement(S.a,Object(s.a)({focusRipple:!1,disableRipple:!0,disabled:w,component:"div","aria-expanded":_,className:Object(d.a)(r.root,i,w&&r.disabled,_&&r.expanded,v&&r.focused),onFocusVisible:function(e){m(!0),p&&p(e)},onBlur:function(e){m(!1),l&&l(e)},onClick:function(e){x&&x(e),f&&f(e)},ref:t},h),u.createElement("div",{className:Object(d.a)(r.content,_&&r.expanded)},n),o&&u.createElement(he.a,Object(s.a)({className:Object(d.a)(r.expandIcon,_&&r.expanded),edge:"end",component:"div",tabIndex:null,role:null,"aria-hidden":!0},a),o))})),Ye=Object(p.a)((function(e){var t={duration:e.transitions.duration.shortest};return{root:{display:"flex",minHeight:48,transition:e.transitions.create(["min-height","background-color"],t),padding:e.spacing(0,2),"&:hover:not($disabled)":{cursor:"pointer"},"&$expanded":{minHeight:64},"&$focused":{backgroundColor:e.palette.action.focus},"&$disabled":{opacity:e.palette.action.disabledOpacity}},expanded:{},focused:{},disabled:{},content:{display:"flex",flexGrow:1,transition:e.transitions.create(["margin"],t),margin:"12px 0","&$expanded":{margin:"20px 0"}},expandIcon:{transform:"rotate(0deg)",transition:e.transitions.create("transform",t),"&:hover":{backgroundColor:"transparent"},"&$expanded":{transform:"rotate(180deg)"}}}}),{name:"MuiExpansionPanelSummary"})(Qe),Je=n(1159),et=n(758),tt=n(1129),nt=n(456),rt=n(170),it=n(1160),ot=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.row,o=void 0!==i&&i,a=Object(c.a)(e,["classes","className","row"]);return u.createElement("div",Object(s.a)({className:Object(d.a)(n.root,r,o&&n.row),ref:t},a))})),at=Object(p.a)({root:{display:"flex",flexDirection:"column",flexWrap:"wrap"},row:{flexDirection:"row"}},{name:"MuiFormGroup"})(ot),st=n(1131),ct=n(1132),ut=n(583),lt=u.forwardRef((function(e,t){var n=e.cellHeight,r=void 0===n?180:n,i=e.children,o=e.classes,a=e.className,l=e.cols,f=void 0===l?2:l,p=e.component,h=void 0===p?"ul":p,g=e.spacing,v=void 0===g?4:g,m=e.style,y=Object(c.a)(e,["cellHeight","children","classes","className","cols","component","spacing","style"]);return u.createElement(h,Object(s.a)({className:Object(d.a)(o.root,a),ref:t,style:Object(s.a)({margin:-v/2},m)},y),u.Children.map(i,(function(e){if(!u.isValidElement(e))return null;var t=e.props.cols||1,n=e.props.rows||1;return u.cloneElement(e,{style:Object(s.a)({width:"".concat(100/f*t,"%"),height:"auto"===r?"auto":r*n+v,padding:v/2},e.props.style)})})))})),ft=Object(p.a)({root:{display:"flex",flexWrap:"wrap",overflowY:"auto",listStyle:"none",padding:0,WebkitOverflowScrolling:"touch"}},{name:"MuiGridList"})(lt),dt=n(73),pt=n(89),ht=function(e,t){var n,r,i,o;e&&e.complete&&(e.width/e.height>e.parentElement.offsetWidth/e.parentElement.offsetHeight?((n=e.classList).remove.apply(n,Object(H.a)(t.imgFullWidth.split(" "))),(r=e.classList).add.apply(r,Object(H.a)(t.imgFullHeight.split(" ")))):((i=e.classList).remove.apply(i,Object(H.a)(t.imgFullHeight.split(" "))),(o=e.classList).add.apply(o,Object(H.a)(t.imgFullWidth.split(" ")))))};var gt=u.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.className,o=(e.cols,e.component),a=void 0===o?"li":o,l=(e.rows,Object(c.a)(e,["children","classes","className","cols","component","rows"])),f=u.useRef(null);return u.useEffect((function(){!function(e,t){e&&(e.complete?ht(e,t):e.addEventListener("load",(function(){ht(e,t)})))}(f.current,r)})),u.useEffect((function(){var e=Object(dt.a)((function(){ht(f.current,r)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[r]),u.createElement(a,Object(s.a)({className:Object(d.a)(r.root,i),ref:t},l),u.createElement("div",{className:r.tile},u.Children.map(n,(function(e){return u.isValidElement(e)?"img"===e.type||Object(pt.a)(e,["Image"])?u.cloneElement(e,{ref:f}):e:null}))))})),vt=Object(p.a)({root:{boxSizing:"border-box",flexShrink:0},tile:{position:"relative",display:"block",height:"100%",overflow:"hidden"},imgFullHeight:{height:"100%",transform:"translateX(-50%)",position:"relative",left:"50%"},imgFullWidth:{width:"100%",position:"relative",transform:"translateY(-50%)",top:"50%"}},{name:"MuiGridListTile"})(gt),mt=u.forwardRef((function(e,t){var n=e.actionIcon,r=e.actionPosition,i=void 0===r?"right":r,o=e.classes,a=e.className,l=e.subtitle,f=e.title,p=e.titlePosition,h=void 0===p?"bottom":p,g=Object(c.a)(e,["actionIcon","actionPosition","classes","className","subtitle","title","titlePosition"]),v=n&&i;return u.createElement("div",Object(s.a)({className:Object(d.a)(o.root,a,"top"===h?o.titlePositionTop:o.titlePositionBottom,l&&o.rootSubtitle),ref:t},g),u.createElement("div",{className:Object(d.a)(o.titleWrap,{left:o.titleWrapActionPosLeft,right:o.titleWrapActionPosRight}[v])},u.createElement("div",{className:o.title},f),l?u.createElement("div",{className:o.subtitle},l):null),n?u.createElement("div",{className:Object(d.a)(o.actionIcon,"left"===v&&o.actionIconActionPosLeft)},n):null)})),yt=Object(p.a)((function(e){return{root:{position:"absolute",left:0,right:0,height:48,background:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",fontFamily:e.typography.fontFamily},titlePositionBottom:{bottom:0},titlePositionTop:{top:0},rootSubtitle:{height:68},titleWrap:{flexGrow:1,marginLeft:16,marginRight:16,color:e.palette.common.white,overflow:"hidden"},titleWrapActionPosLeft:{marginLeft:0},titleWrapActionPosRight:{marginRight:0},title:{fontSize:e.typography.pxToRem(16),lineHeight:"24px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},subtitle:{fontSize:e.typography.pxToRem(12),lineHeight:1,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},actionIcon:{},actionIconActionPosLeft:{order:-1}}}),{name:"MuiGridListTileBar"})(mt),bt=n(476),wt=n(299),_t=n(36);function xt(e){var t=e.children,n=e.only,r=e.width,i=Object(_t.a)(),o=!0;if(n)if(Array.isArray(n))for(var a=0;ae.parentElement.offsetWidth/e.parentElement.offsetHeight?((n=e.classList).remove.apply(n,Object(H.a)(t.imgFullWidth.split(" "))),(r=e.classList).add.apply(r,Object(H.a)(t.imgFullHeight.split(" ")))):((i=e.classList).remove.apply(i,Object(H.a)(t.imgFullHeight.split(" "))),(o=e.classList).add.apply(o,Object(H.a)(t.imgFullWidth.split(" ")))))};var It=u.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.className,o=(e.cols,e.component),a=void 0===o?"li":o,l=(e.rows,Object(c.a)(e,["children","classes","className","cols","component","rows"])),f=u.useRef(null);return u.useEffect((function(){!function(e,t){e&&(e.complete?Pt(e,t):e.addEventListener("load",(function(){Pt(e,t)})))}(f.current,r)})),u.useEffect((function(){var e=Object(dt.a)((function(){Pt(f.current,r)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[r]),u.createElement(a,Object(s.a)({className:Object(d.a)(r.root,i),ref:t},l),u.createElement("div",{className:r.item},u.Children.map(n,(function(e){return u.isValidElement(e)?"img"===e.type||Object(pt.a)(e,["Image"])?u.cloneElement(e,{ref:f}):e:null}))))})),Rt=Object(p.a)({root:{boxSizing:"border-box",flexShrink:0},item:{position:"relative",display:"block",height:"100%",overflow:"hidden"},imgFullHeight:{height:"100%",transform:"translateX(-50%)",position:"relative",left:"50%"},imgFullWidth:{width:"100%",position:"relative",transform:"translateY(-50%)",top:"50%"}},{name:"MuiImageListItem"})(It),At=u.forwardRef((function(e,t){var n=e.actionIcon,r=e.actionPosition,i=void 0===r?"right":r,o=e.classes,a=e.className,l=e.subtitle,f=e.title,p=e.position,h=void 0===p?"bottom":p,g=e.titlePosition,v=Object(c.a)(e,["actionIcon","actionPosition","classes","className","subtitle","title","position","titlePosition"]),m=g||h,y=n&&i;return u.createElement("div",Object(s.a)({className:Object(d.a)(o.root,a,l&&o.rootSubtitle,{bottom:o.positionBottom,top:o.positionTop}[m]),ref:t},v),u.createElement("div",{className:Object(d.a)(o.titleWrap,{left:o.titleWrapActionPosLeft,right:o.titleWrapActionPosRight}[y])},u.createElement("div",{className:o.title},f),l?u.createElement("div",{className:o.subtitle},l):null),n?u.createElement("div",{className:Object(d.a)(o.actionIcon,"left"===y&&o.actionIconActionPosLeft)},n):null)})),Mt=Object(p.a)((function(e){return{root:{position:"absolute",left:0,right:0,height:48,background:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",fontFamily:e.typography.fontFamily},positionBottom:{bottom:0},positionTop:{top:0},rootSubtitle:{height:68},titleWrap:{flexGrow:1,marginLeft:16,marginRight:16,color:e.palette.common.white,overflow:"hidden"},titleWrapActionPosLeft:{marginLeft:0},titleWrapActionPosRight:{marginRight:0},title:{fontSize:e.typography.pxToRem(16),lineHeight:"24px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},subtitle:{fontSize:e.typography.pxToRem(12),lineHeight:1,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},actionIcon:{},actionIconActionPosLeft:{order:-1}}}),{name:"MuiImageListItemBar"})(At),Dt=n(761),Nt=n(1161),Lt=n(760),zt=n(1134),Bt=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.color,o=void 0===i?"primary":i,a=e.value,l=e.valueBuffer,f=e.variant,p=void 0===f?"indeterminate":f,h=Object(c.a)(e,["classes","className","color","value","valueBuffer","variant"]),g=Object(_t.a)(),v={},m={bar1:{},bar2:{}};if("determinate"===p||"buffer"===p)if(void 0!==a){v["aria-valuenow"]=Math.round(a),v["aria-valuemin"]=0,v["aria-valuemax"]=100;var y=a-100;"rtl"===g.direction&&(y=-y),m.bar1.transform="translateX(".concat(y,"%)")}else 0;if("buffer"===p)if(void 0!==l){var b=(l||0)-100;"rtl"===g.direction&&(b=-b),m.bar2.transform="translateX(".concat(b,"%)")}else 0;return u.createElement("div",Object(s.a)({className:Object(d.a)(n.root,n["color".concat(Object(Q.a)(o))],r,{determinate:n.determinate,indeterminate:n.indeterminate,buffer:n.buffer,query:n.query}[p]),role:"progressbar"},v,{ref:t},h),"buffer"===p?u.createElement("div",{className:Object(d.a)(n.dashed,n["dashedColor".concat(Object(Q.a)(o))])}):null,u.createElement("div",{className:Object(d.a)(n.bar,n["barColor".concat(Object(Q.a)(o))],("indeterminate"===p||"query"===p)&&n.bar1Indeterminate,{determinate:n.bar1Determinate,buffer:n.bar1Buffer}[p]),style:m.bar1}),"determinate"===p?null:u.createElement("div",{className:Object(d.a)(n.bar,("indeterminate"===p||"query"===p)&&n.bar2Indeterminate,"buffer"===p?[n["color".concat(Object(Q.a)(o))],n.bar2Buffer]:n["barColor".concat(Object(Q.a)(o))]),style:m.bar2}))})),Ft=Object(p.a)((function(e){var t=function(t){return"light"===e.palette.type?Object(U.j)(t,.62):Object(U.b)(t,.5)},n=t(e.palette.primary.main),r=t(e.palette.secondary.main);return{root:{position:"relative",overflow:"hidden",height:4,"@media print":{colorAdjust:"exact"}},colorPrimary:{backgroundColor:n},colorSecondary:{backgroundColor:r},determinate:{},indeterminate:{},buffer:{backgroundColor:"transparent"},query:{transform:"rotate(180deg)"},dashed:{position:"absolute",marginTop:0,height:"100%",width:"100%",animation:"$buffer 3s infinite linear"},dashedColorPrimary:{backgroundImage:"radial-gradient(".concat(n," 0%, ").concat(n," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"},dashedColorSecondary:{backgroundImage:"radial-gradient(".concat(r," 0%, ").concat(r," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"},bar:{width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},barColorPrimary:{backgroundColor:e.palette.primary.main},barColorSecondary:{backgroundColor:e.palette.secondary.main},bar1Indeterminate:{width:"auto",animation:"$indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite"},bar1Determinate:{transition:"transform .".concat(4,"s linear")},bar1Buffer:{zIndex:1,transition:"transform .".concat(4,"s linear")},bar2Indeterminate:{width:"auto",animation:"$indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite"},bar2Buffer:{transition:"transform .".concat(4,"s linear")},"@keyframes indeterminate1":{"0%":{left:"-35%",right:"100%"},"60%":{left:"100%",right:"-90%"},"100%":{left:"100%",right:"-90%"}},"@keyframes indeterminate2":{"0%":{left:"-200%",right:"100%"},"60%":{left:"107%",right:"-8%"},"100%":{left:"107%",right:"-8%"}},"@keyframes buffer":{"0%":{opacity:1,backgroundPosition:"0 -23px"},"50%":{opacity:0,backgroundPosition:"0 -23px"},"100%":{opacity:1,backgroundPosition:"-200px -23px"}}}}),{name:"MuiLinearProgress"})(Bt),Wt=n(1162),Ht=n(1124),Vt=n(1125),Ut=n(104),qt=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=Object(c.a)(e,["classes","className"]),o=u.useContext(Ut.a);return u.createElement("div",Object(s.a)({className:Object(d.a)(n.root,r,"flex-start"===o.alignItems&&n.alignItemsFlexStart),ref:t},i))})),Gt=Object(p.a)({root:{minWidth:56,flexShrink:0},alignItemsFlexStart:{marginTop:8}},{name:"MuiListItemAvatar"})(qt),Kt=n(577),$t=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=Object(c.a)(e,["classes","className"]);return u.createElement("div",Object(s.a)({className:Object(d.a)(n.root,r),ref:t},i))}));$t.muiName="ListItemSecondaryAction";var Zt=Object(p.a)({root:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"}},{name:"MuiListItemSecondaryAction"})($t),Xt=n(578),Qt=n(1163),Yt=n(675),Jt=n(579),en=n(454),tn=u.forwardRef((function(e,t){var n=e.activeStep,r=void 0===n?0:n,i=e.backButton,o=e.classes,a=e.className,l=e.LinearProgressProps,f=e.nextButton,p=e.position,h=void 0===p?"bottom":p,g=e.steps,v=e.variant,m=void 0===v?"dots":v,y=Object(c.a)(e,["activeStep","backButton","classes","className","LinearProgressProps","nextButton","position","steps","variant"]);return u.createElement(Ve.a,Object(s.a)({square:!0,elevation:0,className:Object(d.a)(o.root,o["position".concat(Object(Q.a)(h))],a),ref:t},y),i,"text"===m&&u.createElement(u.Fragment,null,r+1," / ",g),"dots"===m&&u.createElement("div",{className:o.dots},Object(H.a)(new Array(g)).map((function(e,t){return u.createElement("div",{key:t,className:Object(d.a)(o.dot,t===r&&o.dotActive)})}))),"progress"===m&&u.createElement(Ft,Object(s.a)({className:o.progress,variant:"determinate",value:Math.ceil(r/(g-1)*100)},l)),f)})),nn=Object(p.a)((function(e){return{root:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",background:e.palette.background.default,padding:8},positionBottom:{position:"fixed",bottom:0,left:0,right:0,zIndex:e.zIndex.mobileStepper},positionTop:{position:"fixed",top:0,left:0,right:0,zIndex:e.zIndex.mobileStepper},positionStatic:{},dots:{display:"flex",flexDirection:"row"},dot:{backgroundColor:e.palette.action.disabled,borderRadius:"50%",width:8,height:8,margin:"0 2px"},dotActive:{backgroundColor:e.palette.primary.main},progress:{width:"50%"}}}),{name:"MuiMobileStepper"})(tn),rn=n(255),on=n(205),an=n(676),sn="undefined"!=typeof window?u.useLayoutEffect:u.useEffect;var cn=function(e){var t=e.children,n=e.defer,r=void 0!==n&&n,i=e.fallback,o=void 0===i?null:i,a=u.useState(!1),s=a[0],c=a[1];return sn((function(){r||c(!0)}),[r]),u.useEffect((function(){r&&c(!0)}),[r]),u.createElement(u.Fragment,null,s?t:o)},un=n(1136),ln=n(457),fn=n(1122),dn=n(1123),pn=Object(q.a)(u.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),hn=Object(q.a)(u.createElement("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked");var gn=Object(p.a)((function(e){return{root:{position:"relative",display:"flex","&$checked $layer":{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}},layer:{left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest})},checked:{}}}),{name:"PrivateRadioButtonIcon"})((function(e){var t=e.checked,n=e.classes,r=e.fontSize;return u.createElement("div",{className:Object(d.a)(n.root,t&&n.checked)},u.createElement(pn,{fontSize:r}),u.createElement(hn,{fontSize:r,className:n.layer}))})),vn=n(82);var mn=u.createContext();function yn(){return u.useContext(mn)}var bn=u.createElement(gn,{checked:!0}),wn=u.createElement(gn,null),_n=u.forwardRef((function(e,t){var n=e.checked,r=e.classes,i=e.color,o=void 0===i?"secondary":i,a=e.name,l=e.onChange,f=e.size,p=void 0===f?"medium":f,h=Object(c.a)(e,["checked","classes","color","name","onChange","size"]),g=yn(),v=n,m=Object(vn.a)(l,g&&g.onChange),y=a;return g&&(void 0===v&&(v=g.value===e.value),void 0===y&&(y=g.name)),u.createElement(ve,Object(s.a)({color:o,type:"radio",icon:u.cloneElement(wn,{fontSize:"small"===p?"small":"medium"}),checkedIcon:u.cloneElement(bn,{fontSize:"small"===p?"small":"medium"}),classes:{root:Object(d.a)(r.root,r["color".concat(Object(Q.a)(o))]),checked:r.checked,disabled:r.disabled},name:y,checked:v,onChange:m,ref:t},h))})),xn=Object(p.a)((function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(U.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(U.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiRadio"})(_n),On=n(31),Sn=n(135),En=u.forwardRef((function(e,t){var n=e.actions,r=e.children,i=e.name,o=e.value,a=e.onChange,l=Object(c.a)(e,["actions","children","name","value","onChange"]),f=u.useRef(null),d=Object(de.a)({controlled:o,default:e.defaultValue,name:"RadioGroup"}),p=Object(fe.a)(d,2),h=p[0],g=p[1];u.useImperativeHandle(n,(function(){return{focus:function(){var e=f.current.querySelector("input:not(:disabled):checked");e||(e=f.current.querySelector("input:not(:disabled)")),e&&e.focus()}}}),[]);var v=Object(On.a)(t,f),m=Object(Sn.a)(i);return u.createElement(mn.Provider,{value:{name:m,onChange:function(e){g(e.target.value),a&&a(e,e.target.value)},value:h}},u.createElement(at,Object(s.a)({role:"radiogroup",ref:v},l),r))})),Cn=n(77),kn=n(60),Tn=n(187),jn=n(156),Pn=n(157),In=n(33),Rn=n(64);function An(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(Pn.a)(e);if(t){var i=Object(Pn.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(jn.a)(this,n)}}var Mn=function(e){Object(Tn.a)(n,e);var t=An(n);function n(){return Object(Cn.a)(this,n),t.apply(this,arguments)}return Object(kn.a)(n,[{key:"componentDidMount",value:function(){this.ref=In.findDOMNode(this),Object(Rn.a)(this.props.rootRef,this.ref)}},{key:"componentDidUpdate",value:function(e){var t=In.findDOMNode(this);e.rootRef===this.props.rootRef&&this.ref===t||(e.rootRef!==this.props.rootRef&&Object(Rn.a)(e.rootRef,null),this.ref=t,Object(Rn.a)(this.props.rootRef,this.ref))}},{key:"componentWillUnmount",value:function(){this.ref=null,Object(Rn.a)(this.props.rootRef,null)}},{key:"render",value:function(){return this.props.children}}]),n}(u.Component),Dn=n(1137),Nn=n(1128),Ln=n(1178),zn=n(1164),Bn=n(1135),Fn=u.forwardRef((function(e,t){var n=e.active,r=void 0!==n&&n,i=e.alternativeLabel,o=e.children,a=e.classes,l=e.className,f=e.completed,p=void 0!==f&&f,h=e.connector,g=e.disabled,v=void 0!==g&&g,m=e.expanded,y=void 0!==m&&m,b=e.index,w=e.last,_=e.orientation,x=Object(c.a)(e,["active","alternativeLabel","children","classes","className","completed","connector","disabled","expanded","index","last","orientation"]),O=h?u.cloneElement(h,{orientation:_,alternativeLabel:i,index:b,active:r,completed:p,disabled:v}):null,S=u.createElement("div",Object(s.a)({className:Object(d.a)(a.root,a[_],l,i&&a.alternativeLabel,p&&a.completed),ref:t},x),O&&i&&0!==b?O:null,u.Children.map(o,(function(e){return u.isValidElement(e)?u.cloneElement(e,Object(s.a)({active:r,alternativeLabel:i,completed:p,disabled:v,expanded:y,last:w,icon:b+1,orientation:_},e.props)):null})));return O&&!i&&0!==b?u.createElement(u.Fragment,null,O,S):S})),Wn=Object(p.a)({root:{},horizontal:{paddingLeft:8,paddingRight:8},vertical:{},alternativeLabel:{flex:1,position:"relative"},completed:{}},{name:"MuiStep"})(Fn),Hn=Object(q.a)(u.createElement("path",{d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm-2 17l-5-5 1.4-1.4 3.6 3.6 7.6-7.6L19 8l-9 9z"}),"CheckCircle"),Vn=Object(q.a)(u.createElement("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning"),Un=n(329),qn=u.createElement("circle",{cx:"12",cy:"12",r:"12"}),Gn=u.forwardRef((function(e,t){var n=e.completed,r=void 0!==n&&n,i=e.icon,o=e.active,a=void 0!==o&&o,s=e.error,c=void 0!==s&&s,l=e.classes;if("number"==typeof i||"string"==typeof i){var f=Object(d.a)(l.root,a&&l.active,c&&l.error,r&&l.completed);return c?u.createElement(Vn,{className:f,ref:t}):r?u.createElement(Hn,{className:f,ref:t}):u.createElement(Un.a,{className:f,ref:t},qn,u.createElement("text",{className:l.text,x:"12",y:"16",textAnchor:"middle"},i))}return i})),Kn=Object(p.a)((function(e){return{root:{display:"block",color:e.palette.text.disabled,"&$completed":{color:e.palette.primary.main},"&$active":{color:e.palette.primary.main},"&$error":{color:e.palette.error.main}},text:{fill:e.palette.primary.contrastText,fontSize:e.typography.caption.fontSize,fontFamily:e.typography.fontFamily},active:{},completed:{},error:{}}}),{name:"MuiStepIcon"})(Gn),$n=u.forwardRef((function(e,t){var n=e.active,r=void 0!==n&&n,i=e.alternativeLabel,o=void 0!==i&&i,a=e.children,l=e.classes,f=e.className,p=e.completed,h=void 0!==p&&p,g=e.disabled,v=void 0!==g&&g,m=e.error,y=void 0!==m&&m,b=(e.expanded,e.icon),w=(e.last,e.optional),_=e.orientation,x=void 0===_?"horizontal":_,O=e.StepIconComponent,S=e.StepIconProps,E=Object(c.a)(e,["active","alternativeLabel","children","classes","className","completed","disabled","error","expanded","icon","last","optional","orientation","StepIconComponent","StepIconProps"]),C=O;return b&&!C&&(C=Kn),u.createElement("span",Object(s.a)({className:Object(d.a)(l.root,l[x],f,v&&l.disabled,o&&l.alternativeLabel,y&&l.error),ref:t},E),b||C?u.createElement("span",{className:Object(d.a)(l.iconContainer,o&&l.alternativeLabel)},u.createElement(C,Object(s.a)({completed:h,active:r,error:y,icon:b},S))):null,u.createElement("span",{className:l.labelContainer},a?u.createElement(V.a,{variant:"body2",component:"span",display:"block",className:Object(d.a)(l.label,o&&l.alternativeLabel,h&&l.completed,r&&l.active,y&&l.error)},a):null,w))}));$n.muiName="StepLabel";var Zn=Object(p.a)((function(e){return{root:{display:"flex",alignItems:"center","&$alternativeLabel":{flexDirection:"column"},"&$disabled":{cursor:"default"}},horizontal:{},vertical:{},label:{color:e.palette.text.secondary,"&$active":{color:e.palette.text.primary,fontWeight:500},"&$completed":{color:e.palette.text.primary,fontWeight:500},"&$alternativeLabel":{textAlign:"center",marginTop:16},"&$error":{color:e.palette.error.main}},active:{},completed:{},error:{},disabled:{},iconContainer:{flexShrink:0,display:"flex",paddingRight:8,"&$alternativeLabel":{paddingRight:0}},alternativeLabel:{},labelContainer:{width:"100%"}}}),{name:"MuiStepLabel"})($n),Xn=u.forwardRef((function(e,t){var n=e.active,r=e.alternativeLabel,i=e.children,o=e.classes,a=e.className,l=e.completed,f=e.disabled,p=(e.expanded,e.icon),h=(e.last,e.optional),g=e.orientation,v=Object(c.a)(e,["active","alternativeLabel","children","classes","className","completed","disabled","expanded","icon","last","optional","orientation"]),m={active:n,alternativeLabel:r,completed:l,disabled:f,icon:p,optional:h,orientation:g},y=Object(pt.a)(i,["StepLabel"])?u.cloneElement(i,m):u.createElement(Zn,m,i);return u.createElement(S.a,Object(s.a)({focusRipple:!0,disabled:f,TouchRippleProps:{className:o.touchRipple},className:Object(d.a)(o.root,o[g],a),ref:t},v),y)})),Qn=Object(p.a)({root:{width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},horizontal:{},vertical:{justifyContent:"flex-start",padding:"8px",margin:"-8px"},touchRipple:{color:"rgba(0, 0, 0, 0.3)"}},{name:"MuiStepButton"})(Xn),Yn=u.forwardRef((function(e,t){var n=e.active,r=e.alternativeLabel,i=void 0!==r&&r,o=e.classes,a=e.className,l=e.completed,f=e.disabled,p=(e.index,e.orientation),h=void 0===p?"horizontal":p,g=Object(c.a)(e,["active","alternativeLabel","classes","className","completed","disabled","index","orientation"]);return u.createElement("div",Object(s.a)({className:Object(d.a)(o.root,o[h],a,i&&o.alternativeLabel,n&&o.active,l&&o.completed,f&&o.disabled),ref:t},g),u.createElement("span",{className:Object(d.a)(o.line,{horizontal:o.lineHorizontal,vertical:o.lineVertical}[h])}))})),Jn=Object(p.a)((function(e){return{root:{flex:"1 1 auto"},horizontal:{},vertical:{marginLeft:12,padding:"0 0 8px"},alternativeLabel:{position:"absolute",top:12,left:"calc(-50% + 20px)",right:"calc(50% + 20px)"},active:{},completed:{},disabled:{},line:{display:"block",borderColor:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600]},lineHorizontal:{borderTopStyle:"solid",borderTopWidth:1},lineVertical:{borderLeftStyle:"solid",borderLeftWidth:1,minHeight:24}}}),{name:"MuiStepConnector"})(Yn),er=u.forwardRef((function(e,t){var n=e.active,r=(e.alternativeLabel,e.children),i=e.classes,o=e.className,a=(e.completed,e.expanded),l=e.last,f=(e.optional,e.orientation,e.TransitionComponent),p=void 0===f?Te.a:f,h=e.transitionDuration,g=void 0===h?"auto":h,v=e.TransitionProps,m=Object(c.a)(e,["active","alternativeLabel","children","classes","className","completed","expanded","last","optional","orientation","TransitionComponent","transitionDuration","TransitionProps"]);var y=g;return"auto"!==g||p.muiSupportAuto||(y=void 0),u.createElement("div",Object(s.a)({className:Object(d.a)(i.root,o,l&&i.last),ref:t},m),u.createElement(p,Object(s.a)({in:n||a,className:i.transition,timeout:y,unmountOnExit:!0},v),r))})),tr=Object(p.a)((function(e){return{root:{marginTop:8,marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:"1px solid ".concat("light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600])},last:{borderLeft:"none"},transition:{}}}),{name:"MuiStepContent"})(er),nr=u.createElement(Jn,null),rr=u.forwardRef((function(e,t){var n=e.activeStep,r=void 0===n?0:n,i=e.alternativeLabel,o=void 0!==i&&i,a=e.children,l=e.classes,f=e.className,p=e.connector,h=void 0===p?nr:p,g=e.nonLinear,v=void 0!==g&&g,m=e.orientation,y=void 0===m?"horizontal":m,b=Object(c.a)(e,["activeStep","alternativeLabel","children","classes","className","connector","nonLinear","orientation"]),w=u.isValidElement(h)?u.cloneElement(h,{orientation:y}):null,_=u.Children.toArray(a),x=_.map((function(e,t){var n={index:t,active:!1,completed:!1,disabled:!1};return r===t?n.active=!0:!v&&r>t?n.completed=!0:!v&&r1&&void 0!==arguments[1]?arguments[1]:{},r=t.mode,i=void 0===r?null:r,a=t.changeTransition,s=void 0===a||a,c=Object(We.b)(n,o),u=-1!==["right","bottom"].indexOf(c)?1:-1,f=Object(We.c)(o),d=f?"translate(".concat(u*e,"px, 0)"):"translate(0, ".concat(u*e,"px)"),p=H.current.style;p.webkitTransform=d,p.transform=d;var h="";if(i&&(h=n.transitions.create("all",Object(ur.a)({timeout:R},{mode:i}))),s&&(p.webkitTransition=h,p.transition=h),!l&&!g){var v=W.current.style;v.opacity=1-e/gr(f,H.current),s&&(v.webkitTransition=h,v.transition=h)}}),[o,l,g,n,R]),G=Object(sr.a)((function(e){if(V.current)if(dr=null,V.current=!1,z(!1),B.current.isSwiping){B.current.isSwiping=null;var t,r=Object(We.b)(n,o),i=Object(We.c)(o);t=i?pr(r,e.changedTouches):hr(r,e.changedTouches);var a=i?B.current.startX:B.current.startY,s=gr(i,H.current),c=vr(t,a,E,s),u=c/s;Math.abs(B.current.velocity)>b&&(U.current=1e3*Math.abs((s-c)/B.current.velocity)),E?B.current.velocity>b||u>m?O():q(0,{mode:"exit"}):B.current.velocity<-b||1-u>m?S():q(gr(i,H.current),{mode:"enter"})}else B.current.isSwiping=null})),K=Object(sr.a)((function(e){if(H.current&&V.current&&(null==dr||dr===B.current)){var t=Object(We.b)(n,o),r=Object(We.c)(o),i=pr(t,e.touches),a=hr(t,e.touches);if(E&&H.current.contains(e.target)&&null==dr){var s=function(e){var t=e.domTreeShapes,n=e.start,r=e.current,i=e.anchor,o={x:"scrollLeft",y:"scrollTop"},a={x:"scrollWidth",y:"scrollHeight"},s={x:"clientWidth",y:"clientHeight"};return t.some((function(e){var t=r>=n;"top"!==i&&"left"!==i||(t=!t);var c="left"===i||"right"===i?"x":"y",u=e[o[c]],l=u>0,f=u+e[s[c]]0&&e.scrollWidth>e.clientWidth||e.clientHeight>0&&e.scrollHeight>e.clientHeight)&&n.push(e),e=e.parentElement}return n}(e.target,H.current),start:r?B.current.startX:B.current.startY,current:r?i:a,anchor:o});if(s)return void(dr=s);dr=B.current}if(null==B.current.isSwiping){var c=Math.abs(i-B.current.startX),u=Math.abs(a-B.current.startY);c>u&&e.cancelable&&e.preventDefault();var l=r?c>u&&c>3:u>c&&u>3;if(!0===l||(r?u>3:c>3)){if(B.current.isSwiping=l,!l)return void G(e);B.current.startX=i,B.current.startY=a,d||E||(r?B.current.startX-=P:B.current.startY-=P)}}if(B.current.isSwiping){var f=gr(r,H.current),p=r?B.current.startX:B.current.startY;E&&!B.current.paperHit&&(p=Math.min(p,f));var h=vr(r?i:a,p,E,f);if(E)if(B.current.paperHit)0===h&&(B.current.startX=i,B.current.startY=a);else{if(!(r?iP)return}else if(a>P)return}e.muiHandled=!0,dr=null,B.current.startX=i,B.current.startY=a,z(!0),!E&&H.current&&q(gr(r,H.current)+(d?20:-P),{changeTransition:!1}),B.current.velocity=0,B.current.lastTime=null,B.current.lastTranslate=null,B.current.paperHit=!1,V.current=!0}}));u.useEffect((function(){if("temporary"===M){var e=Object(ar.a)(H.current);return e.addEventListener("touchstart",$),e.addEventListener("touchmove",K,{passive:!1}),e.addEventListener("touchend",G),function(){e.removeEventListener("touchstart",$),e.removeEventListener("touchmove",K,{passive:!1}),e.removeEventListener("touchend",G)}}}),[M,$,K,G]),u.useEffect((function(){return function(){dr===B.current&&(dr=null)}}),[]),u.useEffect((function(){E||z(!1)}),[E]);var Z=u.useCallback((function(e){W.current=In.findDOMNode(e)}),[]);return u.createElement(u.Fragment,null,u.createElement(We.a,Object(s.a)({open:!("temporary"!==M||!L)||E,variant:M,ModalProps:Object(s.a)({BackdropProps:Object(s.a)({},_,{ref:Z})},x),PaperProps:Object(s.a)({},k,{style:Object(s.a)({pointerEvents:"temporary"!==M||E?"":"none"},k.style),ref:H}),anchor:o,transitionDuration:U.current||R,onClose:O,ref:t},D)),!h&&"temporary"===M&&u.createElement(cn,null,u.createElement(fr,Object(s.a)({anchor:o,ref:F,width:P},T))))})),_r=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.color,o=void 0===i?"secondary":i,a=e.edge,l=void 0!==a&&a,f=e.size,p=void 0===f?"medium":f,h=Object(c.a)(e,["classes","className","color","edge","size"]),g=u.createElement("span",{className:n.thumb});return u.createElement("span",{className:Object(d.a)(n.root,r,{start:n.edgeStart,end:n.edgeEnd}[l],"small"===p&&n["size".concat(Object(Q.a)(p))])},u.createElement(ve,Object(s.a)({type:"checkbox",icon:g,checkedIcon:g,classes:{root:Object(d.a)(n.switchBase,n["color".concat(Object(Q.a)(o))]),input:n.input,checked:n.checked,disabled:n.disabled},ref:t},h)),u.createElement("span",{className:n.track}))})),xr=Object(p.a)((function(e){return{root:{display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},edgeStart:{marginLeft:-8},edgeEnd:{marginRight:-8},switchBase:{position:"absolute",top:0,left:0,zIndex:1,color:"light"===e.palette.type?e.palette.grey[50]:e.palette.grey[400],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),"&$checked":{transform:"translateX(20px)"},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{opacity:.5},"&$disabled + $track":{opacity:"light"===e.palette.type?.12:.1}},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(U.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.primary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(U.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.secondary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},sizeSmall:{width:40,height:24,padding:7,"& $thumb":{width:16,height:16},"& $switchBase":{padding:4,"&$checked":{transform:"translateX(16px)"}}},checked:{},disabled:{},input:{left:"-100%",width:"300%"},thumb:{boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"},track:{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white,opacity:"light"===e.palette.type?.38:.3}}}),{name:"MuiSwitch"})(_r),Or=n(1165);var Sr=u.createContext(),Er=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"table":i,a=e.padding,l=void 0===a?"normal":a,f=e.size,p=void 0===f?"medium":f,h=e.stickyHeader,g=void 0!==h&&h,v=Object(c.a)(e,["classes","className","component","padding","size","stickyHeader"]),m=u.useMemo((function(){return{padding:l,size:p,stickyHeader:g}}),[l,p,g]);return u.createElement(Sr.Provider,{value:m},u.createElement(o,Object(s.a)({role:"table"===o?null:"table",ref:t,className:Object(d.a)(n.root,r,g&&n.stickyHeader)},v)))})),Cr=Object(p.a)((function(e){return{root:{display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":Object(s.a)({},e.typography.body2,{padding:e.spacing(2),color:e.palette.text.secondary,textAlign:"left",captionSide:"bottom"})},stickyHeader:{borderCollapse:"separate"}}}),{name:"MuiTable"})(Er);var kr=u.createContext(),Tr={variant:"body"},jr=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"tbody":i,a=Object(c.a)(e,["classes","className","component"]);return u.createElement(kr.Provider,{value:Tr},u.createElement(o,Object(s.a)({className:Object(d.a)(n.root,r),ref:t,role:"tbody"===o?null:"rowgroup"},a)))})),Pr=Object(p.a)({root:{display:"table-row-group"}},{name:"MuiTableBody"})(jr),Ir=u.forwardRef((function(e,t){var n,r,i=e.align,o=void 0===i?"inherit":i,a=e.classes,l=e.className,f=e.component,p=e.padding,h=e.scope,g=e.size,v=e.sortDirection,m=e.variant,y=Object(c.a)(e,["align","classes","className","component","padding","scope","size","sortDirection","variant"]),b=u.useContext(Sr),w=u.useContext(kr),_=w&&"head"===w.variant;f?(r=f,n=_?"columnheader":"cell"):r=_?"th":"td";var x=h;!x&&_&&(x="col");var O=p||(b&&b.padding?b.padding:"normal"),S=g||(b&&b.size?b.size:"medium"),E=m||w&&w.variant,C=null;return v&&(C="asc"===v?"ascending":"descending"),u.createElement(r,Object(s.a)({ref:t,className:Object(d.a)(a.root,a[E],l,"inherit"!==o&&a["align".concat(Object(Q.a)(o))],"normal"!==O&&a["padding".concat(Object(Q.a)(O))],"medium"!==S&&a["size".concat(Object(Q.a)(S))],"head"===E&&b&&b.stickyHeader&&a.stickyHeader),"aria-sort":C,role:n,scope:x},y))})),Rr=Object(p.a)((function(e){return{root:Object(s.a)({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:"1px solid\n ".concat("light"===e.palette.type?Object(U.j)(Object(U.a)(e.palette.divider,1),.88):Object(U.b)(Object(U.a)(e.palette.divider,1),.68)),textAlign:"left",padding:16}),head:{color:e.palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},body:{color:e.palette.text.primary},footer:{color:e.palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},sizeSmall:{padding:"6px 24px 6px 16px","&:last-child":{paddingRight:16},"&$paddingCheckbox":{width:24,padding:"0 12px 0 16px","&:last-child":{paddingLeft:12,paddingRight:16},"& > *":{padding:0}}},paddingCheckbox:{width:48,padding:"0 0 0 4px","&:last-child":{paddingLeft:0,paddingRight:4}},paddingNone:{padding:0,"&:last-child":{padding:0}},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right",flexDirection:"row-reverse"},alignJustify:{textAlign:"justify"},stickyHeader:{position:"sticky",top:0,left:0,zIndex:2,backgroundColor:e.palette.background.default}}}),{name:"MuiTableCell"})(Ir),Ar=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"div":i,a=Object(c.a)(e,["classes","className","component"]);return u.createElement(o,Object(s.a)({ref:t,className:Object(d.a)(n.root,r)},a))})),Mr=Object(p.a)({root:{width:"100%",overflowX:"auto"}},{name:"MuiTableContainer"})(Ar),Dr={variant:"footer"},Nr=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"tfoot":i,a=Object(c.a)(e,["classes","className","component"]);return u.createElement(kr.Provider,{value:Dr},u.createElement(o,Object(s.a)({className:Object(d.a)(n.root,r),ref:t,role:"tfoot"===o?null:"rowgroup"},a)))})),Lr=Object(p.a)({root:{display:"table-footer-group"}},{name:"MuiTableFooter"})(Nr),zr={variant:"head"},Br=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"thead":i,a=Object(c.a)(e,["classes","className","component"]);return u.createElement(kr.Provider,{value:zr},u.createElement(o,Object(s.a)({className:Object(d.a)(n.root,r),ref:t,role:"thead"===o?null:"rowgroup"},a)))})),Fr=Object(p.a)({root:{display:"table-header-group"}},{name:"MuiTableHead"})(Br),Wr=n(1166),Hr=n(250),Vr=n(249),Ur=u.createElement(Vr.a,null),qr=u.createElement(Hr.a,null),Gr=u.createElement(Hr.a,null),Kr=u.createElement(Vr.a,null),$r=u.forwardRef((function(e,t){var n=e.backIconButtonProps,r=e.count,i=e.nextIconButtonProps,o=e.onChangePage,a=void 0===o?function(){}:o,l=e.onPageChange,f=void 0===l?function(){}:l,d=e.page,p=e.rowsPerPage,h=Object(c.a)(e,["backIconButtonProps","count","nextIconButtonProps","onChangePage","onPageChange","page","rowsPerPage"]),g=Object(_t.a)();return u.createElement("div",Object(s.a)({ref:t},h),u.createElement(he.a,Object(s.a)({onClick:function(e){a(e,d-1),f(e,d-1)},disabled:0===d,color:"inherit"},n),"rtl"===g.direction?Ur:qr),u.createElement(he.a,Object(s.a)({onClick:function(e){a(e,d+1),f(e,d+1)},disabled:-1!==r&&d>=Math.ceil(r/p)-1,color:"inherit"},i),"rtl"===g.direction?Gr:Kr))})),Zr=function(e){var t=e.from,n=e.to,r=e.count;return"".concat(t,"-").concat(n," of ").concat(-1!==r?r:"more than ".concat(n))},Xr=[10,25,50,100],Qr=u.forwardRef((function(e,t){var n,r=e.ActionsComponent,i=void 0===r?$r:r,o=e.backIconButtonProps,a=e.backIconButtonText,l=void 0===a?"Previous page":a,f=e.classes,p=e.className,h=e.colSpan,g=e.component,v=void 0===g?Rr:g,m=e.count,y=e.labelDisplayedRows,b=void 0===y?Zr:y,w=e.labelRowsPerPage,_=void 0===w?"Rows per page:":w,x=e.nextIconButtonProps,O=e.nextIconButtonText,S=void 0===O?"Next page":O,E=e.onChangePage,C=e.onPageChange,k=e.onChangeRowsPerPage,T=e.onRowsPerPageChange,j=e.page,P=e.rowsPerPage,I=e.rowsPerPageOptions,R=void 0===I?Xr:I,A=e.SelectProps,M=void 0===A?{}:A,D=Object(c.a)(e,["ActionsComponent","backIconButtonProps","backIconButtonText","classes","className","colSpan","component","count","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","nextIconButtonText","onChangePage","onPageChange","onChangeRowsPerPage","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps"]),N=k||T;v!==Rr&&"td"!==v||(n=h||1e3);var L=Object(Sn.a)(),z=Object(Sn.a)(),B=M.native?"option":Jt.a;return u.createElement(v,Object(s.a)({className:Object(d.a)(f.root,p),colSpan:n,ref:t},D),u.createElement(Wr.a,{className:f.toolbar},u.createElement("div",{className:f.spacer}),R.length>1&&u.createElement(V.a,{color:"inherit",variant:"body2",className:f.caption,id:z},_),R.length>1&&u.createElement(Dn.a,Object(s.a)({classes:{select:f.select,icon:f.selectIcon},input:u.createElement(Lt.a,{className:Object(d.a)(f.input,f.selectRoot)}),value:P,onChange:N,id:L,labelId:z},M),R.map((function(e){return u.createElement(B,{className:f.menuItem,key:e.value?e.value:e,value:e.value?e.value:e},e.label?e.label:e)}))),u.createElement(V.a,{color:"inherit",variant:"body2",className:f.caption},b({from:0===m?0:j*P+1,to:-1!==m?Math.min(m,(j+1)*P):(j+1)*P,count:-1===m?-1:m,page:j})),u.createElement(i,{className:f.actions,backIconButtonProps:Object(s.a)({title:l,"aria-label":l},o),count:m,nextIconButtonProps:Object(s.a)({title:S,"aria-label":S},x),onChangePage:E,onPageChange:C,page:j,rowsPerPage:P})))})),Yr=Object(p.a)((function(e){return{root:{color:e.palette.text.primary,fontSize:e.typography.pxToRem(14),overflow:"auto","&:last-child":{padding:0}},toolbar:{minHeight:52,paddingRight:2},spacer:{flex:"1 1 100%"},caption:{flexShrink:0},selectRoot:{marginRight:32,marginLeft:8},select:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"},selectIcon:{},input:{color:"inherit",fontSize:"inherit",flexShrink:0},menuItem:{},actions:{flexShrink:0,marginLeft:20}}}),{name:"MuiTablePagination"})(Qr),Jr=u.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"tr":i,a=e.hover,l=void 0!==a&&a,f=e.selected,p=void 0!==f&&f,h=Object(c.a)(e,["classes","className","component","hover","selected"]),g=u.useContext(kr);return u.createElement(o,Object(s.a)({ref:t,className:Object(d.a)(n.root,r,g&&{head:n.head,footer:n.footer}[g.variant],l&&n.hover,p&&n.selected),role:"tr"===o?null:"row"},h))})),ei=Object(p.a)((function(e){return{root:{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,"&$hover:hover":{backgroundColor:e.palette.action.hover},"&$selected, &$selected:hover":{backgroundColor:Object(U.a)(e.palette.secondary.main,e.palette.action.selectedOpacity)}},selected:{},hover:{},head:{},footer:{}}}),{name:"MuiTableRow"})(Jr),ti=Object(q.a)(u.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),ni=u.forwardRef((function(e,t){var n=e.active,r=void 0!==n&&n,i=e.children,o=e.classes,a=e.className,l=e.direction,f=void 0===l?"asc":l,p=e.hideSortIcon,h=void 0!==p&&p,g=e.IconComponent,v=void 0===g?ti:g,m=Object(c.a)(e,["active","children","classes","className","direction","hideSortIcon","IconComponent"]);return u.createElement(S.a,Object(s.a)({className:Object(d.a)(o.root,a,r&&o.active),component:"span",disableRipple:!0,ref:t},m),i,h&&!r?null:u.createElement(v,{className:Object(d.a)(o.icon,o["iconDirection".concat(Object(Q.a)(f))])}))})),ri=Object(p.a)((function(e){return{root:{cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:e.palette.text.secondary},"&:hover":{color:e.palette.text.secondary,"& $icon":{opacity:.5}},"&$active":{color:e.palette.text.primary,"&& $icon":{opacity:1,color:e.palette.text.secondary}}},active:{},icon:{fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none"},iconDirectionDesc:{transform:"rotate(0deg)"},iconDirectionAsc:{transform:"rotate(180deg)"}}}),{name:"MuiTableSortLabel"})(ni),ii=n(1173),oi=n(1167),ai=n(1168),si=n(1130),ci=n(1121),ui=n(1148),li=n(1133);function fi(e,t){var n=t.disableHysteresis,r=void 0!==n&&n,i=t.threshold,o=void 0===i?100:i,a=t.target,s=e.current;return a&&(e.current=void 0!==a.pageYOffset?a.pageYOffset:a.scrollTop),!(!r&&void 0!==s&&e.currento}var di="undefined"!=typeof window?window:null;function pi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.getTrigger,n=void 0===t?fi:t,r=e.target,i=void 0===r?di:r,o=Object(c.a)(e,["getTrigger","target"]),a=u.useRef(),l=u.useState((function(){return n(a,o)})),f=l[0],d=l[1];return u.useEffect((function(){var e=function(){d(n(a,Object(s.a)({target:i},o)))};return e(),i.addEventListener("scroll",e),function(){i.removeEventListener("scroll",e)}}),[i,n,JSON.stringify(o)]),f}var hi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=e.breakpoint,r=void 0===n?"sm":n;return Object(wt.a)()((function(e){return u.createElement(t,Object(s.a)({fullScreen:Object(wt.b)(r,e.width)},e))}))}},gi=n(145),vi=n(372),mi={entering:{transform:"none"},entered:{transform:"none"}},yi={enter:cr.b.enteringScreen,exit:cr.b.leavingScreen},bi=u.forwardRef((function(e,t){var n=e.children,r=e.disableStrictModeCompat,i=void 0!==r&&r,o=e.in,a=e.onEnter,l=e.onEntered,f=e.onEntering,d=e.onExit,p=e.onExited,h=e.onExiting,g=e.style,v=e.timeout,m=void 0===v?yi:v,y=e.TransitionComponent,b=void 0===y?vi.a:y,w=Object(c.a)(e,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),_=Object(_t.a)(),x=_.unstable_strictMode&&!i,O=u.useRef(null),S=Object(On.a)(n.ref,t),E=Object(On.a)(x?O:void 0,S),C=function(e){return function(t,n){if(e){var r=x?[O.current,t]:[t,n],i=Object(fe.a)(r,2),o=i[0],a=i[1];void 0===a?e(o):e(o,a)}}},k=C(f),T=C((function(e,t){Object(ur.b)(e);var n=Object(ur.a)({style:g,timeout:m},{mode:"enter"});e.style.webkitTransition=_.transitions.create("transform",n),e.style.transition=_.transitions.create("transform",n),a&&a(e,t)})),j=C(l),P=C(h),I=C((function(e){var t=Object(ur.a)({style:g,timeout:m},{mode:"exit"});e.style.webkitTransition=_.transitions.create("transform",t),e.style.transition=_.transitions.create("transform",t),d&&d(e)})),R=C(p);return u.createElement(b,Object(s.a)({appear:!0,in:o,nodeRef:x?O:void 0,onEnter:T,onEntered:j,onEntering:k,onExit:I,onExited:R,onExiting:P,timeout:m},w),(function(e,t){return u.cloneElement(n,Object(s.a)({style:Object(s.a)({transform:"scale(0)",visibility:"exited"!==e||o?void 0:"hidden"},mi[e],g,n.props.style),ref:E},t))}))}))},function(e,t,n){"use strict";n.r(t),n.d(t,"selectInfoResponses",(function(){return h})),n.d(t,"getCanvases",(function(){return g})),n.d(t,"getCanvas",(function(){return v})),n.d(t,"getCurrentCanvas",(function(){return m})),n.d(t,"getVisibleCanvasIds",(function(){return y})),n.d(t,"getVisibleCanvases",(function(){return b})),n.d(t,"getCanvasGroupings",(function(){return w})),n.d(t,"getCanvasGrouping",(function(){return _})),n.d(t,"getNextCanvasGrouping",(function(){return x})),n.d(t,"getPreviousCanvasGrouping",(function(){return O})),n.d(t,"getCanvasLabel",(function(){return S})),n.d(t,"getCanvasDescription",(function(){return E})),n.d(t,"getVisibleCanvasNonTiledResources",(function(){return C})),n.d(t,"getVisibleCanvasVideoResources",(function(){return k})),n.d(t,"getVisibleCanvasCaptions",(function(){return T})),n.d(t,"getVisibleCanvasAudioResources",(function(){return j})),n.d(t,"selectInfoResponse",(function(){return P}));var r=n(10),i=n(29),o=n.n(i);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"single";a(this,e),this.canvases=t,this.viewType=n,this._groupings=null}var t,n,r;return t=e,(n=[{key:"getCanvases",value:function(e){switch(this.viewType){case"book":return this.groupings()[Math.ceil(e/2)];default:return this.groupings()[e]}}},{key:"groupings",value:function(){if(this._groupings)return this._groupings;if("scroll"===this.viewType)return[this.canvases];if("book"!==this.viewType)return this.canvases.map((function(e){return[e]}));var e=[];return this.canvases.forEach((function(t,n){0!==n?n%2!=0?e.push([t]):e[Math.ceil(n/2)].push(t):e.push([t])})),this._groupings=e,e}}])&&s(t.prototype,n),r&&s(t,r),e}(),u=n(48),l=n(46),f=n(38),d=n(76),p=n(206),h=function(e){return Object(l.a)(e).infoResponses},g=Object(r.createSelector)([d.b],(function(e){return e&&e.getCanvases()||[]})),v=Object(r.createSelector)([d.b,function(e,t){return t.canvasId}],(function(e,t){if(e&&t)return e.getCanvasById(t)})),m=Object(r.createSelector)([d.b,f.e],(function(e,t){if(e&&t)return t.canvasId?e.getCanvasById(t.canvasId):e.getCanvasByIndex(0)})),y=Object(r.createSelector)([f.e],(function(e){return e&&(e.visibleCanvases||e.canvasId&&[e.canvasId])||[]})),b=Object(r.createSelector)([y,g],(function(e,t){return(t||[]).filter((function(t){return e.includes(t.id)}))})),w=Object(r.createSelector)([g,p.f],(function(e,t){return e&&new c(e,t).groupings()})),_=Object(r.createSelector)([w,function(e,t){return t.canvasId}],(function(e,t){return e&&e.find((function(e){return e.some((function(e){return e.id===t}))}))||[]})),x=Object(r.createSelector)([w,m],(function(e,t,n){if(e&&t){var r=e.findIndex((function(e){return e.some((function(e){return e.id===t.id}))}));if(!(r<0||r+1>=e.length))return e[r+1]}})),O=Object(r.createSelector)([w,m],(function(e,t,n){if(e&&t){var r=e.findIndex((function(e){return e.some((function(e){return e.id===t.id}))}));if(!(r<1))return e[r-1]}})),S=Object(r.createSelector)([v],(function(e){return e&&(e.getLabel().length>0?e.getLabel().getValue():String(e.index+1))})),E=Object(r.createSelector)([v],(function(e){return e&&e.getProperty("description")})),C=Object(r.createSelector)([b],(function(e){return o()(e.map((function(e){return new u.a(e).imageResources}))).filter((function(e){return e.getServices().length<1}))})),k=Object(r.createSelector)([b],(function(e){return o()(e.map((function(e){return new u.a(e).videoResources})))})),T=Object(r.createSelector)([b],(function(e){return o()(e.map((function(e){return new u.a(e).vttContent})))})),j=Object(r.createSelector)([b],(function(e){return o()(e.map((function(e){return new u.a(e).audioResources})))})),P=Object(r.createSelector)([function(e,t){return t.infoId},v,h],(function(e,t,n){var r=e;if(!e){if(!t)return;var i=new u.a(t).iiifImageResources[0];r=i&&i.getServices()[0].id}return r&&n[r]&&!n[r].isFetching&&n[r]}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(103);function i(e){return r.a.state.slice?e[r.a.state.slice]:e}},function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(29),i=n.n(r),o=n(138),a=n.n(o),s=n(35);function c(e,t){for(var n=0;n0?this.canvas.getLabel().getValue():String(this.canvas.index+1)}}])&&c(t.prototype,n),r&&c(t,r),e}()},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(4),i={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},o={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a(e){return"".concat(Math.round(e),"ms")}t.a={easing:i,duration:o,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?o.standard:n,c=t.easing,u=void 0===c?i.easeInOut:c,l=t.delay,f=void 0===l?0:l;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof s?s:a(s)," ").concat(u," ").concat("string"==typeof f?f:a(f))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(248);var i=n(333),o=n(209);function a(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";function r(e){for(var t=1;t0)return i.getInlineStyleAt(r-1);if(i.getLength())return i.getInlineStyleAt(0);return w(e,n)}(t,n):function(e,t){var n=t.getStartKey(),r=t.getStartOffset(),i=e.getBlockForKey(n);if(r0)return i.getInlineStyleAt(r-1);return w(e,n)}(t,n)},e.getBlockTree=function(e){return this.getImmutable().getIn(["treeMap",e])},e.isSelectionAtStartOfContent=function(){var e=this.getCurrentContent().getBlockMap().first().getKey();return this.getSelection().hasEdgeWithin(e,0,0)},e.isSelectionAtEndOfContent=function(){var e=this.getCurrentContent().getBlockMap().last(),t=e.getLength();return this.getSelection().hasEdgeWithin(e.getKey(),t,t)},e.getDirectionMap=function(){return this.getImmutable().get("directionMap")},t.acceptSelection=function(e,t){return m(e,t,!1)},t.forceSelection=function(e,t){return t.getHasFocus()||(t=t.set("hasFocus",!0)),m(e,t,!0)},t.moveSelectionToEnd=function(e){var n=e.getCurrentContent().getLastBlock(),r=n.getKey(),i=n.getLength();return t.acceptSelection(e,new c({anchorKey:r,anchorOffset:i,focusKey:r,focusOffset:i,isBackward:!1}))},t.moveFocusToEnd=function(e){var n=t.moveSelectionToEnd(e);return t.forceSelection(n,n.getSelection())},t.push=function(e,n,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.getCurrentContent()===n)return e;var o=s.getDirectionMap(n,e.getDirectionMap());if(!e.getAllowUndo())return t.set(e,{currentContent:n,directionMap:o,lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:i,inlineStyleOverride:null});var a=e.getSelection(),c=e.getCurrentContent(),u=e.getUndoStack(),l=n;a!==c.getSelectionAfter()||b(e,r)?(u=u.push(c),l=l.set("selectionBefore",a)):"insert-characters"!==r&&"backspace-character"!==r&&"delete-character"!==r||(l=l.set("selectionBefore",c.getSelectionBefore()));var f=e.getInlineStyleOverride(),p=["adjust-depth","change-block-type","split-block"];-1===p.indexOf(r)&&(f=null);var h={currentContent:l,directionMap:o,undoStack:u,redoStack:d(),lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:i,inlineStyleOverride:f};return t.set(e,h)},t.undo=function(e){if(!e.getAllowUndo())return e;var n=e.getUndoStack(),r=n.peek();if(!r)return e;var i=e.getCurrentContent(),o=s.getDirectionMap(r,e.getDirectionMap());return t.set(e,{currentContent:r,directionMap:o,undoStack:n.shift(),redoStack:e.getRedoStack().push(i),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"undo",nativelyRenderedContent:null,selection:i.getSelectionBefore()})},t.redo=function(e){if(!e.getAllowUndo())return e;var n=e.getRedoStack(),r=n.peek();if(!r)return e;var i=e.getCurrentContent(),o=s.getDirectionMap(r,e.getDirectionMap());return t.set(e,{currentContent:r,directionMap:o,undoStack:e.getUndoStack().push(i),redoStack:n.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"redo",nativelyRenderedContent:null,selection:r.getSelectionAfter()})},e.getImmutable=function(){return this._immutable},t}();function m(e,t,n){return v.set(e,{selection:t,forceSelection:n,nativelyRenderedContent:null,inlineStyleOverride:null})}function y(e,t){return e.getBlockMap().map((function(n){return o.generate(e,n,t)})).toOrderedMap()}function b(e,t){return t!==e.getLastChangeType()||"insert-characters"!==t&&"backspace-character"!==t&&"delete-character"!==t}function w(e,t){var n=e.getBlockMap().reverse().skipUntil((function(e,n){return n===t})).skip(1).skipUntil((function(e,t){return e.getLength()})).first();return n?n.getInlineStyleAt(n.getLength()-1):l()}e.exports=v},function(e,t,n){"use strict";n.r(t);var r=n(140);n.d(t,"default",(function(){return r.a}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(344),i="object"==typeof self&&self&&self.Object===Object&&self,o=r.a||i||Function("return this")();t.a=o},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var r=function(e){return e.scrollTop};function i(e,t){var n=e.timeout,r=e.style,i=void 0===r?{}:r;return{duration:i.transitionDuration||"number"==typeof n?n:n[t.mode]||0,delay:i.transitionDelay}}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";n.r(t);var r=n(579);n.d(t,"default",(function(){return r.a}))},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return $})),n.d(t,"b",(function(){return Q})),n.d(t,"c",(function(){return ve})),n.d(t,"d",(function(){return f})),n.d(t,"e",(function(){return ye})),n.d(t,"f",(function(){return me})),n.d(t,"g",(function(){return p}));var r=n(1),i=n(186),o=(n(243),n(60)),a=n(95),s=n(53),c=n(58),u={}.constructor;function l(e){if(null==e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(l);if(e.constructor!==u)return e;var t={};for(var n in e)t[n]=l(e[n]);return t}function f(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=l(t),o=r.plugins.onCreateRule(e,i,n);return o||(e[0],null)}var d=function(e,t){for(var n="",r=0;r<+~=|^:(),"'`\s])/g,y="undefined"!=typeof CSS&&CSS.escape,b=function(e){return y?y(e):e.replace(m,"\\$1")},w=function(){function e(e,t,n){this.type="style",this.isProcessed=!1;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var s=o&&a;if(s?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var c=this.options.sheet;return c&&c.attached,this},e}(),_=function(e){function t(t,n,r){var i;i=e.call(this,t,n,r)||this;var o=r.selector,a=r.scoped,c=r.sheet,u=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=u(Object(s.a)(Object(s.a)(i)),c),i.selectorText="."+b(i.id)),i}Object(a.a)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=p(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(r.a)({},e,{allowEmpty:!0}):e;return v(this.selectorText,this.style,n)},Object(o.a)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(w),x={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new _(e,t,n)}},O={indent:1,children:!0},S=/@([\w-]+)/,E=function(){function e(e,t,n){this.type="conditional",this.isProcessed=!1,this.key=e;var i=e.match(S);for(var o in this.at=i?i[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new $(Object(r.a)({},n,{parent:this})),t)this.rules.add(o,t[o]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.replaceRule=function(e,t,n){var r=this.rules.replace(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.toString=function(e){void 0===e&&(e=O);var t=h(e).linebreak;if(null==e.indent&&(e.indent=O.indent),null==e.children&&(e.children=O.children),!1===e.children)return this.query+" {}";var n=this.rules.toString(e);return n?this.query+" {"+t+n+t+"}":""},e}(),C=/@media|@supports\s+/,k={onCreateRule:function(e,t,n){return C.test(e)?new E(e,t,n):null}},T={indent:1,children:!0},j=/@keyframes\s+([\w-]+)/,P=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var i=e.match(j);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,s=n.generateId;for(var c in this.id=!1===o?this.name:b(s(this,a)),this.rules=new $(Object(r.a)({},n,{parent:this})),t)this.rules.add(c,t[c],Object(r.a)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){void 0===e&&(e=T);var t=h(e).linebreak;if(null==e.indent&&(e.indent=T.indent),null==e.children&&(e.children=T.children),!1===e.children)return this.at+" "+this.id+" {}";var n=this.rules.toString(e);return n&&(n=""+t+n+t),this.at+" "+this.id+" {"+n+"}"},e}(),I=/@keyframes\s+/,R=/\$([\w-]+)/g,A=function(e,t){return"string"==typeof e?e.replace(R,(function(e,n){return n in t?t[n]:e})):e},M=function(e,t,n){var r=e[t],i=A(r,n);i!==r&&(e[t]=i)},D={onCreateRule:function(e,t,n){return"string"==typeof e&&I.test(e)?new P(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&M(e,"animation-name",n.keyframes),"animation"in e&&M(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return A(e,r.keyframes);default:return e}}},N=function(e){function t(){return e.apply(this,arguments)||this}return Object(a.a)(t,e),t.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(r.a)({},e,{allowEmpty:!0}):e;return v(this.key,this.style,n)},t}(w),L={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new N(e,t,n):null}},z=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){var t=h(e).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=Object(c.a)(t,["attached"]),i=h(r).linebreak,o="",a=0;a0){var n=function(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function(e){for(var t=ce(),n=0;nn?n:t},pe=function(){function e(e){this.getPropertyValue=ie,this.setProperty=oe,this.removeProperty=ae,this.setSelector=se,this.hasInsertedRules=!1,this.cssRules=[],e&&Y.add(e),this.sheet=e;var t,n=this.sheet?this.sheet.options:{},r=n.media,i=n.meta,o=n.element;this.element=o||((t=document.createElement("style")).textContent="\n",t),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),i&&this.element.setAttribute("data-meta",i);var a=le();a&&this.element.setAttribute("nonce",a)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=ue(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"==typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling)}else ce().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n0})}),(function(e,t){var n=t.windowId,r=t.id;return{onCloseClick:function(){return e(f.c(n,r))},updateCompanionWindow:function(){for(var t=arguments.length,i=new Array(t),o=0;o1),t})),s(e,l(e),n),u&&(n=i(n,7,c));for(var f=t.length;f--;)o(n,t[f]);return n}));e.exports=f},function(e,t,n){"use strict";function r(e,t){"function"==typeof e?e(t):e&&(e.current=t)}n.d(t,"a",(function(){return r}))},,function(e,t,n){"use strict";n.r(t);var r=n(329);n.d(t,"default",(function(){return r.a}))},function(e,t,n){"use strict";e.exports=n(853)},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";n(1);var r=n(136);t.a=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:.15;return u(e)>.5?f(e,t):d(e,t)},t.fade=function(e,t){0;return l(e,t)},t.alpha=l,t.darken=f,t.lighten=d;var r=n(25);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function o(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}function a(e){var t=(e=s(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},u="rgb",l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(u+="a",l.push(t[3])),c({type:u,values:l})}function s(e){if(e.type)return e;if("#"===e.charAt(0))return s(o(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error((0,r.formatMuiErrorMessage)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function c(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function u(e){var t="hsl"===(e=s(e)).type?s(a(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function l(e,t){return e=s(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,c(e)}function f(e,t){if(e=s(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return c(e)}function d(e,t){if(e=s(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return c(e)}},function(e,t,n){"use strict";var r=n(5),i=n(0),o=n.n(i),a=n(465),s=n.n(a),c=n(14),u={iiif:{ALLOWED_ATTR:["href","src","alt"],ALLOWED_TAGS:["a","b","br","i","img","p","span"]},liberal:{},mirador2:{ALLOWED_ATTR:["href","target","src","alt","dir"],ALLOWED_TAGS:["a","b","br","i","img","p","span","strong","em","ul","ol","li"]},noHtml:{ALLOWED_TAGS:[]}};function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA",i=p(e,t),o=h(i,t);return u(o,o.getSelectionAfter(),n,r)},removeRange:function(e,t,n){var r,i,o,s;t.getIsBackward()&&(t=t.merge({anchorKey:t.getFocusKey(),anchorOffset:t.getFocusOffset(),focusKey:t.getAnchorKey(),focusOffset:t.getAnchorOffset(),isBackward:!1})),r=t.getAnchorKey(),i=t.getFocusKey(),o=e.getBlockForKey(r),s=e.getBlockForKey(i);var c=t.getStartOffset(),u=t.getEndOffset(),l=o.getEntityAt(c),f=s.getEntityAt(u-1);if(r===i&&l&&l===f){var d=a(e.getEntityMap(),o,s,t,n);return h(e,d)}var g=p(e,t);return h(g,t)},splitBlock:function(e,t){var n=p(e,t),r=h(n,t);return g(r,r.getSelectionAfter())},applyInlineStyle:function(e,t,n){return i.add(e,t,n)},removeInlineStyle:function(e,t,n){return i.remove(e,t,n)},setBlockType:function(e,t,n){return d(e,t,(function(e){return e.merge({type:n,depth:0})}))},setBlockData:function(e,t,n){return d(e,t,(function(e){return e.merge({data:n})}))},mergeBlockData:function(e,t,n){return d(e,t,(function(e){return e.merge({data:e.getData().merge(n)})}))},applyEntity:function(e,t,n){var r=p(e,t);return o(r,t,n)}};e.exports=m},function(e,t,n){"use strict";e.exports=function(e){if(null!=e)return e;throw new Error("Got unexpected null or undefined")}},function(e,t,n){"use strict";var r=n(965),i=n(968),o=n(969),a=n(970);function s(e,t,n,r){if(e===n)return!0;if(!n.startsWith(e))return!1;var o=n.slice(e.length);return!!t&&(o=r?r(o):o,i.contains(o,t))}function c(e){return"Windows"===r.platformName?e.replace(/^\s*NT/,""):e}var u={isBrowser:function(e){return s(r.browserName,r.browserFullVersion,e)},isBrowserArchitecture:function(e){return s(r.browserArchitecture,null,e)},isDevice:function(e){return s(r.deviceName,null,e)},isEngine:function(e){return s(r.engineName,r.engineVersion,e)},isPlatform:function(e){return s(r.platformName,r.platformFullVersion,e,c)},isPlatformArchitecture:function(e){return s(r.platformArchitecture,null,e)}};e.exports=o(u,a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"g",(function(){return h})),n.d(t,"i",(function(){return g})),n.d(t,"b",(function(){return v})),n.d(t,"h",(function(){return m})),n.d(t,"e",(function(){return y}));var r=n(10),i=n(120),o=n.n(i),a=n(46),s=n(38);function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.locale||t.language})),v=Object(r.createSelector)([l.b],(function(e){return e||{missing:!0}})),m=Object(r.createSelector)([l.b],(function(e){return e&&e.error})),y=o()(l.b,g,(function(e,t){return e&&h(e.json,t)}))((function(e,t){var n=t.companionWindowId;return[t.manifestId,t.windowId,g(e,{companionWindowId:n})].join(" - ")})),b=Object(r.createSelector)(y,(function(e,t){return t.json}),g,(function(e,t,n){return t&&h(t,n)||e})),w=Object(r.createSelector)([b],(function(e){return e&&e.options&&e.options.locale&&e.options.locale.replace(/-.*$/,"")}));function _(e){return Object(r.createSelector)([b],(function(t){return t&&t.getProperty(e)}))}var x=Object(r.createSelector)([b],(function(e){return e&&e.getLogo()})),O=Object(r.createSelector)([_("provider"),w],(function(e,t){return e&&e[0].label&&a.b.parse(e[0].label,t).getValue()})),S=Object(r.createSelector)([_("homepage"),w],(function(e,t){return e&&Object(c.a)(e).map((function(e){return{label:a.b.parse(e.label,t).getValue(),value:e.id||e["@id"]}}))})),E=Object(r.createSelector)([b],(function(e){return e&&e.getRenderings().map((function(e){return{label:e.getLabel().getValue(),value:e.id}}))})),C=Object(r.createSelector)([_("seeAlso"),w],(function(e,t){return e&&Object(c.a)(e).map((function(e){return{format:e.format,label:a.b.parse(e.label,t).getValue(),value:e.id||e["@id"]}}))})),k=Object(r.createSelector)([b],(function(e){return e&&Object(c.a)(e.getRequiredStatement()).filter((function(e){return e.getValues().some((function(e){return e}))})).map((function(e){return{label:e.label&&e.label.getValue()||null,values:e.getValues()}}))})),T=Object(r.createSelector)([_("rights"),_("license"),w],(function(e,t,n){var r=e||t;return Object(c.a)(a.b.parse(r,n).getValues())}));function j(e,t){var n=b(e,t),r=Object(f.a)(e).thumbnails,i=void 0===r?{}:r;if(n){var o=Object(s.a)(n,{maxHeight:80,maxWidth:120,preferredFormats:i.preferredFormats});return o&&o.url}}var P=Object(r.createSelector)([b],(function(e){return e&&e.getLabel().getValue()})),I=Object(r.createSelector)([b],(function(e){return e&&e.getDescription().getValue()})),R=Object(r.createSelector)([b],(function(e){return e&&e.id}));function A(e){return e&&e.getMetadata().map((function(e){return{label:e.getLabel(),values:e.getValues()}}))}var M=Object(r.createSelector)([b],(function(e){return e&&A(e)}));function D(e){var t=[];return Array.isArray(e)?t.push.apply(t,d(e.filter((function(e){return"object"==typeof e&&e["@language"]})).map((function(e){return e["@language"]})))):e&&"object"==typeof e&&e["@language"]&&t.push(e["@language"]),t}var N=Object(r.createSelector)([b],(function(e){return function(e){if(!e)return[];for(var t=e.getProperty("metadata")||[],n={},r=0;r0&&void 0!==arguments[0]?arguments[0]:d;return e.call(this,g(t))||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.getKey=function(){return this.get("key")},o.getType=function(){return this.get("type")},o.getText=function(){return this.get("text")},o.getCharacterList=function(){return this.get("characterList")},o.getLength=function(){return this.getText().length},o.getDepth=function(){return this.get("depth")},o.getData=function(){return this.get("data")},o.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():f},o.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},o.getChildKeys=function(){return this.get("children")},o.getParentKey=function(){return this.get("parent")},o.getPrevSiblingKey=function(){return this.get("prevSibling")},o.getNextSiblingKey=function(){return this.get("nextSibling")},o.findStyleRanges=function(e,t){i(this.getCharacterList(),p,e,t)},o.findEntityRanges=function(e,t){i(this.getCharacterList(),h,e,t)},r}(u(d));e.exports=v},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MosaicWindowContext=t.MosaicContext=void 0;var i=r(n(0));t.MosaicContext=i.default.createContext(void 0),t.MosaicWindowContext=i.default.createContext(void 0)},function(e,t,n){"use strict";n.r(t),n.d(t,"MiradorMenuButton",(function(){return f}));var r=n(0),i=n.n(r),o=n(1120),a=n(757),s=n(1121),c=n(14),u=["badge","children","containerId","dispatch","BadgeProps","TooltipProps"];function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function f(e){var t=e["aria-label"],n=e.badge,r=e.children,f=e.containerId,d=(e.dispatch,e.BadgeProps),p=e.TooltipProps,h=l(e,u),g=i.a.createElement(a.a,h,n?i.a.createElement(o.a,d,r):r);return h.disabled?g:i.a.createElement(s.a,Object.assign({PopperProps:{container:document.querySelector("#".concat(f," .").concat(Object(c.a)("viewer")))},title:t},p),g)}f.defaultProps={badge:!1,BadgeProps:{},dispatch:function(){},TooltipProps:{}}},function(e,t,n){"use strict";function r(e){var t=e.props,n=e.states,r=e.muiFormControl;return n.reduce((function(e,n){return e[n]=t[n],r&&void 0===t[n]&&(e[n]=r[n]),e}),{})}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(126);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ns)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=h,c=g,i=d;var m=(1e4*(268435455&(h+=122192928e5))+g)%4294967296;l[u++]=m>>>24&255,l[u++]=m>>>16&255,l[u++]=m>>>8&255,l[u++]=255&m;var y=h/4294967296*1e4&268435455;l[u++]=y>>>8&255,l[u++]=255&y,l[u++]=y>>>24&15|16,l[u++]=y>>>16&255,l[u++]=d>>>8|128,l[u++]=255&d;for(var b=0;b<6;++b)l[u+b]=f[b];return t||Object(a.a)(l)},l=n(150);var f=function(e){if(!Object(l.a)(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};var d=function(e,t,n){function r(e,r,i,o){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n>>9<<4)+1}function h(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function g(e,t,n,r,i,o){return h((a=h(h(t,e),h(r,o)))<<(s=i)|a>>>32-s,n);var a,s}function v(e,t,n,r,i,o,a){return g(t&n|~t&r,e,t,i,o,a)}function m(e,t,n,r,i,o,a){return g(t&r|n&~r,e,t,i,o,a)}function y(e,t,n,r,i,o,a){return g(t^n^r,e,t,i,o,a)}function b(e,t,n,r,i,o,a){return g(n^(t|~r),e,t,i,o,a)}var w=d("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n>5]>>>r%32&255,o=parseInt("0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[r/8])<>>32-t}var S=d("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i>>0;b=y,y=m,m=O(v,30)>>>0,v=g,g=S}n[0]=n[0]+g>>>0,n[1]=n[1]+v>>>0,n[2]=n[2]+m>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),E="00000000-0000-0000-0000-000000000000";var C=function(e){if(!Object(l.a)(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAndAssertNodeAtPathExists=t.getNodeAtPath=t.getLeaves=t.getPathToCorner=t.getOtherDirection=t.getOtherBranch=t.createBalancedTreeFromLeaves=t.isParent=t.Corner=void 0;var i,o=r(n(651)),a=r(n(548));function s(e){return null!=e.direction}function c(e){return"row"===e?"column":"row"}function u(e,t){return t.length>0?a.default(e,t,null):e}!function(e){e[e.TOP_LEFT=1]="TOP_LEFT",e[e.TOP_RIGHT=2]="TOP_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT",e[e.BOTTOM_RIGHT=4]="BOTTOM_RIGHT"}(i=t.Corner||(t.Corner={})),t.isParent=s,t.createBalancedTreeFromLeaves=function(e,t){if(void 0===t&&(t="row"),0===e.length)return null;for(var n=o.default(e),r=[];n.length>1;){for(;n.length>0;)n.length>1?r.push({direction:"row",first:n.shift(),second:n.shift()}):r.unshift(n.shift());n=r,r=[]}return function e(t,n){if(void 0===n&&(n="row"),s(t)){var r=c(n);return{direction:n,first:e(t.first,r),second:e(t.second,r)}}return t}(n[0],t)},t.getOtherBranch=function(e){if("first"===e)return"second";if("second"===e)return"first";throw new Error("Branch '"+e+"' not a valid branch")},t.getOtherDirection=c,t.getPathToCorner=function(e,t){for(var n=e,r=[];s(n);)("row"!==n.direction||t!==i.TOP_LEFT&&t!==i.BOTTOM_LEFT)&&("column"!==n.direction||t!==i.TOP_LEFT&&t!==i.TOP_RIGHT)?(r.push("second"),n=n.second):(r.push("first"),n=n.first);return r},t.getLeaves=function e(t){return null==t?[]:s(t)?e(t.first).concat(e(t.second)):[t]},t.getNodeAtPath=u,t.getAndAssertNodeAtPathExists=function(e,t){if(null==e)throw new Error("Root is empty, cannot fetch path");var n=u(e,t);if(null==n)throw new Error("Path ["+t.join(", ")+"] did not resolve to a node");return n}},function(e,t,n){"use strict";function r(e){return void 0===e?[]:Array.isArray(e)?e:[e]}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=n(1),i=n(4),o=["xs","sm","md","lg","xl"];function a(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,a=e.unit,s=void 0===a?"px":a,c=e.step,u=void 0===c?5:c,l=Object(i.a)(e,["values","unit","step"]);function f(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(s,")")}function d(e,t){var r=o.indexOf(t);return r===o.length-1?f(e):"@media (min-width:".concat("number"==typeof n[e]?n[e]:e).concat(s,") and ")+"(max-width:".concat((-1!==r&&"number"==typeof n[o[r+1]]?n[o[r+1]]:t)-u/100).concat(s,")")}return Object(r.a)({keys:o,values:n,up:f,down:function(e){var t=o.indexOf(e)+1,r=n[o[t]];return t===o.length?f("xs"):"@media (max-width:".concat(("number"==typeof r&&t>0?r:e)-u/100).concat(s,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},l)}},function(e,t,n){"use strict";n.r(t);var r=n(572);n.d(t,"default",(function(){return r.a}))},function(e,t,n){"use strict";n.r(t);var r=n(576);n.d(t,"default",(function(){return r.a}))},function(e,t,n){"use strict";n.r(t);var r=n(577);n.d(t,"default",(function(){return r.a}))},function(e,t,n){"use strict";n.r(t);var r=n(583);n.d(t,"default",(function(){return r.a}))},function(e,t,n){"use strict";var r={},i=Math.pow(2,24);e.exports=function(){for(var e;void 0===e||r.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*i).toString(32);return r[e]=!0,e}},function(e,t,n){"use strict";n.r(t),n.d(t,"HTML5DragTransition",(function(){return o})),n.d(t,"TouchTransition",(function(){return i})),n.d(t,"MouseTransition",(function(){return a})),n.d(t,"createTransition",(function(){return r})),n.d(t,"MultiBackend",(function(){return d})),n.d(t,"PreviewManager",(function(){return f}));var r=function(e,t){return{_isMBTransition:!0,event:e,check:t}},i=r("touchstart",(function(e){return null!=e.touches})),o=r("dragstart",(function(e){return!!e.type&&(-1!==e.type.indexOf("drag")||-1!==e.type.indexOf("drop"))})),a=r("mousedown",(function(e){return!!e.type&&(-1===e.type.indexOf("touch")&&-1!==e.type.indexOf("mouse"))}));function s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}(t.previews);try{for(r.s();!(n=r.n()).done;){n.value.backendChanged(e)}}catch(e){r.e(e)}finally{r.f()}},this.previews=[]},d=function e(t,n,r){var i=this;l(this,e),this.setup=function(){if("undefined"!=typeof window){if(i.constructor.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");i.constructor.isSetUp=!0,i.addEventListeners(window),i.backends[i.current].instance.setup()}},this.teardown=function(){"undefined"!=typeof window&&(i.constructor.isSetUp=!1,i.removeEventListeners(window),i.backends[i.current].instance.teardown())},this.connectDragSource=function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r0?e.getLabel().getValue():String(t+1)}}],(n=[{key:"componentDidMount",value:function(){var e=this;this.setState((function(t){return m(m({},t),{},{image:e.image()})}))}},{key:"componentDidUpdate",value:function(e){var t=this,n=this.props,r=n.maxHeight,i=n.maxWidth,o=n.resource;e.maxHeight===r&&e.maxWidth===i&&e.resource===o||this.setState((function(e){return m(m({},e),{},{image:t.image()})}))}},{key:"handleIntersection",value:function(e){!this.state.loaded&&e.isIntersecting&&this.setState((function(e){return m(m({},e),{},{loaded:!0})}))}},{key:"imageStyles",value:function(){var e=this.props,t=e.maxHeight,n=e.maxWidth,r=e.style,i=this.image(),o={height:"auto",width:"auto"};if(!i)return m(m({},r),{},{height:t||"auto",width:n||"auto"});var a=i.height,s=i.width;if(a&&s)if(t&&a>t||n&&s>n){var c=s/a;t&&n?n/t>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?x(e)+t:t}function S(){return!0}function E(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function C(e,t){return T(e,t,0)}function k(e,t){return T(e,t,t)}function T(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var j,P,I,R="function"==typeof Symbol&&Symbol.iterator,A=R||"@@iterator";function M(e){this.next=e}function D(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function N(){return{value:void 0,done:!0}}function L(e){return!!F(e)}function z(e){return e&&"function"==typeof e.next}function B(e){var t=F(e);return t&&t.call(e)}function F(e){var t=e&&(R&&e[R]||e["@@iterator"]);if("function"==typeof t)return t}function W(e){return e&&"number"==typeof e.length}function H(e){return null==e?Q():a(e)?e.toSeq():function(e){var t=ee(e)||"object"==typeof e&&new K(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function V(e){return null==e?Q().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():Y(e)}function U(e){return null==e?Q():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():J(e)}function q(e){return(null==e?Q():a(e)?s(e)?e.entrySeq():e:J(e)).toSetSeq()}function G(e){this._array=e,this.size=e.length}function K(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function $(e){this._iterable=e,this.size=e.length||e.size}function Z(e){this._iterator=e,this._iteratorCache=[]}function X(e){return!(!e||!e["@@__IMMUTABLE_SEQ__@@"])}function Q(){return j||(j=new G([]))}function Y(e){var t=Array.isArray(e)?new G(e).fromEntrySeq():z(e)?new Z(e).fromEntrySeq():L(e)?new $(e).fromEntrySeq():"object"==typeof e?new K(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function J(e){var t=ee(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ee(e){return W(e)?new G(e):z(e)?new Z(e):L(e)?new $(e):void 0}function te(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function ne(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new M((function(){var e=i[n?o-a:a];return a++>o?{value:void 0,done:!0}:D(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function re(e,t){return t?function e(t,n,r,i){return Array.isArray(n)?t.call(i,r,U(n).map((function(r,i){return e(t,r,i,n)}))):oe(n)?t.call(i,r,V(n).map((function(r,i){return e(t,r,i,n)}))):n}(t,e,"",{"":e}):ie(e)}function ie(e){return Array.isArray(e)?U(e).map(ie).toList():oe(e)?V(e).map(ie).toMap():e}function oe(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ae(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function se(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||c(e)!==c(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!u(e);if(l(e)){var r=e.entries();return t.every((function(e,t){var i=r.next().value;return i&&ae(i[1],e)&&(n||ae(i[0],t))}))&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var f=!0,d=t.__iterate((function(t,r){if(n?!e.has(t):i?!ae(t,e.get(r,g)):!ae(e.get(r,g),t))return f=!1,!1}));return f&&e.size===d}function ce(e,t){if(!(this instanceof ce))return new ce(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(P)return P;P=this}}function ue(e,t){if(!e)throw new Error(t)}function le(e,t,n){if(!(this instanceof le))return new le(e,t,n);if(ue(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),tr?{value:void 0,done:!0}:D(e,i,n[t?r-i++:i++])}))},t(K,V),K.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},K.prototype.has=function(e){return this._object.hasOwnProperty(e)},K.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},K.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new M((function(){var a=r[t?i-o:o];return o++>i?{value:void 0,done:!0}:D(e,a,n[a])}))},K.prototype[h]=!0,t($,U),$.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=B(this._iterable),r=0;if(z(n))for(var i;!(i=n.next()).done&&!1!==e(i.value,r++,this););return r},$.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=B(this._iterable);if(!z(n))return new M(N);var r=0;return new M((function(){var t=n.next();return t.done?t:D(e,r++,t.value)}))},t(Z,U),Z.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,i=this._iteratorCache,o=0;o=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return D(e,i,r[i++])}))},t(ce,U),ce.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},ce.prototype.get=function(e,t){return this.has(e)?this._value:t},ce.prototype.includes=function(e){return ae(this._value,e)},ce.prototype.slice=function(e,t){var n=this.size;return E(e,t,n)?this:new ce(this._value,k(t,n)-C(e,n))},ce.prototype.reverse=function(){return this},ce.prototype.indexOf=function(e){return ae(this._value,e)?0:-1},ce.prototype.lastIndexOf=function(e){return ae(this._value,e)?this.size:-1},ce.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?{value:void 0,done:!0}:D(e,o++,a)}))},le.prototype.equals=function(e){return e instanceof le?this._start===e._start&&this._end===e._end&&this._step===e._step:se(this,e)},t(fe,n),t(de,fe),t(pe,fe),t(he,fe),fe.Keyed=de,fe.Indexed=pe,fe.Set=he;var ge="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function ve(e){return e>>>1&1073741824|3221225471&e}function me(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return ve(n)}if("string"===t)return e.length>Ee?function(e){var t=Te[e];return void 0===t&&(t=ye(e),ke===Ce&&(ke=0,Te={}),ke++,Te[e]=t),t}(e):ye(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(xe&&void 0!==(t=be.get(e)))return t;if(void 0!==(t=e[Se]))return t;if(!_e){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Se]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Oe,1073741824&Oe&&(Oe=0),xe)be.set(e,t);else{if(void 0!==we&&!1===we(e))throw new Error("Non-extensible objects are not allowed as keys.");if(_e)Object.defineProperty(e,Se,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Se]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Se]=t}}return t}(e);if("function"==typeof e.toString)return ye(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ye(e){for(var t=0,n=0;n=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},Pe.prototype.toString=function(){return this.__toString("Map {","}")},Pe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Pe.prototype.set=function(e,t){return qe(this,e,t)},Pe.prototype.setIn=function(e,t){return this.updateIn(e,g,(function(){return t}))},Pe.prototype.remove=function(e){return qe(this,e,g)},Pe.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return g}))},Pe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Pe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=function e(t,n,r,i){var o=t===g,a=n.next();if(a.done){var s=o?r:t,c=i(s);return c===s?t:c}ue(o||t&&t.set,"invalid keyPath");var u=a.value,l=o?g:t.get(u,g),f=e(l,n,r,i);return f===l?t:f===g?t.remove(u):(o?Ue():t).set(u,f)}(this,Zt(e),t,n);return r===g?void 0:r},Pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Ue()},Pe.prototype.merge=function(){return Ze(this,void 0,arguments)},Pe.prototype.mergeWith=function(t){var n=e.call(arguments,1);return Ze(this,t,n)},Pe.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Ue(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},Pe.prototype.mergeDeep=function(){return Ze(this,Xe,arguments)},Pe.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return Ze(this,Qe(t),n)},Pe.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Ue(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},Pe.prototype.sort=function(e){return _t(zt(this,e))},Pe.prototype.sortBy=function(e,t){return _t(zt(this,t,e))},Pe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Pe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new w)},Pe.prototype.asImmutable=function(){return this.__ensureOwner()},Pe.prototype.wasAltered=function(){return this.__altered},Pe.prototype.__iterator=function(e,t){return new Fe(this,e,t)},Pe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},Pe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ve(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Pe.isMap=Ie;var Re,Ae="@@__IMMUTABLE_MAP__@@",Me=Pe.prototype;function De(e,t){this.ownerID=e,this.entries=t}function Ne(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function Le(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function ze(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Be(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Fe(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&He(e._root)}function We(e,t){return D(e,t[0],t[1])}function He(e,t){return{node:e,index:0,__prev:t}}function Ve(e,t,n,r){var i=Object.create(Me);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Ue(){return Re||(Re=Ve(0))}function qe(e,t,n){var r,i;if(e._root){var o=y(v),a=y(m);if(r=Ge(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===g?-1:1:0)}else{if(n===g)return e;i=1,r=new De(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ve(i,r):Ue()}function Ge(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===g?e:(b(s),b(a),new Be(t,r,[i,o]))}function Ke(e){return e.constructor===Be||e.constructor===ze}function $e(e,t,n,r,i){if(e.keyHash===r)return new ze(t,r,[e.entry,i]);var o,a=31&(0===n?e.keyHash:e.keyHash>>>n),s=31&(0===n?r:r>>>n);return new Ne(t,1<>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function et(e,t,n,r){var i=r?e:_(e);return i[t]=n,i}Me[Ae]=!0,Me.delete=Me.remove,Me.removeIn=Me.deleteIn,De.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o=tt)return function(e,t,n,r){e||(e=new w);for(var i=new Be(e,me(n),[n,r]),o=0;o>>e)),o=this.bitmap;return 0==(o&i)?r:this.nodes[Je(o&i-1)].get(e+5,t,n,r)},Ne.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=me(r));var s=31&(0===t?n:n>>>t),c=1<=nt)return function(e,t,n,r,i){for(var o=0,a=new Array(32),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new Le(e,o+1,a)}(e,d,u,s,h);if(l&&!h&&2===d.length&&Ke(d[1^f]))return d[1^f];if(l&&h&&1===d.length&&Ke(h))return h;var v=e&&e===this.ownerID,m=l?h?u:u^c:u|c,y=l?h?et(d,f,h,v):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,a=0;a>>e),o=this.nodes[i];return o?o.get(e+5,t,n,r):r},Le.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=me(r));var s=31&(0===t?n:n>>>t),c=i===g,u=this.nodes,l=u[s];if(c&&!l)return this;var f=Ge(l,e,t+5,n,r,i,o,a);if(f===l)return this;var d=this.count;if(l){if(!f&&--d0&&r<32?pt(0,r,5,null,new ct(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function ot(e){return!(!e||!e[at])}t(it,pe),it.of=function(){return this(arguments)},it.prototype.toString=function(){return this.__toString("List [","]")},it.prototype.get=function(e,t){if((e=O(this,e))>=0&&e=e.size||t<0)return e.withMutations((function(e){t<0?yt(e,t).set(0,n):yt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,i=e._root,o=y(m);return t>=wt(e._capacity)?r=gt(r,e.__ownerID,0,t,n,o):i=gt(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):pt(e._origin,e._capacity,e._level,i,r):e}(this,e,t)},it.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},it.prototype.insert=function(e,t){return this.splice(e,0,t)},it.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):ht()},it.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){yt(n,0,t+e.length);for(var r=0;r>>t&31;if(r>=this.array.length)return new ct([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-5,n))===a&&o)return this}if(o&&!i)return this;var s=vt(this,e);if(!o)for(var c=0;c>>t&31;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((r=o&&o.removeAfter(e,t-5,n))===o&&i===this.array.length-1)return this}var a=vt(this,e);return a.array.splice(i+1),r&&(a.array[i]=r),a};var ut,lt,ft={};function dt(e,t){var n=e._origin,r=e._capacity,i=wt(r),o=e._tail;return a(e._root,e._level,0);function a(e,s,c){return 0===s?function(e,a){var s=a===i?o&&o.array:e&&e.array,c=a>n?0:n-a,u=r-a;return u>32&&(u=32),function(){if(c===u)return ft;var e=t?--u:c++;return s&&s[e]}}(e,c):function(e,i,o){var s,c=e&&e.array,u=o>n?0:n-o>>i,l=1+(r-o>>i);return l>32&&(l=32),function(){for(;;){if(s){var e=s();if(e!==ft)return e;s=null}if(u===l)return ft;var n=t?--l:u++;s=a(c&&c[n],i-5,o+(n<>>n&31,c=e&&s0){var u=e&&e.array[s],l=gt(u,t,n-5,r,i,o);return l===u?e:((a=vt(e,t)).array[s]=l,a)}return c&&e.array[s]===i?e:(b(o),a=vt(e,t),void 0===i&&s===a.array.length-1?a.array.pop():a.array[s]=i,a)}function vt(e,t){return t&&e&&t===e.ownerID?e:new ct(e?e.array.slice():[],t)}function mt(e,t){if(t>=wt(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&31],r-=5;return n}}function yt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new w,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var c=e._level,u=e._root,l=0;a+l<0;)u=new ct(u&&u.array.length?[void 0,u]:[],r),l+=1<<(c+=5);l&&(a+=l,i+=l,s+=l,o+=l);for(var f=wt(o),d=wt(s);d>=1<f?new ct([],r):p;if(p&&d>f&&a5;v-=5){var m=f>>>v&31;g=g.array[m]=vt(g.array[m],r)}g.array[f>>>5&31]=p}if(s=d)a-=d,s-=d,c=5,u=null,h=h&&h.removeBefore(r,0,a);else if(a>i||d>>c&31;if(y!==d>>>c&31)break;y&&(l+=(1<i&&(u=u.removeBefore(r,c,a-l)),u&&do&&(o=u.size),a(c)||(u=u.map((function(e){return re(e)}))),r.push(u)}return o>e.size&&(e=e.setSize(o)),Ye(e,t,r)}function wt(e){return e<32?0:e-1>>>5<<5}function _t(e){return null==e?St():xt(e)?e:St().withMutations((function(t){var n=r(e);je(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function xt(e){return Ie(e)&&l(e)}function Ot(e,t,n,r){var i=Object.create(_t.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=n,i.__hash=r,i}function St(){return lt||(lt=Ot(Ue(),ht()))}function Et(e,t,n){var r,i,o=e._map,a=e._list,s=o.get(t),c=void 0!==s;if(n===g){if(!c)return e;a.size>=32&&a.size>=2*o.size?(r=(i=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(c){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):Ot(r,i)}function Ct(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function kt(e){this._iter=e,this.size=e.size}function Tt(e){this._iter=e,this.size=e.size}function jt(e){this._iter=e,this.size=e.size}function Pt(e){var t=Gt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Kt,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(2===t){var r=e.__iterator(t,n);return new M((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,n)},t}function It(e,t,n){var r=Gt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,g);return o===g?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate((function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)}),i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(2,i);return new M((function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return D(r,s,t.call(n,a[1],s,e),i)}))},r}function Rt(e,t){var n=Gt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Pt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Kt,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function At(e,t,n,r){var i=Gt(e);return r&&(i.has=function(r){var i=e.get(r,g);return i!==g&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,g);return o!==g&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate((function(e,o,c){if(t.call(n,e,o,c))return s++,i(e,r?o:s-1,a)}),o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(2,o),s=0;return new M((function(){for(;;){var o=a.next();if(o.done)return o;var c=o.value,u=c[0],l=c[1];if(t.call(n,l,u,e))return D(i,r?u:s++,l,o)}}))},i}function Mt(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),E(t,n,i))return e;var o=C(t,i),a=k(n,i);if(o!=o||a!=a)return Mt(e.toSeq().cacheResult(),t,n,r);var s,c=a-o;c==c&&(s=c<0?0:c);var u=Gt(e);return u.size=0===s?s:e.size&&s||void 0,!r&&X(e)&&s>=0&&(u.get=function(t,n){return(t=O(this,t))>=0&&ts)return{value:void 0,done:!0};var e=i.next();return r||1===t?e:D(t,c-1,0===t?void 0:e.value[1],e)}))},u}function Dt(e,t,n,r){var i=Gt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,c=0;return e.__iterate((function(e,o,u){if(!s||!(s=t.call(n,e,o,u)))return c++,i(e,r?o:c-1,a)})),c},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(2,o),c=!0,u=0;return new M((function(){var e,o,l;do{if((e=s.next()).done)return r||1===i?e:D(i,u++,0===i?void 0:e.value[1],e);var f=e.value;o=f[0],l=f[1],c&&(c=t.call(n,l,o,a))}while(c);return 2===i?e:D(i,o,l,e)}))},i}function Nt(e,t){var n=s(e),i=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?Y(e):J(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===i.length)return e;if(1===i.length){var o=i[0];if(o===e||n&&s(o)||c(e)&&c(o))return o}var u=new G(i);return n?u=u.toKeyedSeq():c(e)||(u=u.toSetSeq()),(u=u.flatten(!0)).size=i.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),u}function Lt(e,t,n){var r=Gt(e);return r.__iterateUncached=function(r,i){var o=0,s=!1;return function e(c,u){var l=this;c.__iterate((function(i,c){return(!t||u0}function Wt(e,t,r){var i=Gt(e);return i.size=new G(r).map((function(e){return e.size})).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(1,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map((function(e){return e=n(e),B(i?e.reverse():e)})),a=0,s=!1;return new M((function(){var n;return s||(n=o.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?{value:void 0,done:!0}:D(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},i}function Ht(e,t){return X(e)?t:e.constructor(t)}function Vt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Ut(e){return je(e.size),x(e)}function qt(e){return s(e)?r:c(e)?i:o}function Gt(e){return Object.create((s(e)?V:c(e)?U:q).prototype)}function Kt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):H.prototype.cacheResult.call(this)}function $t(e,t){return e>t?1:e=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):_n(e,t)},vn.prototype.pushAll=function(e){if(0===(e=i(e)).size)return this;je(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):_n(t,n)},vn.prototype.pop=function(){return this.slice(1)},vn.prototype.unshift=function(){return this.push.apply(this,arguments)},vn.prototype.unshiftAll=function(e){return this.pushAll(e)},vn.prototype.shift=function(){return this.pop.apply(this,arguments)},vn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):xn()},vn.prototype.slice=function(e,t){if(E(e,t,this.size))return this;var n=C(e,this.size);if(k(t,this.size)!==this.size)return pe.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):_n(r,i)},vn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?_n(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},vn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},vn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new M((function(){if(r){var t=r.value;return r=r.next,D(e,n++,t)}return{value:void 0,done:!0}}))},vn.isStack=mn;var yn,bn="@@__IMMUTABLE_STACK__@@",wn=vn.prototype;function _n(e,t,n,r){var i=Object.create(wn);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function xn(){return yn||(yn=_n(0))}function On(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}wn[bn]=!0,wn.withMutations=Me.withMutations,wn.asMutable=Me.asMutable,wn.asImmutable=Me.asImmutable,wn.wasAltered=Me.wasAltered,n.Iterator=M,On(n,{toArray:function(){je(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new kt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new Ct(this,!0)},toMap:function(){return Pe(this.toKeyedSeq())},toObject:function(){je(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return _t(this.toKeyedSeq())},toOrderedSet:function(){return ln(s(this)?this.valueSeq():this)},toSet:function(){return tn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Tt(this)},toSeq:function(){return c(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return vn(s(this)?this.valueSeq():this)},toList:function(){return it(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return Ht(this,Nt(this,t))},includes:function(e){return this.some((function(t){return ae(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){je(this.size);var n=!0;return this.__iterate((function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1})),n},filter:function(e,t){return Ht(this,At(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return je(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){je(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return Ht(this,It(this,e,t))},reduce:function(e,t,n){var r,i;return je(this.size),arguments.length<2?i=!0:r=t,this.__iterate((function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Ht(this,Rt(this,!0))},slice:function(e,t){return Ht(this,Mt(this,e,t,!0))},some:function(e,t){return!this.every(Tn(e),t)},sort:function(e){return Ht(this,zt(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return x(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Pe().asMutable();return e.__iterate((function(i,o){r.update(t.call(n,i,o,e),0,(function(e){return e+1}))})),r.asImmutable()}(this,e,t)},equals:function(e){return se(this,e)},entrySeq:function(){var e=this;if(e._cache)return new G(e._cache);var t=e.toSeq().map(kn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Tn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate((function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1})),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(S)},flatMap:function(e,t){return Ht(this,function(e,t,n){var r=qt(e);return e.toSeq().map((function(i,o){return r(t.call(n,i,o,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Ht(this,Lt(this,e,!0))},fromEntrySeq:function(){return new jt(this)},get:function(e,t){return this.find((function(t,n){return ae(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,i=Zt(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,g):g)===g)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),i=(l(e)?_t():Pe()).asMutable();e.__iterate((function(o,a){i.update(t.call(n,o,a,e),(function(e){return(e=e||[]).push(r?[a,o]:o),e}))}));var o=qt(e);return i.map((function(t){return Ht(e,o(t))}))}(this,e,t)},has:function(e){return this.get(e,g)!==g},hasIn:function(e){return this.getIn(e,g)!==g},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return ae(t,e)}))},keySeq:function(){return this.toSeq().map(Cn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Bt(this,e)},maxBy:function(e,t){return Bt(this,t,e)},min:function(e){return Bt(this,e?jn(e):Rn)},minBy:function(e,t){return Bt(this,t?jn(t):Rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Ht(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Ht(this,Dt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Tn(e),t)},sortBy:function(e,t){return Ht(this,zt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Ht(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Ht(this,function(e,t,n){var r=Gt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate((function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)})),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(2,i),s=!0;return new M((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var i=e.value,c=i[0],u=i[1];return t.call(n,u,c,o)?2===r?e:D(r,c,u,e):(s=!1,{value:void 0,done:!0})}))},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Tn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=l(e),n=s(e),r=t?1:0;return function(e,t){return t=ge(t,3432918353),t=ge(t<<15|t>>>-15,461845907),t=ge(t<<13|t>>>-13,5),t=ge((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=ve((t=ge(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+An(me(e),me(t))|0}:function(e,t){r=r+An(me(e),me(t))|0}:t?function(e){r=31*r+me(e)|0}:function(e){r=r+me(e)|0}),r)}(this))}});var Sn=n.prototype;Sn[f]=!0,Sn[A]=Sn.values,Sn.__toJS=Sn.toArray,Sn.__toStringMapper=Pn,Sn.inspect=Sn.toSource=function(){return this.toString()},Sn.chain=Sn.flatMap,Sn.contains=Sn.includes,On(r,{flip:function(){return Ht(this,Pt(this))},mapEntries:function(e,t){var n=this,r=0;return Ht(this,this.toSeq().map((function(i,o){return e.call(t,[o,i],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Ht(this,this.toSeq().flip().map((function(r,i){return e.call(t,r,i,n)})).flip())}});var En=r.prototype;function Cn(e,t){return t}function kn(e,t){return[t,e]}function Tn(e){return function(){return!e.apply(this,arguments)}}function jn(e){return function(){return-e.apply(this,arguments)}}function Pn(e){return"string"==typeof e?JSON.stringify(e):String(e)}function In(){return _(arguments)}function Rn(e,t){return et?-1:0}function An(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return En[d]=!0,En[A]=Sn.entries,En.__toJS=Sn.toObject,En.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Pn(e)},On(i,{toKeyedSeq:function(){return new Ct(this,!1)},filter:function(e,t){return Ht(this,At(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Ht(this,Rt(this,!1))},slice:function(e,t){return Ht(this,Mt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=C(e,e<0?this.count():this.size);var r=this.slice(0,e);return Ht(this,1===n?r:r.concat(_(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Ht(this,Lt(this,e,!1))},get:function(e,t){return(e=O(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=O(this,e))>=0&&(void 0!==this.size?this.size===1/0||e=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e){var t=e.classes,n=e.className,r=c(e,s),i=[n,t.shadowScrollDialog].join(" ");return o.a.createElement(a.a,Object.assign({className:i},r))}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}u.defaultProps={className:""};t.a=Object(r.a)((function(e){var t;return{shadowScrollDialog:(t={background:"linear-gradient(".concat(e.palette.background.paper," 30%, rgba(255, 255, 255, 0)), ")+"linear-gradient(rgba(255, 255, 255, 0), ".concat(e.palette.background.paper," 70%) 0 100%, ")+"radial-gradient(50% 0, farthest-side, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)), radial-gradient(50% 100%, farthest-side, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 100%,"},l(t,"background","linear-gradient(".concat(e.palette.background.paper," 30%, rgba(255, 255, 255, 0)), ")+"linear-gradient(rgba(255, 255, 255, 0), ".concat(e.palette.background.paper," 70%) 0 100%, ")+"radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 100%;"),l(t,"backgroundAttachment","local, local, scroll, scroll"),l(t,"backgroundRepeat","no-repeat"),l(t,"backgroundSize","100% 40px, 100% 40px, 100% 14px, 100% 14px"),l(t,"overflowY","auto"),t)}}))(u)},function(e,t,n){var r=n(203);e.exports=function(e){return(null==e?0:e.length)?r(e,1/0):[]}},function(e,t){e.exports=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t1&&void 0!==arguments[1]?arguments[1]:0,n=(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase();if(!Object(r.a)(n))throw TypeError("Stringified UUID is invalid");return n}},function(e,t,n){"use strict";n.r(t),n.d(t,"getCompanionWindows",(function(){return p})),n.d(t,"getCompanionWindow",(function(){return h})),n.d(t,"getThumbnailNavigationPosition",(function(){return g})),n.d(t,"getCompanionWindowsForPosition",(function(){return w})),n.d(t,"getCompanionWindowsForContent",(function(){return _})),n.d(t,"getCompanionWindowIdsForPosition",(function(){return O})),n.d(t,"getCompanionAreaVisibility",(function(){return S})),n.d(t,"selectCompanionWindowDimensions",(function(){return E}));var r=n(10),i=n(462),o=n.n(i),a=n(46),s=n(38);function c(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.some(t=>t instanceof RegExp?t.test(e):t===e),o=(e,t)=>{if(t={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...t},Reflect.has(t,"normalizeHttps"))throw new Error("options.normalizeHttps is renamed to options.forceHttp");if(Reflect.has(t,"normalizeHttp"))throw new Error("options.normalizeHttp is renamed to options.forceHttps");if(Reflect.has(t,"stripFragment"))throw new Error("options.stripFragment is renamed to options.stripHash");if(e=e.trim(),/^data:/i.test(e))return((e,{stripHash:t})=>{const n=e.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/);if(!n)throw new Error("Invalid URL: "+e);const r=n[1].split(";"),i=n[2],o=t?"":n[3];let a=!1;"base64"===r[r.length-1]&&(r.pop(),a=!0);const s=(r.shift()||"").toLowerCase(),c=[...r.map(e=>{let[t,n=""]=e.split("=").map(e=>e.trim());return"charset"===t&&(n=n.toLowerCase(),"us-ascii"===n)?"":`${t}${n?"="+n:""}`}).filter(Boolean)];return a&&c.push("base64"),(0!==c.length||s&&"text/plain"!==s)&&c.unshift(s),`data:${c.join(";")},${a?i.trim():i}${o?"#"+o:""}`})(e,t);const n=e.startsWith("//");!n&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));const o=new r(e);if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&"https:"===o.protocol&&(o.protocol="http:"),t.forceHttps&&"http:"===o.protocol&&(o.protocol="https:"),t.stripAuthentication&&(o.username="",o.password=""),t.stripHash&&(o.hash=""),o.pathname&&(o.pathname=o.pathname.replace(/((?!:).|^)\/{2,}/g,(e,t)=>/^(?!\/)/g.test(t)?t+"/":"/")),o.pathname&&(o.pathname=decodeURI(o.pathname)),!0===t.removeDirectoryIndex&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=o.pathname.split("/");const n=e[e.length-1];i(n,t.removeDirectoryIndex)&&(e=e.slice(0,e.length-1),o.pathname=e.slice(1).join("/")+"/")}if(o.hostname&&(o.hostname=o.hostname.replace(/\.$/,""),t.stripWWW&&/^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,""))),Array.isArray(t.removeQueryParameters))for(const e of[...o.searchParams.keys()])i(e,t.removeQueryParameters)&&o.searchParams.delete(e);return t.sortQueryParameters&&o.searchParams.sort(),t.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,"")),e=o.toString(),!t.removeTrailingSlash&&"/"!==o.pathname||""!==o.hash||(e=e.replace(/\/$/,"")),n&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e};e.exports=o,e.exports.default=o},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(70),i=n(53);function o(e,t){if(t&&("object"===Object(r.a)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Object(i.a)(e)}},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return r}))},function(e,t){function n(e,t,n,r){var i,o=null==(i=r)||"number"==typeof i||"boolean"==typeof i?r:n(r),a=t.get(o);return void 0===a&&(a=e.call(this,r),t.set(o,a)),a}function r(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return void 0===o&&(o=e.apply(this,r),t.set(i,o)),o}function i(e,t,n,r,i){return n.bind(t,e,r,i)}function o(e,t){return i(e,this,1===e.length?n:r,t.cache.create(),t.serializer)}function a(){return JSON.stringify(arguments)}function s(){this.cache=Object.create(null)}s.prototype.has=function(e){return e in this.cache},s.prototype.get=function(e){return this.cache[e]},s.prototype.set=function(e,t){this.cache[e]=t};var c={create:function(){return new s}};e.exports=function(e,t){var n=t&&t.cache?t.cache:c,r=t&&t.serializer?t.serializer:a;return(t&&t.strategy?t.strategy:o)(e,{cache:n,serializer:r})},e.exports.strategies={variadic:function(e,t){return i(e,this,r,t.cache.create(),t.serializer)},monadic:function(e,t){return i(e,this,n,t.cache.create(),t.serializer)}}},,,,,,function(e,t,n){var r=n(770),i=n(775);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(537),i=n(399),o=n(166);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){var r=n(179),i=n(397);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){var r=n(786),i=n(820),o=n(202),a=n(56),s=n(827);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},function(e,t,n){var r=n(201);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){"use strict";n.r(t);var r=n(573);n.d(t,"default",(function(){return r.a}))},function(e,t,n){"use strict";var r=n(81);n.d(t,"a",(function(){return r.a}))},function(e,t,n){"use strict";var r=n(98),i=n(236),o=n(40),a=o.List,s=o.Map,c=o.OrderedSet,u=o.Record,l=o.Repeat,f=c(),d=u({key:"",type:"unstyled",text:"",characterList:a(),depth:0,data:s()}),p=function(e){var t,n;function o(t){return e.call(this,function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=a(l(r.EMPTY,n.length))),e}(t))||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var s=o.prototype;return s.getKey=function(){return this.get("key")},s.getType=function(){return this.get("type")},s.getText=function(){return this.get("text")},s.getCharacterList=function(){return this.get("characterList")},s.getLength=function(){return this.getText().length},s.getDepth=function(){return this.get("depth")},s.getData=function(){return this.get("data")},s.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():f},s.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},s.findStyleRanges=function(e,t){i(this.getCharacterList(),h,e,t)},s.findEntityRanges=function(e,t){i(this.getCharacterList(),g,e,t)},o}(d);function h(e,t){return e.getStyle()===t.getStyle()}function g(e,t){return e.getEntity()===t.getEntity()}e.exports=p},function(e,t,n){"use strict";function r(e){return e.replace(/\//g,"-")}e.exports=function(e){return"object"==typeof e?Object.keys(e).filter((function(t){return e[t]})).map(r).join(" "):Array.prototype.map.call(arguments,r).join(" ")}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.ownerDocument)&&e.nodeType===Node.ELEMENT_NODE}},function(e,t,n){"use strict";var r=n(42),i=/[\uD800-\uDFFF]/;function o(e){return 55296<=e&&e<=57343}function a(e){return i.test(e)}function s(e,t){return 1+o(e.charCodeAt(t))}function c(e,t,n){if(t=t||0,n=void 0===n?1/0:n||0,!a(e))return e.substr(t,n);var r=e.length;if(r<=0||t>r||n<=0)return"";var i=0;if(t>0){for(;t>0&&i=r)return""}else if(t<0){for(i=r;t<0&&00&&o-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',Q.join(", "),t),Object(s.a)("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),Y.forEach((function(t){Object(s.a)("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),function(t,n){return new J(e,t,n)}}function te(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e;"function"!=typeof e&&(Object(s.a)(Z(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',e),i=function(){return e}),Object(s.a)(P(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',t);var o=ee(t);return Object(s.a)("function"==typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',n),Object(s.a)(P(r),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',n),function(e){return K({containerDisplayName:"DragSource",createHandler:o,registerHandler:l.a,createConnector:function(e){return new w(e)},createMonitor:function(e){return new g(e)},DecoratedComponent:e,getType:i,collect:n,options:r})}}var ne=n(361),re=n(360);function ie(e,t){for(var n=0;n-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',oe.join(", "),t),Object(s.a)("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target",t,t,e[t])})),function(t,n){return new ae(e,t,n)}}function ce(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e;"function"!=typeof e&&(Object(s.a)(Z(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',e),i=function(){return e}),Object(s.a)(P(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',t);var o=se(t);return Object(s.a)("function"==typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',n),Object(s.a)(P(r),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',n),function(e){return K({containerDisplayName:"DropTarget",createHandler:o,registerHandler:l.b,createMonitor:function(e){return new re.a(e)},createConnector:function(e){return new ne.a(e)},DecoratedComponent:e,getType:i,collect:n,options:r})}}function ue(e){return(ue="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 le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return Object(s.a)("function"==typeof e,'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',"Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer",e),Object(s.a)(P(t),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer',t),function(n){var i=n,a=t.arePropsEqual,c=void 0===a?y.a:a,u=i.displayName||i.name||"Component",l=function(t){function n(){var e;return le(this,n),(e=pe(this,he(n).apply(this,arguments))).isCurrentlyMounted=!1,e.ref=o.createRef(),e.handleChange=function(){if(e.isCurrentlyMounted){var t=e.getCurrentState();Object(y.a)(t,e.state)||e.setState(t)}},e}return ge(n,t),de(n,[{key:"getDecoratedComponentInstance",value:function(){return Object(s.a)(this.ref.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.ref.current}},{key:"shouldComponentUpdate",value:function(e,t){return!c(e,this.props)||!Object(y.a)(t,this.state)}},{key:"componentDidMount",value:function(){this.isCurrentlyMounted=!0,this.handleChange()}},{key:"componentWillUnmount",value:function(){this.isCurrentlyMounted=!1,this.unsubscribeFromOffsetChange&&(this.unsubscribeFromOffsetChange(),this.unsubscribeFromOffsetChange=void 0),this.unsubscribeFromStateChange&&(this.unsubscribeFromStateChange(),this.unsubscribeFromStateChange=void 0)}},{key:"render",value:function(){var e=this;return o.createElement(r.a.Consumer,null,(function(t){var n=t.dragDropManager;return void 0===n?null:(e.receiveDragDropManager(n),e.isCurrentlyMounted?o.createElement(i,Object.assign({},e.props,e.state,{ref:R(i)?e.ref:null})):null)}))}},{key:"receiveDragDropManager",value:function(e){if(void 0===this.manager){this.manager=e,Object(s.a)("object"===ue(e),"Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",u,u);var t=this.manager.getMonitor();this.unsubscribeFromOffsetChange=t.subscribeToOffsetChange(this.handleChange),this.unsubscribeFromStateChange=t.subscribeToStateChange(this.handleChange)}}},{key:"getCurrentState",value:function(){if(!this.manager)return{};var t=this.manager.getMonitor();return e(t,this.props)}}]),n}(o.Component);return l.displayName="DragLayer(".concat(u,")"),l.DecoratedComponent=n,M()(l,n)}}},function(e,t,n){var r=n(591);e.exports=function(e,t){if(null==e)return{};var n,i,o=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"a",(function(){return D}));var r=n(27),i=n(4),o=n(331),a=n(111),s=n(1);function c(e,t,n){var i;return Object(s.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.","You can use the source of the mixin directly:","\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")),Object(s.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(s.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var u=n(247),l=n(183),f=n(210),d=n(211),p=n(212),h=n(213),g=n(214),v=n(215),m=n(216),y=n(24),b={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:l.a.white,default:f.a[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:l.a.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:f.a[800],default:"#303030"},action:{active:l.a.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function _(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(y.j)(e.main,i):"dark"===t&&(e.dark=Object(y.b)(e.main,o)))}function x(e){var t=e.primary,n=void 0===t?{light:d.a[300],main:d.a[500],dark:d.a[700]}:t,r=e.secondary,a=void 0===r?{light:p.a.A200,main:p.a.A400,dark:p.a.A700}:r,c=e.error,x=void 0===c?{light:h.a[300],main:h.a[500],dark:h.a[700]}:c,O=e.warning,S=void 0===O?{light:g.a[300],main:g.a[500],dark:g.a[700]}:O,E=e.info,C=void 0===E?{light:v.a[300],main:v.a[500],dark:v.a[700]}:E,k=e.success,T=void 0===k?{light:m.a[300],main:m.a[500],dark:m.a[700]}:k,j=e.type,P=void 0===j?"light":j,I=e.contrastThreshold,R=void 0===I?3:I,A=e.tonalOffset,M=void 0===A?.2:A,D=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function N(e){return Object(y.f)(e,w.text.primary)>=R?w.text.primary:b.text.primary}var L=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(s.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(u.a)(4,t));if("string"!=typeof e.main)throw new Error(Object(u.a)(5,JSON.stringify(e.main)));return _(e,"light",n,M),_(e,"dark",r,M),e.contrastText||(e.contrastText=N(e.main)),e},z={dark:w,light:b};return Object(o.a)(Object(s.a)({common:l.a,type:P,primary:L(n),secondary:L(a,"A400","A200","A700"),error:L(x),warning:L(S),info:L(C),success:L(T),grey:f.a,contrastThreshold:R,getContrastText:N,augmentColor:L,tonalOffset:M},z[P]),D)}function O(e){return Math.round(1e5*e)/1e5}function S(e){return O(e)}var E={textTransform:"uppercase"};function C(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,a=void 0===r?'"Roboto", "Helvetica", "Arial", sans-serif':r,c=n.fontSize,u=void 0===c?14:c,l=n.fontWeightLight,f=void 0===l?300:l,d=n.fontWeightRegular,p=void 0===d?400:d,h=n.fontWeightMedium,g=void 0===h?500:h,v=n.fontWeightBold,m=void 0===v?700:v,y=n.htmlFontSize,b=void 0===y?16:y,w=n.allVariants,_=n.pxToRem,x=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var C=u/14,k=_||function(e){return"".concat(e/b*C,"rem")},T=function(e,t,n,r,i){return Object(s.a)({fontFamily:a,fontWeight:e,fontSize:k(t),lineHeight:n},'"Roboto", "Helvetica", "Arial", sans-serif'===a?{letterSpacing:"".concat(O(r/t),"em")}:{},i,w)},j={h1:T(f,96,1.167,-1.5),h2:T(f,60,1.2,-.5),h3:T(p,48,1.167,0),h4:T(p,34,1.235,.25),h5:T(p,24,1.334,0),h6:T(g,20,1.6,.15),subtitle1:T(p,16,1.75,.15),subtitle2:T(g,14,1.57,.1),body1:T(p,16,1.5,.15),body2:T(p,14,1.43,.15),button:T(g,14,1.75,.4,E),caption:T(p,12,1.66,.4),overline:T(p,12,2.66,1,E)};return Object(o.a)(Object(s.a)({htmlFontSize:b,pxToRem:k,round:S,fontFamily:a,fontSize:u,fontWeightLight:f,fontWeightRegular:p,fontWeightMedium:g,fontWeightBold:m},j),x,{clone:!1})}function k(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var T=["none",k(0,2,1,-1,0,1,1,0,0,1,3,0),k(0,3,1,-2,0,2,2,0,0,1,5,0),k(0,3,3,-2,0,3,4,0,0,1,8,0),k(0,2,4,-1,0,4,5,0,0,1,10,0),k(0,3,5,-1,0,5,8,0,0,1,14,0),k(0,3,5,-1,0,6,10,0,0,1,18,0),k(0,4,5,-2,0,7,10,1,0,2,16,1),k(0,5,5,-3,0,8,10,1,0,3,14,2),k(0,5,6,-3,0,9,12,1,0,3,16,2),k(0,6,6,-3,0,10,14,1,0,4,18,3),k(0,6,7,-4,0,11,15,1,0,4,20,3),k(0,7,8,-4,0,12,17,2,0,5,22,4),k(0,7,8,-4,0,13,19,2,0,5,24,4),k(0,7,9,-4,0,14,21,2,0,5,26,4),k(0,8,9,-5,0,15,22,2,0,6,28,5),k(0,8,10,-5,0,16,24,2,0,6,30,5),k(0,8,11,-5,0,17,26,2,0,6,32,5),k(0,9,11,-5,0,18,28,2,0,7,34,6),k(0,9,12,-6,0,19,29,2,0,7,36,6),k(0,10,13,-6,0,20,31,3,0,8,38,7),k(0,10,13,-6,0,21,33,3,0,8,40,7),k(0,10,14,-6,0,22,35,3,0,8,42,7),k(0,11,14,-7,0,23,36,3,0,9,44,8),k(0,11,15,-7,0,24,38,3,0,9,46,8)],j={borderRadius:4},P=n(318);function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=Object(P.a)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,s=void 0===r?{}:r,u=e.palette,l=void 0===u?{}:u,f=e.spacing,d=e.typography,p=void 0===d?{}:d,h=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),g=x(l),v=Object(a.a)(n),m=I(f),y=Object(o.a)({breakpoints:v,direction:"ltr",mixins:c(v,m,s),overrides:{},palette:g,props:{},shadows:T,typography:C(g,p),spacing:m,shape:j,transitions:R.a,zIndex:A.a},h),b=arguments.length,w=new Array(b>1?b-1:0),_=1;_=t||n<0||v&&e-h>=l}function _(){var e=i();if(w(e))return x(e);d=setTimeout(_,function(e){var n=t-(e-p);return v?s(n,l-(e-h)):n}(e))}function x(e){return d=void 0,m&&c?y(e):(c=u=void 0,f)}function O(){var e=i(),n=w(e);if(c=arguments,u=this,p=e,n){if(void 0===d)return b(p);if(v)return clearTimeout(d),d=setTimeout(_,t),y(p)}return void 0===d&&(d=setTimeout(_,t)),f}return t=o(t)||0,r(n)&&(g=!!n.leading,l=(v="maxWait"in n)?a(o(n.maxWait)||0,t):l,m="trailing"in n?!!n.trailing:m),O.cancel=function(){void 0!==d&&clearTimeout(d),h=0,c=p=u=d=void 0},O.flush=function(){return void 0===d?f:x(i())},O}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createExpandUpdate=t.createHideUpdate=t.createDragToUpdates=t.createRemoveUpdate=t.updateTree=t.buildSpecFromUpdate=void 0;var i=r(n(1087)),o=r(n(1088)),a=r(n(324)),s=r(n(119)),c=r(n(649)),u=r(n(652)),l=r(n(1089)),f=n(449),d=n(109);function p(e){return e.path.length>0?u.default({},e.path,e.spec):e.spec}function h(e,t){var n=e;return t.forEach((function(e){n=i.default(n,p(e))})),n}function g(e,t){var n=a.default(t),r=c.default(t),i=n.concat(d.getOtherBranch(r));return{path:n,spec:{$set:d.getAndAssertNodeAtPathExists(e,i)}}}function v(e,t,n){return s.default(l.default(e,n),l.default(t,n))}t.buildSpecFromUpdate=p,t.updateTree=h,t.createRemoveUpdate=g,t.createDragToUpdates=function(e,t,n,r){var i=d.getAndAssertNodeAtPathExists(e,n),a=[];v(t,n,n.length)?i=h(i,[g(i,o.default(t,n.length))]):(a.push(g(e,t)),v(t,n,t.length-1)&&n.splice(t.length-1,1));var s,c,u=d.getAndAssertNodeAtPathExists(e,t);r===f.MosaicDropTargetPosition.LEFT||r===f.MosaicDropTargetPosition.TOP?(s=u,c=i):(s=i,c=u);var l="column";return r!==f.MosaicDropTargetPosition.LEFT&&r!==f.MosaicDropTargetPosition.RIGHT||(l="row"),a.push({path:n,spec:{$set:{first:s,second:c,direction:l}}}),a},t.createHideUpdate=function(e){return{path:a.default(e),spec:{splitPercentage:{$set:"first"===c.default(e)?0:100}}}},t.createExpandUpdate=function(e,t){for(var n,r={},i=e.length-1;i>=0;i--){var o=e[i];(n={splitPercentage:{$set:"first"===o?t:100-t}})[o]=r,r=n}return{spec:r,path:[]}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return Ne})),n.d(t,"b",(function(){return Le}));var r=n(0),i=n(7),o="dnd-core/INIT_COORDS",a="dnd-core/BEGIN_DRAG",s="dnd-core/PUBLISH_DRAG_SOURCE",c="dnd-core/HOVER",u="dnd-core/DROP",l="dnd-core/END_DRAG",f=function(e,t){return e===t};function d(e,t){return!e&&!t||!(!e||!t)&&(e.x===t.x&&e.y===t.y)}function p(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f;if(e.length!==t.length)return!1;for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:m,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case o:case a:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case c:return d(e.clientOffset,n.clientOffset)?e:g({},e,{clientOffset:n.clientOffset});case l:case u:return m;default:return e}}var b="dnd-core/ADD_SOURCE",w="dnd-core/ADD_TARGET",_="dnd-core/REMOVE_SOURCE",x="dnd-core/REMOVE_TARGET";function O(e){return(O="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,n){return t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:n||null}),e)}function E(e,t){return e.filter((function(e){return e!==t}))}function C(e){return"object"===O(e)}function k(e,t){var n=new Map,r=function(e){return n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);var i=[];return n.forEach((function(e,t){1===e&&i.push(t)})),i}function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:I,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case a:return j({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case s:return j({},e,{isSourcePublic:!0});case c:return j({},e,{targetIds:n.targetIds});case x:return-1===e.targetIds.indexOf(n.targetId)?e:j({},e,{targetIds:E(e.targetIds,n.targetId)});case u:return j({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case l:return j({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case b:case w:return e+1;case _:case x:return e-1;default:return e}}var M=[],D=[];function N(e,t){return e!==M&&(e===D||void 0===t||(n=e,t.filter((function(e){return n.indexOf(e)>-1}))).length>0);var n}function L(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case c:break;case b:case w:case x:case _:return M;case a:case s:case l:case u:default:return D}var t=e.payload,n=t.targetIds,r=void 0===n?[]:n,i=t.prevTargetIds,o=void 0===i?[]:i,f=k(r,o),d=f.length>0||!p(r,o);if(!d)return M;var h=o[o.length-1],g=r[r.length-1];return h!==g&&(h&&f.push(h),g&&f.push(g)),f}function z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e+1}function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function F(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:L(e.dirtyHandlerIds,{type:t.type,payload:F({},t.payload,{prevTargetIds:S(e,"dragOperation.targetIds",[])})}),dragOffset:y(e.dragOffset,t),refCount:A(e.refCount,t),dragOperation:R(e.dragOperation,t),stateId:z(e.stateId)}}M.__IS_NONE__=!0,D.__IS_ALL__=!0;var V=n(17);function U(e,t){return{type:o,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var q={type:o,payload:{clientOffset:null,sourceClientOffset:null}};function G(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},r=n.publishSource,i=void 0===r||r,o=n.clientOffset,s=n.getSourceClientOffset,c=e.getMonitor(),u=e.getRegistry();e.dispatch(U(o)),K(t,c,u);var l=X(t,c);if(null!==l){var f=null;o&&($(s),f=s(l)),e.dispatch(U(o,f));var d=u.getSource(l),p=d.beginDrag(c,l);Z(p),u.pinSource(l);var h=u.getSourceType(l);return{type:a,payload:{itemType:h,item:p,sourceId:l,clientOffset:o||null,sourceClientOffset:f||null,isSourcePublic:!!i}}}e.dispatch(q)}}function K(e,t,n){Object(V.a)(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){Object(V.a)(n.getSource(e),"Expected sourceIds to be registered.")}))}function $(e){Object(V.a)("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}function Z(e){Object(V.a)(C(e),"Item must be an object.")}function X(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function Q(e){return function(){if(e.getMonitor().isDragging())return{type:s}}}function Y(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function J(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.clientOffset;ee(t);var i=t.slice(0),o=e.getMonitor(),a=e.getRegistry();te(i,o,a);var s=o.getItemType();return ne(i,a,s),re(i,o,a),{type:c,payload:{targetIds:i,clientOffset:r||null}}}}function ee(e){Object(V.a)(Array.isArray(e),"Expected targetIds to be an array.")}function te(e,t,n){Object(V.a)(t.isDragging(),"Cannot call hover while not dragging."),Object(V.a)(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r=0;r--){var i=e[r];Y(t.getTargetType(i),n)||e.splice(r,1)}}function re(e,t,n){e.forEach((function(e){n.getTarget(e).hover(t,e)}))}function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=e.getMonitor(),r=e.getRegistry();ce(n);var i=le(n);i.forEach((function(i,o){var a=ue(i,o,r,n),s={type:u,payload:{dropResult:oe({},t,{},a)}};e.dispatch(s)}))}}function ce(e){Object(V.a)(e.isDragging(),"Cannot call drop while not dragging."),Object(V.a)(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ue(e,t,n,r){var i=n.getTarget(e),o=i?i.drop(r,e):void 0;return function(e){Object(V.a)(void 0===e||C(e),"Drop result must either be an object or undefined.")}(o),void 0===o&&(o=0===t?{}:r.getDropResult()),o}function le(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function fe(e){return function(){var t=e.getMonitor(),n=e.getRegistry();!function(e){Object(V.a)(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var r=t.getSourceId();return n.getSource(r,!0).endDrag(t,r),n.unpinSource(),{type:l}}}function de(e,t){return{x:e.x-t.x,y:e.y-t.y}}function pe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0},r=n.handlerIds;Object(V.a)("function"==typeof e,"listener must be a function."),Object(V.a)(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var i=this.store.getState().stateId,o=function(){var n=t.store.getState(),o=n.stateId;try{o===i||o===i+1&&!N(n.dirtyHandlerIds,r)||e()}finally{i=o}};return this.store.subscribe(o)}},{key:"subscribeToOffsetChange",value:function(e){var t=this;Object(V.a)("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe((function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return Object(V.a)(t,"Expected to find a valid source."),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return Object(V.a)(t,"Expected to find a valid target."),!(!this.isDragging()||this.didDrop())&&Y(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return Object(V.a)(t,"Expected to find a valid source."),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1};if(!e)return!1;var n=t.shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!Y(r,i))return!1;var o=this.getTargetIds();if(!o.length)return!1;var a=o.indexOf(e);return n?a===o.length-1:a>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return e=this.store.getState().dragOffset,r=e.clientOffset,i=e.initialClientOffset,o=e.initialSourceClientOffset,r&&i&&o?de((n=o,{x:(t=r).x+n.x,y:t.y+n.y}),i):null;var e,t,n,r,i,o}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,t=e.clientOffset,n=e.initialClientOffset,t&&n?de(t,n):null;var e,t,n}}])&&pe(t.prototype,n),r&&pe(t,r),e}(),ve=0;function me(e){return(me="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 ye(e,t){t&&Array.isArray(e)?e.forEach((function(e){return ye(e,!1)})):Object(V.a)("string"==typeof e||"symbol"===me(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(he||(he={}));var be=n(467),we=[],_e=[],xe=be.a.makeRequestCallFromTimer((function(){if(_e.length)throw _e.shift()}));function Oe(e){var t;(t=we.length?we.pop():new Se).task=e,Object(be.a)(t)}var Se=function(){function e(){}return e.prototype.call=function(){try{this.task.call()}catch(e){Oe.onerror?Oe.onerror(e):(_e.push(e),xe())}finally{this.task=null,we[we.length]=this}},e}();function Ee(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];Object(V.a)(this.isSourceId(e),"Expected a valid source ID.");var n=t&&e===this.pinnedSourceId,r=n?this.pinnedSource:this.dragSources.get(e);return r}},{key:"getTarget",value:function(e){return Object(V.a)(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return Object(V.a)(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return Object(V.a)(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Te(e)===he.SOURCE}},{key:"isTargetId",value:function(e){return Te(e)===he.TARGET}},{key:"removeSource",value:function(e){var t=this;Object(V.a)(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:_,payload:{sourceId:e}}}(e)),Oe((function(){t.dragSources.delete(e),t.types.delete(e)}))}},{key:"removeTarget",value:function(e){Object(V.a)(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:x,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);Object(V.a)(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){Object(V.a)(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,n){var r=ke(e);return this.types.set(r,t),e===he.SOURCE?this.dragSources.set(r,n):e===he.TARGET&&this.dropTargets.set(r,n),r}}])&&Ee(t.prototype,n),r&&Ee(t,r),e}();function Ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Re(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];Ie(this,e),this.isSetUp=!1,this.handleRefCountChange=function(){var e=t.store.getState().refCount>0;t.backend&&(e&&!t.isSetUp?(t.backend.setup(),t.isSetUp=!0):!e&&t.isSetUp&&(t.backend.teardown(),t.isSetUp=!1))};var r=Ae(n);this.store=r,this.monitor=new ge(r,new Pe(r)),r.subscribe(this.handleRefCountChange)}var t,n,r;return t=e,(n=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,n=function(e){return{beginDrag:G(e),publishDragSource:Q(e),hover:J(e),drop:se(e),endDrag:fe(e)}}(this);return Object.keys(n).reduce((function(r,i){var o,a=n[i];return r[i]=(o=a,function(){for(var n=arguments.length,r=new Array(n),i=0;i1&&void 0!==arguments[1]&&arguments[1];return e&&(r(e.value)&&""!==e.value||t&&r(e.defaultValue)&&""!==e.defaultValue)}function o(e){return e.startAdornment}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";(function(e){var r=n(54),i=n(677),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.a.Buffer:void 0,c=(s?s.isBuffer:void 0)||i.a;t.a=c}).call(this,n(426)(e))},function(e,t,n){"use strict";var r="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},i="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType;t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(330);function i(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h})),n.d(t,"c",(function(){return g})),n.d(t,"b",(function(){return v})),n.d(t,"d",(function(){return m})),n.d(t,"e",(function(){return y}));var r=n(681),i=n.n(r),o=n(682),a=n.n(o),s=n(134),c=n.n(s),u=n(0);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};p=f(f({},p),e)}(e.options.react),function(e){d=e}(e)}}},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,$,fullScreenApi;//! openseadragon 2.4.2 //! Built on 2020-03-05 //! Git commit: v2.4.2-0-c450749 //! http://openseadragon.github.io //! License: http://openseadragon.github.io/license/ function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}!function(e){e.version={versionStr:"2.4.2",major:parseInt("2",10),minor:parseInt("4",10),revision:parseInt("2",10)};var t,n={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},r=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.isFunction=function(t){return"function"===e.type(t)},e.isArray=Array.isArray||function(t){return"array"===e.type(t)},e.isWindow=function(e){return e&&"object"==typeof e&&"setInterval"in e},e.type=function(e){return null==e?String(e):n[r.call(e)]||"object"},e.isPlainObject=function(t){if(!t||"object"!==OpenSeadragon.type(t)||t.nodeType||e.isWindow(t))return!1;if(t.constructor&&!i.call(t,"constructor")&&!i.call(t.constructor.prototype,"isPrototypeOf"))return!1;var n;for(var r in t)n=r;return void 0===n||i.call(t,n)},e.isEmptyObject=function(e){for(var t in e)return!1;return!0},e.freezeObject=function(t){return Object.freeze?e.freezeObject=Object.freeze:e.freezeObject=function(e){return e},e.freezeObject(t)},e.supportsCanvas=(t=document.createElement("canvas"),!(!e.isFunction(t.getContext)||!t.getContext("2d"))),e.isCanvasTainted=function(e){var t=!1;try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){t=!0}return t},e.pixelDensityRatio=function(){if(e.supportsCanvas){var t=document.createElement("canvas").getContext("2d"),n=window.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return Math.max(n,1)/r}return 1}()}(OpenSeadragon),function($){$.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=arguments.length,c=!1,u=1;for("boolean"==typeof a&&(c=a,a=arguments[1]||{},u=2),"object"==typeof a||OpenSeadragon.isFunction(a)||(a={}),s===u&&(a=this,--u);u=n.x&&t.x=n.y},getEvent:function(e){return $.getEvent=e?function(e){return e}:function(){return window.event},$.getEvent(e)},getMousePosition:function(e){if("number"==typeof e.pageX)$.getMousePosition=function(e){var t=new $.Point;return e=$.getEvent(e),t.x=e.pageX,t.y=e.pageY,t};else{if("number"!=typeof e.clientX)throw new Error("Unknown event mouse position, no known technique.");$.getMousePosition=function(e){var t=new $.Point;return e=$.getEvent(e),t.x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,t.y=e.clientY+document.body.scrollTop+document.documentElement.scrollTop,t}}return $.getMousePosition(e)},getPageScroll:function(){var e=document.documentElement||{},t=document.body||{};if("number"==typeof window.pageXOffset)$.getPageScroll=function(){return new $.Point(window.pageXOffset,window.pageYOffset)};else if(t.scrollLeft||t.scrollTop)$.getPageScroll=function(){return new $.Point(document.body.scrollLeft,document.body.scrollTop)};else{if(!e.scrollLeft&&!e.scrollTop)return new $.Point(0,0);$.getPageScroll=function(){return new $.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)}}return $.getPageScroll()},setPageScroll:function(e){if(void 0!==window.scrollTo)$.setPageScroll=function(e){window.scrollTo(e.x,e.y)};else{var t=$.getPageScroll();if(t.x===e.x&&t.y===e.y)return;document.body.scrollLeft=e.x,document.body.scrollTop=e.y;var n=$.getPageScroll();if(n.x!==t.x&&n.y!==t.y)return void($.setPageScroll=function(e){document.body.scrollLeft=e.x,document.body.scrollTop=e.y});if(document.documentElement.scrollLeft=e.x,document.documentElement.scrollTop=e.y,(n=$.getPageScroll()).x!==t.x&&n.y!==t.y)return void($.setPageScroll=function(e){document.documentElement.scrollLeft=e.x,document.documentElement.scrollTop=e.y});$.setPageScroll=function(e){}}return $.setPageScroll(e)},getWindowSize:function(){var e=document.documentElement||{},t=document.body||{};if("number"==typeof window.innerWidth)$.getWindowSize=function(){return new $.Point(window.innerWidth,window.innerHeight)};else if(e.clientWidth||e.clientHeight)$.getWindowSize=function(){return new $.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else{if(!t.clientWidth&&!t.clientHeight)throw new Error("Unknown window size, no known technique.");$.getWindowSize=function(){return new $.Point(document.body.clientWidth,document.body.clientHeight)}}return $.getWindowSize()},makeCenteredNode:function(e){e=$.getElement(e);var t=[$.makeNeutralElement("div"),$.makeNeutralElement("div"),$.makeNeutralElement("div")];return $.extend(t[0].style,{display:"table",height:"100%",width:"100%"}),$.extend(t[1].style,{display:"table-row"}),$.extend(t[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),t[0].appendChild(t[1]),t[1].appendChild(t[2]),t[2].appendChild(e),t[0]},makeNeutralElement:function(e){var t=document.createElement(e),n=t.style;return n.background="transparent none",n.border="none",n.margin="0px",n.padding="0px",n.position="static",t},now:function(){return Date.now?$.now=Date.now:$.now=function(){return(new Date).getTime()},$.now()},makeTransparentImage:function(e){return $.makeTransparentImage=function(e){var t=$.makeNeutralElement("img");return t.src=e,t},$.Browser.vendor==$.BROWSERS.IE&&$.Browser.version<7&&($.makeTransparentImage=function(e){var t=$.makeNeutralElement("img"),n=null;return(n=$.makeNeutralElement("span")).style.display="inline-block",t.onload=function(){n.style.width=n.style.width||t.width+"px",n.style.height=n.style.height||t.height+"px",t.onload=null,t=null},t.src=e,n.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e+"', sizingMethod='scale')",n}),$.makeTransparentImage(e)},setElementOpacity:function(e,t,n){var r;e=$.getElement(e),n&&!$.Browser.alpha&&(t=Math.round(t)),$.Browser.opacity?e.style.opacity=t<1?t:"":t<1?(r="alpha(opacity="+Math.round(100*t)+")",e.style.filter=r):e.style.filter=""},setElementTouchActionNone:function(e){void 0!==(e=$.getElement(e)).style.touchAction?e.style.touchAction="none":void 0!==e.style.msTouchAction&&(e.style.msTouchAction="none")},addClass:function(e,t){(e=$.getElement(e)).className?-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=" "+t):e.className=t},indexOf:function(e,t,n){return Array.prototype.indexOf?this.indexOf=function(e,t,n){return e.indexOf(t,n)}:this.indexOf=function(e,t,n){var r,i,o=n||0;if(!e)throw new TypeError;if(0===(i=e.length)||o>=i)return-1;for(o<0&&(o=i-Math.abs(o)),r=o;r=200&&s.status<300||0===s.status&&"http:"!==a&&"https:"!==a?t(s):($.console.log("AJAX request returned %d: %s",s.status,e),$.isFunction(n)&&n(s)))};try{if(s.open("GET",e,!0),o&&(s.responseType=o),i)for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&i[c]&&s.setRequestHeader(c,i[c]);r&&(s.withCredentials=!0),s.send(null)}catch(r){var u=r.message;if($.Browser.vendor==$.BROWSERS.IE&&$.Browser.version<10&&void 0!==r.number&&-2147024891==r.number&&(u+="\nSee http://msdn.microsoft.com/en-us/library/ms537505(v=vs.85).aspx#xdomain"),$.console.log("%s while making AJAX request: %s",r.name,u),s.onreadystatechange=function(){},window.XDomainRequest){var l=new window.XDomainRequest;if(l){l.onload=function(e){$.isFunction(t)&&t({responseText:l.responseText,status:200,statusText:"OK"})},l.onerror=function(e){$.isFunction(n)&&n({responseText:l.responseText,status:444,statusText:"An error happened. Due to an XDomainRequest deficiency we can not extract any information about this error. Upgrade your browser."})};try{l.open("GET",e),l.send()}catch(e){$.isFunction(n)&&n(s,r)}}}else $.isFunction(n)&&n(s,r)}return s},jsonp:function(e){var t,n=e.url,r=document.head||document.getElementsByTagName("head")[0]||document.documentElement,i=e.callbackName||"openseadragon"+$.now(),o=window[i],a="$1"+i+"$2",s=e.param||"callback",c=e.callback;n=n.replace(/(\=)\?(&|$)|\?\?/i,a),n+=(/\?/.test(n)?"&":"?")+s+"="+i,window[i]=function(e){if(o)window[i]=o;else try{delete window[i]}catch(e){}c&&$.isFunction(c)&&c(e)},t=document.createElement("script"),void 0===e.async&&!1===e.async||(t.async="async"),e.scriptCharset&&(t.charset=e.scriptCharset),t.src=n,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,r&&t.parentNode&&r.removeChild(t),t=void 0)},r.insertBefore(t,r.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(e){if(window.DOMParser)$.parseXml=function(e){return(new DOMParser).parseFromString(e,"text/xml")};else{if(!window.ActiveXObject)throw new Error("Browser doesn't support XML DOM.");$.parseXml=function(e){var t=null;return(t=new ActiveXObject("Microsoft.XMLDOM")).async=!1,t.loadXML(e),t}}return $.parseXml(e)},parseJSON:function(string){return window.JSON&&window.JSON.parse?$.parseJSON=window.JSON.parse:$.parseJSON=function(string){return eval("("+string+")")},$.parseJSON(string)},imageFormatSupported:function(e){return!!FILEFORMATS[(e=e||"").toLowerCase()]}});var nullfunction=function(e){};$.console=window.console||{log:nullfunction,debug:nullfunction,info:nullfunction,warn:nullfunction,error:nullfunction,assert:nullfunction},$.Browser={vendor:$.BROWSERS.UNKNOWN,version:0,alpha:!0};var FILEFORMATS={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},URLPARAMS={};function getOffsetParent(e,t){return t&&e!=document.body?document.body:e.offsetParent}!function(){var e=navigator.appVersion,t=navigator.userAgent;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&($.Browser.vendor=$.BROWSERS.IE,$.Browser.version=parseFloat(t.substring(t.indexOf("MSIE")+5,t.indexOf(";",t.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(t.indexOf("Firefox")>=0?($.Browser.vendor=$.BROWSERS.FIREFOX,$.Browser.version=parseFloat(t.substring(t.indexOf("Firefox")+8))):t.indexOf("Safari")>=0?($.Browser.vendor=t.indexOf("Chrome")>=0?$.BROWSERS.CHROME:$.BROWSERS.SAFARI,$.Browser.version=parseFloat(t.substring(t.substring(0,t.indexOf("Safari")).lastIndexOf("/")+1,t.indexOf("Safari")))):null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(t)&&($.Browser.vendor=$.BROWSERS.IE,$.Browser.version=parseFloat(RegExp.$1)));break;case"Opera":$.Browser.vendor=$.BROWSERS.OPERA,$.Browser.version=parseFloat(e)}var n,r,i,o=window.location.search.substring(1).split("&");for(i=0;i0){var a=n.substring(0,r),s=n.substring(r+1);try{URLPARAMS[a]=decodeURIComponent(s)}catch(e){$.console.error("Ignoring malformed URL parameter: %s=%s",a,s)}}$.Browser.alpha=!($.Browser.vendor==$.BROWSERS.IE&&$.Browser.version<9||$.Browser.vendor==$.BROWSERS.CHROME&&$.Browser.version<2),$.Browser.opacity=!($.Browser.vendor==$.BROWSERS.IE&&$.Browser.version<9)}(),function(e){var t=e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||e.msRequestAnimationFrame,n=e.cancelAnimationFrame||e.mozCancelAnimationFrame||e.webkitCancelAnimationFrame||e.msCancelAnimationFrame;if(t&&n)$.requestAnimationFrame=function(){return t.apply(e,arguments)},$.cancelAnimationFrame=function(){return n.apply(e,arguments)};else{var r,i=[],o=[],a=0;$.requestAnimationFrame=function(e){return i.push([++a,e]),r||(r=setInterval((function(){if(i.length){var e=$.now(),t=o;for(o=i,i=t;o.length;)o.shift()[1](e)}else clearInterval(r),r=void 0}),20)),a},$.cancelAnimationFrame=function(e){var t,n;for(t=0,n=i.length;t0&&(e.removeEvent(e.MouseTracker.captureElement,"mousemove",r.mousemovecaptured,!0),e.removeEvent(e.MouseTracker.captureElement,"mouseup",r.mouseupcaptured,!0),e.removeEvent(e.MouseTracker.captureElement,e.MouseTracker.unprefixedPointerEvents?"pointermove":"MSPointerMove",r.pointermovecaptured,!0),e.removeEvent(e.MouseTracker.captureElement,e.MouseTracker.unprefixedPointerEvents?"pointerup":"MSPointerUp",r.pointerupcaptured,!0),e.removeEvent(e.MouseTracker.captureElement,"touchmove",r.touchmovecaptured,!0),e.removeEvent(e.MouseTracker.captureElement,"touchend",r.touchendcaptured,!0),r.activePointersLists[n].captureCount=0);for(n=0;n0){for(r=0;r0&&(ve(e,t,o,0),n.captureCount=1,p(e,n.type),he(e,t,o))}}function q(t,n){var r,i,o,a,c=n.changedTouches.length,u=[],l=t.getActivePointersListByType("touch");for(r=e.now(),l.getLength()>n.touches.length-c&&(e.console.warn("Tracked touch contact count doesn't match event.touches.length. Removing all tracked touch pointers."),U(t,n,l)),i=0;i8||"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",e.MouseTracker.supportsMouseCapture=(a=document.createElement("div"),e.isFunction(a.setCapture)&&e.isFunction(a.releaseCapture)),e.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur",e.MouseTracker.wheelEventName],"DOMMouseScroll"==e.MouseTracker.wheelEventName&&e.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent&&(window.navigator.pointerEnabled||e.Browser.vendor!==e.BROWSERS.IE)?(e.MouseTracker.havePointerEvents=!0,e.MouseTracker.subscribeEvents.push("pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),e.MouseTracker.unprefixedPointerEvents=!0,navigator.maxTouchPoints?e.MouseTracker.maxTouchPoints=navigator.maxTouchPoints:e.MouseTracker.maxTouchPoints=0,e.MouseTracker.haveMouseEnter=!1):window.MSPointerEvent&&window.navigator.msPointerEnabled?(e.MouseTracker.havePointerEvents=!0,e.MouseTracker.subscribeEvents.push("MSPointerOver","MSPointerOut","MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"),e.MouseTracker.unprefixedPointerEvents=!1,navigator.msMaxTouchPoints?e.MouseTracker.maxTouchPoints=navigator.msMaxTouchPoints:e.MouseTracker.maxTouchPoints=0,e.MouseTracker.haveMouseEnter=!1):(e.MouseTracker.havePointerEvents=!1,e.Browser.vendor===e.BROWSERS.IE&&e.Browser.version<9?(e.MouseTracker.subscribeEvents.push("mouseenter","mouseleave"),e.MouseTracker.haveMouseEnter=!0):(e.MouseTracker.subscribeEvents.push("mouseover","mouseout"),e.MouseTracker.haveMouseEnter=!1),e.MouseTracker.subscribeEvents.push("mousedown","mouseup","mousemove"),"ontouchstart"in window&&e.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&e.MouseTracker.subscribeEvents.push("gesturestart","gesturechange"),e.MouseTracker.mousePointerId="legacy-mouse",e.MouseTracker.maxTouchPoints=10),e.MouseTracker.GesturePointList=function(e){this._gPoints=[],this.type=e,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},e.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(e){return this._gPoints.push(e)},removeById:function(e){var t,n=this._gPoints.length;for(t=0;t1&&("mouse"===this.type||"pen"===this.type)&&(this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(this.contacts=0)}};var ye=function(){try{return window.self!==window.top}catch(e){return!0}}();function be(e){try{return e.addEventListener&&e.removeEventListener}catch(e){return!1}}}(OpenSeadragon),function(e){e.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4,ABSOLUTE:5},e.Control=function(t,n,r){var i=t.parentNode;"number"==typeof n&&(e.console.error("Passing an anchor directly into the OpenSeadragon.Control constructor is deprecated; please use an options object instead. Support for this deprecated variant is scheduled for removal in December 2013"),n={anchor:n}),n.attachToViewer=void 0===n.attachToViewer||n.attachToViewer,this.autoFade=void 0===n.autoFade||n.autoFade,this.element=t,this.anchor=n.anchor,this.container=r,this.anchor==e.ControlAnchor.ABSOLUTE?(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top="number"==typeof n.top?n.top+"px":n.top,this.wrapper.style.left="number"==typeof n.left?n.left+"px":n.left,this.wrapper.style.height="number"==typeof n.height?n.height+"px":n.height,this.wrapper.style.width="number"==typeof n.width?n.width+"px":n.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor==e.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),n.attachToViewer?this.anchor==e.ControlAnchor.TOP_RIGHT||this.anchor==e.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):i.appendChild(this.wrapper)},e.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.container.removeChild(this.wrapper)},isVisible:function(){return"none"!=this.wrapper.style.display},setVisible:function(t){this.wrapper.style.display=t?this.anchor==e.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(t){this.element[e.SIGNAL]&&e.Browser.vendor==e.BROWSERS.IE?e.setElementOpacity(this.element,t,!0):e.setElementOpacity(this.wrapper,t,!0)}}}(OpenSeadragon),function(e){function t(e,t){var n,r=e.controls;for(n=r.length-1;n>=0;n--)if(r[n].element==t)return n;return-1}e.ControlDock=function(t){var n,r,i=["topleft","topright","bottomright","bottomleft"];for(e.extend(!0,this,{id:"controldock-"+e.now()+"-"+Math.floor(1e6*Math.random()),container:e.makeNeutralElement("div"),controls:[]},t),this.container.onsubmit=function(){return!1},this.element&&(this.element=e.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),r=0;r=0)){switch(r.anchor){case e.ControlAnchor.TOP_RIGHT:i=this.controls.topright,n.style.position="relative",n.style.paddingRight="0px",n.style.paddingTop="0px";break;case e.ControlAnchor.BOTTOM_RIGHT:i=this.controls.bottomright,n.style.position="relative",n.style.paddingRight="0px",n.style.paddingBottom="0px";break;case e.ControlAnchor.BOTTOM_LEFT:i=this.controls.bottomleft,n.style.position="relative",n.style.paddingLeft="0px",n.style.paddingBottom="0px";break;case e.ControlAnchor.TOP_LEFT:i=this.controls.topleft,n.style.position="relative",n.style.paddingLeft="0px",n.style.paddingTop="0px";break;case e.ControlAnchor.ABSOLUTE:i=this.container,n.style.margin="0px",n.style.padding="0px";break;default:case e.ControlAnchor.NONE:i=this.container,n.style.margin="0px",n.style.padding="0px"}this.controls.push(new e.Control(n,r,i)),n.style.display="inline-block"}},removeControl:function(n){var r=t(this,n=e.getElement(n));return r>=0&&(this.controls[r].destroy(),this.controls.splice(r,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var e;for(e=this.controls.length-1;e>=0;e--)if(this.controls[e].isVisible())return!0;return!1},setControlsEnabled:function(e){var t;for(t=this.controls.length-1;t>=0;t--)this.controls[t].setVisible(e);return this}}}(OpenSeadragon),function(e){e.Placement=e.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(OpenSeadragon),function(e){var t={},n=1;function r(t){return t=e.getElement(t),new e.Point(0===t.clientWidth?1:t.clientWidth,0===t.clientHeight?1:t.clientHeight)}function i(t,n){if(n instanceof e.Overlay)return n;var r=null;if(n.element)r=e.getElement(n.element);else{var i=n.id?n.id:"openseadragon-overlay-"+Math.floor(1e7*Math.random());(r=e.getElement(n.id))||((r=document.createElement("a")).href="#/overlay/"+i),r.id=i,e.addClass(r,n.className?n.className:"openseadragon-overlay")}var o=n.location,a=n.width,s=n.height;if(!o){var c=n.x,u=n.y;if(void 0!==n.px){var l=t.viewport.imageToViewportRectangle(new e.Rect(n.px,n.py,a||0,s||0));c=l.x,u=l.y,a=void 0!==a?l.width:void 0,s=void 0!==s?l.height:void 0}o=new e.Point(c,u)}var f=n.placement;return f&&"string"===e.type(f)&&(f=e.Placement[n.placement.toUpperCase()]),new e.Overlay({element:r,location:o,placement:f,onDraw:n.onDraw,checkResize:n.checkResize,width:a,height:s,rotationMode:n.rotationMode})}function o(e,t){var n;for(n=e.length-1;n>=0;n--)if(e[n].element===t)return n;return-1}function a(t,n){return e.requestAnimationFrame((function(){n(t)}))}function s(t){e.requestAnimationFrame((function(){!function(t){var n,r,i,o;if(t.controlsShouldFade){for(n=e.now(),r=n-t.controlsFadeBeginTime,i=1-r/t.controlsFadeLength,i=Math.min(1,i),i=Math.max(0,i),o=t.controls.length-1;o>=0;o--)t.controls[o].autoFade&&t.controls[o].setOpacity(i);i>0&&s(t)}}(t)}))}function c(t){t.autoHideControls&&(t.controlsShouldFade=!0,t.controlsFadeBeginTime=e.now()+t.controlsFadeDelay,window.setTimeout((function(){s(t)}),t.controlsFadeDelay))}function u(e){var t;for(e.controlsShouldFade=!1,t=e.controls.length-1;t>=0;t--)e.controls[t].setOpacity(1)}function l(){u(this)}function f(){c(this)}function d(t){var n={originalEvent:t.originalEvent,preventDefaultAction:t.preventDefaultAction,preventVerticalPan:t.preventVerticalPan,preventHorizontalPan:t.preventHorizontalPan};if(this.raiseEvent("canvas-key",n),n.preventDefaultAction||t.ctrl||t.alt||t.meta)return!0;switch(t.keyCode){case 38:return n.preventVerticalPan||(t.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),!1;case 40:return n.preventVerticalPan||(t.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),!1;case 37:return n.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),!1;case 39:return n.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),!1;default:return!0}}function p(t){var n={originalEvent:t.originalEvent,preventDefaultAction:t.preventDefaultAction,preventVerticalPan:t.preventVerticalPan,preventHorizontalPan:t.preventHorizontalPan};if(this.raiseEvent("canvas-key",n),n.preventDefaultAction||t.ctrl||t.alt||t.meta)return!0;switch(t.keyCode){case 43:case 61:return this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),!1;case 45:return this.viewport.zoomBy(.9),this.viewport.applyConstraints(),!1;case 48:return this.viewport.goHome(),this.viewport.applyConstraints(),!1;case 119:case 87:return n.preventVerticalPan||(t.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-40))),this.viewport.applyConstraints()),!1;case 115:case 83:return n.preventVerticalPan||(t.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,40))),this.viewport.applyConstraints()),!1;case 97:return n.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-40,0))),this.viewport.applyConstraints()),!1;case 100:return n.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(40,0))),this.viewport.applyConstraints()),!1;case 114:return this.viewport.flipped?this.viewport.setRotation(e.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)):this.viewport.setRotation(e.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)),this.viewport.applyConstraints(),!1;case 82:return this.viewport.flipped?this.viewport.setRotation(e.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)):this.viewport.setRotation(e.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)),this.viewport.applyConstraints(),!1;case 102:return this.viewport.toggleFlip(),!1;default:return!0}}function h(e){var t;document.activeElement==this.canvas||this.canvas.focus(),this.viewport.flipped&&(e.position.x=this.viewport.getContainerSize().x-e.position.x);var n={tracker:e.eventSource,position:e.position,quick:e.quick,shift:e.shift,originalEvent:e.originalEvent,preventDefaultAction:e.preventDefaultAction};this.raiseEvent("canvas-click",n),!n.preventDefaultAction&&this.viewport&&e.quick&&(t=this.gestureSettingsByDeviceType(e.pointerType)).clickToZoom&&(this.viewport.zoomBy(e.shift?1/this.zoomPerClick:this.zoomPerClick,t.zoomToRefPoint?this.viewport.pointFromPixel(e.position,!0):null),this.viewport.applyConstraints())}function g(e){var t,n={tracker:e.eventSource,position:e.position,shift:e.shift,originalEvent:e.originalEvent,preventDefaultAction:e.preventDefaultAction};this.raiseEvent("canvas-double-click",n),!n.preventDefaultAction&&this.viewport&&(t=this.gestureSettingsByDeviceType(e.pointerType)).dblClickToZoom&&(this.viewport.zoomBy(e.shift?1/this.zoomPerClick:this.zoomPerClick,t.zoomToRefPoint?this.viewport.pointFromPixel(e.position,!0):null),this.viewport.applyConstraints())}function v(e){var t,n={tracker:e.eventSource,position:e.position,delta:e.delta,speed:e.speed,direction:e.direction,shift:e.shift,originalEvent:e.originalEvent,preventDefaultAction:e.preventDefaultAction};if(this.raiseEvent("canvas-drag",n),!n.preventDefaultAction&&this.viewport){if(t=this.gestureSettingsByDeviceType(e.pointerType),this.panHorizontal||(e.delta.x=0),this.panVertical||(e.delta.y=0),this.viewport.flipped&&(e.delta.x=-e.delta.x),this.constrainDuringPan){var r=this.viewport.deltaPointsFromPixels(e.delta.negate());this.viewport.centerSpringX.target.value+=r.x,this.viewport.centerSpringY.target.value+=r.y;var i=this.viewport.getBounds(),o=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=r.x,this.viewport.centerSpringY.target.value-=r.y,i.x!=o.x&&(e.delta.x=0),i.y!=o.y&&(e.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(e.delta.negate()),t.flickEnabled&&!this.constrainDuringPan)}}function m(t){if(!t.preventDefaultAction&&this.viewport){var n=this.gestureSettingsByDeviceType(t.pointerType);if(n.flickEnabled&&t.speed>=n.flickMinSpeed){var r=0;this.panHorizontal&&(r=n.flickMomentum*t.speed*Math.cos(t.direction));var i=0;this.panVertical&&(i=n.flickMomentum*t.speed*Math.sin(t.direction));var o=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),a=this.viewport.pointFromPixel(new e.Point(o.x-r,o.y-i));this.viewport.panTo(a,!1)}this.viewport.applyConstraints()}this.raiseEvent("canvas-drag-end",{tracker:t.eventSource,position:t.position,speed:t.speed,direction:t.direction,shift:t.shift,originalEvent:t.originalEvent})}function y(e){this.raiseEvent("canvas-enter",{tracker:e.eventSource,pointerType:e.pointerType,position:e.position,buttons:e.buttons,pointers:e.pointers,insideElementPressed:e.insideElementPressed,buttonDownAny:e.buttonDownAny,originalEvent:e.originalEvent})}function b(t){window.location!=window.parent.location&&e.MouseTracker.resetAllMouseTrackers(),this.raiseEvent("canvas-exit",{tracker:t.eventSource,pointerType:t.pointerType,position:t.position,buttons:t.buttons,pointers:t.pointers,insideElementPressed:t.insideElementPressed,buttonDownAny:t.buttonDownAny,originalEvent:t.originalEvent})}function w(e){this.raiseEvent("canvas-press",{tracker:e.eventSource,pointerType:e.pointerType,position:e.position,insideElementPressed:e.insideElementPressed,insideElementReleased:e.insideElementReleased,originalEvent:e.originalEvent})}function _(e){this.raiseEvent("canvas-release",{tracker:e.eventSource,pointerType:e.pointerType,position:e.position,insideElementPressed:e.insideElementPressed,insideElementReleased:e.insideElementReleased,originalEvent:e.originalEvent})}function x(e){this.raiseEvent("canvas-nonprimary-press",{tracker:e.eventSource,position:e.position,pointerType:e.pointerType,button:e.button,buttons:e.buttons,originalEvent:e.originalEvent})}function O(e){this.raiseEvent("canvas-nonprimary-release",{tracker:e.eventSource,position:e.position,pointerType:e.pointerType,button:e.button,buttons:e.buttons,originalEvent:e.originalEvent})}function S(e){var t,n,r;if(!e.preventDefaultAction&&this.viewport&&((t=this.gestureSettingsByDeviceType(e.pointerType)).pinchToZoom&&(n=this.viewport.pointFromPixel(e.center,!0),r=this.viewport.pointFromPixel(e.lastCenter,!0).minus(n),this.panHorizontal||(r.x=0),this.panVertical||(r.y=0),this.viewport.zoomBy(e.distance/e.lastDistance,n,!0),t.zoomToRefPoint&&this.viewport.panBy(r,!0),this.viewport.applyConstraints()),t.pinchRotate)){var i=Math.atan2(e.gesturePoints[0].currentPos.y-e.gesturePoints[1].currentPos.y,e.gesturePoints[0].currentPos.x-e.gesturePoints[1].currentPos.x),o=Math.atan2(e.gesturePoints[0].lastPos.y-e.gesturePoints[1].lastPos.y,e.gesturePoints[0].lastPos.x-e.gesturePoints[1].lastPos.x);this.viewport.setRotation(this.viewport.getRotation()+(i-o)*(180/Math.PI))}return this.raiseEvent("canvas-pinch",{tracker:e.eventSource,gesturePoints:e.gesturePoints,lastCenter:e.lastCenter,center:e.center,lastDistance:e.lastDistance,distance:e.distance,shift:e.shift,originalEvent:e.originalEvent}),!1}function E(t){var n,r,i;if((i=e.now())-this._lastScrollTime>this.minScrollDeltaTime){if(this._lastScrollTime=i,this.viewport.flipped&&(t.position.x=this.viewport.getContainerSize().x-t.position.x),!t.preventDefaultAction&&this.viewport&&(n=this.gestureSettingsByDeviceType(t.pointerType)).scrollToZoom&&(r=Math.pow(this.zoomPerScroll,t.scroll),this.viewport.zoomBy(r,n.zoomToRefPoint?this.viewport.pointFromPixel(t.position,!0):null),this.viewport.applyConstraints()),this.raiseEvent("canvas-scroll",{tracker:t.eventSource,position:t.position,scroll:t.scroll,shift:t.shift,originalEvent:t.originalEvent}),n&&n.scrollToZoom)return!1}else if((n=this.gestureSettingsByDeviceType(t.pointerType))&&n.scrollToZoom)return!1}function C(e){t[this.hash].mouseInside=!0,u(this),this.raiseEvent("container-enter",{tracker:e.eventSource,position:e.position,buttons:e.buttons,pointers:e.pointers,insideElementPressed:e.insideElementPressed,buttonDownAny:e.buttonDownAny,originalEvent:e.originalEvent})}function k(e){e.pointers<1&&(t[this.hash].mouseInside=!1,t[this.hash].animating||c(this)),this.raiseEvent("container-exit",{tracker:e.eventSource,position:e.position,buttons:e.buttons,pointers:e.pointers,insideElementPressed:e.insideElementPressed,buttonDownAny:e.buttonDownAny,originalEvent:e.originalEvent})}function T(e){!function(e){if(e._opening)return;if(e.autoResize){var n=r(e.container),i=t[e.hash].prevContainerSize;if(!n.equals(i)){var o=e.viewport;if(e.preserveImageSizeOnResize){var a=i.x/n.x,s=o.getZoom()*a,l=o.getCenter();o.resize(n,!1),o.zoomTo(s,null,!0),o.panTo(l,!0)}else{var f=o.getBounds();o.resize(n,!0),o.fitBoundsWithConstraints(f,!0)}t[e.hash].prevContainerSize=n,t[e.hash].forceRedraw=!0}}var d=e.viewport.update(),p=e.world.update()||d;d&&e.raiseEvent("viewport-change");e.referenceStrip&&(p=e.referenceStrip.update(e.viewport)||p);!t[e.hash].animating&&p&&(e.raiseEvent("animation-start"),u(e));(p||t[e.hash].forceRedraw||e.world.needsDraw())&&(!function(e){e.imageLoader.clear(),e.drawer.clear(),e.world.draw(),e.raiseEvent("update-viewport",{})}(e),e._drawOverlays(),e.navigator&&e.navigator.update(e.viewport),t[e.hash].forceRedraw=!1,p&&e.raiseEvent("animation"));t[e.hash].animating&&!p&&(e.raiseEvent("animation-finish"),t[e.hash].mouseInside||c(e));t[e.hash].animating=p}(e),e.isOpen()?e._updateRequestId=a(e,T):e._updateRequestId=!1}function j(e,t){return e?e+t:t}function P(){t[this.hash].lastZoomTime=e.now(),t[this.hash].zoomFactor=this.zoomPerSecond,t[this.hash].zooming=!0,A(this)}function I(){t[this.hash].lastZoomTime=e.now(),t[this.hash].zoomFactor=1/this.zoomPerSecond,t[this.hash].zooming=!0,A(this)}function R(){t[this.hash].zooming=!1}function A(t){e.requestAnimationFrame(e.delegate(t,M))}function M(){var n,r,i;t[this.hash].zooming&&this.viewport&&(r=(n=e.now())-t[this.hash].lastZoomTime,i=Math.pow(t[this.hash].zoomFactor,r/1e3),this.viewport.zoomBy(i),this.viewport.applyConstraints(),t[this.hash].lastZoomTime=n,A(this))}function D(){this.viewport&&(t[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function N(){this.viewport&&(t[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function L(){this.buttons.emulateEnter(),this.buttons.emulateExit()}function z(){this.viewport&&this.viewport.goHome()}function B(){this.isFullPage()&&!e.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttons&&this.buttons.emulateExit(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function F(){if(this.viewport){var t=this.viewport.getRotation();t=this.viewport.flipped?e.positiveModulo(t+this.rotationIncrement,360):e.positiveModulo(t-this.rotationIncrement,360),this.viewport.setRotation(t)}}function W(){if(this.viewport){var t=this.viewport.getRotation();t=this.viewport.flipped?e.positiveModulo(t-this.rotationIncrement,360):e.positiveModulo(t+this.rotationIncrement,360),this.viewport.setRotation(t)}}function H(){this.viewport.toggleFlip()}function V(){var e=this._sequenceIndex-1;this.navPrevNextWrap&&e<0&&(e+=this.tileSources.length),this.goToPage(e)}function U(){var e=this._sequenceIndex+1;this.navPrevNextWrap&&e>=this.tileSources.length&&(e=0),this.goToPage(e)}e.Viewer=function(i){var o,s,u=arguments,l=this;if(e.isPlainObject(i)||(i={id:u[0],xmlPath:u.length>1?u[1]:void 0,prefixUrl:u.length>2?u[2]:void 0,controls:u.length>3?u[3]:void 0,overlays:u.length>4?u[4]:void 0}),i.config&&(e.extend(!0,i,i.config),delete i.config),e.extend(!0,this,{id:i.id,hash:i.hash||n++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttons:null,profiler:null},e.DEFAULT_SETTINGS,i),void 0===this.hash)throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(void 0!==t[this.hash]&&e.console.warn("Hash "+this.hash+" has already been used."),t[this.hash]={fsBoundsDelta:new e.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._lastScrollTime=e.now(),e.EventSource.call(this),this.addHandler("open-failed",(function(t){var n=e.getString("Errors.OpenFailed",t.eventSource,t.message);l._showMessage(n)})),e.ControlDock.call(this,i),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=e.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",(s=this.canvas.style).width="100%",s.height="100%",s.overflow="hidden",s.position="absolute",s.top="0px",s.left="0px",e.setElementTouchActionNone(this.canvas),""!==i.tabIndex&&(this.canvas.tabIndex=void 0===i.tabIndex?0:i.tabIndex),this.container.className="openseadragon-container",function(e){e.width="100%",e.height="100%",e.position="relative",e.overflow="hidden",e.left="0px",e.top="0px",e.textAlign="left"}(this.container.style),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new e.MouseTracker({element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,keyDownHandler:e.delegate(this,d),keyHandler:e.delegate(this,p),clickHandler:e.delegate(this,h),dblClickHandler:e.delegate(this,g),dragHandler:e.delegate(this,v),dragEndHandler:e.delegate(this,m),enterHandler:e.delegate(this,y),exitHandler:e.delegate(this,b),pressHandler:e.delegate(this,w),releaseHandler:e.delegate(this,_),nonPrimaryPressHandler:e.delegate(this,x),nonPrimaryReleaseHandler:e.delegate(this,O),scrollHandler:e.delegate(this,E),pinchHandler:e.delegate(this,S)}),this.outerTracker=new e.MouseTracker({element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:e.delegate(this,C),exitHandler:e.delegate(this,k)}),this.toolbar&&(this.toolbar=new e.ControlDock({element:this.toolbar})),this.bindStandardControls(),t[this.hash].prevContainerSize=r(this.container),this.world=new e.World({viewer:this}),this.world.addHandler("add-item",(function(e){l.source=l.world.getItemAt(0).source,t[l.hash].forceRedraw=!0,l._updateRequestId||(l._updateRequestId=a(l,T))})),this.world.addHandler("remove-item",(function(e){l.world.getItemCount()?l.source=l.world.getItemAt(0).source:l.source=null,t[l.hash].forceRedraw=!0})),this.world.addHandler("metrics-change",(function(e){l.viewport&&l.viewport._setContentBounds(l.world.getHomeBounds(),l.world.getContentFactor())})),this.world.addHandler("item-index-change",(function(e){l.source=l.world.getItemAt(0).source})),this.viewport=new e.Viewport({containerSize:t[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new e.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:i.timeout}),this.tileCache=new e.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new e.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=e.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(o=this.buttons.buttons.indexOf(this.rotateLeft),this.buttons.buttons.splice(o,1),this.buttons.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(o=this.buttons.buttons.indexOf(this.rotateRight),this.buttons.buttons.splice(o,1),this.buttons.element.removeChild(this.rotateRight.element))),this.showNavigator&&(this.navigator=new e.Navigator({id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),o=0;o-1&&t.index\s*$/))n=e.parseXml(n);else if(n.match(/^\s*[\{\[].*[\}\]]\s*$/))try{var s=e.parseJSON(n);n=s}catch(e){}function c(e,t){e.ready?i(e):(e.addHandler("ready",(function(){i(e)})),e.addHandler("open-failed",(function(e){o({message:e.message,source:t})})))}setTimeout((function(){if("string"==e.type(n))(n=new e.TileSource({url:n,crossOriginPolicy:void 0!==r.crossOriginPolicy?r.crossOriginPolicy:t.crossOriginPolicy,ajaxWithCredentials:t.ajaxWithCredentials,ajaxHeaders:t.ajaxHeaders,useCanvas:t.useCanvas,success:function(e){i(e.tileSource)}})).addHandler("open-failed",(function(e){o(e)}));else if(e.isPlainObject(n)||n.nodeType)if(void 0!==n.crossOriginPolicy||void 0===r.crossOriginPolicy&&void 0===t.crossOriginPolicy||(n.crossOriginPolicy=void 0!==r.crossOriginPolicy?r.crossOriginPolicy:t.crossOriginPolicy),void 0===n.ajaxWithCredentials&&(n.ajaxWithCredentials=t.ajaxWithCredentials),void 0===n.useCanvas&&(n.useCanvas=t.useCanvas),e.isFunction(n.getTileUrl)){var s=new e.TileSource(n);s.getTileUrl=n.getTileUrl,i(s)}else{var u=e.TileSource.determineType(a,n);if(!u)return void o({message:"Unable to load TileSource",source:n});var l=u.prototype.configure.apply(a,[n]);c(new u(l),n)}else c(n,n)}))}(this,t.tileSource,t,(function(e){r.tileSource=e,a()}),(function(e){e.options=t,i(e),a()})))},addSimpleImage:function(t){e.console.assert(t,"[Viewer.addSimpleImage] options is required"),e.console.assert(t.url,"[Viewer.addSimpleImage] options.url is required");var n=e.extend({},t,{tileSource:{type:"image",url:t.url}});delete n.url,this.addTiledImage(n)},addLayer:function(t){var n=this;e.console.error("[Viewer.addLayer] this function is deprecated; use Viewer.addTiledImage() instead.");var r=e.extend({},t,{success:function(e){n.raiseEvent("add-layer",{options:t,drawer:e.item})},error:function(e){n.raiseEvent("add-layer-failed",e)}});return this.addTiledImage(r),this},getLayerAtLevel:function(t){return e.console.error("[Viewer.getLayerAtLevel] this function is deprecated; use World.getItemAt() instead."),this.world.getItemAt(t)},getLevelOfLayer:function(t){return e.console.error("[Viewer.getLevelOfLayer] this function is deprecated; use World.getIndexOfItem() instead."),this.world.getIndexOfItem(t)},getLayersCount:function(){return e.console.error("[Viewer.getLayersCount] this function is deprecated; use World.getItemCount() instead."),this.world.getItemCount()},setLayerLevel:function(t,n){return e.console.error("[Viewer.setLayerLevel] this function is deprecated; use World.setItemIndex() instead."),this.world.setItemIndex(t,n)},removeLayer:function(t){return e.console.error("[Viewer.removeLayer] this function is deprecated; use World.removeItem() instead."),this.world.removeItem(t)},forceRedraw:function(){return t[this.hash].forceRedraw=!0,this},bindSequenceControls:function(){var t=e.delegate(this,l),n=e.delegate(this,f),r=e.delegate(this,U),i=e.delegate(this,V),o=this.navImages,a=!0;return this.showSequenceControl&&((this.previousButton||this.nextButton)&&(a=!1),this.previousButton=new e.Button({element:this.previousButton?e.getElement(this.previousButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.PreviousPage"),srcRest:j(this.prefixUrl,o.previous.REST),srcGroup:j(this.prefixUrl,o.previous.GROUP),srcHover:j(this.prefixUrl,o.previous.HOVER),srcDown:j(this.prefixUrl,o.previous.DOWN),onRelease:i,onFocus:t,onBlur:n}),this.nextButton=new e.Button({element:this.nextButton?e.getElement(this.nextButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.NextPage"),srcRest:j(this.prefixUrl,o.next.REST),srcGroup:j(this.prefixUrl,o.next.GROUP),srcHover:j(this.prefixUrl,o.next.HOVER),srcDown:j(this.prefixUrl,o.next.DOWN),onRelease:r,onFocus:t,onBlur:n}),this.navPrevNextWrap||this.previousButton.disable(),this.tileSources&&this.tileSources.length||this.nextButton.disable(),a&&(this.paging=new e.ButtonGroup({buttons:[this.previousButton,this.nextButton],clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold}),this.pagingControl=this.paging.element,this.toolbar?this.toolbar.addControl(this.pagingControl,{anchor:e.ControlAnchor.BOTTOM_RIGHT}):this.addControl(this.pagingControl,{anchor:this.sequenceControlAnchor||e.ControlAnchor.TOP_LEFT}))),this},bindStandardControls:function(){var t=e.delegate(this,P),n=e.delegate(this,R),r=e.delegate(this,D),i=e.delegate(this,I),o=e.delegate(this,N),a=e.delegate(this,z),s=e.delegate(this,B),c=e.delegate(this,F),u=e.delegate(this,W),d=e.delegate(this,H),p=e.delegate(this,l),h=e.delegate(this,f),g=this.navImages,v=[],m=!0;return this.showNavigationControl&&((this.zoomInButton||this.zoomOutButton||this.homeButton||this.fullPageButton||this.rotateLeftButton||this.rotateRightButton||this.flipButton)&&(m=!1),this.showZoomControl&&(v.push(this.zoomInButton=new e.Button({element:this.zoomInButton?e.getElement(this.zoomInButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.ZoomIn"),srcRest:j(this.prefixUrl,g.zoomIn.REST),srcGroup:j(this.prefixUrl,g.zoomIn.GROUP),srcHover:j(this.prefixUrl,g.zoomIn.HOVER),srcDown:j(this.prefixUrl,g.zoomIn.DOWN),onPress:t,onRelease:n,onClick:r,onEnter:t,onExit:n,onFocus:p,onBlur:h})),v.push(this.zoomOutButton=new e.Button({element:this.zoomOutButton?e.getElement(this.zoomOutButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.ZoomOut"),srcRest:j(this.prefixUrl,g.zoomOut.REST),srcGroup:j(this.prefixUrl,g.zoomOut.GROUP),srcHover:j(this.prefixUrl,g.zoomOut.HOVER),srcDown:j(this.prefixUrl,g.zoomOut.DOWN),onPress:i,onRelease:n,onClick:o,onEnter:i,onExit:n,onFocus:p,onBlur:h}))),this.showHomeControl&&v.push(this.homeButton=new e.Button({element:this.homeButton?e.getElement(this.homeButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.Home"),srcRest:j(this.prefixUrl,g.home.REST),srcGroup:j(this.prefixUrl,g.home.GROUP),srcHover:j(this.prefixUrl,g.home.HOVER),srcDown:j(this.prefixUrl,g.home.DOWN),onRelease:a,onFocus:p,onBlur:h})),this.showFullPageControl&&v.push(this.fullPageButton=new e.Button({element:this.fullPageButton?e.getElement(this.fullPageButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.FullPage"),srcRest:j(this.prefixUrl,g.fullpage.REST),srcGroup:j(this.prefixUrl,g.fullpage.GROUP),srcHover:j(this.prefixUrl,g.fullpage.HOVER),srcDown:j(this.prefixUrl,g.fullpage.DOWN),onRelease:s,onFocus:p,onBlur:h})),this.showRotationControl&&(v.push(this.rotateLeftButton=new e.Button({element:this.rotateLeftButton?e.getElement(this.rotateLeftButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.RotateLeft"),srcRest:j(this.prefixUrl,g.rotateleft.REST),srcGroup:j(this.prefixUrl,g.rotateleft.GROUP),srcHover:j(this.prefixUrl,g.rotateleft.HOVER),srcDown:j(this.prefixUrl,g.rotateleft.DOWN),onRelease:c,onFocus:p,onBlur:h})),v.push(this.rotateRightButton=new e.Button({element:this.rotateRightButton?e.getElement(this.rotateRightButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.RotateRight"),srcRest:j(this.prefixUrl,g.rotateright.REST),srcGroup:j(this.prefixUrl,g.rotateright.GROUP),srcHover:j(this.prefixUrl,g.rotateright.HOVER),srcDown:j(this.prefixUrl,g.rotateright.DOWN),onRelease:u,onFocus:p,onBlur:h}))),this.showFlipControl&&v.push(this.flipButton=new e.Button({element:this.flipButton?e.getElement(this.flipButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.Flip"),srcRest:j(this.prefixUrl,g.flip.REST),srcGroup:j(this.prefixUrl,g.flip.GROUP),srcHover:j(this.prefixUrl,g.flip.HOVER),srcDown:j(this.prefixUrl,g.flip.DOWN),onRelease:d,onFocus:p,onBlur:h})),m&&(this.buttons=new e.ButtonGroup({buttons:v,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold}),this.navControl=this.buttons.element,this.addHandler("open",e.delegate(this,L)),this.toolbar?this.toolbar.addControl(this.navControl,{anchor:this.navigationControlAnchor||e.ControlAnchor.TOP_LEFT}):this.addControl(this.navControl,{anchor:this.navigationControlAnchor||e.ControlAnchor.TOP_LEFT}))),this},currentPage:function(){return this._sequenceIndex},goToPage:function(e){return this.tileSources&&e>=0&&e=0)return this;var c=i(this,s);return this.currentOverlays.push(c),c.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:t,location:s.location,placement:s.placement}),this},updateOverlay:function(n,r,i){var a;return n=e.getElement(n),(a=o(this.currentOverlays,n))>=0&&(this.currentOverlays[a].update(r,i),t[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:n,location:r,placement:i})),this},removeOverlay:function(n){var r;return n=e.getElement(n),(r=o(this.currentOverlays,n))>=0&&(this.currentOverlays[r].destroy(),this.currentOverlays.splice(r,1),t[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:n})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return t[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(t){var n;return t=e.getElement(t),(n=o(this.currentOverlays,t))>=0?this.currentOverlays[n]:null},_updateSequenceButtons:function(e){this.nextButton&&(this.tileSources&&this.tileSources.length-1!==e?this.nextButton.enable():this.navPrevNextWrap||this.nextButton.disable()),this.previousButton&&(e>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(t){this._hideMessage();var n=e.makeNeutralElement("div");n.appendChild(document.createTextNode(t)),this.messageDiv=e.makeCenteredNode(n),e.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var e=this.messageDiv;e&&(e.parentNode.removeChild(e),delete this.messageDiv)},gestureSettingsByDeviceType:function(e){switch(e){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var e,t=this.currentOverlays.length;for(e=0;e1&&(this.referenceStrip=new e.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else e.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')}})}(OpenSeadragon),function(e){function t(e){var t={tracker:e.eventSource,position:e.position,quick:e.quick,shift:e.shift,originalEvent:e.originalEvent,preventDefaultAction:e.preventDefaultAction};if(this.viewer.raiseEvent("navigator-click",t),!t.preventDefaultAction&&e.quick&&this.viewer.viewport&&(this.panVertical||this.panHorizontal)){this.viewer.viewport.flipped&&(e.position.x=this.viewport.getContainerSize().x-e.position.x);var n=this.viewport.pointFromPixel(e.position);this.panVertical?this.panHorizontal||(n.x=this.viewer.viewport.getCenter(!0).x):n.y=this.viewer.viewport.getCenter(!0).y,this.viewer.viewport.panTo(n),this.viewer.viewport.applyConstraints()}}function n(e){var t={tracker:e.eventSource,position:e.position,delta:e.delta,speed:e.speed,direction:e.direction,shift:e.shift,originalEvent:e.originalEvent,preventDefaultAction:e.preventDefaultAction};this.viewer.raiseEvent("navigator-drag",t),!t.preventDefaultAction&&this.viewer.viewport&&(this.panHorizontal||(e.delta.x=0),this.panVertical||(e.delta.y=0),this.viewer.viewport.flipped&&(e.delta.x=-e.delta.x),this.viewer.viewport.panBy(this.viewport.deltaPointsFromPixels(e.delta)),this.viewer.constrainDuringPan&&this.viewer.viewport.applyConstraints())}function r(e){e.insideElementPressed&&this.viewer.viewport&&this.viewer.viewport.applyConstraints()}function i(e){return this.viewer.raiseEvent("navigator-scroll",{tracker:e.eventSource,position:e.position,scroll:e.scroll,shift:e.shift,originalEvent:e.originalEvent}),!1}function o(e,t){a(e,"rotate("+t+"deg)")}function a(e,t){e.style.webkitTransform=t,e.style.mozTransform=t,e.style.msTransform=t,e.style.oTransform=t,e.style.transform=t}e.Navigator=function(a){var s,c,u,l,f=a.viewer,d=this;function p(e){o(d.displayRegionContainer,e),o(d.displayRegion,-e),d.viewport.setRotation(e)}(a.id?(this.element=document.getElementById(a.id),a.controlOptions={anchor:e.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(a.id="navigator-"+e.now(),this.element=e.makeNeutralElement("div"),a.controlOptions={anchor:e.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:a.autoFade},a.position&&("BOTTOM_RIGHT"==a.position?a.controlOptions.anchor=e.ControlAnchor.BOTTOM_RIGHT:"BOTTOM_LEFT"==a.position?a.controlOptions.anchor=e.ControlAnchor.BOTTOM_LEFT:"TOP_RIGHT"==a.position?a.controlOptions.anchor=e.ControlAnchor.TOP_RIGHT:"TOP_LEFT"==a.position?a.controlOptions.anchor=e.ControlAnchor.TOP_LEFT:"ABSOLUTE"==a.position&&(a.controlOptions.anchor=e.ControlAnchor.ABSOLUTE,a.controlOptions.top=a.top,a.controlOptions.left=a.left,a.controlOptions.height=a.height,a.controlOptions.width=a.width))),this.element.id=a.id,this.element.className+=" navigator",(a=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.navigatorSizeRatio},a,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,autoResize:a.autoResize,minZoomImageRatio:1,background:a.background,opacity:a.opacity,borderColor:a.borderColor,displayRegionColor:a.displayRegionColor})).minPixelRatio=this.minPixelRatio=f.minPixelRatio,e.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new e.Point(1,1),this.totalBorderWidths=new e.Point(2*this.borderWidth,2*this.borderWidth).minus(this.fudge),a.controlOptions.anchor!=e.ControlAnchor.NONE&&(u=this.element.style,l=this.borderWidth,u.margin="0px",u.border=l+"px solid "+a.borderColor,u.padding="0px",u.background=a.background,u.opacity=a.opacity,u.overflow="hidden"),this.displayRegion=e.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(e,t){e.position="relative",e.top="0px",e.left="0px",e.fontSize="0px",e.overflow="hidden",e.border=t+"px solid "+a.displayRegionColor,e.margin="0px",e.padding="0px",e.background="transparent",e.float="left",e.cssFloat="left",e.styleFloat="left",e.zIndex=999999999,e.cursor="default"}(this.displayRegion.style,this.borderWidth),this.displayRegionContainer=e.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",f.addControl(this.element,a.controlOptions),this._resizeWithViewer=a.controlOptions.anchor!=e.ControlAnchor.ABSOLUTE&&a.controlOptions.anchor!=e.ControlAnchor.NONE,a.width&&a.height?(this.setWidth(a.width),this.setHeight(a.height)):this._resizeWithViewer&&(s=e.getElementSize(f.element),this.element.style.height=Math.round(s.y*a.sizeRatio)+"px",this.element.style.width=Math.round(s.x*a.sizeRatio)+"px",this.oldViewerSize=s,c=e.getElementSize(this.element),this.elementArea=c.x*c.y),this.oldContainerSize=new e.Point(0,0),e.Viewer.apply(this,[a]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer),a.navigatorRotate)&&(p(a.viewer.viewport?a.viewer.viewport.getRotation():a.viewer.degrees||0),a.viewer.addHandler("rotate",(function(e){p(e.degrees)})));this.innerTracker.destroy(),this.innerTracker=new e.MouseTracker({element:this.element,dragHandler:e.delegate(this,n),clickHandler:e.delegate(this,t),releaseHandler:e.delegate(this,r),scrollHandler:e.delegate(this,i)}),this.addHandler("reset-size",(function(){d.viewport&&d.viewport.goHome(!0)})),f.world.addHandler("item-index-change",(function(e){window.setTimeout((function(){var t=d.world.getItemAt(e.previousIndex);d.world.setItemIndex(t,e.newIndex)}),1)})),f.world.addHandler("remove-item",(function(e){var t=e.item,n=d._getMatchingItem(t);n&&d.world.removeItem(n)})),this.update(f.viewport)},e.extend(e.Navigator.prototype,e.EventSource.prototype,e.Viewer.prototype,{updateSize:function(){if(this.viewport){var t=new e.Point(0===this.container.clientWidth?1:this.container.clientWidth,0===this.container.clientHeight?1:this.container.clientHeight);t.equals(this.oldContainerSize)||(this.viewport.resize(t,!0),this.viewport.goHome(!0),this.oldContainerSize=t,this.drawer.clear(),this.world.draw())}},setWidth:function(e){this.width=e,this.element.style.width="number"==typeof e?e+"px":e,this._resizeWithViewer=!1},setHeight:function(e){this.height=e,this.element.style.height="number"==typeof e?e+"px":e,this._resizeWithViewer=!1},setFlip:function(e){return this.viewport.setFlip(e),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(e){a(this.displayRegion,e),a(this.canvas,e),a(this.element,e)},update:function(t){var n,r,i,o,a,s;if(n=e.getElementSize(this.viewer.element),this._resizeWithViewer&&n.x&&n.y&&!n.equals(this.oldViewerSize)&&(this.oldViewerSize=n,this.maintainSizeRatio||!this.elementArea?(r=n.x*this.sizeRatio,i=n.y*this.sizeRatio):(r=Math.sqrt(this.elementArea*(n.x/n.y)),i=this.elementArea/r),this.element.style.width=Math.round(r)+"px",this.element.style.height=Math.round(i)+"px",this.elementArea||(this.elementArea=r*i),this.updateSize()),t&&this.viewport){o=t.getBoundsNoRotate(!0),a=this.viewport.pixelFromPointNoRotate(o.getTopLeft(),!1),s=this.viewport.pixelFromPointNoRotate(o.getBottomRight(),!1).minus(this.totalBorderWidths);var c=this.displayRegion.style;c.display=this.world.getItemCount()?"block":"none",c.top=Math.round(a.y)+"px",c.left=Math.round(a.x)+"px";var u=Math.abs(a.x-s.x),l=Math.abs(a.y-s.y);c.width=Math.round(Math.max(u,0))+"px",c.height=Math.round(Math.max(l,0))+"px"}},addTiledImage:function(t){var n=this,r=t.originalTiledImage;delete t.original;var i=e.extend({},t,{success:function(e){var t=e.item;function i(){n._matchBounds(t,r)}t._originalForNavigator=r,n._matchBounds(t,r,!0),r.addHandler("bounds-change",i),r.addHandler("clip-change",i),r.addHandler("opacity-change",(function(){n._matchOpacity(t,r)})),r.addHandler("composite-operation-change",(function(){n._matchCompositeOperation(t,r)}))}});return e.Viewer.prototype.addTiledImage.apply(this,[i])},_getMatchingItem:function(e){for(var t,n=this.world.getItemCount(),r=0;r1||t.y>1);e++);return e-1},getTileAtPoint:function(t,n){var r=n.x>=0&&n.x<=1&&n.y>=0&&n.y<=1/this.aspectRatio;e.console.assert(r,"[TileSource.getTileAtPoint] must be called with a valid point.");var i=this.dimensions.x*this.getLevelScale(t),o=n.x*i,a=n.y*i,s=Math.floor(o/this.getTileWidth(t)),c=Math.floor(a/this.getTileHeight(t));n.x>=1&&(s=this.getNumTiles(t).x-1);return n.y>=1/this.aspectRatio-1e-15&&(c=this.getNumTiles(t).y-1),new e.Point(s,c)},getTileBounds:function(t,n,r,i){var o=this.dimensions.times(this.getLevelScale(t)),a=this.getTileWidth(t),s=this.getTileHeight(t),c=0===n?0:a*n-this.tileOverlap,u=0===r?0:s*r-this.tileOverlap,l=a+(0===n?1:2)*this.tileOverlap,f=s+(0===r?1:2)*this.tileOverlap,d=1/o.x;return l=Math.min(l,o.x-c),f=Math.min(f,o.y-u),i?new e.Rect(0,0,l,f):new e.Rect(c*d,u*d,l*d,f*d)},getImageInfo:function(t){var n,r,i,o,a,s,c,u=this;t&&(c=(s=(a=t.split("/"))[a.length-1]).lastIndexOf("."))>-1&&(a[a.length-1]=s.slice(0,c)),r=function(n){"string"==typeof n&&(n=e.parseXml(n));var r=e.TileSource.determineType(u,n,t);r?(void 0===(o=r.prototype.configure.apply(u,[n,t])).ajaxWithCredentials&&(o.ajaxWithCredentials=u.ajaxWithCredentials),i=new r(o),u.ready=!0,u.raiseEvent("ready",{tileSource:i})):u.raiseEvent("open-failed",{message:"Unable to load TileSource",source:t})},t.match(/\.js$/)?(n=t.split("/").pop().replace(".js",""),e.jsonp({url:t,async:!1,callbackName:n,callback:r})):e.makeAjaxRequest({url:t,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(t){var n=function(t){var n,r,i=t.responseText,o=t.status;if(!t)throw new Error(e.getString("Errors.Security"));if(200!==t.status&&0!==t.status)throw o=t.status,n=404==o?"Not Found":t.statusText,new Error(e.getString("Errors.Status",o,n));if(i.match(/\s*<.*/))try{r=t.responseXML&&t.responseXML.documentElement?t.responseXML:e.parseXml(i)}catch(e){r=t.responseText}else if(i.match(/\s*[\{\[].*/))try{r=e.parseJSON(i)}catch(e){r=i}else r=i;return r}(t);r(n)},error:function(e,n){var r;try{r="HTTP "+e.status+" attempting to load TileSource"}catch(e){r=(void 0!==n&&n.toString?n.toString():"Unknown error")+" attempting to load TileSource"}u.raiseEvent("open-failed",{message:r,source:t})}})},supports:function(e,t){return!1},configure:function(e,t){throw new Error("Method not implemented.")},getTileUrl:function(e,t,n){throw new Error("Method not implemented.")},getTileAjaxHeaders:function(e,t,n){return{}},tileExists:function(e,t,n){var r=this.getNumTiles(e);return e>=this.minLevel&&e<=this.maxLevel&&t>=0&&n>=0&&t=0;l--)for(d=(f=this.displayRects[l]).minLevel;d<=f.maxLevel;d++)this._levelRects[d]||(this._levelRects[d]=[]),this._levelRects[d].push(f);e.TileSource.apply(this,[p])},e.extend(e.DziTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){var n;return e.Image?n=e.Image.xmlns:e.documentElement&&("Image"!=e.documentElement.localName&&"Image"!=e.documentElement.tagName||(n=e.documentElement.namespaceURI)),-1!==(n=(n||"").toLowerCase()).indexOf("schemas.microsoft.com/deepzoom/2008")||-1!==n.indexOf("schemas.microsoft.com/deepzoom/2009")},configure:function(n,r){var i;return i=e.isPlainObject(n)?t(this,n):function(n,r){if(!r||!r.documentElement)throw new Error(e.getString("Errors.Xml"));var i,o,a,s,c,u=r.documentElement,l=u.localName||u.tagName,f=r.documentElement.namespaceURI,d=null,p=[];if("Image"==l)try{if(void 0===(s=u.getElementsByTagName("Size")[0])&&(s=u.getElementsByTagNameNS(f,"Size")[0]),d={Image:{xmlns:"http://schemas.microsoft.com/deepzoom/2008",Url:u.getAttribute("Url"),Format:u.getAttribute("Format"),DisplayRect:null,Overlap:parseInt(u.getAttribute("Overlap"),10),TileSize:parseInt(u.getAttribute("TileSize"),10),Size:{Height:parseInt(s.getAttribute("Height"),10),Width:parseInt(s.getAttribute("Width"),10)}}},!e.imageFormatSupported(d.Image.Format))throw new Error(e.getString("Errors.ImageFormat",d.Image.Format.toUpperCase()));for(void 0===(i=u.getElementsByTagName("DisplayRect"))&&(i=u.getElementsByTagNameNS(f,"DisplayRect")[0]),c=0;cthis.maxLevel)return!1;if(!l||!l.length)return!0;for(u=l.length-1;u>=0;u--)if(!(e<(r=l[u]).minLevel||e>r.maxLevel)&&(i=this.getLevelScale(e),o=r.x*i,a=r.y*i,s=o+r.width*i,c=a+r.height*i,o=Math.floor(o/this._tileWidth),a=Math.floor(a/this._tileWidth),s=Math.ceil(s/this._tileWidth),c=Math.ceil(c/this._tileWidth),o<=t&&t1&&e.profile[1].supports&&(r=-1!==e.profile[1].supports.indexOf("sizeByW")),3===e.version&&e.extraFeatures&&(r=-1!==e.extraFeatures.indexOf("sizeByWh")),!n||r}function n(e){for(var t=[],n=0;n0?r.tileSize=Math.max.apply(null,u):r.tileSize=s}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,r.levels=n(this),e.extend(!0,r,{width:r.levels[r.levels.length-1].width,height:r.levels[r.levels.length-1].height,tileSize:Math.max(r.height,r.width),tileOverlap:0,minLevel:0,maxLevel:r.levels.length-1}),this.levels=r.levels):e.console.error("Nothing in the info.json to construct image pyramids from");if(!r.maxLevel&&!this.emulateLegacyImagePyramid)if(this.scale_factors){var f=Math.max.apply(null,this.scale_factors);r.maxLevel=Math.round(Math.log(f)*Math.LOG2E)}else r.maxLevel=Number(Math.ceil(Math.log(Math.max(this.width,this.height),2)));e.TileSource.apply(this,[r])},e.extend(e.IIIFTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){return!(!e.protocol||"http://iiif.io/api/image"!=e.protocol)||(!(!e["@context"]||"http://library.stanford.edu/iiif/image-api/1.1/context.json"!=e["@context"]&&"http://iiif.io/api/image/1/context.json"!=e["@context"])||(!(!e.profile||0!==e.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html"))||(!!(e.identifier&&e.width&&e.height)||!(!e.documentElement||"info"!=e.documentElement.tagName||"http://library.stanford.edu/iiif/image-api/ns/"!=e.documentElement.namespaceURI))))},configure:function(t,n){if(e.isPlainObject(t)){if(t["@context"]){var r=t["@context"];if(Array.isArray(r))for(var i=0;i0&&t>=this.minLevel&&t<=this.maxLevel&&(n=this.levels[t].width/this.levels[this.maxLevel].width),n}return e.TileSource.prototype.getLevelScale.call(this,t)},getNumTiles:function(t){return this.emulateLegacyImagePyramid?this.getLevelScale(t)?new e.Point(1,1):new e.Point(0,0):e.TileSource.prototype.getNumTiles.call(this,t)},getTileAtPoint:function(t,n){return this.emulateLegacyImagePyramid?new e.Point(0,0):e.TileSource.prototype.getTileAtPoint.call(this,t,n)},getTileUrl:function(e,t,n){if(this.emulateLegacyImagePyramid){var r=null;return this.levels.length>0&&e>=this.minLevel&&e<=this.maxLevel&&(r=this.levels[e].url),r}var i,o,a,s,c,u,l,f,d,p,h,g,v,m=Math.pow(.5,this.maxLevel-e),y=Math.ceil(this.width*m),b=Math.ceil(this.height*m);return i=this.getTileWidth(e),o=this.getTileHeight(e),a=Math.ceil(i/m),s=Math.ceil(o/m),v=1===this.version?"native."+this.tileFormat:"default."+this.tileFormat,yu?c/256:u/256,a.maxLevel=Math.ceil(Math.log(s)/Math.log(2))-1,a.tileSize=256,a.width=c,a.height=u,e.TileSource.apply(this,[a])},e.extend(e.TmsTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){return e.type&&"tiledmapservice"==e.type},configure:function(e,t){return e},getTileUrl:function(e,t,n){var r=this.getNumTiles(e).y-1;return this.tilesUrl+e+"/"+t+"/"+(r-n)+".png"}})}(OpenSeadragon),function(e){e.ZoomifyTileSource=function(e){e.tileSize=256;var t={x:e.width,y:e.height};for(e.imageSizes=[{x:e.width,y:e.height}],e.gridSize=[this._getGridSize(e.width,e.height,e.tileSize)];parseInt(t.x,10)>e.tileSize||parseInt(t.y,10)>e.tileSize;)t.x=Math.floor(t.x/2),t.y=Math.floor(t.y/2),e.imageSizes.push({x:t.x,y:t.y}),e.gridSize.push(this._getGridSize(t.x,t.y,e.tileSize));e.imageSizes.reverse(),e.gridSize.reverse(),e.minLevel=0,e.maxLevel=e.gridSize.length-1,OpenSeadragon.TileSource.apply(this,[e])},e.extend(e.ZoomifyTileSource.prototype,e.TileSource.prototype,{_getGridSize:function(e,t,n){return{x:Math.ceil(e/n),y:Math.ceil(t/n)}},_calculateAbsoluteTileNumber:function(e,t,n){for(var r=0,i={},o=0;o");return i.sort((function(e,t){return e.height-t.height}))}(n.levels),n.levels.length>0?(r=n.levels[n.levels.length-1].width,i=n.levels[n.levels.length-1].height):(r=0,i=0,e.console.error("No supported image formats found")),e.extend(!0,n,{width:r,height:i,tileSize:Math.max(i,r),tileOverlap:0,minLevel:0,maxLevel:n.levels.length>0?n.levels.length-1:0}),e.TileSource.apply(this,[n]),this.levels=n.levels},e.extend(e.LegacyTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){return e.type&&"legacy-image-pyramid"==e.type||e.documentElement&&"legacy-image-pyramid"==e.documentElement.getAttribute("type")},configure:function(n,r){return e.isPlainObject(n)?t(this,n):function(n,r){if(!r||!r.documentElement)throw new Error(e.getString("Errors.Xml"));var i,o,a=r.documentElement,s=a.tagName,c=null,u=[];if("image"==s)try{for(c={type:a.getAttribute("type"),levels:[]},u=a.getElementsByTagName("level"),o=0;o0&&e>=this.minLevel&&e<=this.maxLevel&&(t=this.levels[e].width/this.levels[this.maxLevel].width),t},getNumTiles:function(t){return this.getLevelScale(t)?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(e,t,n){var r=null;return this.levels.length>0&&e>=this.minLevel&&e<=this.maxLevel&&(r=this.levels[e].url),r}})}(OpenSeadragon),function(e){e.ImageTileSource=function(t){t=e.extend({buildPyramid:!0,crossOriginPolicy:!1,ajaxWithCredentials:!1,useCanvas:!0},t),e.TileSource.apply(this,[t])},e.extend(e.ImageTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){return e.type&&"image"===e.type},configure:function(e,t){return e},getImageInfo:function(t){var n=this._image=new Image,r=this;this.crossOriginPolicy&&(n.crossOrigin=this.crossOriginPolicy),this.ajaxWithCredentials&&(n.useCredentials=this.ajaxWithCredentials),e.addEvent(n,"load",(function(){r.width=Object.prototype.hasOwnProperty.call(n,"naturalWidth")?n.naturalWidth:n.width,r.height=Object.prototype.hasOwnProperty.call(n,"naturalHeight")?n.naturalHeight:n.height,r.aspectRatio=r.width/r.height,r.dimensions=new e.Point(r.width,r.height),r._tileWidth=r.width,r._tileHeight=r.height,r.tileOverlap=0,r.minLevel=0,r.levels=r._buildLevels(),r.maxLevel=r.levels.length-1,r.ready=!0,r.raiseEvent("ready",{tileSource:r})})),e.addEvent(n,"error",(function(){r.raiseEvent("open-failed",{message:"Error loading image at "+t,source:t})})),n.src=t},getLevelScale:function(e){var t=NaN;return e>=this.minLevel&&e<=this.maxLevel&&(t=this.levels[e].width/this.levels[this.maxLevel].width),t},getNumTiles:function(t){return this.getLevelScale(t)?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(e,t,n){var r=null;return e>=this.minLevel&&e<=this.maxLevel&&(r=this.levels[e].url),r},getContext2D:function(e,t,n){var r=null;return e>=this.minLevel&&e<=this.maxLevel&&(r=this.levels[e].context2D),r},_buildLevels:function(){var t=[{url:this._image.src,width:Object.prototype.hasOwnProperty.call(this._image,"naturalWidth")?this._image.naturalWidth:this._image.width,height:Object.prototype.hasOwnProperty.call(this._image,"naturalHeight")?this._image.naturalHeight:this._image.height}];if(!this.buildPyramid||!e.supportsCanvas||!this.useCanvas)return delete this._image,t;var n=Object.prototype.hasOwnProperty.call(this._image,"naturalWidth")?this._image.naturalWidth:this._image.width,r=Object.prototype.hasOwnProperty.call(this._image,"naturalHeight")?this._image.naturalHeight:this._image.height,i=document.createElement("canvas"),o=i.getContext("2d");if(i.width=n,i.height=r,o.drawImage(this._image,0,0,n,r),t[0].context2D=o,delete this._image,e.isCanvasTainted(i))return t;for(;n>=2&&r>=2;){n=Math.floor(n/2),r=Math.floor(r/2);var a=document.createElement("canvas"),s=a.getContext("2d");a.width=n,a.height=r,s.drawImage(i,0,0,n,r),t.splice(0,0,{context2D:s,width:n,height:r}),i=a,o=s}return t}})}(OpenSeadragon),function(e){e.TileSourceCollection=function(t,n,r,i){e.console.error("TileSourceCollection is deprecated; use World instead")}}(OpenSeadragon),function(e){function t(n){e.requestAnimationFrame((function(){!function(n){var r,i,o;n.shouldFade&&(r=e.now(),i=r-n.fadeBeginTime,o=1-i/n.fadeLength,o=Math.min(1,o),o=Math.max(0,o),n.imgGroup&&e.setElementOpacity(n.imgGroup,o,!0),o>0&&t(n))}(n)}))}function n(t,n){t.element.disabled||(n>=e.ButtonState.GROUP&&t.currentState==e.ButtonState.REST&&(!function(t){t.shouldFade=!1,t.imgGroup&&e.setElementOpacity(t.imgGroup,1,!0)}(t),t.currentState=e.ButtonState.GROUP),n>=e.ButtonState.HOVER&&t.currentState==e.ButtonState.GROUP&&(t.imgHover&&(t.imgHover.style.visibility=""),t.currentState=e.ButtonState.HOVER),n>=e.ButtonState.DOWN&&t.currentState==e.ButtonState.HOVER&&(t.imgDown&&(t.imgDown.style.visibility=""),t.currentState=e.ButtonState.DOWN))}function r(n,r){n.element.disabled||(r<=e.ButtonState.HOVER&&n.currentState==e.ButtonState.DOWN&&(n.imgDown&&(n.imgDown.style.visibility="hidden"),n.currentState=e.ButtonState.HOVER),r<=e.ButtonState.GROUP&&n.currentState==e.ButtonState.HOVER&&(n.imgHover&&(n.imgHover.style.visibility="hidden"),n.currentState=e.ButtonState.GROUP),r<=e.ButtonState.REST&&n.currentState==e.ButtonState.GROUP&&(!function(n){n.shouldFade=!0,n.fadeBeginTime=e.now()+n.fadeDelay,window.setTimeout((function(){t(n)}),n.fadeDelay)}(n),n.currentState=e.ButtonState.REST))}e.ButtonState={REST:0,GROUP:1,HOVER:2,DOWN:3},e.Button=function(t){var i=this;e.EventSource.call(this),e.extend(!0,this,{tooltip:null,srcRest:null,srcGroup:null,srcHover:null,srcDown:null,clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,fadeDelay:0,fadeLength:2e3,onPress:null,onRelease:null,onClick:null,onEnter:null,onExit:null,onFocus:null,onBlur:null},t),this.element=t.element||e.makeNeutralElement("div"),t.element||(this.imgRest=e.makeTransparentImage(this.srcRest),this.imgGroup=e.makeTransparentImage(this.srcGroup),this.imgHover=e.makeTransparentImage(this.srcHover),this.imgDown=e.makeTransparentImage(this.srcDown),this.imgRest.alt=this.imgGroup.alt=this.imgHover.alt=this.imgDown.alt=this.tooltip,this.element.style.position="relative",e.setElementTouchActionNone(this.element),this.imgGroup.style.position=this.imgHover.style.position=this.imgDown.style.position="absolute",this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top="0px",this.imgGroup.style.left=this.imgHover.style.left=this.imgDown.style.left="0px",this.imgHover.style.visibility=this.imgDown.style.visibility="hidden",e.Browser.vendor==e.BROWSERS.FIREFOX&&e.Browser.version<3&&(this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top=""),this.element.appendChild(this.imgRest),this.element.appendChild(this.imgGroup),this.element.appendChild(this.imgHover),this.element.appendChild(this.imgDown)),this.addHandler("press",this.onPress),this.addHandler("release",this.onRelease),this.addHandler("click",this.onClick),this.addHandler("enter",this.onEnter),this.addHandler("exit",this.onExit),this.addHandler("focus",this.onFocus),this.addHandler("blur",this.onBlur),this.currentState=e.ButtonState.GROUP,this.fadeBeginTime=null,this.shouldFade=!1,this.element.style.display="inline-block",this.element.style.position="relative",this.element.title=this.tooltip,this.tracker=new e.MouseTracker({element:this.element,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,enterHandler:function(t){t.insideElementPressed?(n(i,e.ButtonState.DOWN),i.raiseEvent("enter",{originalEvent:t.originalEvent})):t.buttonDownAny||n(i,e.ButtonState.HOVER)},focusHandler:function(e){this.enterHandler(e),i.raiseEvent("focus",{originalEvent:e.originalEvent})},exitHandler:function(t){r(i,e.ButtonState.GROUP),t.insideElementPressed&&i.raiseEvent("exit",{originalEvent:t.originalEvent})},blurHandler:function(e){this.exitHandler(e),i.raiseEvent("blur",{originalEvent:e.originalEvent})},pressHandler:function(t){n(i,e.ButtonState.DOWN),i.raiseEvent("press",{originalEvent:t.originalEvent})},releaseHandler:function(t){t.insideElementPressed&&t.insideElementReleased?(r(i,e.ButtonState.HOVER),i.raiseEvent("release",{originalEvent:t.originalEvent})):t.insideElementPressed?r(i,e.ButtonState.GROUP):n(i,e.ButtonState.HOVER)},clickHandler:function(e){e.quick&&i.raiseEvent("click",{originalEvent:e.originalEvent})},keyHandler:function(e){return 13!==e.keyCode||(i.raiseEvent("click",{originalEvent:e.originalEvent}),i.raiseEvent("release",{originalEvent:e.originalEvent}),!1)}}),r(this,e.ButtonState.REST)},e.extend(e.Button.prototype,e.EventSource.prototype,{notifyGroupEnter:function(){n(this,e.ButtonState.GROUP)},notifyGroupExit:function(){r(this,e.ButtonState.REST)},disable:function(){this.notifyGroupExit(),this.element.disabled=!0,e.setElementOpacity(this.element,.2,!0)},enable:function(){this.element.disabled=!1,e.setElementOpacity(this.element,1,!0),this.notifyGroupEnter()}})}(OpenSeadragon),function(e){e.ButtonGroup=function(t){e.extend(!0,this,{buttons:[],clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},t);var n,r=this.buttons.concat([]),i=this;if(this.element=t.element||e.makeNeutralElement("div"),!t.group)for(this.element.style.display="inline-block",n=0;n=270?(a=this.getTopRight(),this.x=a.x,this.y=a.y,s=this.height,this.height=this.width,this.width=s,this.degrees-=270):this.degrees>=180?(a=this.getBottomRight(),this.x=a.x,this.y=a.y,this.degrees-=180):this.degrees>=90&&(a=this.getBottomLeft(),this.x=a.x,this.y=a.y,s=this.height,this.height=this.width,this.width=s,this.degrees-=90)},e.Rect.fromSummits=function(t,n,r){var i=t.distanceTo(n),o=t.distanceTo(r),a=n.minus(t),s=Math.atan(a.y/a.x);return a.x<0?s+=Math.PI:a.y<0&&(s+=2*Math.PI),new e.Rect(t.x,t.y,i,o,s/Math.PI*180)},e.Rect.prototype={clone:function(){return new e.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new e.Point(this.x,this.y)},getBottomRight:function(){return new e.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new e.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new e.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new e.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new e.Point(this.width,this.height)},equals:function(t){return t instanceof e.Rect&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height&&this.degrees===t.degrees},times:function(t){return new e.Rect(this.x*t,this.y*t,this.width*t,this.height*t,this.degrees)},translate:function(t){return new e.Rect(this.x+t.x,this.y+t.y,this.width,this.height,this.degrees)},union:function(t){var n=this.getBoundingBox(),r=t.getBoundingBox(),i=Math.min(n.x,r.x),o=Math.min(n.y,r.y),a=Math.max(n.x+n.width,r.x+r.width),s=Math.max(n.y+n.height,r.y+r.height);return new e.Rect(i,o,a-i,s-o)},intersection:function(t){var n=[],r=this.getTopLeft();t.containsPoint(r,1e-10)&&n.push(r);var i=this.getTopRight();t.containsPoint(i,1e-10)&&n.push(i);var o=this.getBottomLeft();t.containsPoint(o,1e-10)&&n.push(o);var a=this.getBottomRight();t.containsPoint(a,1e-10)&&n.push(a);var s=t.getTopLeft();this.containsPoint(s,1e-10)&&n.push(s);var c=t.getTopRight();this.containsPoint(c,1e-10)&&n.push(c);var u=t.getBottomLeft();this.containsPoint(u,1e-10)&&n.push(u);var l=t.getBottomRight();this.containsPoint(l,1e-10)&&n.push(l);for(var f=this._getSegments(),d=t._getSegments(),p=0;pw&&(w=S.x),S.y<_&&(_=S.y),S.y>x&&(x=S.y)}return new e.Rect(b,_,w-b,x-_)},_getSegments:function(){var e=this.getTopLeft(),t=this.getTopRight(),n=this.getBottomLeft(),r=this.getBottomRight();return[[e,t],[t,r],[r,n],[n,e]]},rotate:function(t,n){if(0===(t=e.positiveModulo(t,360)))return this.clone();n=n||this.getCenter();var r=this.getTopLeft().rotate(t,n),i=this.getTopRight().rotate(t,n).minus(r);i=i.apply((function(e){return Math.abs(e)<1e-15?0:e}));var o=Math.atan(i.y/i.x);return i.x<0?o+=Math.PI:i.y<0&&(o+=2*Math.PI),new e.Rect(r.x,r.y,this.width,this.height,o/Math.PI*180)},getBoundingBox:function(){if(0===this.degrees)return this.clone();var t=this.getTopLeft(),n=this.getTopRight(),r=this.getBottomLeft(),i=this.getBottomRight(),o=Math.min(t.x,n.x,r.x,i.x),a=Math.max(t.x,n.x,r.x,i.x),s=Math.min(t.y,n.y,r.y,i.y),c=Math.max(t.y,n.y,r.y,i.y);return new e.Rect(o,s,a-o,c-s)},getIntegerBoundingBox:function(){var t=this.getBoundingBox(),n=Math.floor(t.x),r=Math.floor(t.y),i=Math.ceil(t.width+t.x-n),o=Math.ceil(t.height+t.y-r);return new e.Rect(n,r,i,o)},containsPoint:function(e,t){t=t||0;var n=this.getTopLeft(),r=this.getTopRight(),i=this.getBottomLeft(),o=r.minus(n),a=i.minus(n);return(e.x-n.x)*o.x+(e.y-n.y)*o.y>=-t&&(e.x-r.x)*o.x+(e.y-r.y)*o.y<=t&&(e.x-n.x)*a.x+(e.y-n.y)*a.y>=-t&&(e.x-i.x)*a.x+(e.y-i.y)*a.y<=t},toString:function(){return"["+Math.round(100*this.x)/100+", "+Math.round(100*this.y)/100+", "+Math.round(100*this.width)/100+"x"+Math.round(100*this.height)/100+", "+Math.round(100*this.degrees)/100+"deg]"}}}(OpenSeadragon),function(e){var t={};function n(t){var n=Number(this.element.style.marginLeft.replace("px","")),r=Number(this.element.style.marginTop.replace("px","")),o=Number(this.element.style.width.replace("px","")),a=Number(this.element.style.height.replace("px","")),s=e.getElementSize(this.viewer.canvas);return this.dragging=!0,this.element&&("horizontal"==this.scroll?-t.delta.x>0?n>-(o-s.x)&&(this.element.style.marginLeft=n+2*t.delta.x+"px",i(this,s.x,n+2*t.delta.x)):-t.delta.x<0&&n<0&&(this.element.style.marginLeft=n+2*t.delta.x+"px",i(this,s.x,n+2*t.delta.x)):-t.delta.y>0?r>-(a-s.y)&&(this.element.style.marginTop=r+2*t.delta.y+"px",i(this,s.y,r+2*t.delta.y)):-t.delta.y<0&&r<0&&(this.element.style.marginTop=r+2*t.delta.y+"px",i(this,s.y,r+2*t.delta.y))),!1}function r(t){var n=Number(this.element.style.marginLeft.replace("px","")),r=Number(this.element.style.marginTop.replace("px","")),o=Number(this.element.style.width.replace("px","")),a=Number(this.element.style.height.replace("px","")),s=e.getElementSize(this.viewer.canvas);return this.element&&("horizontal"==this.scroll?t.scroll>0?n>-(o-s.x)&&(this.element.style.marginLeft=n-60*t.scroll+"px",i(this,s.x,n-60*t.scroll)):t.scroll<0&&n<0&&(this.element.style.marginLeft=n-60*t.scroll+"px",i(this,s.x,n-60*t.scroll)):t.scroll<0?r>s.y-a&&(this.element.style.marginTop=r+60*t.scroll+"px",i(this,s.y,r+60*t.scroll)):t.scroll>0&&r<0&&(this.element.style.marginTop=r+60*t.scroll+"px",i(this,s.y,r+60*t.scroll))),!1}function i(t,n,r){var i,o,a,s,c,u,l;for(i="horizontal"==t.scroll?t.panelWidth:t.panelHeight,o=Math.ceil(n/i)+5,u=o=(o=(a=Math.ceil((Math.abs(r)+n)/i)+1)-o)<0?0:o;uu+a.x-this.panelWidth?(n=Math.min(n,s-a.x),this.element.style.marginLeft=-n+"px",i(this,a.x,-n)):nl+a.y-this.panelHeight?(n=Math.min(n,c-a.y),this.element.style.marginTop=-n+"px",i(this,a.y,-n)):n1?n[1].springStiffness:5,animationTime:n.length>1?n[1].animationTime:1.5}),e.console.assert("number"==typeof t.springStiffness&&0!==t.springStiffness,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),e.console.assert("number"==typeof t.animationTime&&t.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),t.exponential&&(this._exponential=!0,delete t.exponential),e.extend(!0,this,t),this.current={value:"number"==typeof this.initial?this.initial:this._exponential?0:1,time:e.now()},e.console.assert(!this._exponential||0!==this.current.value,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},e.Spring.prototype={resetTo:function(t){e.console.assert(!this._exponential||0!==t,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=t,this.start.time=this.target.time=this.current.time=e.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(t){e.console.assert(!this._exponential||0!==t,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=t,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(t){this.start.value+=t,this.target.value+=t,this._exponential&&(e.console.assert(0!==this.target.value&&0!==this.start.value,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(t){this._exponential=t,this._exponential&&(e.console.assert(0!==this.current.value&&0!==this.target.value&&0!==this.start.value,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){var t,n;this.current.time=e.now(),this._exponential?(t=this.start._logValue,n=this.target._logValue):(t=this.start.value,n=this.target.value);var r,i,o=this.current.time>=this.target.time?n:t+(n-t)*(r=this.springStiffness,i=(this.current.time-this.start.time)/(this.target.time-this.start.time),(1-Math.exp(r*-i))/(1-Math.exp(-r))),a=this.current.value;return this._exponential?this.current.value=Math.exp(o):this.current.value=o,a!=this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}}}(OpenSeadragon),function(e){function t(t){e.extend(!0,this,{timeout:e.DEFAULT_SETTINGS.timeout,jobId:null},t),this.image=null}t.prototype={errorMsg:null,start:function(){var t=this,n=this.abort;this.image=new Image,this.image.onload=function(){t.finish(!0)},this.image.onabort=this.image.onerror=function(){t.errorMsg="Image load aborted",t.finish(!1)},this.jobId=window.setTimeout((function(){t.errorMsg="Image load exceeded timeout ("+t.timeout+" ms)",t.finish(!1)}),this.timeout),this.loadWithAjax?(this.request=e.makeAjaxRequest({url:this.src,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,responseType:"arraybuffer",success:function(e){var n;try{n=new window.Blob([e.response])}catch(t){var r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if("TypeError"===t.name&&r){var i=new r;i.append(e.response),n=i.getBlob()}}0===n.size&&(t.errorMsg="Empty image response.",t.finish(!1));var o=(window.URL||window.webkitURL).createObjectURL(n);t.image.src=o},error:function(e){t.errorMsg="Image load aborted - XHR error",t.finish(!1)}}),this.abort=function(){t.request.abort(),"function"==typeof n&&n()}):(!1!==this.crossOriginPolicy&&(this.image.crossOrigin=this.crossOriginPolicy),this.image.src=this.src)},finish:function(e){this.image.onload=this.image.onerror=this.image.onabort=null,e||(this.image=null),this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},e.ImageLoader=function(t){e.extend(!0,this,{jobLimit:e.DEFAULT_SETTINGS.imageLoaderLimit,timeout:e.DEFAULT_SETTINGS.timeout,jobQueue:[],jobsInProgress:0},t)},e.ImageLoader.prototype={addJob:function(e){var n=this,r=new t({src:e.src,loadWithAjax:e.loadWithAjax,ajaxHeaders:e.loadWithAjax?e.ajaxHeaders:null,crossOriginPolicy:e.crossOriginPolicy,ajaxWithCredentials:e.ajaxWithCredentials,callback:function(t){!function(e,t,n){e.jobsInProgress--,(!e.jobLimit||e.jobsInProgress0&&(e.jobQueue.shift().start(),e.jobsInProgress++);n(t.image,t.errorMsg,t.request)}(n,t,e.callback)},abort:e.abort,timeout:this.timeout});!this.jobLimit||this.jobsInProgressn&&(n=i)}return n},needsUpdate:function(){return e.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return e.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return e.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return e.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var e=this._calculateCanvasSize();if((this.canvas.width!=e.x||this.canvas.height!=e.y)&&(this.canvas.width=e.x,this.canvas.height=e.y,this._updateImageSmoothingEnabled(this.context),null!==this.sketchCanvas)){var t=this._calculateSketchCanvasSize();this.sketchCanvas.width=t.x,this.sketchCanvas.height=t.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(e,t){if(this.useCanvas){var n=this._getContext(e);if(t)n.clearRect(t.x,t.y,t.width,t.height);else{var r=n.canvas;n.clearRect(0,0,r.width,r.height)}}},viewportToDrawerRectangle:function(t){var n=this.viewport.pixelFromPointNoRotate(t.getTopLeft(),!0),r=this.viewport.deltaPixelsFromPointsNoRotate(t.getSize(),!0);return new e.Rect(n.x*e.pixelDensityRatio,n.y*e.pixelDensityRatio,r.x*e.pixelDensityRatio,r.y*e.pixelDensityRatio)},drawTile:function(t,n,r,i,o){if(e.console.assert(t,"[Drawer.drawTile] tile is required"),e.console.assert(n,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var a=this._getContext(r);i=i||1,t.drawCanvas(a,n,i,o)}else t.drawHTML(this.canvas)},_getContext:function(e){var t=this.context;if(e){if(null===this.sketchCanvas){this.sketchCanvas=document.createElement("canvas");var n=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=n.x,this.sketchCanvas.height=n.y,this.sketchContext=this.sketchCanvas.getContext("2d"),0===this.viewport.getRotation()){var r=this;this.viewer.addHandler("rotate",(function e(){if(0!==r.viewport.getRotation()){r.viewer.removeHandler("rotate",e);var t=r._calculateSketchCanvasSize();r.sketchCanvas.width=t.x,r.sketchCanvas.height=t.y}}))}this._updateImageSmoothingEnabled(this.sketchContext)}t=this.sketchContext}return t},saveContext:function(e){this.useCanvas&&this._getContext(e).save()},restoreContext:function(e){this.useCanvas&&this._getContext(e).restore()},setClip:function(e,t){if(this.useCanvas){var n=this._getContext(t);n.beginPath(),n.rect(e.x,e.y,e.width,e.height),n.clip()}},drawRectangle:function(e,t,n){if(this.useCanvas){var r=this._getContext(n);r.save(),r.fillStyle=t,r.fillRect(e.x,e.y,e.width,e.height),r.restore()}},blendSketch:function(t,n,r,i){var o=t;if(e.isPlainObject(o)||(o={opacity:t,scale:n,translate:r,compositeOperation:i}),this.useCanvas&&this.sketchCanvas){t=o.opacity,i=o.compositeOperation;var a=o.bounds;if(this.context.save(),this.context.globalAlpha=t,i&&(this.context.globalCompositeOperation=i),a)a.x<0&&(a.width+=a.x,a.x=0),a.x+a.width>this.canvas.width&&(a.width=this.canvas.width-a.x),a.y<0&&(a.height+=a.y,a.y=0),a.y+a.height>this.canvas.height&&(a.height=this.canvas.height-a.y),this.context.drawImage(this.sketchCanvas,a.x,a.y,a.width,a.height,a.x,a.y,a.width,a.height);else{n=o.scale||1;var s=(r=o.translate)instanceof e.Point?r:new e.Point(0,0),c=0,u=0;if(r){var l=this.sketchCanvas.width-this.canvas.width,f=this.sketchCanvas.height-this.canvas.height;c=Math.round(l/2),u=Math.round(f/2)}this.context.drawImage(this.sketchCanvas,s.x-c*n,s.y-u*n,(this.canvas.width+2*c)*n,(this.canvas.height+2*u)*n,-c,-u,this.canvas.width+2*c,this.canvas.height+2*u)}this.context.restore()}},drawDebugInfo:function(t,n,r,i){if(this.useCanvas){var o=this.viewer.world.getIndexOfItem(i)%this.debugGridColor.length,a=this.context;a.save(),a.lineWidth=2*e.pixelDensityRatio,a.font="small-caps bold "+13*e.pixelDensityRatio+"px arial",a.strokeStyle=this.debugGridColor[o],a.fillStyle=this.debugGridColor[o],0!==this.viewport.degrees&&this._offsetForRotation({degrees:this.viewport.degrees}),i.getRotation(!0)%360!=0&&this._offsetForRotation({degrees:i.getRotation(!0),point:i.viewport.pixelFromPointNoRotate(i._getRotationPoint(!0),!0)}),0===i.viewport.degrees&&i.getRotation(!0)%360==0&&i._drawer.viewer.viewport.getFlip()&&i._drawer._flip(),a.strokeRect(t.position.x*e.pixelDensityRatio,t.position.y*e.pixelDensityRatio,t.size.x*e.pixelDensityRatio,t.size.y*e.pixelDensityRatio);var s=(t.position.x+t.size.x/2)*e.pixelDensityRatio,c=(t.position.y+t.size.y/2)*e.pixelDensityRatio;a.translate(s,c),a.rotate(Math.PI/180*-this.viewport.degrees),a.translate(-s,-c),0===t.x&&0===t.y&&(a.fillText("Zoom: "+this.viewport.getZoom(),t.position.x*e.pixelDensityRatio,(t.position.y-30)*e.pixelDensityRatio),a.fillText("Pan: "+this.viewport.getBounds().toString(),t.position.x*e.pixelDensityRatio,(t.position.y-20)*e.pixelDensityRatio)),a.fillText("Level: "+t.level,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+20)*e.pixelDensityRatio),a.fillText("Column: "+t.x,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+30)*e.pixelDensityRatio),a.fillText("Row: "+t.y,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+40)*e.pixelDensityRatio),a.fillText("Order: "+r+" of "+n,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+50)*e.pixelDensityRatio),a.fillText("Size: "+t.size.toString(),(t.position.x+10)*e.pixelDensityRatio,(t.position.y+60)*e.pixelDensityRatio),a.fillText("Position: "+t.position.toString(),(t.position.x+10)*e.pixelDensityRatio,(t.position.y+70)*e.pixelDensityRatio),0!==this.viewport.degrees&&this._restoreRotationChanges(),i.getRotation(!0)%360!=0&&this._restoreRotationChanges(),0===i.viewport.degrees&&i.getRotation(!0)%360==0&&i._drawer.viewer.viewport.getFlip()&&i._drawer._flip(),a.restore()}},debugRect:function(t){if(this.useCanvas){var n=this.context;n.save(),n.lineWidth=2*e.pixelDensityRatio,n.strokeStyle=this.debugGridColor[0],n.fillStyle=this.debugGridColor[0],n.strokeRect(t.x*e.pixelDensityRatio,t.y*e.pixelDensityRatio,t.width*e.pixelDensityRatio,t.height*e.pixelDensityRatio),n.restore()}},setImageSmoothingEnabled:function(e){this.useCanvas&&(this._imageSmoothingEnabled=e,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(e){e.msImageSmoothingEnabled=this._imageSmoothingEnabled,e.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(t){var n=this._getContext(t).canvas;return new e.Point(n.width,n.height)},getCanvasCenter:function(){return new e.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(t){var n=t.point?t.point.times(e.pixelDensityRatio):this.getCanvasCenter(),r=this._getContext(t.useSketch);r.save(),r.translate(n.x,n.y),this.viewer.viewport.flipped?(r.rotate(Math.PI/180*-t.degrees),r.scale(-1,1)):r.rotate(Math.PI/180*t.degrees),r.translate(-n.x,-n.y)},_flip:function(t){var n=(t=t||{}).point?t.point.times(e.pixelDensityRatio):this.getCanvasCenter(),r=this._getContext(t.useSketch);r.translate(n.x,0),r.scale(-1,1),r.translate(-n.x,0)},_restoreRotationChanges:function(e){this._getContext(e).restore()},_calculateCanvasSize:function(){var t=e.pixelDensityRatio,n=this.viewport.getContainerSize();return{x:Math.round(n.x*t),y:Math.round(n.y*t)}},_calculateSketchCanvasSize:function(){var e=this._calculateCanvasSize();if(0===this.viewport.getRotation())return e;var t=Math.ceil(Math.sqrt(e.x*e.x+e.y*e.y));return{x:t,y:t}}}}(OpenSeadragon),function(e){e.Viewport=function(t){var n=arguments;n.length&&n[0]instanceof e.Point&&(t={containerSize:n[0],contentSize:n[1],config:n[2]}),t.config&&(e.extend(!0,t,t.config),delete t.config),this._margins=e.extend({left:0,top:0,right:0,bottom:0},t.margins||{}),delete t.margins,e.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,viewer:null,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:e.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:e.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:e.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:e.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:e.DEFAULT_SETTINGS.maxZoomLevel,degrees:e.DEFAULT_SETTINGS.degrees,flipped:e.DEFAULT_SETTINGS.flipped,homeFillsViewer:e.DEFAULT_SETTINGS.homeFillsViewer},t),this._updateContainerInnerSize(),this.centerSpringX=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new e.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._setContentBounds(new e.Rect(0,0,1,1),1),this.goHome(!0),this.update()},e.Viewport.prototype={resetContentSize:function(t){return e.console.assert(t,"[Viewport.resetContentSize] contentSize is required"),e.console.assert(t instanceof e.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),e.console.assert(t.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),e.console.assert(t.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new e.Rect(0,0,1,t.y/t.x),t.x),this},setHomeBounds:function(t,n){e.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(t,n)},_setContentBounds:function(t,n){e.console.assert(t,"[Viewport._setContentBounds] bounds is required"),e.console.assert(t instanceof e.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),e.console.assert(t.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),e.console.assert(t.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=t.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(n),this._contentBounds=t.rotate(this.degrees).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(n),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:n,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var e=this._contentAspectRatio/this.getAspectRatio();return(this.homeFillsViewer?e>=1?e:1:e>=1?1:e)/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var t=this._contentBounds.getCenter(),n=1/this.getHomeZoom(),r=n/this.getAspectRatio();return new e.Rect(t.x-n/2,t.y-r/2,n,r)},goHome:function(e){return this.viewer&&this.viewer.raiseEvent("home",{immediately:e}),this.fitBounds(this.getHomeBounds(),e)},getMinZoom:function(){var e=this.getHomeZoom();return this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*e},getMaxZoom:function(){var e=this.maxZoomLevel;return e||(e=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,e/=this._contentBounds.width),Math.max(e,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new e.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return e.extend({},this._margins)},setMargins:function(t){e.console.assert("object"===e.type(t),"[Viewport.setMargins] margins must be an object"),this._margins=e.extend({left:0,top:0,right:0,bottom:0},t),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(e){return this.getBoundsNoRotate(e).rotate(-this.getRotation())},getBoundsNoRotate:function(t){var n=this.getCenter(t),r=1/this.getZoom(t),i=r/this.getAspectRatio();return new e.Rect(n.x-r/2,n.y-i/2,r,i)},getBoundsWithMargins:function(e){return this.getBoundsNoRotateWithMargins(e).rotate(-this.getRotation(),this.getCenter(e))},getBoundsNoRotateWithMargins:function(e){var t=this.getBoundsNoRotate(e),n=this._containerInnerSize.x*this.getZoom(e);return t.x-=this._margins.left/n,t.y-=this._margins.top/n,t.width+=(this._margins.left+this._margins.right)/n,t.height+=(this._margins.top+this._margins.bottom)/n,t},getCenter:function(t){var n,r,i,o,a,s,c=new e.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),u=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return t?c:this.zoomPoint?(n=this.pixelFromPoint(this.zoomPoint,!0),o=(i=1/(r=this.getZoom()))/this.getAspectRatio(),a=new e.Rect(c.x-i/2,c.y-o/2,i,o),s=this._pixelFromPoint(this.zoomPoint,a).minus(n).divide(this._containerInnerSize.x*r),u.plus(s)):u},getZoom:function(e){return e?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(e){return Math.max(Math.min(e,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(t){var n=new e.Rect(t.x,t.y,t.width,t.height);if(this.wrapHorizontal);else{var r=this.visibilityRatio*n.width,i=n.x+n.width,o=this._contentBoundsNoRotate.x+this._contentBoundsNoRotate.width,a=this._contentBoundsNoRotate.x-i+r,s=o-n.x-r;r>this._contentBoundsNoRotate.width?n.x+=(a+s)/2:s<0?n.x+=s:a>0&&(n.x+=a)}if(this.wrapVertical);else{var c=this.visibilityRatio*n.height,u=n.y+n.height,l=this._contentBoundsNoRotate.y+this._contentBoundsNoRotate.height,f=this._contentBoundsNoRotate.y-u+c,d=l-n.y-c;c>this._contentBoundsNoRotate.height?n.y+=(f+d)/2:d<0?n.y+=d:f>0&&(n.y+=f)}return n},_raiseConstraintsEvent:function(e){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:e})},applyConstraints:function(e){var t=this.getZoom(),n=this._applyZoomConstraints(t);t!==n&&this.zoomTo(n,this.zoomPoint,e);var r=this.getBoundsNoRotate(),i=this._applyBoundaryConstraints(r);return this._raiseConstraintsEvent(e),(r.x!==i.x||r.y!==i.y||e)&&this.fitBounds(i.rotate(-this.getRotation()),e),this},ensureVisible:function(e){return this.applyConstraints(e)},_fitBounds:function(t,n){var r=(n=n||{}).immediately||!1,i=n.constraints||!1,o=this.getAspectRatio(),a=t.getCenter(),s=new e.Rect(t.x,t.y,t.width,t.height,t.degrees+this.getRotation()).getBoundingBox();s.getAspectRatio()>=o?s.height=s.width/o:s.width=s.height*o,s.x=a.x-s.width/2,s.y=a.y-s.height/2;var c=1/s.width;if(i){var u=s.getAspectRatio(),l=this._applyZoomConstraints(c);c!==l&&(c=l,s.width=1/c,s.x=a.x-s.width/2,s.height=s.width/u,s.y=a.y-s.height/2),a=(s=this._applyBoundaryConstraints(s)).getCenter(),this._raiseConstraintsEvent(r)}if(r)return this.panTo(a,!0),this.zoomTo(c,null,!0);this.panTo(this.getCenter(!0),!0),this.zoomTo(this.getZoom(!0),null,!0);var f=this.getBounds(),d=this.getZoom();if(0===d||Math.abs(c/d-1)<1e-8)return this.zoomTo(c,!0),this.panTo(a,r);var p=(s=s.rotate(-this.getRotation())).getTopLeft().times(c).minus(f.getTopLeft().times(d)).divide(c-d);return this.zoomTo(c,p,r)},fitBounds:function(e,t){return this._fitBounds(e,{immediately:t,constraints:!1})},fitBoundsWithConstraints:function(e,t){return this._fitBounds(e,{immediately:t,constraints:!0})},fitVertically:function(t){var n=new e.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(n,t)},fitHorizontally:function(t){var n=new e.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(n,t)},getConstrainedBounds:function(e){var t;return t=this.getBounds(e),this._applyBoundaryConstraints(t)},panBy:function(t,n){var r=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(r.plus(t),n)},panTo:function(e,t){return t?(this.centerSpringX.resetTo(e.x),this.centerSpringY.resetTo(e.y)):(this.centerSpringX.springTo(e.x),this.centerSpringY.springTo(e.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:e,immediately:t}),this},zoomBy:function(e,t,n){return this.zoomTo(this.zoomSpring.target.value*e,t,n)},zoomTo:function(t,n,r){var i=this;return this.zoomPoint=n instanceof e.Point&&!isNaN(n.x)&&!isNaN(n.y)?n:null,r?this._adjustCenterSpringsForZoomPoint((function(){i.zoomSpring.resetTo(t)})):this.zoomSpring.springTo(t),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:t,refPoint:n,immediately:r}),this},setRotation:function(t){return this.viewer&&this.viewer.drawer.canRotate()?(this.degrees=e.positiveModulo(t,360),this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:t}),this):this},getRotation:function(){return this.degrees},resize:function(e,t){var n,r=this.getBoundsNoRotate(),i=r;return this.containerSize.x=e.x,this.containerSize.y=e.y,this._updateContainerInnerSize(),t&&(n=e.x/this.containerSize.x,i.width=r.width*n,i.height=i.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:e,maintain:t}),this.fitBounds(i,!0)},_updateContainerInnerSize:function(){this._containerInnerSize=new e.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var e=this;this._adjustCenterSpringsForZoomPoint((function(){e.zoomSpring.update()})),this.centerSpringX.update(),this.centerSpringY.update();var t=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,t},_adjustCenterSpringsForZoomPoint:function(e){if(this.zoomPoint){var t=this.pixelFromPoint(this.zoomPoint,!0);e();var n=this.pixelFromPoint(this.zoomPoint,!0).minus(t),r=this.deltaPointsFromPixels(n,!0);this.centerSpringX.shiftBy(r.x),this.centerSpringY.shiftBy(r.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else e()},deltaPixelsFromPointsNoRotate:function(e,t){return e.times(this._containerInnerSize.x*this.getZoom(t))},deltaPixelsFromPoints:function(e,t){return this.deltaPixelsFromPointsNoRotate(e.rotate(this.getRotation()),t)},deltaPointsFromPixelsNoRotate:function(e,t){return e.divide(this._containerInnerSize.x*this.getZoom(t))},deltaPointsFromPixels:function(e,t){return this.deltaPointsFromPixelsNoRotate(e,t).rotate(-this.getRotation())},pixelFromPointNoRotate:function(e,t){return this._pixelFromPointNoRotate(e,this.getBoundsNoRotate(t))},pixelFromPoint:function(e,t){return this._pixelFromPoint(e,this.getBoundsNoRotate(t))},_pixelFromPointNoRotate:function(t,n){return t.minus(n.getTopLeft()).times(this._containerInnerSize.x/n.width).plus(new e.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(e,t){return this._pixelFromPointNoRotate(e.rotate(this.getRotation(),this.getCenter(!0)),t)},pointFromPixelNoRotate:function(t,n){var r=this.getBoundsNoRotate(n);return t.minus(new e.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/r.width).plus(r.getTopLeft())},pointFromPixel:function(e,t){return this.pointFromPixelNoRotate(e,t).rotate(-this.getRotation(),this.getCenter(!0))},_viewportToImageDelta:function(t,n){var r=this._contentBoundsNoRotate.width;return new e.Point(t*this._contentSizeNoRotate.x/r,n*this._contentSizeNoRotate.x/r)},viewportToImageCoordinates:function(t,n){if(t instanceof e.Point)return this.viewportToImageCoordinates(t.x,t.y);if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)e.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(1===r){return this.viewer.world.getItemAt(0).viewportToImageCoordinates(t,n,!0)}}return this._viewportToImageDelta(t-this._contentBoundsNoRotate.x,n-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(t,n){var r=this._contentBoundsNoRotate.width;return new e.Point(t/this._contentSizeNoRotate.x*r,n/this._contentSizeNoRotate.x*r)},imageToViewportCoordinates:function(t,n){if(t instanceof e.Point)return this.imageToViewportCoordinates(t.x,t.y);if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)e.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(1===r){return this.viewer.world.getItemAt(0).imageToViewportCoordinates(t,n,!0)}}var i=this._imageToViewportDelta(t,n);return i.x+=this._contentBoundsNoRotate.x,i.y+=this._contentBoundsNoRotate.y,i},imageToViewportRectangle:function(t,n,r,i){var o=t;if(o instanceof e.Rect||(o=new e.Rect(t,n,r,i)),this.viewer){var a=this.viewer.world.getItemCount();if(a>1)e.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(1===a){return this.viewer.world.getItemAt(0).imageToViewportRectangle(t,n,r,i,!0)}}var s=this.imageToViewportCoordinates(o.x,o.y),c=this._imageToViewportDelta(o.width,o.height);return new e.Rect(s.x,s.y,c.x,c.y,o.degrees)},viewportToImageRectangle:function(t,n,r,i){var o=t;if(o instanceof e.Rect||(o=new e.Rect(t,n,r,i)),this.viewer){var a=this.viewer.world.getItemCount();if(a>1)e.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(1===a){return this.viewer.world.getItemAt(0).viewportToImageRectangle(t,n,r,i,!0)}}var s=this.viewportToImageCoordinates(o.x,o.y),c=this._viewportToImageDelta(o.width,o.height);return new e.Rect(s.x,s.y,c.x,c.y,o.degrees)},viewerElementToImageCoordinates:function(e){var t=this.pointFromPixel(e,!0);return this.viewportToImageCoordinates(t)},imageToViewerElementCoordinates:function(e){var t=this.imageToViewportCoordinates(e);return this.pixelFromPoint(t,!0)},windowToImageCoordinates:function(t){e.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var n=t.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(n)},imageToWindowCoordinates:function(t){return e.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer."),this.imageToViewerElementCoordinates(t).plus(e.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(e){return this.pointFromPixel(e,!0)},viewportToViewerElementCoordinates:function(e){return this.pixelFromPoint(e,!0)},viewerElementToViewportRectangle:function(t){return e.Rect.fromSummits(this.pointFromPixel(t.getTopLeft(),!0),this.pointFromPixel(t.getTopRight(),!0),this.pointFromPixel(t.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(t){return e.Rect.fromSummits(this.pixelFromPoint(t.getTopLeft(),!0),this.pixelFromPoint(t.getTopRight(),!0),this.pixelFromPoint(t.getBottomLeft(),!0))},windowToViewportCoordinates:function(t){e.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var n=t.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(n)},viewportToWindowCoordinates:function(t){return e.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer."),this.viewportToViewerElementCoordinates(t).plus(e.getElementPosition(this.viewer.element))},viewportToImageZoom:function(t){if(this.viewer){var n=this.viewer.world.getItemCount();if(n>1)e.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(1===n){return this.viewer.world.getItemAt(0).viewportToImageZoom(t)}}var r=this._contentSizeNoRotate.x;return t*(this._containerInnerSize.x/r*this._contentBoundsNoRotate.width)},imageToViewportZoom:function(t){if(this.viewer){var n=this.viewer.world.getItemCount();if(n>1)e.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(1===n){return this.viewer.world.getItemAt(0).imageToViewportZoom(t)}}return t*(this._contentSizeNoRotate.x/this._containerInnerSize.x/this._contentBoundsNoRotate.width)},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(e){return this.flipped===e||(this.flipped=e,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:e})),this}}}(OpenSeadragon),function(e){function t(e,t,r,i,o,a,c,u,l){var f=c.getBoundingBox().getTopLeft(),d=c.getBoundingBox().getBottomRight();e.viewer&&e.viewer.raiseEvent("update-level",{tiledImage:e,havedrawn:t,level:i,opacity:o,visibility:a,drawArea:c,topleft:f,bottomright:d,currenttime:u,best:l}),s(e.coverage,i),s(e.loadingCoverage,i);for(var p=e._getCornerTiles(i,f,d),h=p.topLeft,g=p.bottomRight,v=e.source.getNumTiles(i),m=e.viewport.pixelFromPoint(e.viewport.getCenter()),y=h.x;y<=g.x;y++)for(var b=h.y;b<=g.y;b++){if(!e.wrapHorizontal&&!e.wrapVertical){var w=e.source.getTileBounds(i,y,b);if(null===c.intersection(w))continue}l=n(e,r,t,y,b,i,o,a,m,v,u,l)}return l}function n(t,n,i,s,c,u,l,f,d,p,h,g){var v=function(t,n,r,i,o,a,s,c,u,l){var f,d,p,h,g,v,m,y,b;a[r]||(a[r]={});a[r][t]||(a[r][t]={});a[r][t][n]||(f=(c.x+t%c.x)%c.x,d=(c.y+n%c.y)%c.y,p=o.getTileBounds(r,f,d),h=o.getTileBounds(r,f,d,!0),g=o.tileExists(r,f,d),v=o.getTileUrl(r,f,d),i.loadTilesWithAjax?(m=o.getTileAjaxHeaders(r,f,d),e.isPlainObject(i.ajaxHeaders)&&(m=e.extend({},i.ajaxHeaders,m))):m=null,y=o.getContext2D?o.getContext2D(r,f,d):void 0,p.x+=(t-f)/c.x,p.y+=l/u*((n-d)/c.y),b=new e.Tile(r,t,n,p,g,v,y,i.loadTilesWithAjax,m,h),f===c.x-1&&(b.isRightMost=!0),d===c.y-1&&(b.isBottomMost=!0),a[r][t][n]=b);return(b=a[r][t][n]).lastTouchTime=s,b}(s,c,u,t,t.source,t.tilesMatrix,h,p,t._worldWidthCurrent,t._worldHeightCurrent),m=i;t.viewer&&t.viewer.raiseEvent("update-tile",{tiledImage:t,tile:v}),a(t.coverage,u,s,c,!1);var y=v.loaded||v.loading||o(t.loadingCoverage,u,s,c);if(a(t.loadingCoverage,u,s,c,y),!v.exists)return g;if(n&&!m&&(o(t.coverage,u,s,c)?a(t.coverage,u,s,c,!0):m=!0),!m)return g;if(function(t,n,r,i,o,a){var s=t.bounds.getTopLeft();s.x*=a._scaleSpring.current.value,s.y*=a._scaleSpring.current.value,s.x+=a._xSpring.current.value,s.y+=a._ySpring.current.value;var c=t.bounds.getSize();c.x*=a._scaleSpring.current.value,c.y*=a._scaleSpring.current.value;var u=r.pixelFromPointNoRotate(s,!0),l=r.pixelFromPointNoRotate(s,!1),f=r.deltaPixelsFromPointsNoRotate(c,!0),d=r.deltaPixelsFromPointsNoRotate(c,!1),p=l.plus(d.divide(2)),h=i.squaredDistanceTo(p);n||(f=f.plus(new e.Point(1,1)));t.isRightMost&&a.wrapHorizontal&&(f.x+=.75);t.isBottomMost&&a.wrapVertical&&(f.y+=.75);t.position=u,t.size=f,t.squaredDistance=h,t.visibility=o}(v,t.source.tileOverlap,t.viewport,d,f,t),!v.loaded)if(v.context2D)r(t,v);else{var b=t._tileCache.getImageRecord(v.cacheKey);if(b)r(t,v,b.getImage())}v.loaded?function(e,t,n,r,i,o,s){var c,u,l=1e3*e.blendTime;t.blendStart||(t.blendStart=s);c=s-t.blendStart,u=l?Math.min(1,c/l):1,e.alwaysBlend&&(u*=o);if(t.opacity=u,e.lastDrawn.push(t),1===u)a(e.coverage,i,n,r,!0),e._hasOpaqueTile=!0;else if(ce.visibility)return t;if(t.visibility==e.visibility&&t.squaredDistanceo?(a=this._clip.x/this._clip.height*t.height,s=this._clip.y/this._clip.height*t.height):(a=this._clip.x/this._clip.width*t.width,s=this._clip.y/this._clip.width*t.width)),t.getAspectRatio()>o){var l=t.height/u,f=0;i.isHorizontallyCentered?f=(t.width-t.height*o)/2:i.isRight&&(f=t.width-t.height*o),this.setPosition(new e.Point(t.x-a+f,t.y-s),r),this.setHeight(l,r)}else{var d=t.width/c,p=0;i.isVerticallyCentered?p=(t.height-t.width/o)/2:i.isBottom&&(p=t.height-t.width/o),this.setPosition(new e.Point(t.x-a,t.y-s+p),r),this.setWidth(d,r)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(t){e.console.assert(!t||t instanceof e.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),t instanceof e.Rect?this._clip=t.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getOpacity:function(){return this.opacity},setOpacity:function(e){e!==this.opacity&&(this.opacity=e,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(e){this._preload=!!e,this._needsDraw=!0},getRotation:function(e){return e?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(e,t){this._degreesSpring.target.value===e&&this._degreesSpring.isAtTargetValue()||(t?this._degreesSpring.resetTo(e):this._degreesSpring.springTo(e),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(e){return this.getBoundsNoRotate(e).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(e){e!==this.compositeOperation&&(this.compositeOperation=e,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},_setScale:function(e,t){var n=this._scaleSpring.target.value===e;if(t){if(n&&this._scaleSpring.current.value===e)return;this._scaleSpring.resetTo(e),this._updateForScale(),this._needsDraw=!0}else{if(n)return;this._scaleSpring.springTo(e),this._updateForScale(),this._needsDraw=!0}n||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var e=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),t=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,n=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(t/this.minPixelRatio)/Math.log(2))));return n=Math.max(n,this.source.minLevel||0),{lowestLevel:e=Math.min(e,n),highestLevel:n}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){this.lastDrawn.pop().beingDrawn=!1}var n=this.viewport,o=this._viewportToTiledImageRectangle(n.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var a=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(null===(o=o.intersection(a)))return}for(var s=this._getLevelsInterval(),c=s.lowestLevel,u=s.highestLevel,l=null,f=!1,d=e.now(),p=u;p>=c;p--){var h=!1,g=n.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(p),!0).x*this._scaleSpring.current.value;if(p===c||!f&&g>=this.minPixelRatio)h=!0,f=!0;else if(!f)continue;var v=n.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(p),!1).x*this._scaleSpring.current.value,m=n.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,y=this.immediateRender?1:m;if(l=t(this,f,h,p,Math.min(1,(g-.5)/.5),y/Math.abs(y-v),o,d,l),i(this.coverage,p))break}!function(t,n){if(0===t.opacity||0===n.length&&!t.placeholderFillStyle)return;var r,i,o,a=n[0];a&&(r=t.opacity<1||t.compositeOperation&&"source-over"!==t.compositeOperation||!t._isBottomItem()&&a._hasTransparencyChannel());var s,c=t.viewport.getZoom(!0),u=t.viewportToImageZoom(c);n.length>1&&u>t.smoothTileEdgesMinZoom&&!t.iOSDevice&&t.getRotation(!0)%360==0&&e.supportsCanvas&&(r=!0,i=a.getScaleForEdgeSmoothing(),o=a.getTranslationForEdgeSmoothing(i,t._drawer.getCanvasSize(!1),t._drawer.getCanvasSize(!0)));r&&(i||(s=t.viewport.viewportToViewerElementRectangle(t.getClippedBounds(!0)).getIntegerBoundingBox(),t._drawer.viewer.viewport.getFlip()&&(0===t.viewport.degrees&&t.getRotation(!0)%360==0||(s.x=t._drawer.viewer.container.clientWidth-(s.x+s.width))),s=s.times(e.pixelDensityRatio)),t._drawer._clear(!0,s));i||(0!==t.viewport.degrees&&t._drawer._offsetForRotation({degrees:t.viewport.degrees,useSketch:r}),t.getRotation(!0)%360!=0&&t._drawer._offsetForRotation({degrees:t.getRotation(!0),point:t.viewport.pixelFromPointNoRotate(t._getRotationPoint(!0),!0),useSketch:r}),0===t.viewport.degrees&&t.getRotation(!0)%360==0&&t._drawer.viewer.viewport.getFlip()&&t._drawer._flip());var l=!1;if(t._clip){t._drawer.saveContext(r);var f=t.imageToViewportRectangle(t._clip,!0);f=f.rotate(-t.getRotation(!0),t._getRotationPoint(!0));var d=t._drawer.viewportToDrawerRectangle(f);i&&(d=d.times(i)),o&&(d=d.translate(o)),t._drawer.setClip(d,r),l=!0}if(t._croppingPolygons){t._drawer.saveContext(r);try{var p=t._croppingPolygons.map((function(e){return e.map((function(e){var n=t.imageToViewportCoordinates(e.x,e.y,!0).rotate(-t.getRotation(!0),t._getRotationPoint(!0)),r=t._drawer.viewportCoordToDrawerCoord(n);return i&&(r=r.times(i)),r}))}));t._drawer.clipWithPolygons(p,r)}catch(t){e.console.error(t)}l=!0}if(t.placeholderFillStyle&&!1===t._hasOpaqueTile){var h=t._drawer.viewportToDrawerRectangle(t.getBounds(!0));i&&(h=h.times(i)),o&&(h=h.translate(o));var g=null;g="function"==typeof t.placeholderFillStyle?t.placeholderFillStyle(t,t._drawer.context):t.placeholderFillStyle,t._drawer.drawRectangle(h,g,r)}for(var v=n.length-1;v>=0;v--)a=n[v],t._drawer.drawTile(a,t._drawingHandler,r,i,o),a.beingDrawn=!0,t.viewer&&t.viewer.raiseEvent("tile-drawn",{tiledImage:t,tile:a});l&&t._drawer.restoreContext(r);i||(t.getRotation(!0)%360!=0&&t._drawer._restoreRotationChanges(r),0!==t.viewport.degrees&&t._drawer._restoreRotationChanges(r));r&&(i&&(0!==t.viewport.degrees&&t._drawer._offsetForRotation({degrees:t.viewport.degrees,useSketch:!1}),t.getRotation(!0)%360!=0&&t._drawer._offsetForRotation({degrees:t.getRotation(!0),point:t.viewport.pixelFromPointNoRotate(t._getRotationPoint(!0),!0),useSketch:!1})),t._drawer.blendSketch({opacity:t.opacity,scale:i,translate:o,compositeOperation:t.compositeOperation,bounds:s}),i&&(t.getRotation(!0)%360!=0&&t._drawer._restoreRotationChanges(!1),0!==t.viewport.degrees&&t._drawer._restoreRotationChanges(!1)));i||0===t.viewport.degrees&&t.getRotation(!0)%360==0&&t._drawer.viewer.viewport.getFlip()&&t._drawer._flip();!function(t,n){if(t.debugMode)for(var r=n.length-1;r>=0;r--){var i=n[r];try{t._drawer.drawDebugInfo(i,n.length,r,t)}catch(t){e.console.error(t)}}}(t,n)}(this,this.lastDrawn),l&&!l.context2D?(!function(t,n,i){n.loading=!0,t._imageLoader.addJob({src:n.url,loadWithAjax:n.loadWithAjax,ajaxHeaders:n.ajaxHeaders,crossOriginPolicy:t.crossOriginPolicy,ajaxWithCredentials:t.ajaxWithCredentials,callback:function(o,a,s){!function(t,n,i,o,a,s){if(!o)return e.console.log("Tile %s failed to load: %s - error: %s",n,n.url,a),t.viewer.raiseEvent("tile-load-failed",{tile:n,tiledImage:t,time:i,message:a,tileRequest:s}),n.loading=!1,void(n.exists=!1);if(ithis._maxImageCacheCount){for(var s,c,u,l,f,d,p=null,h=-1,g=null,v=this._tilesLoaded.length-1;v>=0;v--)(s=(d=this._tilesLoaded[v]).tile).level<=i||s.beingDrawn||(p?(l=s.lastTouchTime,c=p.lastTouchTime,f=s.level,u=p.level,(lu)&&(p=s,h=v,g=d)):(p=s,h=v,g=d));p&&h>=0&&(this._unloadTile(g),o=h)}this._tilesLoaded[o]=new t({tile:r.tile,tiledImage:r.tiledImage})},clearTilesFor:function(t){var n;e.console.assert(t,"[TileCache.clearTilesFor] tiledImage is required");for(var r=0;r=this._items.length)throw new Error("Index bigger than number of layers.");n!==r&&-1!==r&&(this._items.splice(r,1),this._items.splice(n,0,t),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:t,previousIndex:r,newIndex:n}))},removeItem:function(t){e.console.assert(t,"[World.removeItem] item is required");var n=e.indexOf(this._items,t);-1!==n&&(t.removeHandler("bounds-change",this._delegatedFigureSizes),t.removeHandler("clip-change",this._delegatedFigureSizes),t.destroy(),this._items.splice(n,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(t))},removeAll:function(){var e,t;for(this.viewer._cancelPendingImages(),t=0;tl.height?s:s*(l.width/l.height))*(l.height/l.width),p=new e.Point(h+(s-f)/2,g+(s-d)/2),u.setPosition(p,r),u.setWidth(f,r),"horizontal"===i?h+=c:g+=c;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var t=this._homeBounds?this._homeBounds.clone():null,n=this._contentSize?this._contentSize.clone():null,r=this._contentFactor||0;if(this._items.length){var i=this._items[0],o=i.getBounds();this._contentFactor=i.getContentSize().x/o.width;for(var a=i.getClippedBounds().getBoundingBox(),s=a.x,c=a.y,u=a.x+a.width,l=a.y+a.height,f=1;f0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,i=void 0!==r&&r,o=t.center,s=void 0===o?a||t.pulsate:o,c=t.fakeElement,u=void 0!==c&&c;if("mousedown"===e.type&&m.current)m.current=!1;else{"touchstart"===e.type&&(m.current=!0);var l,f,d,p=u?null:w.current,h=p?p.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)l=Math.round(h.width/2),f=Math.round(h.height/2);else{var g=e.touches?e.touches[0]:e,v=g.clientX,x=g.clientY;l=Math.round(v-h.left),f=Math.round(x-h.top)}if(s)(d=Math.sqrt((2*Math.pow(h.width,2)+Math.pow(h.height,2))/3))%2==0&&(d+=1);else{var O=2*Math.max(Math.abs((p?p.clientWidth:0)-l),l)+2,S=2*Math.max(Math.abs((p?p.clientHeight:0)-f),f)+2;d=Math.sqrt(Math.pow(O,2)+Math.pow(S,2))}e.touches?null===b.current&&(b.current=function(){_({pulsate:i,rippleX:l,rippleY:f,rippleSize:d,cb:n})},y.current=setTimeout((function(){b.current&&(b.current(),b.current=null)}),80)):_({pulsate:i,rippleX:l,rippleY:f,rippleSize:d,cb:n})}}),[a,_]),S=o.useCallback((function(){x({},{pulsate:!0})}),[x]),C=o.useCallback((function(e,t){if(clearTimeout(y.current),"touchend"===e.type&&b.current)return e.persist(),b.current(),b.current=null,void(y.current=setTimeout((function(){C(e,t)})));b.current=null,h((function(e){return e.length>0?e.slice(1):e})),v.current=t}),[]);return o.useImperativeHandle(t,(function(){return{pulsate:S,start:x,stop:C}}),[S,x,C]),o.createElement("span",Object(r.a)({className:Object(c.a)(s.root,u),ref:w},l),o.createElement(O,{component:null,exit:!0},d))})),k=Object(f.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(o.memo(C)),T=o.forwardRef((function(e,t){var n=e.action,a=e.buttonRef,f=e.centerRipple,p=void 0!==f&&f,h=e.children,g=e.classes,v=e.className,m=e.component,y=void 0===m?"button":m,b=e.disabled,w=void 0!==b&&b,_=e.disableRipple,x=void 0!==_&&_,O=e.disableTouchRipple,S=void 0!==O&&O,E=e.focusRipple,C=void 0!==E&&E,T=e.focusVisibleClassName,j=e.onBlur,P=e.onClick,I=e.onFocus,R=e.onFocusVisible,A=e.onKeyDown,M=e.onKeyUp,D=e.onMouseDown,N=e.onMouseLeave,L=e.onMouseUp,z=e.onTouchEnd,B=e.onTouchMove,F=e.onTouchStart,W=e.onDragLeave,H=e.tabIndex,V=void 0===H?0:H,U=e.TouchRippleProps,q=e.type,G=void 0===q?"button":q,K=Object(i.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),$=o.useRef(null);var Z=o.useRef(null),X=o.useState(!1),Q=X[0],Y=X[1];w&&Q&&Y(!1);var J=Object(d.a)(),ee=J.isFocusVisible,te=J.onBlurVisible,ne=J.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;return Object(l.a)((function(r){return t&&t(r),!n&&Z.current&&Z.current[e](r),!0}))}o.useImperativeHandle(n,(function(){return{focusVisible:function(){Y(!0),$.current.focus()}}}),[]),o.useEffect((function(){Q&&C&&!x&&Z.current.pulsate()}),[x,C,Q]);var ie=re("start",D),oe=re("stop",W),ae=re("stop",L),se=re("stop",(function(e){Q&&e.preventDefault(),N&&N(e)})),ce=re("start",F),ue=re("stop",z),le=re("stop",B),fe=re("stop",(function(e){Q&&(te(e),Y(!1)),j&&j(e)}),!1),de=Object(l.a)((function(e){$.current||($.current=e.currentTarget),ee(e)&&(Y(!0),R&&R(e)),I&&I(e)})),pe=function(){var e=s.findDOMNode($.current);return y&&"button"!==y&&!("A"===e.tagName&&e.href)},he=o.useRef(!1),ge=Object(l.a)((function(e){C&&!he.current&&Q&&Z.current&&" "===e.key&&(he.current=!0,e.persist(),Z.current.stop(e,(function(){Z.current.start(e)}))),e.target===e.currentTarget&&pe()&&" "===e.key&&e.preventDefault(),A&&A(e),e.target===e.currentTarget&&pe()&&"Enter"===e.key&&!w&&(e.preventDefault(),P&&P(e))})),ve=Object(l.a)((function(e){C&&" "===e.key&&Z.current&&Q&&!e.defaultPrevented&&(he.current=!1,e.persist(),Z.current.stop(e,(function(){Z.current.pulsate(e)}))),M&&M(e),P&&e.target===e.currentTarget&&pe()&&" "===e.key&&!e.defaultPrevented&&P(e)})),me=y;"button"===me&&K.href&&(me="a");var ye={};"button"===me?(ye.type=G,ye.disabled=w):("a"===me&&K.href||(ye.role="button"),ye["aria-disabled"]=w);var be=Object(u.a)(a,t),we=Object(u.a)(ne,$),_e=Object(u.a)(be,we),xe=o.useState(!1),Oe=xe[0],Se=xe[1];o.useEffect((function(){Se(!0)}),[]);var Ee=Oe&&!x&&!w;return o.createElement(me,Object(r.a)({className:Object(c.a)(g.root,v,Q&&[g.focusVisible,T],w&&g.disabled),onBlur:fe,onClick:P,onFocus:de,onKeyDown:ge,onKeyUp:ve,onMouseDown:ie,onMouseLeave:se,onMouseUp:ae,onDragLeave:oe,onTouchEnd:ue,onTouchMove:le,onTouchStart:ce,ref:_e,tabIndex:w?-1:V},ye,K),h,Ee?o.createElement(k,Object(r.a)({ref:Z,center:p},U)):null)}));t.a=Object(f.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(T)},,,,,,,function(e,t,n){var r=n(78).Symbol;e.exports=r},function(e,t,n){var r=n(817),i=n(401),o=n(818),a=n(544),s=n(545),c=n(142),u=n(534),l=u(r),f=u(i),d=u(o),p=u(a),h=u(s),g=c;(r&&"[object DataView]"!=g(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=g(new i)||o&&"[object Promise]"!=g(o.resolve())||a&&"[object Set]"!=g(new a)||s&&"[object WeakMap]"!=g(new s))&&(g=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case l:return"[object DataView]";case f:return"[object Map]";case d:return"[object Promise]";case p:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=g},function(e,t,n){var r=n(200),i=n(168);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n0&&o(l)?n>1?e(l,n-1,o,a,s):r(s,l):a||(s[s.length]=l)}return s}},function(e,t,n){var r=n(202),i=n(550),o=n(413);e.exports=function(e,t){return o(i(e,t,r),e+"")}},function(e,t,n){"use strict";var r=n(244);n.d(t,"a",(function(){return r.b}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"e",(function(){return p})),n.d(t,"b",(function(){return h})),n.d(t,"f",(function(){return g})),n.d(t,"a",(function(){return v})),n.d(t,"d",(function(){return m}));var r=n(10),i=n(90),o=n(88),a=n(38),s=n(319),c=n(76);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return l(l({},t),n)}));function p(e){var t={};return Object.keys(Object(a.h)(e)).forEach((function(n){t[n]=Object(i.o)(e,{windowId:n})})),t}var h=Object(r.createSelector)([a.h],(function(e){return Object.values(e).filter((function(e){return!0===e.maximized})).map((function(e){return e.id}))})),g=Object(r.createSelector)([a.e,d,c.f,c.c],(function(e,t,n,r){var i=t.views,o=void 0===i?[]:i,a=t.defaultView;if(e&&e.view)return e.view;var s=(o||[]).find((function(e){return e.behaviors&&e.behaviors.some((function(e){return n===e||r.includes(e)}))}));return s&&s.key||a})),v=Object(r.createSelector)([c.f,c.c,d],(function(e,t,n){var r=n.views,i=void 0===r?[]:r,o=n.defaultView;return(i||[]).reduce((function(n,r){return r.key!==o&&r.behaviors&&!r.behaviors.some((function(n){return e===n||t.includes(n)}))||n.push(r.key),n}),[])})),m=Object(r.createSelector)([s.d,a.e,function(e){return Object(a.f)(e).length>1}],(function(e,t,n){return"elastic"===e||n&&t&&!1===t.maximized}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(155),i=n.n(r),o=n(48);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:"left-to-right";p(this,e),this.canvases=t.map((function(e){return new o.a(e)})),this.layers=n,this.viewingDirection=r,this._canvasDimensions=null}var t,n,r;return t=e,(n=[{key:"canvasIds",get:function(){return this.canvases.map((function(e){return e.id}))}},{key:"canvasDimensions",get:function(){if(this._canvasDimensions)return this._canvasDimensions;var e=l(this.canvasDirection,2),t=e[0],n=e[1],r=0===n?Math.min.apply(Math,u(this.canvases.map((function(e){return e.getHeight()})))):Math.min.apply(Math,u(this.canvases.map((function(e){return e.getWidth()})))),i=0,o=0,a=this.canvases.reduce((function(e,a){var s=0,c=0;return isNaN(a.aspectRatio)||(0===n?(s=r,c=Math.floor(r*a.aspectRatio)):(c=r,s=Math.floor(r*(1/a.aspectRatio)))),e.push({canvas:a,height:s,width:c,x:i,y:o}),i+=t*c,o+=n*s,e}),[]),c=0===n?r:Math.abs(o),f=0===t?r:Math.abs(i);return this._canvasDimensions=a.reduce((function(e,r){return e.push(s(s({},r),{},{x:-1===t?r.x+f-r.width:r.x,y:-1===n?r.y+c-r.height:r.y})),e}),[]),this._canvasDimensions}},{key:"contentResourceToWorldCoordinates",value:function(e){var t=this.canvases.findIndex((function(t){return t.imageResources.find((function(t){return t.id===e.id}))})),n=this.canvases[t];if(!n)return[];var r=l(this.canvasToWorldCoordinates(n.id),4),i=r[0],o=r[1],a=r[2],s=r[3],c=n.onFragment(e.id);return c?[i+c[0],o+c[1],c[2],c[3]]:[i,o,a,s]}},{key:"canvasToWorldCoordinates",value:function(e){var t=this.canvasDimensions.find((function(t){return t.canvas.id===e}));return[t.x,t.y,t.width,t.height]}},{key:"canvasDirection",get:function(){switch(this.viewingDirection){case"left-to-right":return[1,0];case"right-to-left":return[-1,0];case"top-to-bottom":return[0,1];case"bottom-to-top":return[0,-1];default:return[1,0]}}},{key:"contentResource",value:function(e){var t=this.canvases.find((function(t){return t.imageServiceIds.some((function(t){return i()(t,{stripAuthentication:!1})===i()(e,{stripAuthentication:!1})}))}));if(t)return t.imageResources.find((function(t){return i()(t.getServices()[0].id,{stripAuthentication:!1})===i()(e,{stripAuthentication:!1})}))}},{key:"getLayerMetadata",value:function(e){if(this.layers){var t=this.canvases.find((function(t){return t.imageResources.find((function(t){return t.id===e.id}))}));if(t){var n=t.imageResources.findIndex((function(t){return t.id===e.id})),r=this.layers[t.canvas.id],i=r&&r[e.id];return s({index:n,opacity:1,total:t.imageResources.length,visibility:!0},i)}}}},{key:"layerOpacityOfImageResource",value:function(e){var t=this.getLayerMetadata(e);return t?t.visibility?t.opacity:0:1}},{key:"layerIndexOfImageResource",value:function(e){var t=this.getLayerMetadata(e);if(t)return t.total-t.index-1}},{key:"offsetByCanvas",value:function(e){var t=this.canvasToWorldCoordinates(e);return{x:t[0],y:t[1]}}},{key:"worldBounds",value:function(){return[0,0,Math.max.apply(Math,u(this.canvasDimensions.map((function(e){return e.x+e.width})))),Math.max.apply(Math,u(this.canvasDimensions.map((function(e){return e.y+e.height}))))]}},{key:"canvasAtPoint",value:function(e){var t=this.canvasDimensions.find((function(t){return t.x<=e.x&&e.x<=t.x+t.width&&t.y<=e.y&&e.y<=t.y+t.height}));return t&&t.canvas}}])&&h(t.prototype,n),r&&h(t,r),e}()},function(e,t,n){"use strict";n.d(t,"b",(function(){return u}));var r=n(50),i=n(1),o=n(70),a=(n(2),n(136)),s={xs:0,sm:600,md:960,lg:1280,xl:1920},c={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(s[e],"px)")}};function u(e,t,n){if(Array.isArray(t)){var r=e.theme.breakpoints||c;return t.reduce((function(e,i,o){return e[r.up(r.keys[o])]=n(t[o]),e}),{})}if("object"===Object(o.a)(t)){var i=e.theme.breakpoints||c;return Object.keys(t).reduce((function(e,r){return e[i.up(r)]=n(t[r]),e}),{})}return n(t)}t.a=function(e){var t=function(t){var n=e(t),r=t.theme.breakpoints||c,o=r.keys.reduce((function(n,o){return t[o]&&((n=n||{})[r.up(o)]=e(Object(i.a)({theme:t.theme},t[o]))),n}),null);return Object(a.a)(n,o)};return t.propTypes={},t.filterProps=["xs","sm","md","lg","xl"].concat(Object(r.a)(e.filterProps)),t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(248);function i(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";t.a={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"}},function(e,t,n){"use strict";t.a={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"}},function(e,t,n){"use strict";t.a={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"}},function(e,t,n){"use strict";t.a={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"}},function(e,t,n){"use strict";t.a={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"}},function(e,t,n){"use strict";t.a={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"}},function(e,t,n){"use strict";t.a={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"}},function(e,t,n){"use strict";var r=n(13),i=n(20);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(19)).default)(o.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");t.default=a},function(e,t,n){"use strict";var r=n(13),i=n(20);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(19)).default)(o.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"SearchSharp");t.default=a},function(e,t,n){"use strict";n.d(t,"a",(function(){return P}));var r=n(0),i=n(683),o=n.n(i),a=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;nNumber(l)?l:C})}if(O||this.props.lockAspectRatio&&!x&&!S){C=w+(y-g)/r;this.setState({maxWidth:C>Number(l)?l:C})}if((S||x)&&this.resizable){C=(v-b)/r+this.resizable.size.height;this.setState({maxHeight:C>Number(f)?f:C})}if(E||this.props.lockAspectRatio&&!S&&!x){C=_+(b-v)/r;this.setState({maxHeight:C>Number(f)?f:C})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(e,t,n)},t.prototype.onResize=function(e,t,n,r){var i={x:this.originalPosition.x,y:this.originalPosition.y},o=-r.width,a=-r.height;-1!==["top","left","topLeft","bottomLeft","topRight"].indexOf(t)&&("bottomLeft"===t?i.x+=o:("topRight"===t||(i.x+=o),i.y+=a)),i.x===this.draggable.state.x&&i.y===this.draggable.state.y||this.draggable.setState(i),this.updateOffsetFromParent();var s=this.offsetFromParent,c=this.getDraggablePosition().x+s.left,u=this.getDraggablePosition().y+s.top;this.resizingPosition={x:c,y:u},this.props.onResize&&this.props.onResize(e,t,n,r,{x:c,y:u})},t.prototype.onResizeStop=function(e,t,n,r){this.setState({resizing:!1});var i=this.getMaxSizesFromProps(),o=i.maxWidth,a=i.maxHeight;this.setState({maxWidth:o,maxHeight:a}),this.props.onResizeStop&&this.props.onResizeStop(e,t,n,r,this.resizingPosition)},t.prototype.updateSize=function(e){this.resizable&&this.resizable.updateSize({width:e.width,height:e.height})},t.prototype.updatePosition=function(e){this.draggable.setState(e)},t.prototype.updateOffsetFromParent=function(){var e=this.props.scale,t=this.getParent(),n=this.getSelfElement();if(!t||null===n)return{top:0,left:0};var r=t.getBoundingClientRect(),i=r.left,o=r.top,a=n.getBoundingClientRect(),s=this.getDraggablePosition(),c=t.scrollLeft,u=t.scrollTop;this.offsetFromParent={left:a.left-i+c-s.x*e,top:a.top-o+u-s.y*e}},t.prototype.render=function(){var e=this.props,t=e.disableDragging,n=e.style,i=e.dragHandleClassName,o=e.position,a=e.onMouseDown,s=e.onMouseUp,c=e.dragAxis,u=e.dragGrid,l=e.bounds,f=e.enableUserSelectHack,d=e.cancel,p=e.children,h=(e.onResizeStart,e.onResize,e.onResizeStop,e.onDragStart,e.onDrag,e.onDragStop,e.resizeHandleStyles),g=e.resizeHandleClasses,v=e.resizeHandleComponent,m=e.enableResizing,y=e.resizeGrid,b=e.resizeHandleWrapperClass,w=e.resizeHandleWrapperStyle,_=e.scale,x=e.allowAnyClick,O=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i-1&&e%1==0&&e3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0,a=[t,n].concat(Object(o.a)(r)),s=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,(function(e){1===e.nodeType&&-1===a.indexOf(e)&&-1===s.indexOf(e.tagName)&&u(e,i)}))}function d(e,t){var n=-1;return e.some((function(e,r){return!!t(e)&&(n=r,!0)})),n}function p(e,t){var n,r=[],i=[],o=e.container;if(!t.disableScrollLock){if(function(e){var t=Object(s.a)(e);return t.body===e?Object(c.a)(t).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(o)){var u=Object(a.a)();r.push({value:o.style.paddingRight,key:"padding-right",el:o}),o.style["padding-right"]="".concat(l(o)+u,"px"),n=Object(s.a)(o).querySelectorAll(".mui-fixed"),[].forEach.call(n,(function(e){i.push(e.style.paddingRight),e.style.paddingRight="".concat(l(e)+u,"px")}))}var f=o.parentElement,d="HTML"===f.nodeName&&"scroll"===window.getComputedStyle(f)["overflow-y"]?f:o;r.push({value:d.style.overflow,key:"overflow",el:d}),d.style.overflow="hidden"}return function(){n&&[].forEach.call(n,(function(e,t){i[t]?e.style.paddingRight=i[t]:e.style.removeProperty("padding-right")})),r.forEach((function(e){var t=e.value,n=e.el,r=e.key;t?n.style.setProperty(r,t):n.style.removeProperty(r)}))}}var h=function(){function e(){Object(r.a)(this,e),this.modals=[],this.containers=[]}return Object(i.a)(e,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&u(e.modalRef,!1);var r=function(e){var t=[];return[].forEach.call(e.children,(function(e){e.getAttribute&&"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);f(t,e.mountNode,e.modalRef,r,!0);var i=d(this.containers,(function(e){return e.container===t}));return-1!==i?(this.containers[i].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblingNodes:r}),n)}},{key:"mount",value:function(e,t){var n=d(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];r.restore||(r.restore=p(r,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=d(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&u(e.modalRef,!0),f(r.container,e.mountNode,e.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(n,1);else{var i=r.modals[r.modals.length-1];i.modalRef&&u(i.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),e}()},function(e,t,n){"use strict";n.r(t),n.d(t,"OSDReferences",(function(){return r}));var r={get:function(e){return this.refs[e]},refs:{},set:function(e,t){this.refs[e]=t}}},function(e,t,n){"use strict";n.d(t,"e",(function(){return w})),n.d(t,"c",(function(){return O})),n.d(t,"b",(function(){return S})),n.d(t,"d",(function(){return E})),n.d(t,"a",(function(){return C}));var r=n(10),i=n(672),o=n.n(i),a=n(326),s=n.n(a),c=n(35),u=n(45),l=n(148),f=n(76);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(){return(h=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?y(n.nodes,t):[];return r.push.apply(r,g(o)),(i||o.length>0)&&r.push({containsVisibleCanvas:i,descendantsContainVisibleCanvas:o.length>0,id:n.id,leaf:0===n.nodes.length,parentIds:m(n)}),r}),[])}var b=Object(r.createSelector)([f.d,u.getVisibleCanvasIds],(function(e,t){return 0!==t.length&&e?y(e.nodes,t):[]})),w=Object(r.createSelector)([b],(function(e){return e.map((function(e){return e.id}))})),_=Object(r.createSelector)([b],(function(e){return e.reduce((function(e,t){return t.leaf||!t.descendantsContainVisibleCanvas?e:[].concat(g(e),[t.id])}),[])})),x=Object(r.createSelector)([b],(function(e){return e.reduce((function(e,t){return t.containsVisibleCanvas?[].concat(g(e),[t]):e}),[])}));function O(e,t,n){var r=t.companionWindowId,i=Object(l.getCompanionWindow)(e,{companionWindowId:r});return i.tocNodes?Object.keys(i.tocNodes).reduce((function(e,t){return i.tocNodes[t].expanded===n?[].concat(g(e),[t]):e}),[]):[]}function S(e,t){var n=t.companionWindowId,r=t.windowId,i=_(e,{companionWindowId:n,windowId:r}),a=O(e,{companionWindowId:n},!0),c=O(e,{companionWindowId:n},!1);return s.a.apply(void 0,[o()(a,i)].concat(g(c)))}function E(e,t){var n=h({},t),r=x(e,function(e){for(var t=1;t0){for(var o=0;o0?"tableOfContents":"item"}))},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?e.call(null):r.id=requestAnimationFrame(i)}))};return r}var x=null;function O(e){if(void 0===e&&(e=!1),null===x||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?x="positive-descending":(t.scrollLeft=1,x=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),x}return x}var S=function(e,t){return e};function E(e){var t,n,r=e.getItemOffset,i=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,c=e.getStopIndexForStartIndex,l=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return n=t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=l(n.props,Object(g.a)(Object(g.a)(n))),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:Object(g.a)(Object(g.a)(n)),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=y((function(e,t,r,i){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:i})})),n._callOnScroll=void 0,n._callOnScroll=y((function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})})),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,i=n.props,a=i.direction,s=i.itemSize,c=i.layout,u=n._getItemStyleCache(f&&s,f&&c,f&&a);if(u.hasOwnProperty(e))t=u[e];else{var l=r(n.props,e,n._instanceProps),d=o(n.props,e,n._instanceProps),p="horizontal"===a||"horizontal"===c,h="rtl"===a,g=p?l:0;u[e]=t={position:"absolute",left:h?void 0:g,right:h?g:void 0,top:p?0:l,height:p?"100%":d,width:p?d:"100%"}}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=y((function(e,t,n){return{}})),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;n.setState((function(e){if(e.scrollOffset===i)return null;var t=n.props.direction,a=i;if("rtl"===t)switch(O()){case"negative":a=-i;break;case"positive-descending":a=o-r-i}return a=Math.max(0,Math.min(a,o-r)),{isScrolling:!0,scrollDirection:e.scrollOffset0)for(var j=C;j<=k;j++)T.push(Object(u.createElement)(t,{data:f,key:h(j,f),index:j,isScrolling:b?_:void 0,style:this._getItemStyle(j)}));var P=i(this.props,this._instanceProps);return Object(u.createElement)(v||m||"div",{className:n,onScroll:O,ref:this._outerRefSetter,style:Object(p.a)({position:"relative",height:o,width:w,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:r},y)},Object(u.createElement)(s||c||"div",{children:T,ref:a,style:{height:x?"100%":P,pointerEvents:_?"none":void 0,width:x?P:"100%"}}))},n._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,s=o.scrollOffset,c=o.scrollUpdateWasRequested;this._callOnScroll(a,s,c)}},n._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,a=r.scrollOffset;if(0===t)return[0,0,0,0];var u=s(this.props,a,this._instanceProps),l=c(this.props,u,a,this._instanceProps),f=i&&"backward"!==o?1:Math.max(1,n),d=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,u-f),Math.max(0,Math.min(t-1,l+d)),u,l]},t}(u.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},n}var C=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},k=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var a=0;if(o>=0){var s=i[o];a=s.offset+s.size}for(var c=o+1;c<=t;c++){var u=r(c);i[c]={offset:a,size:u},a+=u}n.lastMeasuredIndex=t}return i[t]},T=function(e,t,n,r,i){for(;r<=n;){var o=r+Math.floor((n-r)/2),a=k(e,o,t).offset;if(a===i)return o;ai&&(n=o-1)}return r>0?r-1:0},j=function(e,t,n,r){for(var i=e.itemCount,o=1;n=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},I=E({getItemOffset:function(e,t,n){return k(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:P,getOffsetForIndexAndAlignment:function(e,t,n,r,i){var o=e.direction,a=e.height,s=e.layout,c=e.width,u="horizontal"===o||"horizontal"===s?c:a,l=k(e,t,i),f=P(e,i),d=Math.max(0,Math.min(f-u,l.offset)),p=Math.max(0,l.offset-u+l.size);switch("smart"===n&&(n=r>=p-u&&r<=d+u?"auto":"center"),n){case"start":return d;case"end":return p;case"center":return Math.round(p+(d-p)/2);case"auto":default:return r>=p&&r<=d?r:r0?r[i].offset:0)>=n?T(e,t,i,0,n):j(e,t,Math.max(0,i),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,o=e.height,a=e.itemCount,s=e.layout,c=e.width,u="horizontal"===i||"horizontal"===s?c:o,l=k(e,t,r),f=n+u,d=l.offset+l.size,p=t;pthis.containerBoundingRect().bottom)}},{key:"scrollToElement",value:function(){var e=this.props,t=e.offsetTop;if(e.scrollTo&&this.elementToScrollTo()&&!this.elementIsVisible()&&this.scrollabelContainer()){var n=this.elementToScrollTo().offsetTop-this.containerBoundingRect().height/2+t;this.scrollabelContainer().scrollTo(0,n)}}},{key:"render",value:function(){var e=this.props,t=e.children;return e.scrollTo?l.a.createElement("div",{ref:this.scrollToRef},t):t}}])&&Ie(t.prototype,n),r&&Ie(t,r),o}(u.Component);function Le(e,t){for(var n=0;n0&&l.a.createElement(rt.a,{labelValuePairs:r}),l.a.createElement(it.a,this.props))}}])&&at(t.prototype,n),r&&at(t,r),o}(u.Component);ft.defaultProps={canvasDescription:null,canvasLabel:null,canvasMetadata:[],index:1,t:function(e){return e},totalSize:1};var dt=Object(r.compose)(Object(o.a)(),Object(i.b)((function(e,t){var n=t.canvasId,r=t.id,i=t.windowId;return{canvasDescription:Object(N.getCanvasDescription)(e,{canvasId:n,companionWindowId:r,windowId:i}),canvasLabel:Object(N.getCanvasLabel)(e,{canvasId:n,companionWindowId:r,windowId:i}),canvasMetadata:Object(tt.a)(Object(N.getCanvas)(e,{canvasId:n,companionWindowId:r,windowId:i}))}})),Object(s.a)("CanvasInfo"))(ft),pt=n(456),ht=n(1137);function gt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vt(e,t){for(var n=0;n0&&l.a.createElement(l.a.Fragment,null,l.a.createElement(le.a,{variant:"subtitle2",component:"dt"},s("iiif_renderings")),i.map((function(e){return l.a.createElement(le.a,{key:e.value,variant:"body1",component:"dd"},l.a.createElement(Lt.a,{target:"_blank",rel:"noopener noreferrer",href:e.value},e.label||e.value))}))),o&&l.a.createElement(l.a.Fragment,null,l.a.createElement(le.a,{variant:"subtitle2",component:"dt"},s("iiif_seeAlso")),o.map((function(e){return l.a.createElement(le.a,{key:e.value,variant:"body1",component:"dd"},l.a.createElement(Lt.a,{target:"_blank",rel:"noopener noreferrer",href:e.value},e.label||e.value),e.format&&l.a.createElement(le.a,{component:"span"}," (".concat(e.format,")")))}))),r&&l.a.createElement(l.a.Fragment,null,l.a.createElement(le.a,{variant:"subtitle2",component:"dt"},s("iiif_manifest")),l.a.createElement(le.a,{variant:"body1",component:"dd"},l.a.createElement(Lt.a,{target:"_blank",rel:"noopener noreferrer",href:r},r)))),l.a.createElement(it.a,this.props))}}])&&Bt(t.prototype,n),r&&Bt(t,r),o}(u.Component);Ut.defaultProps={homepage:null,manifestUrl:null,renderings:null,seeAlso:null,t:function(e){return e}};var qt=Object(r.compose)(Object(a.a)({labelValueMetadata:{"& dd":{marginBottom:".5em",marginLeft:"0"}}}),Object(o.a)(),Object(i.b)((function(e,t){t.id;var n=t.windowId;return{homepage:Object(tt.e)(e,{windowId:n}),manifestUrl:Object(tt.p)(e,{windowId:n}),renderings:Object(tt.k)(e,{windowId:n}),seeAlso:Object(tt.j)(e,{windowId:n})}})),Object(s.a)("ManifestRelatedLinks"))(Ut);function Gt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kt(e,t){for(var n=0;n0&&l.a.createElement("div",{className:i.section},l.a.createElement(Nt,{id:n,windowId:t})),l.a.createElement("div",{className:i.section},l.a.createElement(Ot.a,{id:n,windowId:t})),l.a.createElement("div",{className:i.section},l.a.createElement(qt,{id:n,windowId:t})))}}])&&Kt(t.prototype,n),r&&Kt(t,r),o}(u.Component);Yt.defaultProps={availableLocales:[],canvasIds:[],classes:{},collectionPath:[],locale:"",setLocale:void 0,showLocalePicker:!1,t:function(e){return e}};var Jt=Object(r.compose)(Object(o.a)(),Object(a.a)((function(e){return{section:{borderBottom:".5px solid ".concat(e.palette.section_divider),paddingBottom:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(1),paddingTop:e.spacing(2)}}})),Object(i.b)((function(e,t){var n=t.id,r=t.windowId;return{availableLocales:Object(tt.r)(e,{companionWindowId:n,windowId:r}),canvasIds:Object(N.getVisibleCanvasIds)(e,{windowId:r}),collectionPath:(Object(oe.e)(e,{windowId:r})||{}).collectionPath,locale:Object(ie.getCompanionWindow)(e,{companionWindowId:n}).locale||Object(tt.f)(e,{windowId:r}),showLocalePicker:Object(se.c)(e,{windowId:r}).showLocalePicker}}),(function(e,t){var n=t.windowId,r=t.id;return{setLocale:function(t){return e(et.e(n,r,{locale:t}))}}})),Object(s.a)("WindowSideBarInfoPanel"))(Yt),en=n(1173),tn=n(1165),nn=n(1121),rn=n(701),on=n.n(rn),an=n(700),sn=n.n(an),cn=n(702),un=n.n(cn),ln=n(48);function fn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dn(e,t){for(var n=0;n=0?R.current[t-1]:null},q=function(){return R.current[R.current.length-1]},G=function(){return R.current[0]},K=function(e){e&&(C(e),j(e))},$=u.useRef(null),Z=u.useRef(!1),X=u.useRef([]),Q=function(e,t){var n=B,r=t.start,i=t.next,o=t.current;i&&o&&(-1===X.current.indexOf(o)&&(X.current=[]),Z.current?-1!==X.current.indexOf(i)?(n=n.filter((function(e){return e===r||e!==o})),X.current=X.current.filter((function(e){return e===r||e!==o}))):(n.push(i),X.current.push(i)):(n.push(i),X.current.push(o,i)),w&&w(e,n),F(n))},Y=function(e,t){var n=B,r=t.start,i=t.end;Z.current&&(n=B.filter((function(e){return-1===X.current.indexOf(e)})));var o=function(e,t){var n=R.current.indexOf(e),r=R.current.indexOf(t),i=Math.min(n,r),o=Math.max(n,r);return R.current.slice(i,o+1)}(r,i);X.current=o;var a=n.concat(o);a=a.filter((function(e,t){return a.indexOf(e)===t})),w&&w(e,a),F(a)},J=function(e,t){var n=[];n=-1!==B.indexOf(t)?B.filter((function(e){return e!==t})):[t].concat(B),w&&w(e,n),F(n)},ee=function(e,t){var n=y?[t]:t;w&&w(e,n),F(n)},te=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.start,i=void 0===r?$.current:r,o=t.end,a=t.current;return n?Q(e,{start:i,next:o,current:a}):Y(e,{start:i,end:o}),Z.current=!0,!0},ne=u.useCallback((function(e){var t=P.current[e],n=[];return t&&(n.push(e),t.children&&(n.concat(t.children),t.children.forEach((function(e){n.concat(ne(e))})))),n}),[]),re=u.useCallback((function(e){var t=Object(p.a)({},I.current);e.forEach((function(e){t[e]&&delete t[e]})),I.current=t}),[]),ie=u.useCallback((function(e){var t=ne(e);re(t);var n=Object(p.a)({},P.current);t.forEach((function(e){var t=n[e];if(t){if(t.parent){var r=n[t.parent];if(r&&r.children){var i=r.children.filter((function(t){return t!==e}));n[t.parent]=Object(p.a)({},r,{children:i})}}delete n[e]}})),P.current=n,j((function(t){return t===e?null:t}))}),[ne,re]),oe=u.useRef([]),ae=u.useState(!1),se=ae[0],ce=ae[1];u.useEffect((function(){var e=[];u.Children.forEach(n,(function(t){u.isValidElement(t)&&t.props.nodeId&&e.push(t.props.nodeId)})),function(e,t){if(e.length!==t.length)return!0;for(var n=0;n-1&&K(o[r])},expandAllSiblings:function(e,t){var n,r=P.current[t],i=P.current[r.parent];i?n=i.children.filter((function(e){return!W(e)})):n=P.current[-1].children.filter((function(e){return!W(e)}));var o=D.concat(n);n.length>0&&(N(o),_&&_(e,o))},toggleExpansion:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T;-1!==D.indexOf(n)?(t=D.filter((function(e){return e!==n})),C((function(e){var t=P.current[e];return e&&(t&&t.parent?t.parent.id:null)===n?n:e}))):t=[n].concat(D),_&&_(e,t),N(t)},isExpanded:W,isFocused:function(e){return T===e},isSelected:H,selectNode:v?ue:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!!t&&(n?J(e,t):ee(e,t),$.current=t,Z.current=!1,X.current=[],!0)},selectRange:v?ue:te,selectNextNode:v?ue:function(e,t){return te(e,{end:V(t),current:t},!0)},selectPreviousNode:v?ue:function(e,t){return te(e,{end:U(t),current:t},!0)},rangeSelectToFirst:v?ue:function(e,t){$.current||($.current=t);var n=Z.current?$.current:t;return te(e,{start:n,end:G()})},rangeSelectToLast:v?ue:function(e,t){$.current||($.current=t);var n=Z.current?$.current:t;return te(e,{start:n,end:q()})},selectAllNodes:v?ue:function(e){return te(e,{start:G(),end:q()})},isTabbable:function(e){return E===e},multiSelect:y,getParent:function(e){return P.current[e].parent},mapFirstChar:function(e,t){I.current[e]=t},addNodeToNodeMap:function(e,t){var n=P.current[e];P.current[e]=Object(p.a)({},n,{children:t,id:e}),t.forEach((function(t){var n=P.current[t];P.current[t]=Object(p.a)({},n,{parent:e,id:t})}))},removeNodeFromNodeMap:ie}},u.createElement("ul",Object(p.a)({role:"tree","aria-multiselectable":y,className:Object(Ee.a)(r.root,i),ref:t},O),n))})),Gn=Object(a.a)({root:{padding:0,margin:0,listStyle:"none"}},{name:"MuiTreeView"})(qn),Kn=n(217),$n=n.n(Kn),Zn=n(699),Xn=n.n(Zn),Qn=n(1127),Yn=n(24),Jn=n(36),er=n(31),tr=u.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.className,o=e.collapseIcon,a=e.endIcon,s=e.expandIcon,c=e.icon,l=e.label,f=e.nodeId,d=e.onClick,h=e.onLabelClick,g=e.onIconClick,v=e.onFocus,m=e.onKeyDown,y=e.onMouseDown,b=e.TransitionComponent,w=void 0===b?Qn.a:b,_=e.TransitionProps,x=Object(Bn.a)(e,["children","classes","className","collapseIcon","endIcon","expandIcon","icon","label","nodeId","onClick","onLabelClick","onIconClick","onFocus","onKeyDown","onMouseDown","TransitionComponent","TransitionProps"]),O=u.useContext(Wn),S=O.icons,E=O.focus,C=O.focusFirstNode,k=O.focusLastNode,T=O.focusNextNode,j=O.focusPreviousNode,P=O.focusByFirstCharacter,I=O.selectNode,R=O.selectRange,A=O.selectNextNode,M=O.selectPreviousNode,D=O.rangeSelectToFirst,N=O.rangeSelectToLast,L=O.selectAllNodes,z=O.expandAllSiblings,B=O.toggleExpansion,F=O.isExpanded,W=O.isFocused,H=O.isSelected,V=O.isTabbable,U=O.multiSelect,q=O.getParent,G=O.mapFirstChar,K=O.addNodeToNodeMap,$=O.removeNodeFromNodeMap,Z=u.useRef(null),X=u.useRef(null),Q=Object(er.a)(Z,t),Y=c,J=Boolean(Array.isArray(n)?n.length:n),ee=!!F&&F(f),te=!!W&&W(f),ne=!!V&&V(f),re=!!H&&H(f),ie=S||{},oe=Object(Jn.a)();Y||(J?(Y=ee?o||ie.defaultCollapseIcon:s||ie.defaultExpandIcon)||(Y=ie.defaultParentIcon):Y=a||ie.defaultEndIcon);var ae,se=function(e){return J&&(ee?T(f):B(e)),!0},ce=function(e){if(ee)return B(e,f),!0;var t=q(f);return!!t&&(E(t),!0)};return u.useEffect((function(){if(K){var e=[];u.Children.forEach(n,(function(t){u.isValidElement(t)&&t.props.nodeId&&e.push(t.props.nodeId)})),K(f,e)}}),[n,f,K]),u.useEffect((function(){if($)return function(){$(f)}}),[f,$]),u.useEffect((function(){G&&l&&G(f,X.current.textContent.substring(0,1).toLowerCase())}),[G,f,l]),u.useEffect((function(){te&&Z.current.focus()}),[te]),U?ae=re:re&&(ae=!0),u.createElement("li",Object(p.a)({className:Object(Ee.a)(r.root,i,ee&&r.expanded,re&&r.selected),role:"treeitem",onKeyDown:function(e){var t=!1,n=e.key;if(!e.altKey&&e.currentTarget===e.target){var r,i=e.ctrlKey||e.metaKey;switch(n){case" ":Z.current===e.currentTarget&&(t=U&&e.shiftKey?R(e,{end:f}):U?I(e,f,!0):I(e,f)),e.stopPropagation();break;case"Enter":Z.current===e.currentTarget&&J&&(B(e),t=!0),e.stopPropagation();break;case"ArrowDown":U&&e.shiftKey&&A(e,f),T(f),t=!0;break;case"ArrowUp":U&&e.shiftKey&&M(e,f),j(f),t=!0;break;case"ArrowRight":t="rtl"===oe.direction?ce(e):se(e);break;case"ArrowLeft":t="rtl"===oe.direction?se(e):ce(e);break;case"Home":U&&i&&e.shiftKey&&D(e,f),C(),t=!0;break;case"End":U&&i&&e.shiftKey&&N(e,f),k(),t=!0;break;default:"*"===n?(z(e,f),t=!0):U&&i&&"a"===n.toLowerCase()?t=L(e):!i&&!e.shiftKey&&((r=n)&&1===r.length&&r.match(/\S/))&&(P(f,n),t=!0)}t&&(e.preventDefault(),e.stopPropagation()),m&&m(e)}},onFocus:function(e){te||e.currentTarget!==e.target||E(f),v&&v(e)},"aria-expanded":J?ee:null,"aria-selected":ae,ref:Q,tabIndex:ne?0:-1},x),u.createElement("div",{className:r.content,onClick:function(e){te||E(f);var t=U&&(e.shiftKey||e.ctrlKey||e.metaKey);!J||e.defaultPrevented||t&&F(f)||B(e,f),t?e.shiftKey?R(e,{end:f}):I(e,f,!0):I(e,f),d&&d(e)},onMouseDown:function(e){(e.shiftKey||e.ctrlKey||e.metaKey)&&e.preventDefault(),y&&y(e)},ref:X},u.createElement("div",{onClick:g,className:r.iconContainer},Y),u.createElement(le.a,{onClick:h,component:"div",className:r.label},l)),n&&u.createElement(w,Object(p.a)({unmountOnExit:!0,className:r.group,in:ee,component:"ul",role:"group"},_),n))})),nr=Object(a.a)((function(e){return{root:{listStyle:"none",margin:0,padding:0,outline:0,WebkitTapHighlightColor:"transparent","&:focus > $content $label":{backgroundColor:e.palette.action.hover},"&$selected > $content $label":{backgroundColor:Object(Yn.a)(e.palette.primary.main,e.palette.action.selectedOpacity)},"&$selected > $content $label:hover, &$selected:focus > $content $label":{backgroundColor:Object(Yn.a)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},expanded:{},selected:{},group:{margin:0,padding:0,marginLeft:17},content:{width:"100%",display:"flex",alignItems:"center",cursor:"pointer"},iconContainer:{marginRight:4,width:15,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},label:{width:"100%",paddingLeft:4,position:"relative","&:hover":{backgroundColor:e.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}}}),{name:"MuiTreeItem"})(tr);function rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ir(e,t){for(var n=0;n0)&&i(t.id)}},{key:"selectTreeItem",value:function(e){var t=this.props,n=t.setCanvas,r=t.toggleNode,i=t.windowId;if(e.nodes.length>0&&r(e.id),e.data.getCanvasIds()&&0!==e.data.getCanvasIds().length&&!(e.nodes.length>0)){var o=function(e){var t=e.data.__jsonld;if(t.startCanvas&&"string"==typeof t.startCanvas)return t.startCanvas;if(t.start){if("Canvas"===t.start.type&&"string"==typeof t.start.id)return t.start.id;if("SpecificResource"===t.start.type&&"string"==typeof t.start.source)return t.start.source}return e.data.getCanvasIds()[0]}(e);n(i,-1===o.indexOf("#")?o:o.substr(0,o.indexOf("#")))}}},{key:"buildTreeItems",value:function(e,t,n,r){var i=this,o=this.props.classes;return e?e.map((function(e){return l.a.createElement(Ne,{containerRef:n,key:"".concat(e.id,"-scroll"),offsetTop:96,scrollTo:r===e.id},l.a.createElement(nr,{key:e.id,nodeId:e.id,classes:{content:o.content,group:o.group,label:o.label,root:o.treeItemRoot,selected:o.selected},label:l.a.createElement("div",{className:Object(Ee.a)((a={},s=o.visibleNode,c=-1!==t.indexOf(e.id),s in a?Object.defineProperty(a,s,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[s]=c,a))},e.label),onClick:function(){return i.selectTreeItem(e)},onKeyDown:function(t){return i.handleKeyPressed(t,e)}},e.nodes&&e.nodes.length>0?i.buildTreeItems(e.nodes,t,n,r):null));var a,s,c})):null}},{key:"render",value:function(){var e=this.props,t=e.classes,n=e.treeStructure,r=e.visibleNodeIds,i=e.expandedNodeIds,o=e.containerRef,a=e.nodeIdToScrollTo;return n?l.a.createElement(l.a.Fragment,null,l.a.createElement(Gn,{className:t.root,defaultCollapseIcon:l.a.createElement($n.a,{color:"action"}),defaultExpandIcon:l.a.createElement(Xn.a,{color:"action"}),defaultEndIcon:l.a.createElement(l.a.Fragment,null),expanded:i},this.buildTreeItems(n.nodes,r,o,a))):l.a.createElement(l.a.Fragment,null)}}])&&ir(t.prototype,n),r&&ir(t,r),o}(u.Component),lr=n(246),fr=Object(r.compose)(Object(a.a)((function(e){return{content:{alignItems:"flex-start",borderLeft:"1px solid transparent",padding:"8px 16px 8px 0",width:"auto"},group:{borderLeft:"1px solid ".concat(e.palette.grey[300])},label:{paddingLeft:0},root:{flexGrow:1},selected:{},treeItemRoot:{"&:focus > $content":{backgroundColor:e.palette.action.selected},"&:hover > $content":{backgroundColor:e.palette.action.hover},"&:hover >$content $label, &:focus > $content $label, &$selected > $content $label, &$selected > $content $label:hover, &$selected:focus > $content $label":{backgroundColor:"transparent"}},visibleNode:{backgroundColor:Object(Ln.fade)(e.palette.highlights.primary,.35),display:"inline"}}})),Object(o.a)(),Object(i.b)((function(e,t){var n=t.id,r=t.windowId;return{expandedNodeIds:Object(lr.b)(e,{companionWindowId:n,windowId:r}),nodeIdToScrollTo:Object(lr.d)(e,{companionWindowId:n,windowId:r}),treeStructure:Object(re.d)(e,{windowId:r}),visibleNodeIds:Object(lr.e)(e,{companionWindowId:n,windowId:r})}}),(function(e,t){var n=t.id,r=t.windowId;return{setCanvas:function(){return e(c.a.apply(D,arguments))},toggleNode:function(t){return e(et.d(r,n,t))}}})),Object(s.a)("SidebarIndexTableOfContents"))(ur);function dr(e,t){for(var n=0;n0?e.getLabel().getValue():e.id}}],(n=[{key:"handleSequenceChange",value:function(e){(0,this.props.updateSequence)(e.target.value)}},{key:"handleVariantChange",value:function(e,t){(0,this.props.updateVariant)(t)}},{key:"render",value:function(){var e,t=this.props,n=t.classes,r=t.collection,i=t.id,a=t.showMultipart,s=t.sequenceId,c=t.sequences,u=t.t,f=t.variant,d=t.showToc,p=t.windowId;return e="tableOfContents"===f?l.a.createElement(fr,{id:i,containerRef:this.containerRef,windowId:p}):l.a.createElement(Nn,{id:i,containerRef:this.containerRef,windowId:p}),l.a.createElement(Ge.default,{title:u("canvasIndex"),id:i,windowId:p,ref:this.containerRef,otherRef:this.containerRef,titleControls:l.a.createElement(l.a.Fragment,null,c&&c.length>1&&l.a.createElement(pt.a,null,l.a.createElement(ht.a,{MenuProps:{anchorOrigin:{horizontal:"left",vertical:"bottom"},getContentAnchorEl:null},displayEmpty:!0,value:s,onChange:this.handleSequenceChange,name:"sequenceId",classes:{select:n.select},className:n.selectEmpty},c.map((function(e,t){return l.a.createElement(Te.a,{value:e.id,key:e.id},l.a.createElement(le.a,{variant:"body2"},o.getUseableLabel(e,t)))})))),l.a.createElement("div",{className:n.break}),l.a.createElement(en.a,{value:f,onChange:this.handleVariantChange,variant:"fullWidth",indicatorColor:"primary",textColor:"primary"},d&&l.a.createElement(nn.a,{title:u("tableOfContentsList"),value:"tableOfContents"},l.a.createElement(tn.a,{className:n.variantTab,value:"tableOfContents","aria-label":u("tableOfContentsList"),"aria-controls":"tab-panel-".concat(i),icon:l.a.createElement(sn.a,{style:{transform:"scale(-1, 1)"}})})),l.a.createElement(nn.a,{title:u("itemList"),value:"item"},l.a.createElement(tn.a,{className:n.variantTab,value:"item","aria-label":u("itemList"),"aria-controls":"tab-panel-".concat(i),icon:l.a.createElement(on.a,null)})),l.a.createElement(nn.a,{title:u("thumbnailList"),value:"thumbnail"},l.a.createElement(tn.a,{className:n.variantTab,value:"thumbnail","aria-label":u("thumbnailList"),"aria-controls":"tab-panel-".concat(i),icon:l.a.createElement(kt.a,null)}))))},l.a.createElement("div",{id:"tab-panel-".concat(i)},r&&l.a.createElement(Et.a,{fullWidth:!0,onClick:a,endIcon:l.a.createElement(un.a,null)},l.a.createElement(le.a,{className:n.collectionNavigationButton},o.getUseableLabel(r))),e))}}])&&dr(t.prototype,n),r&&dr(t,r),o}(u.Component);yr.defaultProps={collection:null,sequenceId:null,sequences:[],showToc:!1};var br=Object(r.compose)(Object(o.a)(),Object(a.a)((function(e){return{break:{flexBasis:"100%",height:0},collectionNavigationButton:{textTransform:"none"},label:{paddingLeft:e.spacing(1)},select:{"&:focus":{backgroundColor:e.palette.background.paper}},selectEmpty:{backgroundColor:e.palette.background.paper},variantTab:{minWidth:"auto"}}})),Object(i.b)((function(e,t){var n=t.id,r=t.windowId,i=Object(re.d)(e,{windowId:r}),o=Object(oe.e)(e,{windowId:r}),a=e.config,s=Object(ie.getCompanionWindow)(e,{companionWindowId:n}),c=o.collectionPath||[],u=c&&c[c.length-1],l=Object(re.b)(e,{windowId:r});return{collection:u&&Object(tt.q)(e,{manifestId:u}),config:a,sequenceId:l&&l.id,sequences:Object(re.g)(e,{windowId:r}),showToc:i&&i.nodes&&i.nodes.length>0,variant:s.variant||Object(lr.a)(e,{windowId:r})}}),(function(e,t){var n=t.id,r=t.windowId;return{showMultipart:function(){return e(et.b(r,{content:"collection",position:"right"}))},updateSequence:function(t){return e(St.l(r,{sequenceId:t}))},updateVariant:function(t){return e(et.e(r,n,{variant:t}))}}})),Object(s.a)("WindowSideBarCanvasPanel"))(yr),wr=n(1169),_r=n(252);function xr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Or(e,t){for(var n=0;n0&&l.a.createElement("dl",{className:Object(z.a)("label-value-metadata")},l.a.createElement(le.a,{variant:"subtitle2",component:"dt"},s("rights")),r.map((function(e){return l.a.createElement(le.a,{variant:"body1",component:"dd",key:e.toString()},l.a.createElement(Lt.a,{target:"_blank",rel:"noopener noreferrer",href:e},e))})))),t&&l.a.createElement("div",{className:a.section},l.a.createElement(_r.Img,{src:[t],alt:"",role:"presentation",className:a.logo,unloader:l.a.createElement(wr.a,{className:a.placeholder,variant:"rect",height:60,width:60})})),l.a.createElement(it.a,this.props))}}])&&Or(t.prototype,n),r&&Or(t,r),o}(u.Component);Tr.defaultProps={classes:{},manifestLogo:null,requiredStatement:null,rights:null,t:function(e){return e}};var jr=Object(r.compose)(Object(a.a)((function(e){return{logo:{maxWidth:"100%"},placeholder:{backgroundColor:e.palette.grey[300]},section:{borderBottom:".5px solid ".concat(e.palette.section_divider),paddingBottom:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(1),paddingTop:e.spacing(2)}}})),Object(o.a)(),Object(i.b)((function(e,t){t.id;var n=t.windowId;return{manifestLogo:Object(tt.g)(e,{windowId:n}),requiredStatement:Object(tt.s)(e,{windowId:n}),rights:Object(tt.t)(e,{windowId:n})}})),Object(s.a)("AttributionPanel"))(Tr),Pr=n(563),Ir=n(371),Rr=n.n(Ir),Ar=n(180),Mr=n.n(Ar),Dr=n(68),Nr=n.n(Dr),Lr=n(27),zr=n(1122),Br=n(1163),Fr=n(757),Wr=n(354),Hr=n(43),Vr=Object(Hr.a)(u.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),Ur=(n(70),n(135)),qr=n(39),Gr=n(64);function Kr(e){return void 0!==e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function $r(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignoreAccents,n=void 0===t||t,r=e.ignoreCase,i=void 0===r||r,o=e.limit,a=e.matchFrom,s=void 0===a?"any":a,c=e.stringify,u=e.trim,l=void 0!==u&&u;return function(e,t){var r=t.inputValue,a=t.getOptionLabel,u=l?r.trim():r;i&&(u=u.toLowerCase()),n&&(u=Kr(u));var f=e.filter((function(e){var t=(c||a)(e);return i&&(t=t.toLowerCase()),n&&(t=Kr(t)),"start"===s?0===t.indexOf(u):t.indexOf(u)>-1}));return"number"==typeof o?f.slice(0,o):f}}();function Xr(e){var t=e.autoComplete,n=void 0!==t&&t,r=e.autoHighlight,i=void 0!==r&&r,o=e.autoSelect,a=void 0!==o&&o,s=e.blurOnSelect,c=void 0!==s&&s,l=e.clearOnBlur,f=void 0===l?!e.freeSolo:l,d=e.clearOnEscape,h=void 0!==d&&d,g=e.componentName,v=void 0===g?"useAutocomplete":g,m=e.debug,y=void 0!==m&&m,b=e.defaultValue,w=void 0===b?e.multiple?[]:null:b,_=e.disableClearable,x=void 0!==_&&_,O=e.disableCloseOnSelect,S=void 0!==O&&O,E=e.disabledItemsFocusable,C=void 0!==E&&E,k=e.disableListWrap,T=void 0!==k&&k,j=e.filterOptions,P=void 0===j?Zr:j,I=e.filterSelectedOptions,R=void 0!==I&&I,A=e.freeSolo,M=void 0!==A&&A,D=e.getOptionDisabled,N=e.getOptionLabel,L=void 0===N?function(e){return e}:N,z=e.getOptionSelected,B=void 0===z?function(e,t){return e===t}:z,F=e.groupBy,W=e.handleHomeEndKeys,H=void 0===W?!e.freeSolo:W,V=e.id,U=e.includeInputInList,q=void 0!==U&&U,G=e.inputValue,K=e.multiple,$=void 0!==K&&K,Z=e.onChange,X=e.onClose,Q=e.onHighlightChange,Y=e.onInputChange,J=e.onOpen,ee=e.open,te=e.openOnFocus,ne=void 0!==te&&te,re=e.options,ie=e.selectOnFocus,oe=void 0===ie?!e.freeSolo:ie,ae=e.value,se=Object(Ur.a)(V),ce=L;var ue=u.useRef(!1),le=u.useRef(!0),fe=u.useRef(null),de=u.useRef(null),pe=u.useState(null),he=pe[0],ge=pe[1],ve=u.useState(-1),me=ve[0],ye=ve[1],be=i?0:-1,we=u.useRef(be),_e=Object(Fn.a)({controlled:ae,default:w,name:v}),xe=Object(zn.a)(_e,2),Oe=xe[0],Se=xe[1],Ee=Object(Fn.a)({controlled:G,default:"",name:v,state:"inputValue"}),Ce=Object(zn.a)(Ee,2),ke=Ce[0],Te=Ce[1],je=u.useState(!1),Pe=je[0],Ie=je[1],Re=Object(qr.a)((function(e,t){var n;if($)n="";else if(null==t)n="";else{var r=ce(t);n="string"==typeof r?r:""}ke!==n&&(Te(n),Y&&Y(e,n,"reset"))}));u.useEffect((function(){Re(null,Oe)}),[Oe,Re]);var Ae=Object(Fn.a)({controlled:ee,default:!1,name:v,state:"open"}),Me=Object(zn.a)(Ae,2),De=Me[0],Ne=Me[1],Le=!$&&null!=Oe&&ke===ce(Oe),ze=De,Be=ze?P(re.filter((function(e){return!R||!($?Oe:[Oe]).some((function(t){return null!==t&&B(e,t)}))})),{inputValue:Le?"":ke,getOptionLabel:ce}):[],Fe=Object(qr.a)((function(e){-1===e?fe.current.focus():he.querySelector('[data-tag-index="'.concat(e,'"]')).focus()}));u.useEffect((function(){$&&me>Oe.length-1&&(ye(-1),Fe(-1))}),[Oe,$,me,Fe]);var We=Object(qr.a)((function(e){var t=e.event,n=e.index,r=e.reason,i=void 0===r?"auto":r;if(we.current=n,-1===n?fe.current.removeAttribute("aria-activedescendant"):fe.current.setAttribute("aria-activedescendant","".concat(se,"-option-").concat(n)),Q&&Q(t,-1===n?null:Be[n],i),de.current){var o=de.current.querySelector("[data-focus]");o&&o.removeAttribute("data-focus");var a=de.current.parentElement.querySelector('[role="listbox"]');if(a)if(-1!==n){var s=de.current.querySelector('[data-option-index="'.concat(n,'"]'));if(s&&(s.setAttribute("data-focus","true"),a.scrollHeight>a.clientHeight&&"mouse"!==i)){var c=s,u=a.clientHeight+a.scrollTop,l=c.offsetTop+c.offsetHeight;l>u?a.scrollTop=l-a.clientHeight:c.offsetTop-c.offsetHeight*(F?1.3:0)1?0:e:t>e?t===e+1&&q?-1:T||Math.abs(r)>1?e:0:t}(),o);if(We({index:c,reason:s,event:t}),n&&"reset"!==r)if(-1===c)fe.current.value=ke;else{var u=ce(Be[c]);fe.current.value=u,0===u.toLowerCase().indexOf(ke.toLowerCase())&&ke.length>0&&fe.current.setSelectionRange(ke.length,u.length)}}})),Ve=u.useCallback((function(){if(ze){var e=$?Oe[0]:Oe;if(0!==Be.length&&null!=e){if(de.current)if(R||null==e)we.current>=Be.length-1?We({index:Be.length-1}):We({index:we.current});else{var t=Be[we.current];if($&&t&&-1!==$r(Oe,(function(e){return B(t,e)})))return;var n=$r(Be,(function(t){return B(t,e)}));-1===n?He({diff:"reset"}):We({index:n})}}else He({diff:"reset"})}}),[0===Be.length,!$&&Oe,R,He,We,ze,ke,$]),Ue=Object(qr.a)((function(e){Object(Gr.a)(de,e),e&&Ve()}));u.useEffect((function(){Ve()}),[Ve]);var qe=function(e){De||(Ne(!0),J&&J(e))},Ge=function(e,t){De&&(Ne(!1),X&&X(e,t))},Ke=function(e,t,n,r){Oe!==t&&(Z&&Z(e,t,n,r),Se(t))},$e=u.useRef(!1),Ze=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"select-option",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"options",i=n,o=t;if($){var a=$r(o=Array.isArray(Oe)?Oe.slice():[],(function(e){return B(t,e)}));-1===a?o.push(t):"freeSolo"!==r&&(o.splice(a,1),i="remove-option")}Re(e,o),Ke(e,o,i,{option:t}),S||Ge(e,i),(!0===c||"touch"===c&&$e.current||"mouse"===c&&!$e.current)&&fe.current.blur()};var Xe=function(e,t){if($){Ge(e,"toggleInput");var n=me;-1===me?""===ke&&"previous"===t&&(n=Oe.length-1):((n+="next"===t?1:-1)<0&&(n=0),n===Oe.length&&(n=-1)),n=function(e,t){if(-1===e)return-1;for(var n=e;;){if("next"===t&&n===Oe.length||"previous"===t&&-1===n)return-1;var r=he.querySelector('[data-tag-index="'.concat(n,'"]'));if(!r||r.hasAttribute("tabindex")&&!r.disabled&&"true"!==r.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t),ye(n),Fe(n)}},Qe=function(e){ue.current=!0,Te(""),Y&&Y(e,"","clear"),Ke(e,$?[]:null,"clear")},Ye=function(e){return function(t){switch(-1!==me&&-1===["ArrowLeft","ArrowRight"].indexOf(t.key)&&(ye(-1),Fe(-1)),t.key){case"Home":ze&&H&&(t.preventDefault(),He({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":ze&&H&&(t.preventDefault(),He({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),He({diff:-5,direction:"previous",reason:"keyboard",event:t}),qe(t);break;case"PageDown":t.preventDefault(),He({diff:5,direction:"next",reason:"keyboard",event:t}),qe(t);break;case"ArrowDown":t.preventDefault(),He({diff:1,direction:"next",reason:"keyboard",event:t}),qe(t);break;case"ArrowUp":t.preventDefault(),He({diff:-1,direction:"previous",reason:"keyboard",event:t}),qe(t);break;case"ArrowLeft":Xe(t,"previous");break;case"ArrowRight":Xe(t,"next");break;case"Enter":if(229===t.which)break;if(-1!==we.current&&ze){var r=Be[we.current],i=!!D&&D(r);if(t.preventDefault(),i)return;Ze(t,r,"select-option"),n&&fe.current.setSelectionRange(fe.current.value.length,fe.current.value.length)}else M&&""!==ke&&!1===Le&&($&&t.preventDefault(),Ze(t,ke,"create-option","freeSolo"));break;case"Escape":ze?(t.preventDefault(),t.stopPropagation(),Ge(t,"escape")):h&&(""!==ke||$&&Oe.length>0)&&(t.preventDefault(),t.stopPropagation(),Qe(t));break;case"Backspace":if($&&""===ke&&Oe.length>0){var o=-1===me?Oe.length-1:me,a=Oe.slice();a.splice(o,1),Ke(t,a,"remove-option",{option:Oe[o]})}}e.onKeyDown&&e.onKeyDown(t)}},Je=function(e){Ie(!0),ne&&!ue.current&&qe(e)},et=function(e){null===de.current||document.activeElement!==de.current.parentElement?(Ie(!1),le.current=!0,ue.current=!1,y&&""!==ke||(a&&-1!==we.current&&ze?Ze(e,Be[we.current],"blur"):a&&M&&""!==ke?Ze(e,ke,"blur","freeSolo"):f&&Re(e,Oe),Ge(e,"blur"))):fe.current.focus()},tt=function(e){var t=e.target.value;ke!==t&&(Te(t),Y&&Y(e,t,"input")),""===t?x||$||Ke(e,null,"clear"):qe(e)},nt=function(e){We({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"mouse"})},rt=function(){$e.current=!0},it=function(e){var t=Number(e.currentTarget.getAttribute("data-option-index"));Ze(e,Be[t],"select-option"),$e.current=!1},ot=function(e){return function(t){var n=Oe.slice();n.splice(e,1),Ke(t,n,"remove-option",{option:Oe[e]})}},at=function(e){De?Ge(e,"toggleInput"):qe(e)},st=function(e){e.target.getAttribute("id")!==se&&e.preventDefault()},ct=function(){fe.current.focus(),oe&&le.current&&fe.current.selectionEnd-fe.current.selectionStart==0&&fe.current.select(),le.current=!1},ut=function(e){""!==ke&&De||at(e)},lt=M&&ke.length>0;lt=lt||($?Oe.length>0:null!==Oe);var ft=Be;if(F){new Map;ft=Be.reduce((function(e,t,n){var r=F(t);return e.length>0&&e[e.length-1].group===r?e[e.length-1].options.push(t):e.push({key:n,index:n,group:r,options:[t]}),e}),[])}return{getRootProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(p.a)({"aria-owns":ze?"".concat(se,"-popup"):null,role:"combobox","aria-expanded":ze},e,{onKeyDown:Ye(e),onMouseDown:st,onClick:ct})},getInputLabelProps:function(){return{id:"".concat(se,"-label"),htmlFor:se}},getInputProps:function(){return{id:se,value:ke,onBlur:et,onFocus:Je,onChange:tt,onMouseDown:ut,"aria-activedescendant":ze?"":null,"aria-autocomplete":n?"both":"list","aria-controls":ze?"".concat(se,"-popup"):null,autoComplete:"off",ref:fe,autoCapitalize:"none",spellCheck:"false"}},getClearProps:function(){return{tabIndex:-1,onClick:Qe}},getPopupIndicatorProps:function(){return{tabIndex:-1,onClick:at}},getTagProps:function(e){var t=e.index;return{key:t,"data-tag-index":t,tabIndex:-1,onDelete:ot(t)}},getListboxProps:function(){return{role:"listbox",id:"".concat(se,"-popup"),"aria-labelledby":"".concat(se,"-label"),ref:Ue,onMouseDown:function(e){e.preventDefault()}}},getOptionProps:function(e){var t=e.index,n=e.option,r=($?Oe:[Oe]).some((function(e){return null!=e&&B(n,e)})),i=!!D&&D(n);return{key:t,tabIndex:-1,role:"option",id:"".concat(se,"-option-").concat(t),onMouseOver:nt,onClick:it,onTouchStart:rt,"data-option-index":t,"aria-disabled":i,"aria-selected":r}},id:se,inputValue:ke,value:Oe,dirty:lt,popupOpen:ze,focused:Pe||-1!==me,anchorEl:he,setAnchorEl:ge,focusedTag:me,groupedOptions:ft}}function Qr(e){e.anchorEl,e.open;var t=Object(Bn.a)(e,["anchorEl","open"]);return u.createElement("div",t)}var Yr=u.createElement(Wr.a,{fontSize:"small"}),Jr=u.createElement(Vr,null),ei=u.forwardRef((function(e,t){e.autoComplete,e.autoHighlight,e.autoSelect,e.blurOnSelect;var n,r=e.ChipProps,i=e.classes,o=e.className,a=e.clearOnBlur,s=(void 0===a&&e.freeSolo,e.clearOnEscape,e.clearText),c=void 0===s?"Clear":s,l=e.closeIcon,d=void 0===l?Yr:l,h=e.closeText,g=void 0===h?"Close":h,v=(e.debug,e.defaultValue),m=(void 0===v&&e.multiple,e.disableClearable),y=void 0!==m&&m,b=(e.disableCloseOnSelect,e.disabled),w=void 0!==b&&b,_=(e.disabledItemsFocusable,e.disableListWrap,e.disablePortal),x=void 0!==_&&_,O=(e.filterOptions,e.filterSelectedOptions,e.forcePopupIcon),S=void 0===O?"auto":O,E=e.freeSolo,C=void 0!==E&&E,k=e.fullWidth,T=void 0!==k&&k,j=e.getLimitTagsText,P=void 0===j?function(e){return"+".concat(e)}:j,I=(e.getOptionDisabled,e.getOptionLabel),R=void 0===I?function(e){return e}:I,A=(e.getOptionSelected,e.groupBy),M=e.handleHomeEndKeys,D=(void 0===M&&e.freeSolo,e.id,e.includeInputInList,e.inputValue,e.limitTags),N=void 0===D?-1:D,L=e.ListboxComponent,z=void 0===L?"ul":L,B=e.ListboxProps,F=e.loading,W=void 0!==F&&F,H=e.loadingText,V=void 0===H?"Loading…":H,U=e.multiple,q=void 0!==U&&U,G=e.noOptionsText,K=void 0===G?"No options":G,$=(e.onChange,e.onClose,e.onHighlightChange,e.onInputChange,e.onOpen,e.open,e.openOnFocus,e.openText),Z=void 0===$?"Open":$,X=(e.options,e.PaperComponent),Q=void 0===X?f.a:X,Y=e.PopperComponent,J=void 0===Y?zr.a:Y,ee=e.popupIcon,te=void 0===ee?Jr:ee,ne=e.renderGroup,re=e.renderInput,ie=e.renderOption,oe=e.renderTags,ae=e.selectOnFocus,se=(void 0===ae&&e.freeSolo,e.size),ce=void 0===se?"medium":se,ue=(e.value,Object(Bn.a)(e,["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","classes","className","clearOnBlur","clearOnEscape","clearText","closeIcon","closeText","debug","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionLabel","getOptionSelected","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","value"])),le=x?Qr:J,fe=Xr(Object(p.a)({},e,{componentName:"Autocomplete"})),de=fe.getRootProps,pe=fe.getInputProps,he=fe.getInputLabelProps,ge=fe.getPopupIndicatorProps,ve=fe.getClearProps,me=fe.getTagProps,ye=fe.getListboxProps,be=fe.getOptionProps,we=fe.value,_e=fe.dirty,xe=fe.id,Oe=fe.popupOpen,Se=fe.focused,ke=fe.focusedTag,Te=fe.anchorEl,je=fe.setAnchorEl,Pe=fe.inputValue,Ie=fe.groupedOptions;if(q&&we.length>0){var Re=function(e){return Object(p.a)({className:Object(Ee.a)(i.tag,"small"===ce&&i.tagSizeSmall),disabled:w},me(e))};n=oe?oe(we,Re):we.map((function(e,t){return u.createElement(Ce.a,Object(p.a)({label:R(e),size:ce},Re({index:t}),r))}))}if(N>-1&&Array.isArray(n)){var Ae=n.length-N;!Se&&Ae>0&&(n=n.splice(0,N)).push(u.createElement("span",{className:i.tag,key:n.length},P(Ae)))}var Me=ne||function(e){return u.createElement("li",{key:e.key},u.createElement(Br.a,{className:i.groupLabel,component:"div"},e.group),u.createElement("ul",{className:i.groupUl},e.children))},De=ie||R,Ne=function(e,t){var n=be({option:e,index:t});return u.createElement("li",Object(p.a)({},n,{className:i.option}),De(e,{selected:n["aria-selected"],inputValue:Pe}))},Le=!y&&!w,ze=(!C||!0===S)&&!1!==S;return u.createElement(u.Fragment,null,u.createElement("div",Object(p.a)({ref:t,className:Object(Ee.a)(i.root,o,Se&&i.focused,T&&i.fullWidth,Le&&i.hasClearIcon,ze&&i.hasPopupIcon)},de(ue)),re({id:xe,disabled:w,fullWidth:!0,size:"small"===ce?"small":void 0,InputLabelProps:he(),InputProps:{ref:je,className:i.inputRoot,startAdornment:n,endAdornment:u.createElement("div",{className:i.endAdornment},Le?u.createElement(Fr.a,Object(p.a)({},ve(),{"aria-label":c,title:c,className:Object(Ee.a)(i.clearIndicator,_e&&i.clearIndicatorDirty)}),d):null,ze?u.createElement(Fr.a,Object(p.a)({},ge(),{disabled:w,"aria-label":Oe?g:Z,title:Oe?g:Z,className:Object(Ee.a)(i.popupIndicator,Oe&&i.popupIndicatorOpen)}),te):null)},inputProps:Object(p.a)({className:Object(Ee.a)(i.input,-1===ke&&i.inputFocused),disabled:w},pe())})),Oe&&Te?u.createElement(le,{className:Object(Ee.a)(i.popper,x&&i.popperDisablePortal),style:{width:Te?Te.clientWidth:null},role:"presentation",anchorEl:Te,open:!0},u.createElement(Q,{className:i.paper},W&&0===Ie.length?u.createElement("div",{className:i.loading},V):null,0!==Ie.length||C||W?null:u.createElement("div",{className:i.noOptions},K),Ie.length>0?u.createElement(z,Object(p.a)({className:i.listbox},ye(),B),Ie.map((function(e,t){return A?Me({key:e.key,group:e.group,children:e.options.map((function(t,n){return Ne(t,e.index+n)}))}):Ne(e,t)}))):null)):null)})),ti=Object(a.a)((function(e){var t;return{root:{"&$focused $clearIndicatorDirty":{visibility:"visible"},"@media (pointer: fine)":{"&:hover $clearIndicatorDirty":{visibility:"visible"}}},fullWidth:{width:"100%"},focused:{},tag:{margin:3,maxWidth:"calc(100% - 6px)"},tagSizeSmall:{margin:2,maxWidth:"calc(100% - 4px)"},hasPopupIcon:{},hasClearIcon:{},inputRoot:{flexWrap:"wrap","$hasPopupIcon &, $hasClearIcon &":{paddingRight:30},"$hasPopupIcon$hasClearIcon &":{paddingRight:56},"& $input":{width:0,minWidth:30},'&[class*="MuiInput-root"]':{paddingBottom:1,"& $input":{padding:4},"& $input:first-child":{padding:"6px 0"}},'&[class*="MuiInput-root"][class*="MuiInput-marginDense"]':{"& $input":{padding:"4px 4px 5px"},"& $input:first-child":{padding:"3px 0 6px"}},'&[class*="MuiOutlinedInput-root"]':{padding:9,"$hasPopupIcon &, $hasClearIcon &":{paddingRight:39},"$hasPopupIcon$hasClearIcon &":{paddingRight:65},"& $input":{padding:"9.5px 4px"},"& $input:first-child":{paddingLeft:6},"& $endAdornment":{right:9}},'&[class*="MuiOutlinedInput-root"][class*="MuiOutlinedInput-marginDense"]':{padding:6,"& $input":{padding:"4.5px 4px"}},'&[class*="MuiFilledInput-root"]':{paddingTop:19,paddingLeft:8,"$hasPopupIcon &, $hasClearIcon &":{paddingRight:39},"$hasPopupIcon$hasClearIcon &":{paddingRight:65},"& $input":{padding:"9px 4px"},"& $endAdornment":{right:9}},'&[class*="MuiFilledInput-root"][class*="MuiFilledInput-marginDense"]':{paddingBottom:1,"& $input":{padding:"4.5px 4px"}}},input:{flexGrow:1,textOverflow:"ellipsis",opacity:0},inputFocused:{opacity:1},endAdornment:{position:"absolute",right:0,top:"calc(50% - 14px)"},clearIndicator:{marginRight:-2,padding:4,visibility:"hidden"},clearIndicatorDirty:{},popupIndicator:{padding:2,marginRight:-2},popupIndicatorOpen:{transform:"rotate(180deg)"},popper:{zIndex:e.zIndex.modal},popperDisablePortal:{position:"absolute"},paper:Object(p.a)({},e.typography.body1,{overflow:"hidden",margin:"4px 0"}),listbox:{listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto"},loading:{color:e.palette.text.secondary,padding:"14px 16px"},noOptions:{color:e.palette.text.secondary,padding:"14px 16px"},option:(t={minHeight:48,display:"flex",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16},Object(Lr.a)(t,e.breakpoints.up("sm"),{minHeight:"auto"}),Object(Lr.a)(t,'&[aria-selected="true"]',{backgroundColor:e.palette.action.selected}),Object(Lr.a)(t,'&[data-focus="true"]',{backgroundColor:e.palette.action.hover}),Object(Lr.a)(t,"&:active",{backgroundColor:e.palette.action.selected}),Object(Lr.a)(t,'&[aria-disabled="true"]',{opacity:e.palette.action.disabledOpacity,pointerEvents:"none"}),t),groupLabel:{backgroundColor:e.palette.background.paper,top:-8},groupUl:{padding:0,"& $option":{paddingLeft:24}}}}),{name:"MuiAutocomplete"})(ei),ni=n(1158),ri=n(1168),ii=n(218),oi=n.n(ii),ai=n(709),si=n.n(ai),ci=n(710),ui=n.n(ci);function li(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fi(e,t){for(var n=0;n0}},{key:"render",value:function(){var e=this,t=this.props,n=t.numTotal,r=t.searchHits,i=t.selectedContentSearchAnnotation,o=t.classes,a=t.t,s="rtl"===t.direction?{transform:"rotate(180deg)"}:{},c=r.findIndex((function(e){return e.annotations.includes(i[0])})),u=r.length;return r.length0&&l.a.createElement(le.a,{variant:"body2",align:"center",classes:o},l.a.createElement(ve.a,{"aria-label":a("searchPreviousResult"),disabled:!this.hasPreviousResult(c),onClick:function(){return e.previousSearchResult(c)}},l.a.createElement(si.a,{style:s})),l.a.createElement("span",{style:{unicodeBidi:"plaintext"}},a("pagination",{current:c+1,total:u})),l.a.createElement(ve.a,{"aria-label":a("searchNextResult"),disabled:!this.hasNextResult(c),onClick:function(){return e.nextSearchResult(c)}},l.a.createElement(ui.a,{style:s}))))}}])&&fi(t.prototype,n),r&&fi(t,r),o}(u.Component);vi.defaultProps={classes:{},numTotal:void 0,searchHits:[],t:function(e){return e}};var mi=n(566),yi=Object(r.compose)(Object(i.b)((function(e,t){var n=t.companionWindowId,r=t.windowId;return{direction:Object(ae.h)(e),numTotal:Object(mi.i)(e,{companionWindowId:n,windowId:r}),searchHits:Object(mi.m)(e,{companionWindowId:n,windowId:r}),selectedContentSearchAnnotation:Object(mi.k)(e,{companionWindowId:n,windowId:r})}}),(function(e,t){var n=t.windowId;return{selectAnnotation:function(){for(var t=arguments.length,r=new Array(t),i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n=t.showEmpty,r=void 0!==n&&n,i=this.state.suggestions,o=Rr()(e.trim()).toLowerCase(),a=o.length;return 0!==a||r?i:[]}},{key:"fetchAutocomplete",value:function(e){var t=this.props.autocompleteService;t&&e&&fetch("".concat(t.id,"?q=").concat(e)).then((function(e){return e.json()})).then(this.receiveAutocomplete)}},{key:"receiveAutocomplete",value:function(e){this.setState({suggestions:e.terms})}},{key:"submitSearch",value:function(e){var t=this.props,n=t.companionWindowId,r=t.fetchSearch,i=t.searchService,o=t.windowId,a=this.state.search;e&&e.preventDefault(),a&&r(o,n,"".concat(i.id,"?q=").concat(a),a)}},{key:"selectItem",value:function(e,t,n){t&&Ti(t)&&this.setState({search:Ti(t)},this.submitSearch)}},{key:"render",value:function(){var e=this.props,t=e.classes,n=e.companionWindowId,r=e.searchIsFetching,i=e.t,o=e.windowId,a=this.state,s=a.search,c=a.suggestions,u="search-".concat(n);return l.a.createElement(l.a.Fragment,null,l.a.createElement("form",{onSubmit:this.submitSearch,className:t.form},l.a.createElement(ti,{id:u,inputValue:s,options:c,getOptionLabel:Ti,getOptionSelected:function(e,t){return Rr()(Ti(e).trim()).toLowerCase()===Rr()(Ti(t).trim()).toLowerCase()},noOptionsText:"",onChange:this.selectItem,onInputChange:this.handleChange,freeSolo:!0,renderInput:function(e){return l.a.createElement(ri.a,Object.assign({},e,{label:i("searchInputLabel"),InputProps:wi(wi({},e.InputProps),{},{endAdornment:l.a.createElement("div",{className:t.endAdornment},l.a.createElement(ve.a,{"aria-label":i("searchSubmitAria"),type:"submit"},l.a.createElement(oi.a,null)),Boolean(r)&&l.a.createElement(ni.a,{className:t.searchProgress,size:50}))})}))}})),l.a.createElement(yi,{windowId:o,companionWindowId:n}))}}])&&xi(t.prototype,n),r&&xi(t,r),o}(u.Component);ji.defaultProps={autocompleteService:void 0,classes:{},query:"",t:function(e){return e}};var Pi={fetchSearch:Pr.a},Ii=Object(r.compose)(Object(i.b)((function(e,t){var n=t.companionWindowId,r=t.windowId;return{autocompleteService:Object(tt.b)(e,{windowId:r}),query:Object(mi.j)(e,{companionWindowId:n,windowId:r}),searchIsFetching:Object(mi.h)(e,{companionWindowId:n,windowId:r}),searchService:Object(tt.l)(e,{windowId:r})}}),Pi),Object(a.a)((function(e){return{endAdornment:{position:"absolute",right:0},form:{paddingBottom:e.spacing(1),paddingRight:e.spacing(1.5),width:"100%"},searchProgress:{position:"absolute",right:0}}})),Object(o.a)(),Object(s.a)("SearchPanelControls"))(ji),Ri=n(1124),Ai=n(355),Mi=n.n(Ai),Di=n(366),Ni=n(1125);function Li(e){return function(e){if(Array.isArray(e))return zi(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return zi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zi(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.maxChars,o=void 0===i?200:i,a=r.minimum,s=void 0===a?20:a;Bi(this,e),this.hit=t,this.annotation=n,this.maxChars=o||200,this.minimum=s||20}var t,n,r;return t=e,(n=[{key:"match",get:function(){return this.hit.match||this.annotation&&this.annotation.resource.resource.chars||"-"}},{key:"charsOnSide",get:function(){var e=(this.maxChars-this.match.length)/2,t=[(this.hit.before||"").length,(this.hit.after||"").length].filter((function(e){return e>0}));return Math.max(Math.min.apply(Math,[e].concat(Li(t))),this.minimum)}},{key:"before",get:function(){return this.hit.before?this.hit.before.substring(this.hit.before.length-this.charsOnSide,this.hit.before.length):""}},{key:"after",get:function(){return this.hit.after?this.hit.after.substring(0,Math.min(this.hit.after.length,this.charsOnSide)):""}}])&&Fi(t.prototype,n),r&&Fi(t,r),e}();function Hi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vi(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?o.map((function(n,a){return l.a.createElement(to,{announcer:e,annotationId:n.id,companionWindowId:r,containerRef:i,key:n.id,focused:c,index:a,total:o.length,windowId:s,showDetails:t.toggleFocus})})):a.map((function(n,o){return l.a.createElement(to,{announcer:e,containerRef:i,companionWindowId:r,key:n.annotations[0],focused:c,hit:n,index:o,total:a.length,windowId:s,showDetails:t.toggleFocus})}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.classes,r=t.companionWindowId,i=t.containerRef,o=t.isFetching,a=t.fetchSearch,s=t.nextSearch,c=t.query,u=t.searchAnnotations,f=t.searchHits,d=t.searchNumTotal,p=t.t,h=t.windowId,g=this.state.focused,v=c&&!o&&0===f.length&&0===u.length;return l.a.createElement(l.a.Fragment,null,g&&l.a.createElement(Ne,{containerRef:i,offsetTop:96,scrollTo:!0},l.a.createElement(Et.a,{onClick:this.toggleFocus,className:n.navigation,size:"small"},l.a.createElement(Mi.a,null),p("backToResults"))),v&&l.a.createElement(le.a,{className:n.noResults},p("searchNoResults")),l.a.createElement(Ri.a,{disablePadding:!0},l.a.createElement(Di.b,null,(function(t){var n=t.announcePolite;return e.renderSearchHitsAndAnnotations(n)}))),s&&l.a.createElement(Et.a,{className:n.moreButton,color:"secondary",onClick:function(){return a(h,r,s,c)}},p("moreResults"),l.a.createElement("br",null),"(".concat(p("searchResultsRemaining",{numLeft:d-f.length}),")")))}}])&&no(t.prototype,n),r&&no(t,r),o}(u.Component);function uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lo(e){for(var t=1;t");return t.callbacks},t.setCallbacks=function(e){t.callbacks=e},t}Object(h.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.unbind=Yo(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(e){if(!(e instanceof Jo))throw e;this.setState({})},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(l.a.Component),na=function(e){return e+1},ra=function(e,t){var n=e.droppableId===t.droppableId,r=na(e.index),i=na(t.index);return n?"\n You have moved the item from position "+r+"\n to position "+i+"\n ":"\n You have moved the item from position "+r+"\n in list "+e.droppableId+"\n to list "+t.droppableId+"\n in position "+i+"\n "},ia=function(e,t,n){return t.droppableId===n.droppableId?"\n The item "+e+"\n has been combined with "+n.draggableId:"\n The item "+e+"\n in list "+t.droppableId+"\n has been combined with "+n.draggableId+"\n in list "+n.droppableId+"\n "},oa=function(e){return"\n The item has returned to its starting position\n of "+na(e.index)+"\n"},aa="\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n",sa=function(e){return"\n You have lifted an item in position "+na(e.source.index)+"\n"},ca=function(e){var t=e.destination;if(t)return ra(e.source,t);var n=e.combine;return n?ia(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},ua=function(e){if("CANCEL"===e.reason)return"\n Movement cancelled.\n "+oa(e.source)+"\n ";var t=e.destination,n=e.combine;return t?"\n You have dropped the item.\n "+ra(e.source,t)+"\n ":n?"\n You have dropped the item.\n "+ia(e.draggableId,e.source,n)+"\n ":"\n The item has been dropped while not over a drop area.\n "+oa(e.source)+"\n "},la={x:0,y:0},fa=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},da=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},pa=function(e,t){return e.x===t.x&&e.y===t.y},ha=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},ga=function(e,t,n){var r;return void 0===n&&(n=0),(r={})[e]=t,r["x"===e?"y":"x"]=n,r},va=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},ma=function(e,t){return Math.min.apply(Math,t.map((function(t){return va(e,t)})))},ya=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},ba=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},wa=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]},_a=function(e,t){return t&&t.shouldClipSubject?function(e,t){var n=Lo({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n}(t.pageMarginBox,e):Lo(e)},xa=function(e){var t=e.page,n=e.withPlaceholder,r=e.axis,i=e.frame,o=function(e,t,n){var r;return n&&n.increasedBy?Object(p.a)({},e,((r={})[t.end]=e[t.end]+n.increasedBy[t.line],r)):e}(function(e,t){return t?ba(e,t.scroll.diff.displacement):e}(t.marginBox,i),r,n);return{page:t,withPlaceholder:n,active:_a(o,i)}},Oa=function(e,t){e.frame||ea(!1);var n=e.frame,r=da(t,n.scroll.initial),i=ha(r),o=Object(p.a)({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}}),a=xa({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return Object(p.a)({},e,{frame:o,subject:a})};function Sa(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function Ea(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;ne.bottom,s=r.lefte.right;return!(!a||!s)||(a&&o||s&&i)}},Ha=function(e){var t=Fa(e.top,e.bottom),n=Fa(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)}},Va={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Ua={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},qa=function(e){var t=e.target,n=e.destination,r=e.viewport,i=e.withDroppableDisplacement,o=e.isVisibleThroughFrameFn,a=i?function(e,t){var n=t.frame?t.frame.scroll.diff.displacement:la;return ba(e,n)}(t,n):t;return function(e,t,n){return!!t.subject.active&&n(t.subject.active)(e)}(a,n,o)&&function(e,t,n){return n(t)(e)}(a,r,o)},Ga=function(e){return qa(Object(p.a)({},e,{isVisibleThroughFrameFn:Wa}))},Ka=function(e){return qa(Object(p.a)({},e,{isVisibleThroughFrameFn:Ha}))};function $a(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,i=e.viewport,o=e.forceShouldAnimate,a=e.last;return t.reduce((function(e,t){var s=function(e,t){var n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return Lo(zo(n,r))}(t,r),c=t.descriptor.id;if(e.all.push(c),!Ga({target:s,destination:n,viewport:i,withDroppableDisplacement:!0}))return e.invisible[t.descriptor.id]=!0,e;var u={draggableId:c,shouldAnimate:function(e,t,n){if("boolean"==typeof n)return n;if(!t)return!0;var r=t.invisible,i=t.visible;if(r[e])return!1;var o=i[e];return!o||o.shouldAnimate}(c,a,o)};return e.visible[c]=u,e}),{all:[],visible:{},invisible:{}})}function Za(e){var t=e.insideDestination,n=e.inHomeList,r=e.displacedBy,i=e.destination,o=function(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(t,{inHomeList:n});return{displaced:za,displacedBy:r,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:o}}}}function Xa(e){var t=e.draggable,n=e.insideDestination,r=e.destination,i=e.viewport,o=e.displacedBy,a=e.last,s=e.index,c=e.forceShouldAnimate,u=Na(t,r);if(null==s)return Za({insideDestination:n,inHomeList:u,displacedBy:o,destination:r});var l=Ca(n,(function(e){return e.descriptor.index===s}));if(!l)return Za({insideDestination:n,inHomeList:u,displacedBy:o,destination:r});var f=Da(t,n),d=n.indexOf(l);return{displaced:$a({afterDragging:f.slice(d),destination:r,displacedBy:o,last:a,viewport:i.frame,forceShouldAnimate:c}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:s}}}}function Qa(e,t){return Boolean(t.effected[e])}var Ya=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.draggable,i=e.draggables,o=e.destination,a=e.insideDestination,s=e.previousImpact,c=e.viewport,u=e.afterCritical,l=s.at;if(l||ea(!1),"REORDER"===l.type){var f=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.insideDestination,i=e.location;if(!r.length)return null;var o=i.index,a=t?o+1:o-1,s=r[0].descriptor.index,c=r[r.length-1].descriptor.index;return a(n?c:c+1)?null:a}({isMovingForward:t,isInHomeList:n,location:l.destination,insideDestination:a});return null==f?null:Xa({draggable:r,insideDestination:a,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:f})}var d=function(e){var t=e.isMovingForward,n=e.destination,r=e.draggables,i=e.combine,o=e.afterCritical;if(!n.isCombineEnabled)return null;var a=i.draggableId,s=r[a].descriptor.index;return Qa(a,o)?t?s:s-1:t?s+1:s}({isMovingForward:t,destination:o,displaced:s.displaced,draggables:i,combine:l.combine,afterCritical:u});return null==d?null:Xa({draggable:r,insideDestination:a,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:d})},Ja=function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,i=Ma(n);i||ea(!1);var o=i.draggableId,a=r[o].page.borderBox.center,s=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,i=e.displacedBy,o=Boolean(t.visible[r]||t.invisible[r]);return Qa(r,n)?o?la:ha(i.point):o?i.point:la}({displaced:n.displaced,afterCritical:t,combineWith:o,displacedBy:n.displacedBy});return fa(a,s)},es=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},ts=function(e,t,n){return t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2},ns=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return ga(t.line,n.marginBox[t.end]+es(t,r),ts(t,n.marginBox,r))},rs=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return ga(t.line,n.marginBox[t.start]-function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2}(t,r),ts(t,n.marginBox,r))},is=function(e){var t=e.impact,n=e.draggable,r=e.draggables,i=e.droppable,o=e.afterCritical,a=Ra(i.descriptor.id,r),s=n.page,c=i.axis;if(!a.length)return function(e){var t=e.axis,n=e.moveInto,r=e.isMoving;return ga(t.line,n.contentBox[t.start]+es(t,r),ts(t,n.contentBox,r))}({axis:c,moveInto:i.page,isMoving:s});var u=t.displaced,l=t.displacedBy,f=u.all[0];if(f){var d=r[f];if(Qa(f,o))return rs({axis:c,moveRelativeTo:d.page,isMoving:s});var p=Vo(d.page,l.point);return rs({axis:c,moveRelativeTo:p,isMoving:s})}var h=a[a.length-1];if(h.descriptor.id===n.descriptor.id)return s.borderBox.center;if(Qa(h.descriptor.id,o)){var g=Vo(h.page,ha(o.displacedBy.point));return ns({axis:c,moveRelativeTo:g,isMoving:s})}return ns({axis:c,moveRelativeTo:h.page,isMoving:s})},os=function(e,t){var n=e.frame;return n?fa(t,n.scroll.diff.displacement):t},as=function(e){var t=function(e){var t=e.impact,n=e.draggable,r=e.droppable,i=e.draggables,o=e.afterCritical,a=n.page.borderBox.center,s=t.at;return r&&s?"REORDER"===s.type?is({impact:t,draggable:n,draggables:i,droppable:r,afterCritical:o}):Ja({impact:t,draggables:i,afterCritical:o}):a}(e),n=e.droppable;return n?os(n,t):t},ss=function(e,t){var n=da(t,e.scroll.initial),r=ha(n);return{frame:Lo({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function cs(e,t){return e.map((function(e){return t[e]}))}var us=function(e){var t=e.pageBorderBoxCenter,n=e.draggable,r=function(e,t){return fa(e.scroll.diff.displacement,t)}(e.viewport,t),i=da(r,n.page.borderBox.center);return fa(n.client.borderBox.center,i)},ls=function(e){var t=e.draggable,n=e.destination,r=e.newPageBorderBoxCenter,i=e.viewport,o=e.withDroppableDisplacement,a=e.onlyOnMainAxis,s=void 0!==a&&a,c=da(r,t.page.borderBox.center),u={target:ba(t.page.borderBox,c),destination:n,withDroppableDisplacement:o,viewport:i};return s?function(e){return qa(Object(p.a)({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var n=Fa(e.top,e.bottom),r=Fa(e.left,e.right);return function(e){return t===Va?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)}})}));var t}(u):Ka(u)},fs=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,i=e.draggables,o=e.previousImpact,a=e.viewport,s=e.previousPageBorderBoxCenter,c=e.previousClientSelection,u=e.afterCritical;if(!r.isEnabled)return null;var l=Ra(r.descriptor.id,i),f=Na(n,r),d=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,i=e.insideDestination,o=e.previousImpact;if(!r.isCombineEnabled)return null;if(!Aa(o))return null;function a(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:r.descriptor.id}};return Object(p.a)({},o,{at:t})}var s=o.displaced.all,c=s.length?s[0]:null;if(t)return c?a(c):null;var u=Da(n,i);if(!c)return u.length?a(u[u.length-1].descriptor.id):null;var l=Ea(u,(function(e){return e.descriptor.id===c}));-1===l&&ea(!1);var f=l-1;return f<0?null:a(u[f].descriptor.id)}({isMovingForward:t,draggable:n,destination:r,insideDestination:l,previousImpact:o})||Ya({isMovingForward:t,isInHomeList:f,draggable:n,draggables:i,destination:r,insideDestination:l,previousImpact:o,viewport:a,afterCritical:u});if(!d)return null;var h=as({impact:d,draggable:n,droppable:r,draggables:i,afterCritical:u});if(ls({draggable:n,destination:r,newPageBorderBoxCenter:h,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:us({pageBorderBoxCenter:h,draggable:n,viewport:a}),impact:d,scrollJumpRequest:null};var g=da(h,s);return{clientSelection:c,impact:function(e){var t=e.impact,n=e.viewport,r=e.destination,i=e.draggables,o=e.maxScrollChange,a=ss(n,fa(n.scroll.current,o)),s=r.frame?Oa(r,fa(r.frame.scroll.current,o)):r,c=t.displaced,u=$a({afterDragging:cs(c.all,i),destination:r,displacedBy:t.displacedBy,viewport:a.frame,last:c,forceShouldAnimate:!1}),l=$a({afterDragging:cs(c.all,i),destination:s,displacedBy:t.displacedBy,viewport:n.frame,last:c,forceShouldAnimate:!1}),f={},d={},h=[c,u,l];return c.all.forEach((function(e){var t=function(e,t){for(var n=0;n1?l.sort((function(e,t){return ds(e)[s.start]-ds(t)[s.start]}))[0]:u.sort((function(e,t){var r=ma(n,wa(ds(e))),i=ma(n,wa(ds(t)));return r!==i?r-i:ds(e)[s.start]-ds(t)[s.start]}))[0]}({isMovingForward:t,pageBorderBoxCenter:n,source:i,droppables:a,viewport:s});if(!u)return null;var l=Ra(u.descriptor.id,o),f=function(e){var t=e.previousPageBorderBoxCenter,n=e.moveRelativeTo,r=e.insideDestination,i=e.draggable,o=e.draggables,a=e.destination,s=e.viewport,c=e.afterCritical;if(!n){if(r.length)return null;var u={displaced:za,displacedBy:La,at:{type:"REORDER",destination:{droppableId:a.descriptor.id,index:0}}},l=as({impact:u,draggable:i,droppable:a,draggables:o,afterCritical:c}),f=Na(i,a)?a:ms(a,i,o);return ls({draggable:i,destination:f,newPageBorderBoxCenter:l,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?u:null}var d,p=Boolean(t[a.axis.line]<=n.page.borderBox.center[a.axis.line]),h=(d=n.descriptor.index,n.descriptor.id===i.descriptor.id||p?d:d+1),g=gs(a.axis,i.displaceBy);return Xa({draggable:i,insideDestination:r,destination:a,viewport:s,displacedBy:g,last:za,index:h})}({previousPageBorderBoxCenter:n,destination:u,draggable:r,draggables:o,moveRelativeTo:function(e){var t=e.pageBorderBoxCenter,n=e.viewport,r=e.destination,i=e.insideDestination,o=e.afterCritical;return i.filter((function(e){return Ka({target:hs(e,o),destination:r,viewport:n.frame,withDroppableDisplacement:!0})})).sort((function(e,n){var i=va(t,os(r,ps(e,o))),a=va(t,os(r,ps(n,o)));return ir.left&&n.topr.top))return!1;if(xs(i)(t.center))return!0;var o=e.axis,a=i.center[o.crossAxisLine],s=t[o.crossAxisStart],c=t[o.crossAxisEnd],u=Fa(i[o.crossAxisStart],i[o.crossAxisEnd]),l=u(s),f=u(c);return!l&&!f||(l?sa)}));return i.length?1===i.length?i[0].descriptor.id:function(e){var t=e.pageBorderBox,n=e.draggable,r=e.candidates,i=n.page.borderBox.center,o=r.map((function(e){var n=e.axis,r=ga(e.axis.line,t.center[n.line],e.page.borderBox.center[n.crossAxisLine]);return{id:e.descriptor.id,distance:va(i,r)}})).sort((function(e,t){return t.distance-e.distance}));return o[0]?o[0].id:null}({pageBorderBox:t,draggable:n,candidates:i}):null}var Ss=function(e,t){return Lo(ba(e,t))};function Es(e){var t=e.displaced,n=e.id;return Boolean(t.visible[n]||t.invisible[n])}var Cs=function(e){var t=e.pageOffset,n=e.draggable,r=e.draggables,i=e.droppables,o=e.previousImpact,a=e.viewport,s=e.afterCritical,c=Ss(n.page.borderBox,t),u=Os({pageBorderBox:c,draggable:n,droppables:i});if(!u)return Ba;var l,f,d=i[u],p=Ra(d.descriptor.id,r),h=(l=c,(f=d.frame)?Ss(l,f.scroll.diff.value):l);return function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,r=e.previousImpact,i=e.destination,o=e.insideDestination,a=e.afterCritical;if(!i.isCombineEnabled)return null;var s=i.axis,c=gs(i.axis,t.displaceBy),u=c.value,l=n[s.start],f=n[s.end],d=Ca(Da(t,o),(function(e){var t=e.descriptor.id,n=e.page.borderBox,i=n[s.size]/4,o=Qa(t,a),c=Es({displaced:r.displaced,id:t});return o?c?f>n[s.start]+i&&fn[s.start]-u+i&&ln[s.start]+u+i&&fn[s.start]+i&&lt.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}({draggable:n,closest:Ca(Da(n,i),(function(e){var t=e.descriptor.id,n=e.page.borderBox.center[c.line],r=Qa(t,s),i=Es({displaced:o,id:t});return r?i?d<=n:f=1500)return lc;var o=uc+fc*(i/1500);return Number(("CANCEL"===r?.6*o:o).toFixed(2))}({current:i.current.client.offset,destination:m,reason:o});n(function(e){return{type:"DROP_ANIMATE",payload:e}}({newHomeClientOffset:m,dropDuration:b,completed:y}))}else n(Ys({completed:y}))}}else n(function(e){return{type:"DROP_PENDING",payload:e}}({reason:o}))}else e(r)}}},pc=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function hc(e){var t=e.onWindowScroll;var n,r=Ko((function(){t(pc())})),i=(n=r,{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(e){e.target!==window&&e.target!==window.document||n()}}),o=Qo;function a(){return o!==Qo}return{start:function(){a()&&ea(!1),o=Yo(window,[i])},stop:function(){a()||ea(!1),r.cancel(),o(),o=Qo},isActive:a}}var gc=function(e){var t=hc({onWindowScroll:function(t){e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return function(e){return function(n){t.isActive()||"INITIAL_PUBLISH"!==n.type||t.start(),t.isActive()&&function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(n)&&t.stop(),e(n)}}},vc=function(){var e=[];return{add:function(t){var n=setTimeout((function(){return function(t){var n=Ea(e,(function(e){return e.timerId===t}));-1===n&&ea(!1),e.splice(n,1)[0].callback()}(n)})),r={timerId:n,callback:t};e.push(r)},flush:function(){if(e.length){var t=[].concat(e);e.length=0,t.forEach((function(e){clearTimeout(e.timerId),e.callback()}))}}}},mc=function(e,t){Ms(),t(),Ds()},yc=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},bc=function(e,t,n,r){if(e){var i=function(e){var t=!1,n=!1,r=setTimeout((function(){n=!0})),i=function(i){t||n||(t=!0,e(i),clearTimeout(r))};return i.wasCalled=function(){return t},i}(n);e(t,{announce:i}),i.wasCalled()||n(r(t))}else n(r(t))},wc=function(e,t){var n=function(e,t){var n=vc(),r=null,i=function(n){r||ea(!1),r=null,mc(0,(function(){return bc(e().onDragEnd,n,t,ua)}))};return{beforeCapture:function(t,n){r&&ea(!1),mc(0,(function(){var r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:function(t,n){r&&ea(!1),mc(0,(function(){var r=e().onBeforeDragStart;r&&r(yc(t,n))}))},start:function(i,o){r&&ea(!1);var a=yc(i,o);r={mode:o,lastCritical:i,lastLocation:a.source,lastCombine:null},n.add((function(){mc(0,(function(){return bc(e().onDragStart,a,t,sa)}))}))},update:function(i,o){var a=Aa(o),s=Ma(o);r||ea(!1);var c=!function(e,t){if(e===t)return!0;var n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r}(i,r.lastCritical);c&&(r.lastCritical=i);var u,l,f=(u=r.lastLocation,l=a,!(null==u&&null==l||null!=u&&null!=l&&u.droppableId===l.droppableId&&u.index===l.index));f&&(r.lastLocation=a);var d=!function(e,t){return null==e&&null==t||null!=e&&null!=t&&(e.draggableId===t.draggableId&&e.droppableId===t.droppableId)}(r.lastCombine,s);if(d&&(r.lastCombine=s),c||f||d){var h=Object(p.a)({},yc(i,r.mode),{combine:s,destination:a});n.add((function(){mc(0,(function(){return bc(e().onDragUpdate,h,t,ca)}))}))}},flush:function(){r||ea(!1),n.flush()},drop:i,abort:function(){if(r){var e=Object(p.a)({},yc(r.lastCritical,r.mode),{combine:null,destination:null,reason:"CANCEL"});i(e)}}}}(e,t);return function(e){return function(t){return function(r){if("BEFORE_INITIAL_CAPTURE"!==r.type){if("INITIAL_PUBLISH"===r.type){var i=r.payload.critical;return n.beforeStart(i,r.payload.movementMode),t(r),void n.start(i,r.payload.movementMode)}if("DROP_COMPLETE"===r.type){var o=r.payload.completed.result;return n.flush(),t(r),void n.drop(o)}if(t(r),"FLUSH"!==r.type){var a=e.getState();"DRAGGING"===a.phase&&n.update(a.critical,a.impact)}else n.abort()}else n.beforeCapture(r.payload.draggableId,r.payload.movementMode)}}}},_c=function(e){return function(t){return function(n){if("DROP_ANIMATION_FINISHED"===n.type){var r=e.getState();"DROP_ANIMATING"!==r.phase&&ea(!1),e.dispatch(Ys({completed:r.completed}))}else t(n)}}},xc=function(e){var t=null,n=null;return function(r){return function(i){if("FLUSH"!==i.type&&"DROP_COMPLETE"!==i.type&&"DROP_ANIMATION_FINISHED"!==i.type||(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(i),"DROP_ANIMATE"===i.type){var o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame((function(){n=null,t=Yo(window,[o])}))}}}},Oc=function(e){return function(t){return function(n){if(t(n),"PUBLISH_WHILE_DRAGGING"===n.type){var r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(Js({reason:r.reason})))}}}},Sc=r.compose,Ec=function(e){var t,n=e.dimensionMarshal,i=e.focusMarshal,o=e.styleMarshal,a=e.getResponders,s=e.announce,c=e.autoScroller;return Object(r.createStore)(Ws,Sc(Object(r.applyMiddleware)((t=o,function(){return function(e){return function(n){"INITIAL_PUBLISH"===n.type&&t.dragging(),"DROP_ANIMATE"===n.type&&t.dropping(n.payload.completed.result.reason),"FLUSH"!==n.type&&"DROP_COMPLETE"!==n.type||t.resting(),e(n)}}}),function(e){return function(){return function(t){return function(n){"DROP_COMPLETE"!==n.type&&"FLUSH"!==n.type&&"DROP_ANIMATE"!==n.type||e.stopPublishing(),t(n)}}}}(n),function(e){return function(t){var n=t.getState,r=t.dispatch;return function(t){return function(i){if("LIFT"===i.type){var o=i.payload,a=o.id,s=o.clientSelection,c=o.movementMode,u=n();"DROP_ANIMATING"===u.phase&&r(Ys({completed:u.completed})),"IDLE"!==n().phase&&ea(!1),r({type:"FLUSH",payload:null}),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:a,movementMode:c}});var l={draggableId:a,scrollOptions:{shouldPublishImmediately:"SNAP"===c}},f=e.startPublishing(l),d=f.critical,p=f.dimensions,h=f.viewport;r(function(e){return{type:"INITIAL_PUBLISH",payload:e}}({critical:d,dimensions:p,clientSelection:s,movementMode:c,viewport:h}))}else t(i)}}}}(n),dc,_c,xc,Oc,function(e){return function(t){return function(n){return function(r){if(function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(r))return e.stop(),void n(r);if("INITIAL_PUBLISH"===r.type){n(r);var i=t.getState();return"DRAGGING"!==i.phase&&ea(!1),void e.start(i)}n(r),e.scroll(t.getState())}}}}(c),gc,function(e){var t=!1;return function(){return function(n){return function(r){if("INITIAL_PUBLISH"===r.type)return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if("FLUSH"===r.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===r.type){t=!1;var i=r.payload.completed.result;i.combine&&e.tryShiftRecord(i.draggableId,i.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}}(i),wc(a,s))))};var Cc=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,i=e.width,o=da({x:n,y:t},{x:i,y:r});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},kc=function(){var e=document.documentElement;return e||ea(!1),e},Tc=function(){var e=kc();return Cc({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},jc=function(e){var t=e.critical,n=e.scrollOptions,r=e.registry;Ms();var i,o,a,s,c,u,l,f=(i=pc(),o=Tc(),a=i.y,s=i.x,c=kc(),u=c.clientWidth,l=c.clientHeight,{frame:Lo({top:a,left:s,right:s+u,bottom:a+l}),scroll:{initial:i,current:i,max:o,diff:{value:la,displacement:la}}}),d=f.scroll.current,p=t.droppable,h=r.droppable.getAllByType(p.type).map((function(e){return e.callbacks.getDimensionAndWatchScroll(d,n)})),g=r.draggable.getAllByType(t.draggable.type).map((function(e){return e.getDimension(d)})),v={draggables:ja(g),droppables:Ta(h)};return Ds(),{dimensions:v,critical:t,viewport:f}};function Pc(e,t,n){return n.descriptor.id!==t.id&&(n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode)}var Ic,Rc,Ac=function(e,t){var n=null,r=function(e){var t=e.registry,n=e.callbacks,r={additions:{},removals:{},modified:{}},i=null,o=function(){i||(n.collectionStarting(),i=requestAnimationFrame((function(){i=null,Ms();var e=r,o=e.additions,a=e.removals,s=e.modified,c=Object.keys(o).map((function(e){return t.draggable.getById(e).getDimension(la)})).sort((function(e,t){return e.descriptor.index-t.descriptor.index})),u=Object.keys(s).map((function(e){return{droppableId:e,scroll:t.droppable.getById(e).callbacks.getScrollWhileDragging()}})),l={additions:c,removals:Object.keys(a),modified:u};r={additions:{},removals:{},modified:{}},Ds(),n.publish(l)})))};return{add:function(e){var t=e.descriptor.id;r.additions[t]=e,r.modified[e.descriptor.droppableId]=!0,r.removals[t]&&delete r.removals[t],o()},remove:function(e){var t=e.descriptor;r.removals[t.id]=!0,r.modified[t.droppableId]=!0,r.additions[t.id]&&delete r.additions[t.id],o()},stop:function(){i&&(cancelAnimationFrame(i),i=null,r={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=function(t){n||ea(!1);var i=n.critical.draggable;"ADDITION"===t.type&&Pc(e,i,t.value)&&r.add(t.value),"REMOVAL"===t.type&&Pc(e,i,t.value)&&r.remove(t.value)};return{updateDroppableIsEnabled:function(r,i){e.droppable.exists(r)||ea(!1),n&&t.updateDroppableIsEnabled({id:r,isEnabled:i})},updateDroppableIsCombineEnabled:function(r,i){n&&(e.droppable.exists(r)||ea(!1),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:i}))},scrollDroppable:function(t,r){n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:function(r,i){n&&(e.droppable.exists(r)||ea(!1),t.updateDroppableScroll({id:r,newScroll:i}))},startPublishing:function(t){n&&ea(!1);var r=e.draggable.getById(t.draggableId),o=e.droppable.getById(r.descriptor.droppableId),a={draggable:r.descriptor,droppable:o.descriptor},s=e.subscribe(i);return n={critical:a,unsubscribe:s},jc({critical:a,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:function(){if(n){r.stop();var t=n.critical.droppable;e.droppable.getAllByType(t.type).forEach((function(e){return e.callbacks.dragStopped()})),n.unsubscribe(),n=null}}}},Mc=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&(e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason)},Dc=function(e){window.scrollBy(e.x,e.y)},Nc=y((function(e){return Pa(e).filter((function(e){return!!e.isEnabled&&!!e.frame}))})),Lc=function(e){var t=e.center,n=e.destination,r=e.droppables;if(n){var i=r[n];return i.frame?i:null}return function(e,t){return Ca(Nc(t),(function(t){return t.frame||ea(!1),xs(t.frame.pageMarginBox)(e)}))}(t,r)},zc=.25,Bc=.05,Fc=28,Wc=function(e){return Math.pow(e,2)},Hc={stopDampeningAt:1200,accelerateAt:360},Vc=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,i=n-t;return 0===i?0:(r-t)/i},Uc=Hc.accelerateAt,qc=Hc.stopDampeningAt,Gc=function(e){var t=e.distanceToEdge,n=e.thresholds,r=e.dragStartTime,i=e.shouldUseTimeDampening,o=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return Fc;if(e===t.startScrollingFrom)return 1;var n=Vc({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),r=Fc*Wc(1-n);return Math.ceil(r)}(t,n);return 0===o?0:i?Math.max(function(e,t){var n=t,r=qc,i=Date.now()-n;if(i>=qc)return e;if(it.height,o=n.width>t.width;return o||i?o&&i?null:{x:o?0:r.x,y:i?0:r.y}:r}({container:n,subject:r,proposedScroll:u});return l?pa(l,la)?null:l:null},Xc=ya((function(e){return 0===e?0:e>0?1:-1})),Qc=(Ic=function(e,t){return e<0?e:e>t?e-t:0},function(e){var t=e.current,n=e.max,r=e.change,i=fa(t,r),o={x:Ic(i.x,n.x),y:Ic(i.y,n.y)};return pa(o,la)?null:o}),Yc=function(e){var t=e.max,n=e.current,r=e.change,i={x:Math.max(n.x,t.x),y:Math.max(n.y,t.y)},o=Xc(r),a=Qc({max:i,current:n,change:o});return!a||(0!==o.x&&0===a.x||0!==o.y&&0===a.y)},Jc=function(e,t){return Yc({current:e.scroll.current,max:e.scroll.max,change:t})},eu=function(e,t){var n=e.frame;return!!n&&Yc({current:n.scroll.current,max:n.scroll.max,change:t})},tu=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,i=e.scrollWindow,o=e.scrollDroppable,a=t.current.page.borderBoxCenter,s=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var c=function(e){var t=e.viewport,n=e.subject,r=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,a=Zc({dragStartTime:i,container:t.frame,subject:n,center:r,shouldUseTimeDampening:o});return a&&Jc(t,a)?a:null}({dragStartTime:n,viewport:t.viewport,subject:s,center:a,shouldUseTimeDampening:r});if(c)return void i(c)}var u=Lc({center:a,destination:bs(t.impact),droppables:t.dimensions.droppables});if(u){var l=function(e){var t=e.droppable,n=e.subject,r=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,a=t.frame;if(!a)return null;var s=Zc({dragStartTime:i,container:a.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:o});return s&&eu(t,s)?s:null}({dragStartTime:n,droppable:u,subject:s,center:a,shouldUseTimeDampening:r});l&&o(u.descriptor.id,l)}},nu=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow,i=function(e,t){if(!eu(e,t))return t;var r=function(e,t){var n=e.frame;return n&&eu(e,t)?Qc({current:n.scroll.current,max:n.scroll.max,change:t}):null}(e,t);if(!r)return n(e.descriptor.id,t),null;var i=da(t,r);return n(e.descriptor.id,i),da(t,i)},o=function(e,t,n){if(!e)return n;if(!Jc(t,n))return n;var i=function(e,t){if(!Jc(e,t))return null;var n=e.scroll.max,r=e.scroll.current;return Qc({current:r,max:n,change:t})}(t,n);if(!i)return r(n),null;var o=da(n,i);return r(o),da(n,o)};return function(e){var n=e.scrollJumpRequest;if(n){var r=bs(e.impact);r||ea(!1);var a=i(e.dimensions.droppables[r],n);if(a){var s=e.viewport,c=o(e.isWindowScrollAllowed,s,a);c&&function(e,n){var r=fa(e.current.client.selection,n);t({client:r})}(e,c)}}}},ru=function(e){var t=e.scrollDroppable,n=e.scrollWindow,r=e.move,i=function(e){var t=e.scrollWindow,n=e.scrollDroppable,r=Ko(t),i=Ko(n),o=null,a=function(e){o||ea(!1);var t=o,n=t.shouldUseTimeDampening,a=t.dragStartTime;tu({state:e,scrollWindow:r,scrollDroppable:i,dragStartTime:a,shouldUseTimeDampening:n})};return{start:function(e){Ms(),o&&ea(!1);var t=Date.now(),n=!1,r=function(){n=!0};tu({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:r,scrollDroppable:r}),o={dragStartTime:t,shouldUseTimeDampening:n},Ds(),n&&a(e)},stop:function(){o&&(r.cancel(),i.cancel(),o=null)},scroll:a}}({scrollWindow:n,scrollDroppable:t}),o=nu({move:r,scrollWindow:n,scrollDroppable:t});return{scroll:function(e){"DRAGGING"===e.phase&&("FLUID"!==e.movementMode?e.scrollJumpRequest&&o(e):i.scroll(e))},start:i.start,stop:i.stop}},iu={base:Rc="data-rbd-drag-handle",draggableId:Rc+"-draggable-id",contextId:Rc+"-context-id"},ou=function(){var e="data-rbd-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),au=function(){var e="data-rbd-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),su={contextId:"data-rbd-scroll-container-context-id"},cu=function(e,t){return e.map((function(e){var n=e.styles[t];return n?e.selector+" { "+n+" }":""})).join(" ")},uu="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?u.useLayoutEffect:u.useEffect,lu=function(){var e=document.querySelector("head");return e||ea(!1),e},fu=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function du(e,t){var n=Do((function(){return function(e){var t,n,r,i=(t=e,function(e){return"["+e+'="'+t+'"]'}),o=(n="\n cursor: -webkit-grab;\n cursor: grab;\n ",{selector:i(iu.contextId),styles:{always:"\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",resting:n,dragging:"pointer-events: none;",dropAnimating:n}}),a=[(r="\n transition: "+oc.outOfTheWay+";\n ",{selector:i(ou.contextId),styles:{dragging:r,dropAnimating:r,userCancel:r}}),o,{selector:i(au.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "}}];return{always:cu(a,"always"),resting:cu(a,"resting"),dragging:cu(a,"dragging"),dropAnimating:cu(a,"dropAnimating"),userCancel:cu(a,"userCancel")}}(e)}),[e]),r=Object(u.useRef)(null),i=Object(u.useRef)(null),o=No(y((function(e){var t=i.current;t||ea(!1),t.textContent=e})),[]),a=No((function(e){var t=r.current;t||ea(!1),t.textContent=e}),[]);uu((function(){(r.current||i.current)&&ea(!1);var s=fu(t),c=fu(t);return r.current=s,i.current=c,s.setAttribute("data-rbd-always",e),c.setAttribute("data-rbd-dynamic",e),lu().appendChild(s),lu().appendChild(c),a(n.always),o(n.resting),function(){var e=function(e){var t=e.current;t||ea(!1),lu().removeChild(t),e.current=null};e(r),e(i)}}),[t,a,o,n.always,n.resting,e]);var s=No((function(){return o(n.dragging)}),[o,n.dragging]),c=No((function(e){o("DROP"!==e?n.userCancel:n.dropAnimating)}),[o,n.dropAnimating,n.userCancel]),l=No((function(){i.current&&o(n.resting)}),[o,n.resting]);return Do((function(){return{dragging:s,dropping:c,resting:l}}),[s,c,l])}var pu=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function hu(e){return e instanceof pu(e).HTMLElement}function gu(e,t){var n="["+iu.contextId+'="'+e+'"]',r=ka(document.querySelectorAll(n));if(!r.length)return null;var i=Ca(r,(function(e){return e.getAttribute(iu.draggableId)===t}));return i&&hu(i)?i:null}function vu(){var e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach((function(t){return t(e)}))}function r(t){return e.draggables[t]||null}function i(t){return e.droppables[t]||null}return{draggable:{register:function(t){e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:function(t,n){var r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:function(t){var i=t.descriptor.id,o=r(i);o&&t.uniqueId===o.uniqueId&&(delete e.draggables[i],n({type:"REMOVAL",value:t}))},getById:function(e){var t=r(e);return t||ea(!1),t},findById:r,exists:function(e){return Boolean(r(e))},getAllByType:function(t){return Sa(e.draggables).filter((function(e){return e.descriptor.type===t}))}},droppable:{register:function(t){e.droppables[t.descriptor.id]=t},unregister:function(t){var n=i(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){var t=i(e);return t||ea(!1),t},findById:i,exists:function(e){return Boolean(i(e))},getAllByType:function(t){return Sa(e.droppables).filter((function(e){return e.descriptor.type===t}))}},subscribe:function(e){return t.push(e),function(){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var mu=l.a.createContext(null),yu=function(){var e=document.body;return e||ea(!1),e},bu={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"};var wu=0,_u={separator:"::"};function xu(e,t){return void 0===t&&(t=_u),Do((function(){return""+e+t.separator+wu++}),[t.separator,e])}var Ou=l.a.createContext(null);function Su(e){0}function Eu(e,t){Su()}function Cu(){Eu()}function ku(e){var t=Object(u.useRef)(e);return Object(u.useEffect)((function(){t.current=e})),t}var Tu,ju=((Tu={})[13]=!0,Tu[9]=!0,Tu),Pu=function(e){ju[e.keyCode]&&e.preventDefault()},Iu=function(){var e="visibilitychange";return"undefined"==typeof document?e:Ca([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],(function(e){return"on"+e in document}))||e}();var Ru,Au={type:"IDLE"};function Mu(e){var t=e.cancel,n=e.completed,r=e.getPhase,i=e.setPhase;return[{eventName:"mousemove",fn:function(e){var t=e.button,n=e.clientX,o=e.clientY;if(0===t){var a={x:n,y:o},s=r();if("DRAGGING"===s.type)return e.preventDefault(),void s.actions.move(a);"PENDING"!==s.type&&ea(!1);var c=s.point;if(u=c,l=a,Math.abs(l.x-u.x)>=5||Math.abs(l.y-u.y)>=5){var u,l;e.preventDefault();var f=s.actions.fluidLift(a);i({type:"DRAGGING",actions:f})}}}},{eventName:"mouseup",fn:function(e){var i=r();"DRAGGING"===i.type?(e.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"mousedown",fn:function(e){"DRAGGING"===r().type&&e.preventDefault(),t()}},{eventName:"keydown",fn:function(e){if("PENDING"!==r().type)return 27===e.keyCode?(e.preventDefault(),void t()):void Pu(e);t()}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){"PENDING"===r().type&&t()}},{eventName:"webkitmouseforcedown",fn:function(e){var n=r();"IDLE"===n.type&&ea(!1),n.actions.shouldRespectForcePress()?t():e.preventDefault()}},{eventName:Iu,fn:t}]}function Du(){}var Nu=((Ru={})[34]=!0,Ru[33]=!0,Ru[36]=!0,Ru[35]=!0,Ru);function Lu(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:function(r){return 27===r.keyCode?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(Nu[r.keyCode]?r.preventDefault():Pu(r))}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:Iu,fn:n}]}var zu={type:"IDLE"};var Bu={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function Fu(e,t){var n=t.target;return!!hu(n)&&function e(t,n){if(null==n)return!1;if(Boolean(Bu[n.tagName.toLowerCase()]))return!0;var r=n.getAttribute("contenteditable");return"true"===r||""===r||n!==t&&e(t,n.parentElement)}(e,n)}var Wu=function(e){return Lo(e.getBoundingClientRect()).center};var Hu="undefined"==typeof document?"matches":Ca(["matches","msMatchesSelector","webkitMatchesSelector"],(function(e){return e in Element.prototype}))||"matches";function Vu(e,t){return e.closest?e.closest(t):function e(t,n){return null==t?null:t[Hu](n)?t:e(t.parentElement,n)}(e,t)}function Uu(e,t){var n,r=t.target;if(!((n=r)instanceof pu(n).Element))return null;var i=Vu(r,function(e){return"["+iu.contextId+'="'+e+'"]'}(e));return i&&hu(i)?i:null}function qu(e){e.preventDefault()}function Gu(e){var t=e.expected,n=e.phase,r=e.isLockActive;e.shouldWarn;return!!r()&&t===n}function Ku(e){var t=e.lockAPI,n=e.store,r=e.registry,i=e.draggableId;if(t.isClaimed())return!1;var o=r.draggable.findById(i);return!!o&&(!!o.options.isEnabled&&!!Mc(n.getState(),i))}function $u(e){var t=e.lockAPI,n=e.contextId,r=e.store,i=e.registry,o=e.draggableId,a=e.forceSensorStop,s=e.sourceEvent;if(!Ku({lockAPI:t,store:r,registry:i,draggableId:o}))return null;var c=i.draggable.getById(o),u=function(e,t){var n="["+ou.contextId+'="'+e+'"]',r=Ca(ka(document.querySelectorAll(n)),(function(e){return e.getAttribute(ou.id)===t}));return r&&hu(r)?r:null}(n,c.descriptor.id);if(!u)return null;if(s&&!c.options.canDragInteractiveElements&&Fu(u,s))return null;var l=t.claim(a||Qo),f="PRE_DRAG";function d(){return c.options.shouldRespectForcePress}function h(){return t.isActive(l)}var g=function(e,t){Gu({expected:e,phase:f,isLockActive:h,shouldWarn:!0})&&r.dispatch(t())}.bind(null,"DRAGGING");function v(e){function n(){t.release(),f="COMPLETED"}function i(t,i){if(void 0===i&&(i={shouldBlockNextClick:!1}),e.cleanup(),i.shouldBlockNextClick){var o=Yo(window,[{eventName:"click",fn:qu,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(o)}n(),r.dispatch(Js({reason:t}))}return"PRE_DRAG"!==f&&(n(),"PRE_DRAG"!==f&&ea(!1)),r.dispatch(function(e){return{type:"LIFT",payload:e}}(e.liftActionArgs)),f="DRAGGING",Object(p.a)({isActive:function(){return Gu({expected:"DRAGGING",phase:f,isLockActive:h,shouldWarn:!1})},shouldRespectForcePress:d,drop:function(e){return i("DROP",e)},cancel:function(e){return i("CANCEL",e)}},e.actions)}return{isActive:function(){return Gu({expected:"PRE_DRAG",phase:f,isLockActive:h,shouldWarn:!1})},shouldRespectForcePress:d,fluidLift:function(e){var t=Ko((function(e){g((function(){return Ks({client:e})}))})),n=v({liftActionArgs:{id:o,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return Object(p.a)({},n,{move:t})},snapLift:function(){var e={moveUp:function(){return g($s)},moveRight:function(){return g(Xs)},moveDown:function(){return g(Zs)},moveLeft:function(){return g(Qs)}};return v({liftActionArgs:{id:o,clientSelection:Wu(u),movementMode:"SNAP"},cleanup:Qo,actions:e})},abort:function(){Gu({expected:"PRE_DRAG",phase:f,isLockActive:h,shouldWarn:!0})&&t.release()}}}var Zu=[function(e){var t=Object(u.useRef)(Au),n=Object(u.useRef)(Qo),r=Do((function(){return{eventName:"mousedown",fn:function(t){if(!t.defaultPrevented&&0===t.button&&!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var r=e.findClosestDraggableId(t);if(r){var i=e.tryGetLock(r,a,{sourceEvent:t});if(i){t.preventDefault();var o={x:t.clientX,y:t.clientY};n.current(),l(i,o)}}}}}}),[e]),i=Do((function(){return{eventName:"webkitmouseforcewillbegin",fn:function(t){if(!t.defaultPrevented){var n=e.findClosestDraggableId(t);if(n){var r=e.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||e.canGetLock(n)&&t.preventDefault())}}}}}),[e]),o=No((function(){n.current=Yo(window,[i,r],{passive:!1,capture:!0})}),[i,r]),a=No((function(){"IDLE"!==t.current.type&&(t.current=Au,n.current(),o())}),[o]),s=No((function(){var e=t.current;a(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[a]),c=No((function(){var e=Mu({cancel:s,completed:a,getPhase:function(){return t.current},setPhase:function(e){t.current=e}});n.current=Yo(window,e,{capture:!0,passive:!1})}),[s,a]),l=No((function(e,n){"IDLE"!==t.current.type&&ea(!1),t.current={type:"PENDING",point:n,actions:e},c()}),[c]);uu((function(){return o(),function(){n.current()}}),[o])},function(e){var t=Object(u.useRef)(Du),n=Do((function(){return{eventName:"keydown",fn:function(n){if(!n.defaultPrevented&&32===n.keyCode){var i=e.findClosestDraggableId(n);if(i){var o=e.tryGetLock(i,c,{sourceEvent:n});if(o){n.preventDefault();var a=!0,s=o.snapLift();t.current(),t.current=Yo(window,Lu(s,c),{capture:!0,passive:!1})}}}function c(){a||ea(!1),a=!1,t.current(),r()}}}}),[e]),r=No((function(){t.current=Yo(window,[n],{passive:!1,capture:!0})}),[n]);uu((function(){return r(),function(){t.current()}}),[r])},function(e){var t=Object(u.useRef)(zu),n=Object(u.useRef)(Qo),r=No((function(){return t.current}),[]),i=No((function(e){t.current=e}),[]),o=Do((function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var r=e.findClosestDraggableId(t);if(r){var i=e.tryGetLock(r,s,{sourceEvent:t});if(i){var o=t.touches[0],a={x:o.clientX,y:o.clientY};n.current(),d(i,a)}}}}}}),[e]),a=No((function(){n.current=Yo(window,[o],{capture:!0,passive:!1})}),[o]),s=No((function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),i(zu),n.current(),a())}),[a,i]),c=No((function(){var e=t.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[s]),l=No((function(){var e={capture:!0,passive:!1},t={cancel:c,completed:s,getPhase:r},i=Yo(window,function(e){var t=e.cancel,n=e.completed,r=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(e){var n=r();if("DRAGGING"===n.type){n.hasMoved=!0;var i=e.touches[0],o={x:i.clientX,y:i.clientY};e.preventDefault(),n.actions.move(o)}else t()}},{eventName:"touchend",fn:function(e){var i=r();"DRAGGING"===i.type?(e.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"touchcancel",fn:function(e){"DRAGGING"===r().type?(e.preventDefault(),t()):t()}},{eventName:"touchforcechange",fn:function(e){var n=r();"IDLE"===n.type&&ea(!1);var i=e.touches[0];if(i&&i.force>=.15){var o=n.actions.shouldRespectForcePress();if("PENDING"!==n.type)return o?n.hasMoved?void e.preventDefault():void t():void e.preventDefault();o&&t()}}},{eventName:Iu,fn:t}]}(t),e),o=Yo(window,function(e){var t=e.cancel,n=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(e){e.preventDefault()}},{eventName:"keydown",fn:function(e){"DRAGGING"===n().type?(27===e.keyCode&&e.preventDefault(),t()):t()}},{eventName:Iu,fn:t}]}(t),e);n.current=function(){i(),o()}}),[c,r,s]),f=No((function(){var e=r();"PENDING"!==e.type&&ea(!1);var t=e.actions.fluidLift(e.point);i({type:"DRAGGING",actions:t,hasMoved:!1})}),[r,i]),d=No((function(e,t){"IDLE"!==r().type&&ea(!1);var n=setTimeout(f,120);i({type:"PENDING",point:t,actions:e,longPressTimerId:n}),l()}),[l,r,i,f]);uu((function(){return a(),function(){n.current();var e=r();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),i(zu))}}),[r,a,i]),uu((function(){return Yo(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])}),[])}];function Xu(e){var t=e.contextId,n=e.store,r=e.registry,i=e.customSensors,o=e.enableDefaultSensors,a=[].concat(o?Zu:[],i||[]),s=Object(u.useState)((function(){return function(){var e=null;function t(){e||ea(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&ea(!1);var n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()}))[0],c=No((function(e,t){e.isDragging&&!t.isDragging&&s.tryAbandon()}),[s]);uu((function(){var e=n.getState();return n.subscribe((function(){var t=n.getState();c(e,t),e=t}))}),[s,n,c]),uu((function(){return s.tryAbandon}),[s.tryAbandon]);var l=No((function(e){return Ku({lockAPI:s,registry:r,store:n,draggableId:e})}),[s,r,n]),f=No((function(e,i,o){return $u({lockAPI:s,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:i,sourceEvent:o&&o.sourceEvent?o.sourceEvent:null})}),[t,s,r,n]),d=No((function(e){return function(e,t){var n=Uu(e,t);return n?n.getAttribute(iu.draggableId):null}(t,e)}),[t]),p=No((function(e){var t=r.draggable.findById(e);return t?t.options:null}),[r.draggable]),h=No((function(){s.isClaimed()&&(s.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch({type:"FLUSH",payload:null}))}),[s,n]),g=No(s.isClaimed,[s]),v=Do((function(){return{canGetLock:l,tryGetLock:f,findClosestDraggableId:d,findOptionsForDraggable:p,tryReleaseLock:h,isLockClaimed:g}}),[l,f,d,p,h,g]);Su();for(var m=0;me.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?e.getLabel().getValue():String(t+1)}}],(n=[{key:"handleOpacityChange",value:function(e,t){var n=this.props,r=n.canvasId;(0,n.updateLayers)(n.windowId,r,Vl({},e,{opacity:t/100}))}},{key:"onDragEnd",value:function(e){var t=this.props,n=t.canvasId,r=t.layers,i=t.updateLayers,o=t.windowId;if(e.destination&&e.destination.droppableId===this.droppableId&&e.source.droppableId===this.droppableId){var a=Yl(r.map((function(e){return e.id})),e.source.index,e.destination.index);i(o,n,r.reduce((function(e,t){return e[t.id]={index:a.indexOf(t.id)},e}),{}))}}},{key:"setLayerVisibility",value:function(e,t){var n=this.props,r=n.canvasId;(0,n.updateLayers)(n.windowId,r,Vl({},e,{visibility:t}))}},{key:"moveToTop",value:function(e){var t=this.props,n=t.canvasId,r=t.layers,i=t.updateLayers,o=t.windowId,a=Yl(r.map((function(e){return e.id})),r.findIndex((function(t){return t.id===e})),0);i(o,n,r.reduce((function(e,t){return e[t.id]={index:a.indexOf(t.id)},e}),{}))}},{key:"renderLayer",value:function(e,t){var n=this,r=this.props,i=r.classes,a=r.layerMetadata,s=r.t,c={height:void 0,width:50},u=c.width,f=c.height,d=function(e){for(var t=1;t1&&l.a.createElement(le.a,{className:n.sectionHeading,variant:"overline"},a("annotationCanvasLabel",{context:"".concat(r+1,"/").concat(s),label:i})),l.a.createElement(el,{onDragEnd:this.onDragEnd},l.a.createElement(Wl,{droppableId:this.droppableId},(function(t,r){return l.a.createElement(Ri.a,Object.assign({className:n.list},t.droppableProps,{ref:t.innerRef}),o&&o.map((function(t,n){return e.renderDraggableLayer(t,n)})),t.placeholder)}))))}}])&&Ul(t.prototype,n),r&&Ul(t,r),o}(u.Component);function ef(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tf(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pf(e,t){for(var n=0;n0?e.getLabel().getValue():e.id}}],(n=[{key:"isMultipart",value:function(){var e=this.props.collection;if(!e)return!1;var t=e.getProperty("behavior");return Array.isArray(t)?e.includes("multi-part"):"multi-part"===t}},{key:"render",value:function(){var e=this.props,t=e.canvasNavigation,n=e.classes,r=e.collectionPath,i=e.collection,a=e.id,s=e.isFetching,c=e.manifestId,u=e.parentCollection,f=e.updateCompanionWindow,d=e.updateWindow,p=e.t,h=e.variant,g=e.windowId,v=function(e){var r=e.manifest,i=Tf(e,Ef);return l.a.createElement(Te.a,Object.assign({className:n.menuItem,alignItems:"flex-start",button:!0,component:"li",selected:c===r.id},i),"thumbnail"===h&&l.a.createElement(xf.a,null,l.a.createElement(L.a,{resource:r,maxHeight:t.height,maxWidth:t.width})),l.a.createElement(je.a,null,o.getUseableLabel(r)))};return l.a.createElement(Ge.default,{title:p(this.isMultipart()?"multipartCollection":"collection"),windowId:g,id:a,titleControls:l.a.createElement(l.a.Fragment,null,u&&l.a.createElement(Ri.a,null,l.a.createElement(Ni.a,{button:!0,onClick:function(){return f({collectionPath:r.slice(0,-1)})}},l.a.createElement(xf.a,null,l.a.createElement(Sf.a,null)),l.a.createElement(je.a,{primaryTypographyProps:{variant:"body1"}},o.getUseableLabel(u)))),l.a.createElement(le.a,{variant:"h6"},i&&o.getUseableLabel(i),s&&l.a.createElement(wr.a,{className:n.placeholder,variant:"text"})))},l.a.createElement(ke.a,null,s&&l.a.createElement(Te.a,null,l.a.createElement(je.a,null,l.a.createElement(wr.a,{className:n.placeholder,variant:"text"}),l.a.createElement(wr.a,{className:n.placeholder,variant:"text"}),l.a.createElement(wr.a,{className:n.placeholder,variant:"text"}))),i&&i.getCollections().map((function(e){return l.a.createElement(v,{key:e.id,onClick:function(){f({collectionPath:[].concat(Cf(r),[e.id])})},manifest:e})})),i&&i.getManifests().map((function(e){return l.a.createElement(v,{key:e.id,onClick:function(){d({canvasId:null,collectionPath:r,manifestId:e.id}),f({multipart:!1})},manifest:e})}))))}}])&&Pf(t.prototype,n),r&&Pf(t,r),o}(u.Component);Df.defaultProps={collection:null,collectionPath:[],error:null,isFetching:!1,parentCollection:null,ready:!1,t:function(e){return e},variant:null};var Nf={annotations:Je,attribution:jr,canvas:br,collection:Object(r.compose)(Object(a.a)((function(e){return{label:{paddingLeft:e.spacing(1)},menuItem:{borderBottom:"0.5px solid ".concat(e.palette.divider),paddingRight:e.spacing(1),whiteSpace:"normal"}}})),Object(o.a)(),Object(i.b)((function(e,t){var n=t.id,r=t.windowId,i=Object(oe.e)(e,{windowId:r}),o=Object(ie.getCompanionWindow)(e,{companionWindowId:n}),a=o.collectionPath||i.collectionPath,s=a&&a[a.length-1],c=a&&a[a.length-2],u=s&&Object(oe.b)(e,{manifestId:s}),l=c&&Object(oe.b)(e,{manifestId:c}),f=Object(oe.b)(e,{windowId:r});return{canvasNavigation:e.config.canvasNavigation,collection:u&&Object(tt.q)(e,{manifestId:u.id}),collectionId:s,collectionPath:a,error:u&&u.error,isFetching:u&&u.isFetching,manifestId:f&&f.id,parentCollection:l&&Object(tt.q)(e,{manifestId:l.id}),ready:u&&!!u.json,variant:o.variant||Object(lr.a)(e,{windowId:r})}}),(function(e,t){var n=t.id,r=t.windowId;return{updateCompanionWindow:function(){for(var t=arguments.length,i=new Array(t),o=0;o1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=A(e,360),t=A(t,100),n=A(n,100),0===t)r=i=o=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=a(c,s,e+1/3),i=a(c,s,e),o=a(c,s,e-1/3)}return{r:255*r,g:255*i,b:255*o}}(e.h,r,c),f=!0,d="hsl"),e.hasOwnProperty("a")&&(n=e.a));var p,h,g;return n=R(n),{ok:f,format:e.format||d,r:u(255,l(t.r,0)),g:u(255,l(t.g,0)),b:u(255,l(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=c(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=n.ok,this._tc_id=s++}function p(e,t,n){e=A(e,255),t=A(t,255),n=A(n,255);var r,i,o=l(e,t,n),a=u(e,t,n),s=(o+a)/2;if(o==a)r=i=0;else{var c=o-a;switch(i=s>.5?c/(2-o-a):c/(o+a),o){case e:r=(t-n)/c+(t>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(d(r));return o}function j(e,t){t=t||6;for(var n=d(e).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(d({h:r,s:i,v:o})),o=(o+s)%1;return a}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:i.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=R(e),this._roundA=c(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=c(360*e.h),n=c(100*e.s),r=c(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=p(this._r,this._g,this._b),t=c(360*e.h),n=c(100*e.s),r=c(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return g(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,i){var o=[N(c(e).toString(16)),N(c(t).toString(16)),N(c(n).toString(16)),N(z(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*A(this._r,255))+"%",g:c(100*A(this._g,255))+"%",b:c(100*A(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*A(this._r,255))+"%, "+c(100*A(this._g,255))+"%, "+c(100*A(this._b,255))+"%)":"rgba("+c(100*A(this._r,255))+"%, "+c(100*A(this._g,255))+"%, "+c(100*A(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(I[g(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+v(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=d(e);n="#"+v(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(m,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(O,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(S,arguments)},monochromatic:function(){return this._applyCombination(j,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(E,arguments)},tetrad:function(){return this._applyCombination(C,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:L(e[r]));e=n}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:f(),g:f(),b:f()})},d.mix=function(e,t,n){n=0===n?0:n||50;var r=d(e).toRgb(),i=d(t).toRgb(),o=n/100;return d({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},d.readability=function(e,t){var n=d(e),r=d(t);return(i.max(n.getLuminance(),r.getLuminance())+.05)/(i.min(n.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(e,t,n){var r,i,o=d.readability(e,t);switch(i=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},d.mostReadable=function(e,t,n){var r,i,o,a,s=null,c=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var u=0;uc&&(c=r,s=d(t[u]));return d.isReadable(e,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],n))};var P=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},I=d.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(P);function R(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function A(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=u(t,l(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),i.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function M(e){return u(1,l(0,e))}function D(e){return parseInt(e,16)}function N(e){return 1==e.length?"0"+e:""+e}function L(e){return e<=1&&(e=100*e+"%"),e}function z(e){return i.round(255*parseFloat(e)).toString(16)}function B(e){return D(e)/255}var F,W,H,V=(W="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",H="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+W),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+W),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+W),hsva:new RegExp("hsva"+H),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(e){return!!V.CSS_UNIT.exec(e)}e.exports?e.exports=d:void 0===(r=function(){return d}.call(t,n,t,e))||(e.exports=r)}(Math)},,,,,,,,,,,,,,,,,,,,,function(e,t,n){var r=n(532);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(781),i=n(92),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},function(e,t,n){(function(e){var r=n(78),i=n(782),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||i;e.exports=c}).call(this,n(281)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(788),i=n(789),o=n(790),a=n(791),s=n(792);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultTheme,n=function(e){var n=a.a.forwardRef((function(n,o){var s=n.innerRef,c=Object(i.a)(n,["innerRef"]),l=Object(u.a)()||t;return a.a.createElement(e,Object(r.a)({theme:l,ref:s||o},c))}));return c()(n,e),n};return n}var f=l();t.a=f},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(50),i=n(1),o=(n(2),n(136));function a(e,t){var n={};return Object.keys(e).forEach((function(r){-1===t.indexOf(r)&&(n[r]=e[r])})),n}function s(e){var t=function(t){var n=e(t);return t.css?Object(i.a)({},Object(o.a)(n,e(Object(i.a)({theme:t.theme},t.css))),a(t.css,[e.filterProps])):t.sx?Object(i.a)({},Object(o.a)(n,e(Object(i.a)({theme:t.theme},t.sx))),a(t.sx,[e.filterProps])):n};return t.propTypes={},t.filterProps=["css","sx"].concat(Object(r.a)(e.filterProps)),t}function c(e){return s(e)}t.b=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"g",(function(){return s})),n.d(t,"f",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return d}));var r=n(22),i=n(69);function o(e){return"number"!=typeof e?e:"".concat(e,"px solid")}var a=Object(r.a)({prop:"border",themeKey:"borders",transform:o}),s=Object(r.a)({prop:"borderTop",themeKey:"borders",transform:o}),c=Object(r.a)({prop:"borderRight",themeKey:"borders",transform:o}),u=Object(r.a)({prop:"borderBottom",themeKey:"borders",transform:o}),l=Object(r.a)({prop:"borderLeft",themeKey:"borders",transform:o}),f=Object(r.a)({prop:"borderColor",themeKey:"palette"}),d=Object(r.a)({prop:"borderRadius",themeKey:"shape"}),p=Object(i.a)(a,s,c,u,l,f,d);t.h=p},function(e,t,n){"use strict";n.d(t,"f",(function(){return o})),n.d(t,"g",(function(){return a})),n.d(t,"j",(function(){return s})),n.d(t,"k",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return l})),n.d(t,"n",(function(){return f})),n.d(t,"e",(function(){return d})),n.d(t,"h",(function(){return p})),n.d(t,"i",(function(){return h})),n.d(t,"c",(function(){return g})),n.d(t,"l",(function(){return v})),n.d(t,"m",(function(){return m}));var r=n(22),i=n(69),o=Object(r.a)({prop:"flexBasis"}),a=Object(r.a)({prop:"flexDirection"}),s=Object(r.a)({prop:"flexWrap"}),c=Object(r.a)({prop:"justifyContent"}),u=Object(r.a)({prop:"alignItems"}),l=Object(r.a)({prop:"alignContent"}),f=Object(r.a)({prop:"order"}),d=Object(r.a)({prop:"flex"}),p=Object(r.a)({prop:"flexGrow"}),h=Object(r.a)({prop:"flexShrink"}),g=Object(r.a)({prop:"alignSelf"}),v=Object(r.a)({prop:"justifyItems"}),m=Object(r.a)({prop:"justifySelf"}),y=Object(i.a)(o,a,s,c,u,l,f,d,p,h,g,v,m);t.d=y},function(e,t,n){"use strict";n.d(t,"h",(function(){return o})),n.d(t,"g",(function(){return a})),n.d(t,"j",(function(){return s})),n.d(t,"f",(function(){return c})),n.d(t,"i",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return d})),n.d(t,"l",(function(){return p})),n.d(t,"m",(function(){return h})),n.d(t,"k",(function(){return g})),n.d(t,"b",(function(){return v}));var r=n(22),i=n(69),o=Object(r.a)({prop:"gridGap"}),a=Object(r.a)({prop:"gridColumnGap"}),s=Object(r.a)({prop:"gridRowGap"}),c=Object(r.a)({prop:"gridColumn"}),u=Object(r.a)({prop:"gridRow"}),l=Object(r.a)({prop:"gridAutoFlow"}),f=Object(r.a)({prop:"gridAutoColumns"}),d=Object(r.a)({prop:"gridAutoRows"}),p=Object(r.a)({prop:"gridTemplateColumns"}),h=Object(r.a)({prop:"gridTemplateRows"}),g=Object(r.a)({prop:"gridTemplateAreas"}),v=Object(r.a)({prop:"gridArea"}),m=Object(i.a)(o,a,s,c,u,l,f,d,p,h,g,v);t.a=m},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"g",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return l}));var r=n(22),i=n(69),o=Object(r.a)({prop:"position"}),a=Object(r.a)({prop:"zIndex",themeKey:"zIndex"}),s=Object(r.a)({prop:"top"}),c=Object(r.a)({prop:"right"}),u=Object(r.a)({prop:"bottom"}),l=Object(r.a)({prop:"left"});t.b=Object(i.a)(o,a,s,c,u,l)},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=n(22),i=n(69),o=Object(r.a)({prop:"color",themeKey:"palette"}),a=Object(r.a)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette"}),s=Object(i.a)(o,a);t.c=s},function(e,t,n){"use strict";n.d(t,"j",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"g",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return f})),n.d(t,"i",(function(){return d})),n.d(t,"h",(function(){return p})),n.d(t,"a",(function(){return h}));var r=n(22),i=n(69);function o(e){return e<=1?"".concat(100*e,"%"):e}var a=Object(r.a)({prop:"width",transform:o}),s=Object(r.a)({prop:"maxWidth",transform:o}),c=Object(r.a)({prop:"minWidth",transform:o}),u=Object(r.a)({prop:"height",transform:o}),l=Object(r.a)({prop:"maxHeight",transform:o}),f=Object(r.a)({prop:"minHeight",transform:o}),d=Object(r.a)({prop:"size",cssProperty:"width",transform:o}),p=Object(r.a)({prop:"size",cssProperty:"height",transform:o}),h=Object(r.a)({prop:"boxSizing"}),g=Object(i.a)(a,s,c,u,l,f,h);t.b=g},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return l})),n.d(t,"h",(function(){return f}));var r=n(22),i=n(69),o=Object(r.a)({prop:"fontFamily",themeKey:"typography"}),a=Object(r.a)({prop:"fontSize",themeKey:"typography"}),s=Object(r.a)({prop:"fontStyle",themeKey:"typography"}),c=Object(r.a)({prop:"fontWeight",themeKey:"typography"}),u=Object(r.a)({prop:"letterSpacing"}),l=Object(r.a)({prop:"lineHeight"}),f=Object(r.a)({prop:"textAlign"}),d=Object(i.a)(o,a,s,c,u,l,f);t.a=d},function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"b",(function(){return p}));var r=n(1),i=n(4),o=n(0),a=(n(2),n(475)),s=n(83),c=n.n(s),u=n(36),l=n(111),f=n(1133),d=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n?l.b.indexOf(e)<=l.b.indexOf(t):l.b.indexOf(e)2&&void 0!==arguments[2])||arguments[2];return n?l.b.indexOf(t)<=l.b.indexOf(e):l.b.indexOf(t)0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=e.withTheme,s=void 0!==n&&n,l=e.noSSR,d=void 0!==l&&l,p=e.initialWidth;function g(e){var n=Object(u.a)(),c=e.theme||n,l=Object(a.a)({theme:c,name:"MuiWithWidth",props:Object(r.a)({},e)}),g=l.initialWidth,v=l.width,m=Object(i.a)(l,["initialWidth","width"]),y=o.useState(!1),b=y[0],w=y[1];h((function(){w(!0)}),[]);var _=c.breakpoints.keys.slice().reverse().reduce((function(e,t){var n=Object(f.a)(c.breakpoints.up(t));return!e&&n?t:e}),null),x=Object(r.a)({width:v||(b||d?_:void 0)||g||p},s?{theme:c}:{},m);return void 0===x.width?null:o.createElement(t,x)}return c()(g,t),g}}},function(e,t,n){"use strict";n.r(t);var r=n(582);n.d(t,"default",(function(){return r.a}))},function(e,t,n){var r=n(400),i=n(421),o=n(422),a=n(587),s=n(877),c=n(880),u=n(302),l=n(881),f=n(882),d=n(541),p=n(424),h=n(198),g=n(883),v=n(884),m=n(889),y=n(56),b=n(280),w=n(890),_=n(68),x=n(892),O=n(165),S=n(423),E={};E["[object Arguments]"]=E["[object Array]"]=E["[object ArrayBuffer]"]=E["[object DataView]"]=E["[object Boolean]"]=E["[object Date]"]=E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Map]"]=E["[object Number]"]=E["[object Object]"]=E["[object RegExp]"]=E["[object Set]"]=E["[object String]"]=E["[object Symbol]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E["[object Error]"]=E["[object Function]"]=E["[object WeakMap]"]=!1,e.exports=function e(t,n,C,k,T,j){var P,I=1&n,R=2&n,A=4&n;if(C&&(P=T?C(t,k,T,j):C(t)),void 0!==P)return P;if(!_(t))return t;var M=y(t);if(M){if(P=g(t),!I)return u(t,P)}else{var D=h(t),N="[object Function]"==D||"[object GeneratorFunction]"==D;if(b(t))return c(t,I);if("[object Object]"==D||"[object Arguments]"==D||N&&!T){if(P=R||N?{}:m(t),!I)return R?f(t,s(P,t)):l(t,a(P,t))}else{if(!E[D])return T?t:{};P=v(t,D,I)}}j||(j=new r);var L=j.get(t);if(L)return L;j.set(t,P),x(t)?t.forEach((function(r){P.add(e(r,n,C,r,t,j))})):w(t)&&t.forEach((function(r,i){P.set(i,e(r,n,C,i,t,j))}));var z=M?void 0:(A?R?p:d:R?S:O)(t);return i(z||t,(function(r,i){z&&(r=t[i=r]),o(P,i,e(r,n,C,i,t,j))})),P}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=s},i.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},i.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},i.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},i.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},i.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},r.createEmpty=function(e){return new r({anchorKey:e,anchorOffset:0,focusKey:e,focusOffset:0,isBackward:!1,hasFocus:!1})},r}((0,n(40).Record)({anchorKey:"",anchorOffset:0,focusKey:"",focusOffset:0,isBackward:!1,hasFocus:!1}));e.exports=r},function(e,t,n){"use strict";var r=n(42),i=null;function o(e){return"LTR"===e||"RTL"===e}function a(e){return o(e)||r(!1),"LTR"===e?"ltr":"rtl"}function s(e){i=e}var c={NEUTRAL:"NEUTRAL",LTR:"LTR",RTL:"RTL",isStrong:o,getHTMLDir:a,getHTMLDirIfDifferent:function(e,t){return o(e)||r(!1),o(t)||r(!1),e===t?null:a(e)},setGlobalDir:s,initGlobalDir:function(){s("LTR")},getGlobalDir:function(){return i||this.initGlobalDir(),i||r(!1),i}};e.exports=c},function(e,t,n){"use strict";var r=n(311),i=n(618);e.exports=function(e){for(var t=e;t&&t!==r(e).documentElement;){var n=i(t);if(null!=n)return n;t=t.parentNode}return null}},function(e,t,n){"use strict";e.exports=function(e){return e&&e.ownerDocument?e.ownerDocument:document}},function(e,t,n){"use strict";e.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},function(e,t,n){"use strict";function r(e,t){var n=i.get(e,t);return"auto"===n||"scroll"===n}var i={get:n(980),getScrollParent:function(e){if(!e)return null;for(var t=e.ownerDocument;e&&e!==t.body;){if(r(e,"overflow")||r(e,"overflowY")||r(e,"overflowX"))return e;e=e.parentNode}return t.defaultView||t.parentWindow}};e.exports=i},function(e,t,n){"use strict";var r=n(984),i=n(985);e.exports=function(e){var t=r(e.ownerDocument||e.document);e.Window&&e instanceof e.Window&&(e=t);var n=i(e),o=e===t?e.ownerDocument.documentElement:e,a=e.scrollWidth-o.clientWidth,s=e.scrollHeight-o.clientHeight;return n.x=Math.max(0,Math.min(n.x,a)),n.y=Math.max(0,Math.min(n.y,s)),n}},function(e,t,n){"use strict";e.exports=function(e){return"handled"===e||!0===e}},function(e,t){e.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r2){if(!l[e])return[e];e=l[e]}var t=e.split(""),n=Object(r.a)(t,2),i=n[0],o=n[1],a=c[i],s=u[o]||"";return Array.isArray(s)?s.map((function(e){return a+e})):[a+s]},s={},function(e){return void 0===s[e]&&(s[e]=a(e)),s[e]}),d=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function p(e){var t=e.spacing||8;return"number"==typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"==typeof t?t:function(){}}function h(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"==typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function g(e){var t=p(e.theme);return Object.keys(e).map((function(n){if(-1===d.indexOf(n))return null;var r=h(f(n),t),o=e[n];return Object(i.b)(e,o,r)})).reduce(o.a,{})}g.propTypes={},g.filterProps=d;t.b=g},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return f})),n.d(t,"e",(function(){return p}));var r=n(10),i=n(38),o=n(46);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.resource=t,this.iiifOpts=n}var t,n,l;return t=e,l=[{key:"staticImageUrl",value:function(e){return{height:e.getProperty("height"),url:e.id,width:e.getProperty("width")}}},{key:"getPreferredImage",value:function(e){var t=new o.a(e);return t.iiifImageResources[0]||t.imageResource}},{key:"selectBestImageSize",value:function(e,t){var n=Object(a.a)(e.getProperty("sizes")),r={default:!0,height:e.getProperty("height")||Number.MAX_SAFE_INTEGER,width:e.getProperty("width")||Number.MAX_SAFE_INTEGER},i=function(e){return e.width*e.height-t};if((r=n.reduce((function(e,t){var n=i(t);return n<0?e:Math.abs(n)6*t&&(r=n.reduce((function(e,t){return Math.abs(i(t))1&&(o=Math.round(s/p)),p&&p<1&&(i=Math.round(a*p))):s/a2&&void 0!==arguments[2]?arguments[2]:{clone:!0},i=n.clone?Object(r.a)({},e):e;return o(e)&&o(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(o(t[r])&&r in e?i[r]=a(e[r],t[r],n):i[r]=t[r])})),i}},function(e,t,n){"use strict";var r=n(0),i=n.n(r).a.createContext(null);t.a=i},function(e,t,n){"use strict";function r(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for;t.a=r?Symbol.for("mui.nested"):"__THEME_NESTED__"},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,n){"use strict";function r(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(335),i=n(333),o=n(209),a=n(336);function s(e){return Object(r.a)(e)||Object(i.a)(e)||Object(o.a)(e)||Object(a.a)()}},function(e,t,n){"use strict";var r=n(0),i=r.createContext({});t.a=i},function(e,t,n){"use strict";var r=n(0),i=n(43);t.a=Object(i.a)(r.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown")},function(e,t,n){"use strict";var r=n(1),i=n(4),o=n(0),a=(n(2),n(3)),s=n(11),c=o.forwardRef((function(e,t){var n=e.classes,c=e.className,u=e.disabled,l=e.IconComponent,f=e.inputRef,d=e.variant,p=void 0===d?"standard":d,h=Object(i.a)(e,["classes","className","disabled","IconComponent","inputRef","variant"]);return o.createElement(o.Fragment,null,o.createElement("select",Object(r.a)({className:Object(a.a)(n.root,n.select,n[p],c,u&&n.disabled),disabled:u,ref:f||t},h)),e.multiple?null:o.createElement(l,{className:Object(a.a)(n.icon,n["icon".concat(Object(s.a)(p))],u&&n.disabled)}))}));t.a=c},function(e,t,n){var r=n(142),i=n(56),o=n(92);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(91))},function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var i=n(0),o=r(i),a=r(n(33)),s=r(n(898)),c=n(899),u=r(n(900)),l=r(n(911));function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?x(e):t}var S={};function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";return S[e]||(S[e]=u({strategy:e})),S[e]}var C="react-sizeme: an error occurred whilst stopping to listen to node size changes",k={monitorWidth:!0,monitorHeight:!1,monitorPosition:!1,refreshRate:16,refreshMode:"throttle",noPlaceholder:!1,resizeDetectorStrategy:"scroll"};function T(e){return e.displayName||e.name||"Component"}var j=function(e){function t(){return f(this,t),O(this,b(t).apply(this,arguments))}return y(t,e),p(t,[{key:"render",value:function(){return i.Children.only(this.props.children)}}]),t}(i.Component);function P(e){var t=e.className,n=e.style,r={};return t||n?(t&&(r.className=t),n&&(r.style=n)):r.style={width:"100%",height:"100%"},o.createElement("div",r)}h(j,"displayName","SizeMeReferenceWrapper"),P.displayName="SizeMePlaceholder";var I=function(e){function t(t){var n=t.explicitRef,r=t.className,i=t.style,a=t.size,s=t.disablePlaceholder,c=(t.onSize,_(t,["explicitRef","className","style","size","disablePlaceholder","onSize"])),u=(null==a||null==a.width&&null==a.height&&null==a.position)&&!s,l={className:r,style:i};null!=a&&(l.size=a);var f=u?o.createElement(P,{className:r,style:i}):o.createElement(e,g({},l,c));return o.createElement(j,{ref:n},f)}return t.displayName="SizeMeRenderer(".concat(T(e),")"),t};function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k,t=e.monitorWidth,n=void 0===t?k.monitorWidth:t,r=e.monitorHeight,i=void 0===r?k.monitorHeight:r,u=e.monitorPosition,l=void 0===u?k.monitorPosition:u,d=e.refreshRate,v=void 0===d?k.refreshRate:d,w=e.refreshMode,_=void 0===w?k.refreshMode:w,S=e.noPlaceholder,j=void 0===S?k.noPlaceholder:S,P=e.resizeDetectorStrategy,A=void 0===P?k.resizeDetectorStrategy:P;s(n||i||l,'You have to monitor at least one of the width, height, or position when using "sizeMe"'),s(v>=16,"It is highly recommended that you don't put your refreshRate lower than 16 as this may cause layout thrashing."),s("throttle"===_||"debounce"===_,'The refreshMode should have a value of "throttle" or "debounce"');var M="throttle"===_?c.throttle:c.debounce;return function(e){var t=I(e),r=function(e){function r(){var e,t;f(this,r);for(var o=arguments.length,a=new Array(o),s=0;s0}},{key:"leave",value:function(e){var t,n,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),n=e,t.filter((function(e){return e!==n}))),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}])&&o(t.prototype,n),r&&o(t,r),e}(),s=i((function(){return/firefox/i.test(navigator.userAgent)})),c=i((function(){return Boolean(window.safari)}));function u(e,t){for(var n=0;ne))return n[s];u=s-1}}var f=e-t[a=Math.max(0,u)],d=f*f;return n[a]+r[a]*f+i[a]*d+o[a]*f*d}}])&&u(t.prototype,n),r&&u(t,r),e}();function f(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function d(e){return{x:e.clientX,y:e.clientY}}function p(e,t,n,r,i){var o,a,u="IMG"===(o=t).nodeName&&(s()||!document.documentElement.contains(o)),d=f(u?e:t),p={x:n.x-d.x,y:n.y-d.y},h=e.offsetWidth,g=e.offsetHeight,v=r.anchorX,m=r.anchorY,y=function(e,t,n,r){var i=e?t.width:n,o=e?t.height:r;return c()&&e&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}(u,t,h,g),b=y.dragPreviewWidth,w=y.dragPreviewHeight,_=i.offsetX,x=i.offsetY,O=0===x||x;return{x:0===_||_?_:new l([0,.5,1],[p.x,p.x/h*b,p.x+b-h]).interpolate(v),y:O?x:(a=new l([0,.5,1],[p.y,p.y/g*w,p.y+w-g]).interpolate(m),c()&&u&&(a+=(window.devicePixelRatio-1)*w),a)}}var h,g="__NATIVE_FILE__",v="__NATIVE_URL__",m="__NATIVE_TEXT__";function y(e,t,n){var r=t.reduce((function(t,n){return t||e.getData(n)}),"");return null!=r?r:n}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=(b(h={},g,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items}},matchesTypes:["Files"]}),b(h,v,{exposeProperties:{urls:function(e,t){return y(e,t,"").split("\n")}},matchesTypes:["Url","text/uri-list"]}),b(h,m,{exposeProperties:{text:function(e,t){return y(e,t,"")}},matchesTypes:["Text","text/plain"]}),h);function _(e,t){for(var n=0;n-1}))}))[0]||null}function S(e,t){for(var n=0;n0?e.observer.unobserve(t):(e.observer.disconnect(),d.delete(e.observer)))}}var b,w=(b=function(e,t){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),_=["root","rootMargin","threshold"],x=["root","rootMargin","threshold","disabled"],O=function(e){return _.reduce((function(t,n){var r,i="root"===n&&"[object String]"===l.call(e.root);return Object.assign(t,((r={})[n]=i?document.querySelector(e[n]):e[n],r))}),{})},S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleChange=function(e){t.props.onChange(e,t.externalUnobserve)},t.handleNode=function(e){var n=t.props.children;if(f(n)){var r=n.ref;"function"==typeof r?r(e):r&&u.call(r,"current")&&(r.current=e)}if(t.targetNode=void 0,e){var i=Object(a.findDOMNode)(e);i&&1===i.nodeType&&(t.targetNode=i)}},t.observe=function(){if(null==t.props.children||t.props.disabled)return!1;if(!t.targetNode)throw new Error("ReactIntersectionObserver: Can't find DOM node in the provided children. Make sure to render at least one DOM node in the tree.");return t.observer=v(O(t.props)),t.target=t.targetNode,m(t),!0},t.unobserve=function(e){y(t,e)},t.externalUnobserve=function(){t.targetNode&&t.unobserve(t.targetNode)},t}return w(t,e),t.prototype.getSnapshotBeforeUpdate=function(e){var t=this;this.prevTargetNode=this.targetNode;var n=x.some((function(n){return c(t.props[n],e[n])}));return n&&this.prevTargetNode&&(e.disabled||this.unobserve(this.prevTargetNode)),n},t.prototype.componentDidUpdate=function(e,t,n){var r=!1;n||(r=this.prevTargetNode!==this.targetNode)&&null!=this.prevTargetNode&&this.unobserve(this.prevTargetNode),(n||r)&&this.observe()},t.prototype.componentDidMount=function(){this.observe()},t.prototype.componentWillUnmount=function(){this.targetNode&&this.unobserve(this.targetNode)},t.prototype.render=function(){var e=this.props.children;return null!=e?o.a.cloneElement(o.a.Children.only(e),{ref:this.handleNode}):null},t.displayName="IntersectionObserver",t}(o.a.Component)},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(29),i=n.n(r),o=n(139),a=n.n(o),s=n(126);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};c(this,e),this.resource=t}var t,n,r;return t=e,(n=[{key:"isOnlyTag",value:function(){return 1===this.motivations.length&&"oa:tagging"===this.motivations[0]}},{key:"id",get:function(){return this._id=this._id||this.resource["@id"]||this.resources[0]&&this.resources[0]["@id"]||Object(s.a)(),this._id}},{key:"targetId",get:function(){var e=this.on[0];switch(typeof e){case"string":return e.replace(/#?xywh=(.*)$/,"");case"object":return e.full.replace(/#?xywh=(.*)$/,"");default:return null}}},{key:"motivations",get:function(){return i()(a()(new Array(this.resource.motivation)))}},{key:"resources",get:function(){return i()(a()(new Array(this.resource.resource)))}},{key:"on",get:function(){return i()(a()(new Array(this.resource.on)))}},{key:"tags",get:function(){return this.isOnlyTag()?this.resources.map((function(e){return e.chars})):this.resources.filter((function(e){return"oa:Tag"===e["@type"]})).map((function(e){return e.chars}))}},{key:"chars",get:function(){return this.resources.filter((function(e){return"oa:Tag"!==e["@type"]})).map((function(e){return e.chars})).join(" ")}},{key:"selector",get:function(){var e=this.on[0];switch(typeof e){case"string":return e;case"object":return"oa:Choice"===e.selector["@type"]?e.selector.default:e.selector;default:return null}}},{key:"svgSelector",get:function(){var e=this.on[0];switch(typeof e){case"string":return null;case"object":return e.selector&&e.selector.item&&"oa:SvgSelector"===e.selector.item["@type"]?e.selector.item:null;default:return null}}},{key:"fragmentSelector",get:function(){var e,t=this.selector;switch(typeof t){case"string":e=t.match(/xywh=(.*)$/);break;case"object":e=t.value.match(/xywh=(.*)$/);break;default:return null}return e&&e[1].split(",").map((function(e){return parseInt(e,10)}))}}])&&u(t.prototype,n),r&&u(t,r),e}();function f(e,t){for(var n=0;n0}},{key:"resources",get:function(){var e=this;return this._resources=this._resources||(e.json&&e.json.resources?i()([e.json.resources]).map((function(e){return new l(e)})):[]),this._resources}}])&&f(t.prototype,n),r&&f(t,r),e}()},function(e,t,n){"use strict";var r=n(7),i=n(9),o=n(1175),a=n(8),s=n(90),c=n(0),u=n.n(c),l=n(96),f=n(124),d=n(72),p=n(151),h=n(37);function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n0&&u.a.createElement(p.a,{labelValuePairs:r}),u.a.createElement(h.a,this.props))}}])&&v(t.prototype,n),r&&v(t,r),o}(c.Component);_.defaultProps={manifestDescription:null,manifestLabel:null,manifestMetadata:[],t:function(e){return e}};var x=Object(r.compose)(Object(o.a)(),Object(i.b)((function(e,t){var n=t.id,r=t.manifestId,i=t.windowId;return{manifestDescription:Object(s.c)(e,{companionWindowId:n,manifestId:r,windowId:i}),manifestLabel:Object(s.o)(e,{companionWindowId:n,manifestId:r,windowId:i}),manifestMetadata:Object(s.h)(e,{companionWindowId:n,manifestId:r,windowId:i})}})),Object(a.a)("ManifestInfo"));t.a=x(_)},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),i=n(17);function o(e,t){"function"==typeof e?e(t):e.current=t}function a(e,t){var n=e.ref;return Object(i.a)("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),n?Object(r.cloneElement)(e,{ref:function(e){o(n,e),o(t,e)}}):Object(r.cloneElement)(e,{ref:t})}function s(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a
, or turn it into a ")+"drag source or a drop target itself.")}}function c(e){var t={};return Object.keys(e).forEach((function(n){var i=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var o=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!Object(r.isValidElement)(t)){var i=t;return e(i,n),i}var o=t;s(o);var c=n?function(t){return e(t,n)}:e;return a(o,c)}}(i);t[n]=function(){return o}}})),t}},function(e,t,n){var r=n(1078),i=n(411),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(o,r).replace(a,"")}},function(e,t,n){"use strict";var r=n(58),i=n(95),o=(n(2),n(0)),a=n.n(o),s=n(33),c=n.n(s),u=!1,l=n(220),f=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i="exited",r.appearStatus="entering"):i="entered":i=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",r.state={status:i},r.nextCallback=null,r}Object(i.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(t="entering"):"entering"!==n&&"entered"!==n||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),"entering"===t?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[c.a.findDOMNode(this),r],o=i[0],a=i[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||u?this.safeSetState({status:"entered"},(function(){t.props.onEntered(o)})):(this.props.onEnter(o,a),this.safeSetState({status:"entering"},(function(){t.props.onEntering(o,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:"entered"},(function(){t.props.onEntered(o,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:c.a.findDOMNode(this);t&&!u?(this.props.onExit(r),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:c.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,i=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(r.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a.a.createElement(l.a.Provider,{value:null},"function"==typeof n?n(e,i):a.a.cloneElement(a.a.Children.only(n),i))},t}(a.a.Component);function d(){}f.contextType=l.a,f.propTypes={},f.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:d,onEntering:d,onEntered:d,onExit:d,onExiting:d,onExited:d},f.UNMOUNTED="unmounted",f.EXITED="exited",f.ENTERING="entering",f.ENTERED="entered",f.EXITING="exiting";t.a=f},,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){var r=n(536),i=n(785)(r);e.exports=i},function(e,t,n){var r=n(783),i=n(228),o=n(398),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){(function(e){var r=n(533),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(this,n(281)(e))},function(e,t,n){var r=n(282),i=n(784),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(283),i=n(793),o=n(794),a=n(795),s=n(796),c=n(797);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(164)(n(78),"Map");e.exports=r},function(e,t,n){var r=n(798),i=n(805),o=n(807),a=n(808),s=n(809);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=200){var g=t?null:s(e);if(g)return c(g);d=!1,l=a,h=new r}else h=t?[]:p;e:for(;++u-1}},function(e,t,n){var r=n(404),i=n(415),o=n(552),a=n(143),s=n(228),c=n(405);e.exports=function(e,t,n,u){var l=-1,f=i,d=!0,p=e.length,h=[],g=t.length;if(!p)return h;n&&(t=a(t,s(n))),u?(f=o,d=!1):t.length>=200&&(f=c,d=!1,t=new r(t));e:for(;++l0||c+r0?[["dictionary",r.definitions],i]:i},deserialize:function(e,t,n,r,i){var o=e,a=!n,s=a&&e&&e.length&&"dictionary"===e[0][0];if(n=n||{},Array.isArray(e)){var c=e[0],u="dictionary"===c;if(1==e.length&&/^#/.test(c))return n.dictionary[c];o=[];for(var f=(c=l.exports[c])?1:0,d=e.length;fe.length&&(n=e.length);for(var a=0;a0){var o=t[i],a=o&&o[r];a&&a.call(this,i)}},statics:{inject:function e(t){var n=t._events;if(n){var r={};l.each(n,(function(e,n){var i="string"==typeof e,o=i?e:n,a=l.capitalize(o),s=o.substring(2).toLowerCase();r[s]=i?{}:e,o="_"+o,t["get"+a]=function(){return this[o]},t["set"+a]=function(e){var t=this[o];t&&this.off(s,t),e&&this.on(s,e),this[o]=e}})),t._eventTypes=r}return e.base.apply(this,arguments)}}},d=l.extend({_class:"PaperScope",initialize:function e(){de=this,this.settings=new l({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this._id=e._id++,e._scopes[this._id]=this;var t=e.prototype;if(!this.support){var n=ce.getContext(1,1)||{};t.support={nativeDash:"setLineDash"in n||"mozDash"in n,nativeBlendModes:ue.nativeModes},ce.release(n)}if(!this.agent){var r=a.navigator.userAgent.toLowerCase(),i=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(r)||[])[0],o="darwin"===i?"mac":i,s=t.agent=t.browser={platform:o};o&&(s[o]=!0),r.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node|jsdom)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,(function(e,t,n,r,i){if(!s.chrome){var o="opera"===t?r:/^(node|trident)$/.test(t)?i:n;s.version=o,s.versionNumber=parseFloat(o),t={trident:"msie",jsdom:"node"}[t]||t,s.name=t,s[t]=!0}})),s.chrome&&delete s.webkit,s.atom&&delete s.chrome}},version:"0.12.15",getView:function(){var e=this.project;return e&&e._view},getPaper:function(){return this},execute:function(e,t){var n=de.PaperScript.execute(e,this,t);return Y.updateFocus(),n},install:function(e){var t=this;for(var n in l.each(["project","view","tool"],(function(n){l.define(e,n,{configurable:!0,get:function(){return t[n]}})})),this)!/^_/.test(n)&&this[n]&&(e[n]=this[n])},setup:function(e){return de=this,this.project=new C(e),this},createCanvas:function(e,t){return ce.getCanvas(e,t)},activate:function(){de=this},clear:function(){for(var e=this.projects,t=this.tools,n=e.length-1;n>=0;n--)e[n].remove();for(n=t.length-1;n>=0;n--)t[n].remove()},remove:function(){this.clear(),delete d._scopes[this._id]},statics:new function(){function e(e){return e+="Attribute",function(t,n){return t[e](n)||t[e]("data-paper-"+n)}}return{_scopes:{},_id:0,get:function(e){return this._scopes[e]||null},getAttribute:e("get"),hasAttribute:e("has")}}}),p=l.extend(f,{initialize:function(e){this._scope=de,this._index=this._scope[this._list].push(this)-1,!e&&this._scope[this._reference]||this.activate()},activate:function(){if(!this._scope)return!1;var e=this._scope[this._reference];return e&&e!==this&&e.emit("deactivate"),this._scope[this._reference]=this,this.emit("activate",e),!0},isActive:function(){return this._scope[this._reference]===this},remove:function(){return null!=this._index&&(l.splice(this._scope[this._list],null,this._index,1),this._scope[this._reference]==this&&(this._scope[this._reference]=null),this._scope=null,!0)},getView:function(){return this._scope.getView()}}),h={findItemBoundsCollisions:function(e,t,n){function r(e){for(var t=new Array(e.length),n=0;n>>1;a[e[o]][t]=s;(i||(_&&I||x&&P)&&C>=j[d]-n&&k<=j[p]+n)&&(_&&I&&O.push(o?T:T-s),x&&P&&m[T].push(w))}}}if(_&&(e===t&&O.push(y),m[y]=O),v.length){var R=u(v,f,b[f]);v.splice(R+1,0,y)}else v.push(y)}for(g=0;gn?n:e}function s(e,t,r){function i(e){var t=134217729*e,n=e-t+t;return[n,e-n]}var o=t*t-e*r,a=t*t+e*r;if(3*n(o)1e8)?i(2,-Math.round(o(e))):0}return{EPSILON:1e-12,MACHINE_EPSILON:112e-18,CURVETIME_EPSILON:1e-8,GEOMETRIC_EPSILON:1e-7,TRIGONOMETRIC_EPSILON:1e-8,KAPPA:4*(r(2)-1)/3,isZero:function(e){return e>=-1e-12&&e<=1e-12},isMachineZero:function(e){return e>=-112e-18&&e<=112e-18},clamp:a,integrate:function(n,r,i,o){for(var a=e[o-2],s=t[o-2],c=.5*(i-r),u=c+r,l=0,f=o+1>>1,d=1&o?s[l++]*n(u):0;l0?(o=r,r=d<=i?.5*(i+o):d):(i=r,r=d>=o?.5*(i+o):d)}return a(r,i,o)},solveQuadratic:function(e,t,i,o,u,l){var f,d=1/0;if(n(e)<1e-12){if(n(t)<1e-12)return n(i)<1e-12?-1:0;f=-i/t}else{var p=s(e,t*=-.5,i);if(p&&n(p)<112e-18){var h=c(n(e),n(t),n(i));h&&(p=s(e*=h,t*=h,i*=h))}if(p>=-112e-18){var g=p<0?0:r(p),v=t+(t<0?-g:g);0===v?d=-(f=i/e):(f=v/e,d=i/v)}}var m=0,y=null==u,b=u-1e-12,w=l+1e-12;return isFinite(f)&&(y||f>b&&fb&&d0?1.324717957244746*Math.max(_,r(O)):_,E=d-x*S;if(E!==d){do{b(E),E=0===g?d:d-m/g/(1+112e-18)}while(x*E>x*d);n(e)*d*d>n(s/d)&&(p=((h=-s/d)-o)/d)}}var C=v.solveQuadratic(e,p,h,u,l,f),k=null==l;return isFinite(d)&&(0===C||C>0&&d!==u[0]&&d!==u[1])&&(k||d>l-1e-12&&d1?a[1]:a[0])):"x"in a?this._set(a.x||0,a.y||0):"width"in a?this._set(a.width||0,a.height||0):"angle"in a?(this._set(a.length||0,0),this.setAngle(a.angle||0)):(this._set(0,0),i=0)}return r&&(this.__read=i),this},set:"#initialize",_set:function(e,t){return this.x=e,this.y=t,this},equals:function(e){return this===e||e&&(this.x===e.x&&this.y===e.y||Array.isArray(e)&&this.x===e[0]&&this.y===e[1])||!1},clone:function(){return new y(this.x,this.y)},toString:function(){var e=g.instance;return"{ x: "+e.number(this.x)+", y: "+e.number(this.y)+" }"},_serialize:function(e){var t=e.formatter;return[t.number(this.x),t.number(this.y)]},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(e){if(this.isZero()){var t=this._angle||0;this._set(Math.cos(t)*e,Math.sin(t)*e)}else{var n=e/this.getLength();v.isZero(n)&&this.getAngle(),this._set(this.x*n,this.y*n)}},getAngle:function(){return 180*this.getAngleInRadians.apply(this,arguments)/Math.PI},setAngle:function(e){this.setAngleInRadians.call(this,e*Math.PI/180)},getAngleInDegrees:"#getAngle",setAngleInDegrees:"#setAngle",getAngleInRadians:function(){if(arguments.length){var e=y.read(arguments),t=this.getLength()*e.getLength();if(v.isZero(t))return NaN;var n=this.dot(e)/t;return Math.acos(n<-1?-1:n>1?1:n)}return this.isZero()?this._angle||0:this._angle=Math.atan2(this.y,this.x)},setAngleInRadians:function(e){if(this._angle=e,!this.isZero()){var t=this.getLength();this._set(Math.cos(e)*t,Math.sin(e)*t)}},getQuadrant:function(){return this.x>=0?this.y>=0?1:4:this.y>=0?2:3}},{beans:!1,getDirectedAngle:function(){var e=y.read(arguments);return 180*Math.atan2(this.cross(e),this.dot(e))/Math.PI},getDistance:function(){var e=arguments,t=y.read(e),n=t.x-this.x,r=t.y-this.y,i=n*n+r*r,o=l.read(e);return o?i:Math.sqrt(i)},normalize:function(e){e===s&&(e=1);var t=this.getLength(),n=0!==t?e/t:0,r=new y(this.x*n,this.y*n);return n>=0&&(r._angle=this._angle),r},rotate:function(e,t){if(0===e)return this.clone();e=e*Math.PI/180;var n=t?this.subtract(t):this,r=Math.sin(e),i=Math.cos(e);return n=new y(n.x*i-n.y*r,n.x*r+n.y*i),t?n.add(t):n},transform:function(e){return e?e._transformPoint(this):this},add:function(){var e=y.read(arguments);return new y(this.x+e.x,this.y+e.y)},subtract:function(){var e=y.read(arguments);return new y(this.x-e.x,this.y-e.y)},multiply:function(){var e=y.read(arguments);return new y(this.x*e.x,this.y*e.y)},divide:function(){var e=y.read(arguments);return new y(this.x/e.x,this.y/e.y)},modulo:function(){var e=y.read(arguments);return new y(this.x%e.x,this.y%e.y)},negate:function(){return new y(-this.x,-this.y)},isInside:function(){return x.read(arguments).contains(this)},isClose:function(){var e=arguments,t=y.read(e),n=l.read(e);return this.getDistance(t)<=n},isCollinear:function(){var e=y.read(arguments);return y.isCollinear(this.x,this.y,e.x,e.y)},isColinear:"#isCollinear",isOrthogonal:function(){var e=y.read(arguments);return y.isOrthogonal(this.x,this.y,e.x,e.y)},isZero:function(){var e=v.isZero;return e(this.x)&&e(this.y)},isNaN:function(){return isNaN(this.x)||isNaN(this.y)},isInQuadrant:function(e){return this.x*(e>1&&e<4?-1:1)>=0&&this.y*(e>2?-1:1)>=0},dot:function(){var e=y.read(arguments);return this.x*e.x+this.y*e.y},cross:function(){var e=y.read(arguments);return this.x*e.y-this.y*e.x},project:function(){var e=y.read(arguments),t=e.isZero()?0:this.dot(e)/e.dot(e);return new y(e.x*t,e.y*t)},statics:{min:function(){var e=arguments,t=y.read(e),n=y.read(e);return new y(Math.min(t.x,n.x),Math.min(t.y,n.y))},max:function(){var e=arguments,t=y.read(e),n=y.read(e);return new y(Math.max(t.x,n.x),Math.max(t.y,n.y))},random:function(){return new y(Math.random(),Math.random())},isCollinear:function(e,t,n,r){return Math.abs(e*r-t*n)<=1e-8*Math.sqrt((e*e+t*t)*(n*n+r*r))},isOrthogonal:function(e,t,n,r){return Math.abs(e*n+t*r)<=1e-8*Math.sqrt((e*e+t*t)*(n*n+r*r))}}},l.each(["round","ceil","floor","abs"],(function(e){var t=Math[e];this[e]=function(){return new y(t(this.x),t(this.y))}}),{})),b=y.extend({initialize:function(e,t,n,r){this._x=e,this._y=t,this._owner=n,this._setter=r},_set:function(e,t,n){return this._x=e,this._y=t,n||this._owner[this._setter](this),this},getX:function(){return this._x},setX:function(e){this._x=e,this._owner[this._setter](this)},getY:function(){return this._y},setY:function(e){this._y=e,this._owner[this._setter](this)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(e){this._owner._changeSelection(this._getSelection(),e)},_getSelection:function(){return"setPosition"===this._setter?4:0}}),w=l.extend({_class:"Size",_readIndex:!0,initialize:function(e,t){var n=typeof e,r=this.__read,i=0;if("number"===n){var o="number"==typeof t;this._set(e,o?t:e),r&&(i=o?2:1)}else if("undefined"===n||null===e)this._set(0,0),r&&(i=null===e?1:0);else{var a="string"===n?e.split(/[\s,]+/)||[]:e;i=1,Array.isArray(a)?this._set(+a[0],+(a.length>1?a[1]:a[0])):"width"in a?this._set(a.width||0,a.height||0):"x"in a?this._set(a.x||0,a.y||0):(this._set(0,0),i=0)}return r&&(this.__read=i),this},set:"#initialize",_set:function(e,t){return this.width=e,this.height=t,this},equals:function(e){return e===this||e&&(this.width===e.width&&this.height===e.height||Array.isArray(e)&&this.width===e[0]&&this.height===e[1])||!1},clone:function(){return new w(this.width,this.height)},toString:function(){var e=g.instance;return"{ width: "+e.number(this.width)+", height: "+e.number(this.height)+" }"},_serialize:function(e){var t=e.formatter;return[t.number(this.width),t.number(this.height)]},add:function(){var e=w.read(arguments);return new w(this.width+e.width,this.height+e.height)},subtract:function(){var e=w.read(arguments);return new w(this.width-e.width,this.height-e.height)},multiply:function(){var e=w.read(arguments);return new w(this.width*e.width,this.height*e.height)},divide:function(){var e=w.read(arguments);return new w(this.width/e.width,this.height/e.height)},modulo:function(){var e=w.read(arguments);return new w(this.width%e.width,this.height%e.height)},negate:function(){return new w(-this.width,-this.height)},isZero:function(){var e=v.isZero;return e(this.width)&&e(this.height)},isNaN:function(){return isNaN(this.width)||isNaN(this.height)},statics:{min:function(e,t){return new w(Math.min(e.width,t.width),Math.min(e.height,t.height))},max:function(e,t){return new w(Math.max(e.width,t.width),Math.max(e.height,t.height))},random:function(){return new w(Math.random(),Math.random())}}},l.each(["round","ceil","floor","abs"],(function(e){var t=Math[e];this[e]=function(){return new w(t(this.width),t(this.height))}}),{})),_=w.extend({initialize:function(e,t,n,r){this._width=e,this._height=t,this._owner=n,this._setter=r},_set:function(e,t,n){return this._width=e,this._height=t,n||this._owner[this._setter](this),this},getWidth:function(){return this._width},setWidth:function(e){this._width=e,this._owner[this._setter](this)},getHeight:function(){return this._height},setHeight:function(e){this._height=e,this._owner[this._setter](this)}}),x=l.extend({_class:"Rectangle",_readIndex:!0,beans:!0,initialize:function(e,t,n,r){var i,o=arguments,a=typeof e;if("number"===a?(this._set(e,t,n,r),i=4):"undefined"===a||null===e?(this._set(0,0,0,0),i=null===e?1:0):1===o.length&&(Array.isArray(e)?(this._set.apply(this,e),i=1):e.x!==s||e.width!==s?(this._set(e.x||0,e.y||0,e.width||0,e.height||0),i=1):e.from===s&&e.to===s&&(this._set(0,0,0,0),l.readSupported(o,this)&&(i=1))),i===s){var c,u,f=y.readNamed(o,"from"),d=l.peek(o),p=f.x,h=f.y;if(d&&d.x!==s||l.hasNamed(o,"to")){var g=y.readNamed(o,"to");c=g.x-p,u=g.y-h,c<0&&(p=g.x,c=-c),u<0&&(h=g.y,u=-u)}else{var v=w.read(o);c=v.width,u=v.height}this._set(p,h,c,u),i=o.__index}var m=o.__filtered;return m&&(this.__filtered=m),this.__read&&(this.__read=i),this},set:"#initialize",_set:function(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this},clone:function(){return new x(this.x,this.y,this.width,this.height)},equals:function(e){var t=l.isPlainValue(e)?x.read(arguments):e;return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height||!1},toString:function(){var e=g.instance;return"{ x: "+e.number(this.x)+", y: "+e.number(this.y)+", width: "+e.number(this.width)+", height: "+e.number(this.height)+" }"},_serialize:function(e){var t=e.formatter;return[t.number(this.x),t.number(this.y),t.number(this.width),t.number(this.height)]},getPoint:function(e){return new(e?y:b)(this.x,this.y,this,"setPoint")},setPoint:function(){var e=y.read(arguments);this.x=e.x,this.y=e.y},getSize:function(e){return new(e?w:_)(this.width,this.height,this,"setSize")},_fw:1,_fh:1,setSize:function(){var e=w.read(arguments),t=this._sx,n=this._sy,r=e.width,i=e.height;t&&(this.x+=(this.width-r)*t),n&&(this.y+=(this.height-i)*n),this.width=r,this.height=i,this._fw=this._fh=1},getLeft:function(){return this.x},setLeft:function(e){if(!this._fw){var t=e-this.x;this.width-=.5===this._sx?2*t:t}this.x=e,this._sx=this._fw=0},getTop:function(){return this.y},setTop:function(e){if(!this._fh){var t=e-this.y;this.height-=.5===this._sy?2*t:t}this.y=e,this._sy=this._fh=0},getRight:function(){return this.x+this.width},setRight:function(e){if(!this._fw){var t=e-this.x;this.width=.5===this._sx?2*t:t}this.x=e-this.width,this._sx=1,this._fw=0},getBottom:function(){return this.y+this.height},setBottom:function(e){if(!this._fh){var t=e-this.y;this.height=.5===this._sy?2*t:t}this.y=e-this.height,this._sy=1,this._fh=0},getCenterX:function(){return this.x+this.width/2},setCenterX:function(e){this._fw||.5===this._sx?this.x=e-this.width/2:(this._sx&&(this.x+=2*(e-this.x)*this._sx),this.width=2*(e-this.x)),this._sx=.5,this._fw=0},getCenterY:function(){return this.y+this.height/2},setCenterY:function(e){this._fh||.5===this._sy?this.y=e-this.height/2:(this._sy&&(this.y+=2*(e-this.y)*this._sy),this.height=2*(e-this.y)),this._sy=.5,this._fh=0},getCenter:function(e){return new(e?y:b)(this.getCenterX(),this.getCenterY(),this,"setCenter")},setCenter:function(){var e=y.read(arguments);return this.setCenterX(e.x),this.setCenterY(e.y),this},getArea:function(){return this.width*this.height},isEmpty:function(){return 0===this.width||0===this.height},contains:function(e){return e&&e.width!==s||4===(Array.isArray(e)?e:arguments).length?this._containsRectangle(x.read(arguments)):this._containsPoint(y.read(arguments))},_containsPoint:function(e){var t=e.x,n=e.y;return t>=this.x&&n>=this.y&&t<=this.x+this.width&&n<=this.y+this.height},_containsRectangle:function(e){var t=e.x,n=e.y;return t>=this.x&&n>=this.y&&t+e.width<=this.x+this.width&&n+e.height<=this.y+this.height},intersects:function(){var e=x.read(arguments),t=l.read(arguments)||0;return e.x+e.width>this.x-t&&e.y+e.height>this.y-t&&e.x=4&&(e[1]+=r?"Y":"X");var i=e[r?0:1],o=e[r?1:0],a="get"+i,s="get"+o,c="set"+i,u="set"+o,l="set"+n;this["get"+n]=function(e){return new(e?y:b)(this[a](),this[s](),this,l)},this[l]=function(){var e=y.read(arguments);this[c](e.x),this[u](e.y)}}),{beans:!0})),O=x.extend({initialize:function(e,t,n,r,i,o){this._set(e,t,n,r,!0),this._owner=i,this._setter=o},_set:function(e,t,n,r,i){return this._x=e,this._y=t,this._width=n,this._height=r,i||this._owner[this._setter](this),this}},new function(){var e=x.prototype;return l.each(["x","y","width","height"],(function(e){var t=l.capitalize(e),n="_"+e;this["get"+t]=function(){return this[n]},this["set"+t]=function(e){this[n]=e,this._dontNotify||this._owner[this._setter](this)}}),l.each(["Point","Size","Center","Left","Top","Right","Bottom","CenterX","CenterY","TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],(function(t){var n="set"+t;this[n]=function(){this._dontNotify=!0,e[n].apply(this,arguments),this._dontNotify=!1,this._owner[this._setter](this)}}),{isSelected:function(){return!!(2&this._owner._selection)},setSelected:function(e){var t=this._owner;t._changeSelection&&t._changeSelection(2,e)}}))}),S=l.extend({_class:"Matrix",initialize:function e(t,n){var r=arguments,i=r.length,o=!0;if(i>=6?this._set.apply(this,r):1===i||2===i?t instanceof e?this._set(t._a,t._b,t._c,t._d,t._tx,t._ty,n):Array.isArray(t)?this._set.apply(this,n?t.concat([n]):t):o=!1:i?o=!1:this.reset(),!o)throw new Error("Unsupported matrix parameters");return this},set:"#initialize",_set:function(e,t,n,r,i,o,a){return this._a=e,this._b=t,this._c=n,this._d=r,this._tx=i,this._ty=o,a||this._changed(),this},_serialize:function(e,t){return l.serialize(this.getValues(),e,!0,t)},_changed:function(){var e=this._owner;e&&(e._applyMatrix?e.transform(null,!0):e._changed(25))},clone:function(){return new S(this._a,this._b,this._c,this._d,this._tx,this._ty)},equals:function(e){return e===this||e&&this._a===e._a&&this._b===e._b&&this._c===e._c&&this._d===e._d&&this._tx===e._tx&&this._ty===e._ty},toString:function(){var e=g.instance;return"[["+[e.number(this._a),e.number(this._c),e.number(this._tx)].join(", ")+"], ["+[e.number(this._b),e.number(this._d),e.number(this._ty)].join(", ")+"]]"},reset:function(e){return this._a=this._d=1,this._b=this._c=this._tx=this._ty=0,e||this._changed(),this},apply:function(e,t){var n=this._owner;return!!n&&(n.transform(null,l.pick(e,!0),t),this.isIdentity())},translate:function(){var e=y.read(arguments),t=e.x,n=e.y;return this._tx+=t*this._a+n*this._c,this._ty+=t*this._b+n*this._d,this._changed(),this},scale:function(){var e=arguments,t=y.read(e),n=y.read(e,0,{readNull:!0});return n&&this.translate(n),this._a*=t.x,this._b*=t.x,this._c*=t.y,this._d*=t.y,n&&this.translate(n.negate()),this._changed(),this},rotate:function(e){e*=Math.PI/180;var t=y.read(arguments,1),n=t.x,r=t.y,i=Math.cos(e),o=Math.sin(e),a=n-n*i+r*o,s=r-n*o-r*i,c=this._a,u=this._b,l=this._c,f=this._d;return this._a=i*c+o*l,this._b=i*u+o*f,this._c=-o*c+i*l,this._d=-o*u+i*f,this._tx+=a*c+s*l,this._ty+=a*u+s*f,this._changed(),this},shear:function(){var e=arguments,t=y.read(e),n=y.read(e,0,{readNull:!0});n&&this.translate(n);var r=this._a,i=this._b;return this._a+=t.y*this._c,this._b+=t.y*this._d,this._c+=t.x*r,this._d+=t.x*i,n&&this.translate(n.negate()),this._changed(),this},skew:function(){var e=arguments,t=y.read(e),n=y.read(e,0,{readNull:!0}),r=Math.PI/180,i=new y(Math.tan(t.x*r),Math.tan(t.y*r));return this.shear(i,n)},append:function(e,t){if(e){var n=this._a,r=this._b,i=this._c,o=this._d,a=e._a,s=e._c,c=e._b,u=e._d,l=e._tx,f=e._ty;this._a=a*n+c*i,this._c=s*n+u*i,this._b=a*r+c*o,this._d=s*r+u*o,this._tx+=l*n+f*i,this._ty+=l*r+f*o,t||this._changed()}return this},prepend:function(e,t){if(e){var n=this._a,r=this._b,i=this._c,o=this._d,a=this._tx,s=this._ty,c=e._a,u=e._c,l=e._b,f=e._d,d=e._tx,p=e._ty;this._a=c*n+u*r,this._c=c*i+u*o,this._b=l*n+f*r,this._d=l*i+f*o,this._tx=c*a+u*s+d,this._ty=l*a+f*s+p,t||this._changed()}return this},appended:function(e){return this.clone().append(e)},prepended:function(e){return this.clone().prepend(e)},invert:function(){var e=this._a,t=this._b,n=this._c,r=this._d,i=this._tx,o=this._ty,a=e*r-t*n,s=null;return a&&!isNaN(a)&&isFinite(i)&&isFinite(o)&&(this._a=r/a,this._b=-t/a,this._c=-n/a,this._d=e/a,this._tx=(n*o-r*i)/a,this._ty=(t*i-e*o)/a,s=this),s},inverted:function(){return this.clone().invert()},concatenate:"#append",preConcatenate:"#prepend",chain:"#appended",_shiftless:function(){return new S(this._a,this._b,this._c,this._d,0,0)},_orNullIfIdentity:function(){return this.isIdentity()?null:this},isIdentity:function(){return 1===this._a&&0===this._b&&0===this._c&&1===this._d&&0===this._tx&&0===this._ty},isInvertible:function(){var e=this._a*this._d-this._c*this._b;return e&&!isNaN(e)&&isFinite(this._tx)&&isFinite(this._ty)},isSingular:function(){return!this.isInvertible()},transform:function(e,t,n){return arguments.length<3?this._transformPoint(y.read(arguments)):this._transformCoordinates(e,t,n)},_transformPoint:function(e,t,n){var r=e.x,i=e.y;return t||(t=new y),t._set(r*this._a+i*this._c+this._tx,r*this._b+i*this._d+this._ty,n)},_transformCoordinates:function(e,t,n){for(var r=0,i=2*n;ro[c]&&(o[c]=s)}return t||(t=new x),t._set(i[0],i[1],o[0]-i[0],o[1]-i[1],n)},inverseTransform:function(){return this._inverseTransform(y.read(arguments))},_inverseTransform:function(e,t,n){var r=this._a,i=this._b,o=this._c,a=this._d,s=this._tx,c=this._ty,u=r*a-i*o,l=null;if(u&&!isNaN(u)&&isFinite(s)&&isFinite(c)){var f=e.x-this._tx,d=e.y-this._ty;t||(t=new y),l=t._set((f*a-d*o)/u,(d*r-f*i)/u,n)}return l},decompose:function(){var e,t,n,r=this._a,i=this._b,o=this._c,a=this._d,s=r*a-i*o,c=Math.sqrt,u=Math.atan2,l=180/Math.PI;if(0!==r||0!==i){var f=c(r*r+i*i);e=Math.acos(r/f)*(i>0?1:-1),t=[f,s/f],n=[u(r*o+i*a,f*f),0]}else if(0!==o||0!==a){var d=c(o*o+a*a);e=Math.asin(o/d)*(a>0?1:-1),t=[s/d,d],n=[0,u(r*o+i*a,d*d)]}else e=0,n=t=[0,0];return{translation:this.getTranslation(),rotation:e*l,scaling:new y(t),skewing:new y(n[0]*l,n[1]*l)}},getValues:function(){return[this._a,this._b,this._c,this._d,this._tx,this._ty]},getTranslation:function(){return new y(this._tx,this._ty)},getScaling:function(){return this.decompose().scaling},getRotation:function(){return this.decompose().rotation},applyToContext:function(e){this.isIdentity()||e.transform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},l.each(["a","b","c","d","tx","ty"],(function(e){var t=l.capitalize(e),n="_"+e;this["get"+t]=function(){return this[n]},this["set"+t]=function(e){this[n]=e,this._changed()}}),{})),E=l.extend({_class:"Line",initialize:function(e,t,n,r,i){var o=!1;arguments.length>=4?(this._px=e,this._py=t,this._vx=n,this._vy=r,o=i):(this._px=e.x,this._py=e.y,this._vx=t.x,this._vy=t.y,o=n),o||(this._vx-=this._px,this._vy-=this._py)},getPoint:function(){return new y(this._px,this._py)},getVector:function(){return new y(this._vx,this._vy)},getLength:function(){return this.getVector().getLength()},intersect:function(e,t){return E.intersect(this._px,this._py,this._vx,this._vy,e._px,e._py,e._vx,e._vy,!0,t)},getSide:function(e,t){return E.getSide(this._px,this._py,this._vx,this._vy,e.x,e.y,!0,t)},getDistance:function(e){return Math.abs(this.getSignedDistance(e))},getSignedDistance:function(e){return E.getSignedDistance(this._px,this._py,this._vx,this._vy,e.x,e.y,!0)},isCollinear:function(e){return y.isCollinear(this._vx,this._vy,e._vx,e._vy)},isOrthogonal:function(e){return y.isOrthogonal(this._vx,this._vy,e._vx,e._vy)},statics:{intersect:function(e,t,n,r,i,o,a,s,c,u){c||(n-=e,r-=t,a-=i,s-=o);var l=n*s-r*a;if(!v.isMachineZero(l)){var f=e-i,d=t-o,p=(a*d-s*f)/l,h=(n*d-r*f)/l;if(u||-1e-12=1?1:p),new y(e+p*n,t+p*r)}},getSide:function(e,t,n,r,i,o,a,s){a||(n-=e,r-=t);var c=i-e,u=c*r-(o-t)*n;return!s&&v.isMachineZero(u)&&(u=(c*n+c*n)/(n*n+r*r))>=0&&u<=1&&(u=0),u<0?-1:u>0?1:0},getSignedDistance:function(e,t,n,r,i,o,a){return a||(n-=e,r-=t),0===n?r>0?i-e:e-i:0===r?n<0?o-t:t-o:((i-e)*r-(o-t)*n)/(r>n?r*Math.sqrt(1+n*n/(r*r)):n*Math.sqrt(1+r*r/(n*n)))},getDistance:function(e,t,n,r,i,o,a){return Math.abs(E.getSignedDistance(e,t,n,r,i,o,a))}}}),C=p.extend({_class:"Project",_list:"projects",_reference:"project",_compactSerialize:!0,initialize:function(e){p.call(this,!0),this._children=[],this._namedChildren={},this._activeLayer=null,this._currentStyle=new Z(null,null,this),this._view=Y.create(this,e||ce.getCanvas(1,1)),this._selectionItems={},this._selectionCount=0,this._updateVersion=0},_serialize:function(e,t){return l.serialize(this._children,e,!0,t)},_changed:function(e,t){if(1&e){var n=this._view;n&&(n._needsUpdate=!0,!n._requested&&n._autoUpdate&&n.requestUpdate())}var r=this._changes;if(r&&t){var i=this._changesById,o=t._id,a=i[o];a?a.flags|=e:r.push(i[o]={item:t,flags:e})}},clear:function(){for(var e=this._children,t=e.length-1;t>=0;t--)e[t].remove()},isEmpty:function(){return!this._children.length},remove:function e(){return!!e.base.call(this)&&(this._view&&this._view.remove(),!0)},getView:function(){return this._view},getCurrentStyle:function(){return this._currentStyle},setCurrentStyle:function(e){this._currentStyle.set(e)},getIndex:function(){return this._index},getOptions:function(){return this._scope.settings},getLayers:function(){return this._children},getActiveLayer:function(){return this._activeLayer||new j({project:this,insert:!0})},getSymbolDefinitions:function(){var e=[],t={};return this.getItems({class:R,match:function(n){var r=n._definition,i=r._id;return t[i]||(t[i]=!0,e.push(r)),!1}}),e},getSymbols:"getSymbolDefinitions",getSelectedItems:function(){var e=this._selectionItems,t=[];for(var n in e){var r=e[n],i=r._selection;1&i&&r.isInserted()?t.push(r):i||this._updateSelection(r)}return t},_updateSelection:function(e){var t=e._id,n=this._selectionItems;e._selection?n[t]!==e&&(this._selectionCount++,n[t]=e):n[t]===e&&(this._selectionCount--,delete n[t])},selectAll:function(){for(var e=this._children,t=0,n=e.length;t0){e.save(),e.strokeWidth=1;var s=this._selectionItems,c=this._scope.settings.handleSize,u=this._updateVersion;for(var f in s)s[f]._drawSelection(e,t,c,s,u);e.restore()}}}),k=l.extend(f,{statics:{extend:function e(t){return t._serializeFields&&(t._serializeFields=l.set({},this.prototype._serializeFields,t._serializeFields)),e.base.apply(this,arguments)},NO_INSERT:{insert:!1}},_class:"Item",_name:null,_applyMatrix:!0,_canApplyMatrix:!0,_canScaleStroke:!1,_pivot:null,_visible:!0,_blendMode:"normal",_opacity:1,_locked:!1,_guide:!1,_clipMask:!1,_selection:0,_selectBounds:!0,_selectChildren:!1,_serializeFields:{name:null,applyMatrix:null,matrix:new S,pivot:null,visible:!0,blendMode:"normal",opacity:1,locked:!1,guide:!1,clipMask:!1,selected:!1,data:{}},_prioritize:["applyMatrix"]},new function(){var e=["onMouseDown","onMouseUp","onMouseDrag","onClick","onDoubleClick","onMouseMove","onMouseEnter","onMouseLeave"];return l.each(e,(function(e){this._events[e]={install:function(e){this.getView()._countItemEvent(e,1)},uninstall:function(e){this.getView()._countItemEvent(e,-1)}}}),{_events:{onFrame:{install:function(){this.getView()._animateItem(this,!0)},uninstall:function(){this.getView()._animateItem(this,!1)}},onLoad:{},onError:{}},statics:{_itemHandlers:e}})},{initialize:function(){},_initialize:function(e,t){var n=e&&l.isPlainObject(e),r=n&&!0===e.internal,i=this._matrix=new S,o=n&&e.project||de.project,a=de.settings;return this._id=r?null:m.get(),this._parent=this._index=null,this._applyMatrix=this._canApplyMatrix&&a.applyMatrix,t&&i.translate(t),i._owner=this,this._style=new Z(o._currentStyle,this,o),r||n&&0==e.insert||!a.insertItems&&(!n||!0!==e.insert)?this._setProject(o):(n&&e.parent||o)._insertItem(s,this,!0),n&&e!==k.NO_INSERT&&this.set(e,{internal:!0,insert:!0,project:!0,parent:!0}),n},_serialize:function(e,t){var n={},r=this;function i(i){for(var o in i){var a=r[o];l.equals(a,"leading"===o?1.2*i.fontSize:i[o])||(n[o]=l.serialize(a,e,"data"!==o,t))}}return i(this._serializeFields),this instanceof T||i(this._style._defaults),[this._class,n]},_changed:function(e){var t=this._symbol,n=this._parent||t,r=this._project;8&e&&(this._bounds=this._position=this._decomposed=s),16&e&&(this._globalMatrix=s),n&&72&e&&k._clearBoundsCache(n),2&e&&k._clearBoundsCache(this),r&&r._changed(e,this),t&&t._changed(e)},getId:function(){return this._id},getName:function(){return this._name},setName:function(e){if(this._name&&this._removeNamed(),e===+e+"")throw new Error("Names consisting only of numbers are not supported.");var t=this._getOwner();if(e&&t){var n=t._children,r=t._namedChildren;(r[e]=r[e]||[]).push(this),e in n||(n[e]=this)}this._name=e||s,this._changed(256)},getStyle:function(){return this._style},setStyle:function(e){this.getStyle().set(e)}},l.each(["locked","visible","blendMode","opacity","guide"],(function(e){var t=l.capitalize(e),n="_"+e,r={locked:256,visible:265};this["get"+t]=function(){return this[n]},this["set"+t]=function(t){t!=this[n]&&(this[n]=t,this._changed(r[e]||257))}}),{}),{beans:!0,getSelection:function(){return this._selection},setSelection:function(e){if(e!==this._selection){this._selection=e;var t=this._project;t&&(t._updateSelection(this),this._changed(257))}},_changeSelection:function(e,t){var n=this._selection;this.setSelection(t?n|e:n&~e)},isSelected:function(){if(this._selectChildren)for(var e=this._children,t=0,n=e.length;t=0;n--)if(t[n].contains(e))return!0;return!1}return e.isInside(this.getInternalBounds())},isInside:function(){return x.read(arguments).contains(this.getBounds())},_asPathItem:function(){return new F.Rectangle({rectangle:this.getInternalBounds(),matrix:this._matrix,insert:!1})},intersects:function(e,t){return e instanceof k&&this._asPathItem().getIntersections(e._asPathItem(),null,t,!0).length>0}},new function(){function e(){var e=arguments;return this._hitTest(y.read(e),M.getOptions(e))}function t(){var e=arguments,t=y.read(e),n=M.getOptions(e),r=[];return this._hitTest(t,new l({all:r},n)),r}function n(e,t,n,r){var i=this._children;if(i)for(var o=i.length-1;o>=0;o--){var a=i[o],s=a!==r&&a._hitTest(e,t,n);if(s&&!t.all)return s}return null}return C.inject({hitTest:e,hitTestAll:t,_hitTest:n}),{hitTest:e,hitTestAll:t,_hitTestChildren:n}},{_hitTest:function(e,t,n){if(this._locked||!this._visible||this._guide&&!t.guides||this.isEmpty())return null;var r=this._matrix,i=n?n.appended(r):this.getGlobalMatrix().prepend(this.getView()._matrix),o=Math.max(t.tolerance,1e-12),a=t._tolerancePadding=new w(F._getStrokePadding(o,r._shiftless().invert()));if(!(e=r._inverseTransform(e))||!this._children&&!this.getBounds({internal:!0,stroke:!0,handle:!0}).expand(a.multiply(2))._containsPoint(e))return null;var s,c,u=!(t.guides&&!this._guide||t.selected&&!this.isSelected()||t.type&&t.type!==l.hyphenate(this._class)||t.class&&!(this instanceof t.class)),f=t.match,d=this;function p(e){return e&&f&&!f(e)&&(e=null),e&&t.all&&t.all.push(e),e}function h(t,n){var r=n?s["get"+n]():d.getPosition();if(e.subtract(r).divide(a).length<=1)return new M(t,d,{name:n?l.hyphenate(n):t,point:r})}var g=t.position,v=t.center,m=t.bounds;if(u&&this._parent&&(g||v||m)){if((v||m)&&(s=this.getInternalBounds()),!(c=g&&h("position")||v&&h("center","Center"))&&m)for(var y=["TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],b=0;b<8&&!c;b++)c=h("bounds",y[b]);c=p(c)}return c||(c=this._hitTestChildren(e,t,i)||u&&p(this._hitTestSelf(e,t,i,this.getStrokeScaling()?null:i._shiftless().invert()))||null),c&&c.point&&(c.point=r.transform(c.point)),c},_hitTestSelf:function(e,t){if(t.fill&&this.hasFill()&&this._contains(e))return new M("fill",this)},matches:function(e,t){var n=typeof e;if("object"===n){for(var r in e)if(e.hasOwnProperty(r)&&!this.matches(r,e[r]))return!1;return!0}if("function"===n)return e(this);if("match"===e)return t(this);var i=/^(empty|editable)$/.test(e)?this["is"+l.capitalize(e)]():"type"===e?l.hyphenate(this._class):this[e];if("class"===e){if("function"==typeof t)return this instanceof t;i=this._class}if("function"==typeof t)return!!t(i);if(t){if(t.test)return t.test(i);if(l.isPlainObject(t))return function e(t,n){for(var r in t)if(t.hasOwnProperty(r)){var i=t[r],o=n[r];if(l.isPlainObject(i)&&l.isPlainObject(o)){if(!e(i,o))return!1}else if(!l.equals(i,o))return!1}return!0}(t,i)}return l.equals(i,t)},getItems:function(e){return k._getItems(this,e,this._matrix)},getItem:function(e){return k._getItems(this,e,this._matrix,null,!0)[0]||null},statics:{_getItems:function e(t,n,r,i,o){if(!i){var a="object"==typeof n&&n,s=a&&a.overlapping,c=a&&a.inside,u=(y=s||c)&&x.read([y]);i={items:[],recursive:a&&!1!==a.recursive,inside:!!c,overlapping:!!s,rect:u,path:s&&new F.Rectangle({rectangle:u,insert:!1})},a&&(n=l.filter({},n,{recursive:!0,inside:!0,overlapping:!0}))}var f=t._children,d=i.items;r=(u=i.rect)&&(r||new S);for(var p=0,h=f&&f.length;p0)break}return d}}},{importJSON:function(e){var t=l.importJSON(e,this);return t!==this?this.addChild(t):t},addChild:function(e){return this.insertChild(s,e)},insertChild:function(e,t){var n=t?this.insertChildren(e,[t]):null;return n&&n[0]},addChildren:function(e){return this.insertChildren(this._children.length,e)},insertChildren:function(e,t){var n=this._children;if(n&&t&&t.length>0){for(var r={},i=(t=l.slice(t)).length-1;i>=0;i--){var o=(u=t[i])&&u._id;!u||r[o]?t.splice(i,1):(u._remove(!1,!0),r[o]=!0)}l.splice(n,t,e,0);for(var a=this._project,s=a._changes,c=(i=0,t.length);i=0;r--)n[r]._remove(!0,!1);return n.length>0&&this._changed(11),n},clear:"#removeChildren",reverseChildren:function(){if(this._children){this._children.reverse();for(var e=0,t=this._children.length;e0},isInserted:function(){return!!this._parent&&this._parent.isInserted()},isAbove:function(e){return-1===this._getOrder(e)},isBelow:function(e){return 1===this._getOrder(e)},isParent:function(e){return this._parent===e},isChild:function(e){return e&&e._parent===this},isDescendant:function(e){for(var t=this;t=t._parent;)if(t===e)return!0;return!1},isAncestor:function(e){return!!e&&e.isDescendant(this)},isSibling:function(e){return this._parent===e._parent},isGroupedWith:function(e){for(var t=this._parent;t;){if(t._parent&&/^(Group|Layer|CompoundPath)$/.test(t._class)&&e.isDescendant(t))return!0;t=t._parent}return!1}},l.each(["rotate","scale","shear","skew"],(function(e){var t="rotate"===e;this[e]=function(){var n=arguments,r=(t?l:y).read(n),i=y.read(n,0,{readNull:!0});return this.transform((new S)[e](r,i||this.getPosition(!0)))}}),{translate:function(){var e=new S;return this.transform(e.translate.apply(e,arguments))},transform:function(e,t,n){var r=this._matrix,i=e&&!e.isIdentity(),o=n&&this._canApplyMatrix||this._applyMatrix&&(i||!r.isIdentity()||t&&this._children);if(!i&&!o)return this;if(i){!e.isInvertible()&&r.isInvertible()&&(r._backup=r.getValues()),r.prepend(e,!0);var a=this._style,s=a.getFillColor(!0),c=a.getStrokeColor(!0);s&&s.transform(e),c&&c.transform(e)}if(o&&(o=this._transformContent(r,t,n))){var u=this._pivot;u&&r._transformPoint(u,u,!0),r.reset(!0),n&&this._canApplyMatrix&&(this._applyMatrix=!0)}var l=this._bounds,f=this._position;(i||o)&&this._changed(25);var d=i&&l&&e.decompose();if(d&&d.skewing.isZero()&&d.rotation%90==0){for(var p in l){var h=l[p];if(h.nonscaling)delete l[p];else if(o||!h.internal){var g=h.rect;e._transformBounds(g,g)}}this._bounds=l;var v=l[this._getBoundsCacheKey(this._boundsOptions||{})];v&&(this._position=this._getPositionFromBounds(v.rect))}else i&&f&&this._pivot&&(this._position=e._transformPoint(f,f));return this},_transformContent:function(e,t,n){var r=this._children;if(r){for(var i=0,o=r.length;ii:r1&&o<4?-1:1,o>2?-1:1),s=a.multiply(i),c=s.subtract(a.multiply(r));if(new x(n?s.add(a.multiply(n)):s,c).contains(t))return{point:c,quadrant:o}}}function t(e,t,n,r){var i=e.divide(t);return(!r||i.isInQuadrant(r))&&i.subtract(i.normalize()).multiply(t).divide(n).length<=1}return{_contains:function t(n){if("rectangle"===this._type){var r=e(this,n);return r?n.subtract(r.point).divide(this._radius).getLength()<=1:t.base.call(this,n)}return n.divide(this.size).getLength()<=.5},_hitTestSelf:function n(r,i,o,a){var s=!1,c=this._style,u=i.stroke&&c.hasStroke(),l=i.fill&&c.hasFill();if(u||l){var f=this._type,d=this._radius,p=u?c.getStrokeWidth()/2:0,h=i._tolerancePadding.add(F._getStrokePadding(p,!c.getStrokeScaling()&&a));if("rectangle"===f){var g=h.multiply(2),v=e(this,r,g);if(v)s=t(r.subtract(v.point),d,h,v.quadrant);else{var m=new x(this._size).setCenter(0,0),y=m.expand(g),b=m.expand(g.negate());s=y._containsPoint(r)&&!b._containsPoint(r)}}else s=t(r,d,h)}return s?new M(u?"stroke":"fill",this):n.base.apply(this,arguments)}}},{statics:new function(){function e(e,t,n,r,i){var o=l.create(P.prototype);return o._type=e,o._size=n,o._radius=r,o._initialize(l.getNamed(i),t),o}return{Circle:function(){var t=arguments,n=y.readNamed(t,"center"),r=l.readNamed(t,"radius");return e("circle",n,new w(2*r),r,t)},Rectangle:function(){var t=arguments,n=x.readNamed(t,"rectangle"),r=w.min(w.readNamed(t,"radius"),n.getSize(!0).divide(2));return e("rectangle",n.getCenter(!0),n.getSize(!0),r,t)},Ellipse:function(){var t=arguments,n=P._readEllipse(t),r=n.radius;return e("ellipse",n.center,r.multiply(2),r,t)},_readEllipse:function(e){var t,n;if(l.hasNamed(e,"radius"))t=y.readNamed(e,"center"),n=w.readNamed(e,"radius");else{var r=x.readNamed(e,"rectangle");t=r.getCenter(!0),n=r.getSize(!0).divide(2)}return{center:t,radius:n}}}}}),I=k.extend({_class:"Raster",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!1,handle:!1},_serializeFields:{crossOrigin:null,source:null},_prioritize:["crossOrigin"],_smoothing:"low",beans:!0,initialize:function(e,t){if(!this._initialize(e,t!==s&&y.read(arguments))){var n,r=typeof e,i="string"===r?u.getElementById(e):"object"===r?e:null;if(i&&i!==k.NO_INSERT)if(i.getContext||null!=i.naturalHeight)n=i;else if(i){var o=w.read(arguments);o.isZero()||(n=ce.getCanvas(o))}n?this.setImage(n):this.setSource(e)}this._size||(this._size=new w,this._loaded=!1)},_equals:function(e){return this.getSource()===e.getSource()},copyContent:function(e){var t=e._image,n=e._canvas;if(t)this._setImage(t);else if(n){var r=ce.getCanvas(e._size);r.getContext("2d").drawImage(n,0,0),this._setImage(r)}this._crossOrigin=e._crossOrigin},getSize:function(){var e=this._size;return new _(e?e.width:0,e?e.height:0,this,"setSize")},setSize:function(e,t){var n=w.read(arguments);if(n.equals(this._size))t&&this.clear();else if(n.width>0&&n.height>0){var r=!t&&this.getElement();this._setImage(ce.getCanvas(n)),r&&this.getContext(!0).drawImage(r,0,0,n.width,n.height)}else this._canvas&&ce.release(this._canvas),this._size=n.clone()},getWidth:function(){return this._size?this._size.width:0},setWidth:function(e){this.setSize(e,this.getHeight())},getHeight:function(){return this._size?this._size.height:0},setHeight:function(e){this.setSize(this.getWidth(),e)},getLoaded:function(){return this._loaded},isEmpty:function(){var e=this._size;return!e||0===e.width&&0===e.height},getResolution:function(){var e=this._matrix,t=new y(0,0).transform(e),n=new y(1,0).transform(e).subtract(t),r=new y(0,1).transform(e).subtract(t);return new w(72/n.getLength(),72/r.getLength())},getPpi:"#getResolution",getImage:function(){return this._image},setImage:function(e){var t=this;function n(e){var n=t.getView(),r=e&&e.type||"load";n&&t.responds(r)&&(de=n._scope,t.emit(r,new ee(e)))}this._setImage(e),this._loaded?setTimeout(n,0):e&&Q.add(e,{load:function(r){t._setImage(e),n(r)},error:n})},_setImage:function(e){this._canvas&&ce.release(this._canvas),e&&e.getContext?(this._image=null,this._canvas=e,this._loaded=!0):(this._image=e,this._canvas=null,this._loaded=!!(e&&e.src&&e.complete)),this._size=new w(e?e.naturalWidth||e.width:0,e?e.naturalHeight||e.height:0),this._context=null,this._changed(1033)},getCanvas:function(){if(!this._canvas){var e=ce.getContext(this._size);try{this._image&&e.drawImage(this._image,0,0),this._canvas=e.canvas}catch(t){ce.release(e)}}return this._canvas},setCanvas:"#setImage",getContext:function(e){return this._context||(this._context=this.getCanvas().getContext("2d")),e&&(this._image=null,this._changed(1025)),this._context},setContext:function(e){this._context=e},getSource:function(){var e=this._image;return e&&e.src||this.toDataURL()},setSource:function(e){var t=new a.Image,n=this._crossOrigin;n&&(t.crossOrigin=n),e&&(t.src=e),this.setImage(t)},getCrossOrigin:function(){var e=this._image;return e&&e.crossOrigin||this._crossOrigin||""},setCrossOrigin:function(e){this._crossOrigin=e;var t=this._image;t&&(t.crossOrigin=e)},getSmoothing:function(){return this._smoothing},setSmoothing:function(e){this._smoothing="string"==typeof e?e:e?"low":"off",this._changed(257)},getElement:function(){return this._canvas||this._loaded&&this._image}},{beans:!1,getSubCanvas:function(){var e=x.read(arguments),t=ce.getContext(e.getSize());return t.drawImage(this.getCanvas(),e.x,e.y,e.width,e.height,0,0,e.width,e.height),t.canvas},getSubRaster:function(){var e=x.read(arguments),t=new I(k.NO_INSERT);return t._setImage(this.getSubCanvas(e)),t.translate(e.getCenter().subtract(this.getSize().divide(2))),t._matrix.prepend(this._matrix),t.insertAbove(this),t},toDataURL:function(){var e=this._image,t=e&&e.src;if(/^data:/.test(t))return t;var n=this.getCanvas();return n?n.toDataURL.apply(n,arguments):null},drawImage:function(e){var t=y.read(arguments,1);this.getContext(!0).drawImage(e,t.x,t.y)},getAverageColor:function(e){var t,n;if(e?e instanceof B?(n=e,t=e.getBounds()):"object"==typeof e&&("width"in e?t=new x(e):"x"in e&&(t=new x(e.x-.5,e.y-.5,1,1))):t=this.getBounds(),!t)return null;var r=Math.min(t.width,32),i=Math.min(t.height,32),o=I._sampleContext;o?o.clearRect(0,0,33,33):o=I._sampleContext=ce.getContext(new w(32)),o.save();var a=(new S).scale(r/t.width,i/t.height).translate(-t.x,-t.y);a.applyToContext(o),n&&n.draw(o,new l({clip:!0,matrices:[a]})),this._matrix.applyToContext(o);var s=this.getElement(),c=this._size;s&&o.drawImage(s,-c.width/2,-c.height/2),o.restore();for(var u=o.getImageData(.5,.5,Math.ceil(r),Math.ceil(i)).data,f=[0,0,0],d=0,p=0,h=u.length;p0&&r.height>0){e.globalAlpha=v.clamp(this._opacity,0,1),this._setStyles(e,t,n);var i=this._smoothing,o="off"===i;X.setPrefixed(e,o?"imageSmoothingEnabled":"imageSmoothingQuality",!o&&i),e.drawImage(r,-this._size.width/2,-this._size.height/2)}},_canComposite:function(){return!0}}),R=k.extend({_class:"SymbolItem",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!0},_serializeFields:{symbol:null},initialize:function(e,t){this._initialize(e,t!==s&&y.read(arguments,1))||this.setDefinition(e instanceof A?e:new A(e))},_equals:function(e){return this._definition===e._definition},copyContent:function(e){this.setDefinition(e._definition)},getDefinition:function(){return this._definition},setDefinition:function(e){this._definition=e,this._changed(9)},getSymbol:"#getDefinition",setSymbol:"#setDefinition",isEmpty:function(){return this._definition._item.isEmpty()},_getBounds:function(e,t){var n=this._definition._item;return n._getCachedBounds(n._matrix.prepended(e),t)},_hitTestSelf:function(e,t,n){var r=t.extend({all:!1}),i=this._definition._item._hitTest(e,r,n);return i&&(i.item=this),i},_draw:function(e,t){this._definition._item.draw(e,t)}}),A=l.extend({_class:"SymbolDefinition",initialize:function(e,t){this._id=m.get(),this.project=de.project,e&&this.setItem(e,t)},_serialize:function(e,t){return t.add(this,(function(){return l.serialize([this._class,this._item],e,!1,t)}))},_changed:function(e){8&e&&k._clearBoundsCache(this),1&e&&this.project._changed(e)},getItem:function(){return this._item},setItem:function(e,t){e._symbol&&(e=e.clone()),this._item&&(this._item._symbol=null),this._item=e,e.remove(),e.setSelected(!1),t||e.setPosition(new y),e._symbol=this,this._changed(9)},getDefinition:"#getItem",setDefinition:"#setItem",place:function(e){return new R(this,e)},clone:function(){return new A(this._item.clone(!1))},equals:function(e){return e===this||e&&this._item.equals(e._item)||!1}}),M=l.extend({_class:"HitResult",initialize:function(e,t,n){this.type=e,this.item=t,n&&this.inject(n)},statics:{getOptions:function(e){var t=e&&l.read(e);return new l({type:null,tolerance:de.settings.hitTolerance,fill:!t,stroke:!t,segments:!t,handles:!1,ends:!1,position:!1,center:!1,bounds:!1,guides:!1,selected:!1},t)}}}),D=l.extend({_class:"Segment",beans:!0,_selection:0,initialize:function(e,t,n,r,i,o){var a,c,u,l,f=arguments.length;f>0&&(null==e||"object"==typeof e?1===f&&e&&"point"in e?(a=e.point,c=e.handleIn,u=e.handleOut,l=e.selection):(a=e,c=t,u=n,l=r):(a=[e,t],c=n!==s?[n,r]:null,u=i!==s?[i,o]:null)),new N(a,this,"_point"),new N(c,this,"_handleIn"),new N(u,this,"_handleOut"),l&&this.setSelection(l)},_serialize:function(e,t){var n=this._point,r=this._selection,i=r||this.hasHandles()?[n,this._handleIn,this._handleOut]:n;return r&&i.push(r),l.serialize(i,e,!0,t)},_changed:function(e){var t=this._path;if(t){var n,r=t._curves,i=this._index;r&&(e&&e!==this._point&&e!==this._handleIn||!(n=i>0?r[i-1]:t._closed?r[r.length-1]:null)||n._changed(),e&&e!==this._point&&e!==this._handleOut||!(n=r[i])||n._changed()),t._changed(41)}},getPoint:function(){return this._point},setPoint:function(){this._point.set(y.read(arguments))},getHandleIn:function(){return this._handleIn},setHandleIn:function(){this._handleIn.set(y.read(arguments))},getHandleOut:function(){return this._handleOut},setHandleOut:function(){this._handleOut.set(y.read(arguments))},hasHandles:function(){return!this._handleIn.isZero()||!this._handleOut.isZero()},isSmooth:function(){var e=this._handleIn,t=this._handleOut;return!e.isZero()&&!t.isZero()&&e.isCollinear(t)},clearHandles:function(){this._handleIn._set(0,0),this._handleOut._set(0,0)},getSelection:function(){return this._selection},setSelection:function(e){var t=this._selection,n=this._path;this._selection=e=e||0,n&&e!==t&&(n._updateSelection(this,t,e),n._changed(257))},_changeSelection:function(e,t){var n=this._selection;this.setSelection(t?n|e:n&~e)},isSelected:function(){return!!(7&this._selection)},setSelected:function(e){this._changeSelection(7,e)},getIndex:function(){return this._index!==s?this._index:null},getPath:function(){return this._path||null},getCurve:function(){var e=this._path,t=this._index;return e?(t>0&&!e._closed&&t===e._segments.length-1&&t--,e.getCurves()[t]||null):null},getLocation:function(){var e=this.getCurve();return e?new z(e,this===e._segment1?0:1):null},getNext:function(){var e=this._path&&this._path._segments;return e&&(e[this._index+1]||this._path._closed&&e[0])||null},smooth:function(e,t,n){var r=e||{},i=r.type,o=r.factor,a=this.getPrevious(),c=this.getNext(),u=(a||this)._point,l=this._point,f=(c||this)._point,d=u.getDistance(l),p=l.getDistance(f);if(i&&"catmull-rom"!==i){if("geometric"!==i)throw new Error("Smoothing method '"+i+"' not supported.");if(a&&c){var h=u.subtract(f),g=o===s?.4:o,v=g*d/(d+p);t||this.setHandleIn(h.multiply(v)),n||this.setHandleOut(h.multiply(v-g))}}else{var m=o===s?.5:o,b=Math.pow(d,m),w=b*b,_=Math.pow(p,m),x=_*_;if(!t&&a){var O=2*x+3*_*b+w,S=3*_*(_+b);this.setHandleIn(0!==S?new y((x*u._x+O*l._x-w*f._x)/S-l._x,(x*u._y+O*l._y-w*f._y)/S-l._y):new y)}if(!n&&c){O=2*w+3*b*_+x,S=3*b*(b+_);this.setHandleOut(0!==S?new y((w*f._x+O*l._x-x*u._x)/S-l._x,(w*f._y+O*l._y-x*u._y)/S-l._y):new y)}}},getPrevious:function(){var e=this._path&&this._path._segments;return e&&(e[this._index-1]||this._path._closed&&e[e.length-1])||null},isFirst:function(){return!this._index},isLast:function(){var e=this._path;return e&&this._index===e._segments.length-1||!1},reverse:function(){var e=this._handleIn,t=this._handleOut,n=e.clone();e.set(t),t.set(n)},reversed:function(){return new D(this._point,this._handleOut,this._handleIn)},remove:function(){return!!this._path&&!!this._path.removeSegment(this._index)},clone:function(){return new D(this._point,this._handleIn,this._handleOut)},equals:function(e){return e===this||e&&this._class===e._class&&this._point.equals(e._point)&&this._handleIn.equals(e._handleIn)&&this._handleOut.equals(e._handleOut)||!1},toString:function(){var e=["point: "+this._point];return this._handleIn.isZero()||e.push("handleIn: "+this._handleIn),this._handleOut.isZero()||e.push("handleOut: "+this._handleOut),"{ "+e.join(", ")+" }"},transform:function(e){this._transformCoordinates(e,new Array(6),!0),this._changed()},interpolate:function(e,t,n){var r=1-n,i=n,o=e._point,a=t._point,s=e._handleIn,c=t._handleIn,u=t._handleOut,l=e._handleOut;this._point._set(r*o._x+i*a._x,r*o._y+i*a._y,!0),this._handleIn._set(r*s._x+i*c._x,r*s._y+i*c._y,!0),this._handleOut._set(r*l._x+i*u._x,r*l._y+i*u._y,!0),this._changed()},_transformCoordinates:function(e,t,n){var r=this._point,i=n&&this._handleIn.isZero()?null:this._handleIn,o=n&&this._handleOut.isZero()?null:this._handleOut,a=r._x,s=r._y,c=2;return t[0]=a,t[1]=s,i&&(t[c++]=i._x+a,t[c++]=i._y+s),o&&(t[c++]=o._x+a,t[c++]=o._y+s),e&&(e._transformCoordinates(t,t,c/2),a=t[0],s=t[1],n?(r._x=a,r._y=s,c=2,i&&(i._x=t[c++]-a,i._y=t[c++]-s),o&&(o._x=t[c++]-a,o._y=t[c++]-s)):(i||(t[c++]=a,t[c++]=s),o||(t[c++]=a,t[c++]=s))),t}}),N=y.extend({initialize:function(e,t,n){var r,i,o;if(e)if((r=e[0])!==s)i=e[1];else{var a=e;(r=a.x)===s&&(r=(a=y.read(arguments)).x),i=a.y,o=a.selected}else r=i=0;this._x=r,this._y=i,this._owner=t,t[n]=this,o&&this.setSelected(!0)},_set:function(e,t){return this._x=e,this._y=t,this._owner._changed(this),this},getX:function(){return this._x},setX:function(e){this._x=e,this._owner._changed(this)},getY:function(){return this._y},setY:function(e){this._y=e,this._owner._changed(this)},isZero:function(){var e=v.isZero;return e(this._x)&&e(this._y)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(e){this._owner._changeSelection(this._getSelection(),e)},_getSelection:function(){var e=this._owner;return this===e._point?1:this===e._handleIn?2:this===e._handleOut?4:0}}),L=l.extend({_class:"Curve",beans:!0,initialize:function(e,t,n,r,i,o,a,s){var c,u,l,f,d,p,h=arguments.length;3===h?(this._path=e,c=t,u=n):h?1===h?"segment1"in e?(c=new D(e.segment1),u=new D(e.segment2)):"point1"in e?(l=e.point1,d=e.handle1,p=e.handle2,f=e.point2):Array.isArray(e)&&(l=[e[0],e[1]],f=[e[6],e[7]],d=[e[2]-e[0],e[3]-e[1]],p=[e[4]-e[6],e[5]-e[7]]):2===h?(c=new D(e),u=new D(t)):4===h?(l=e,d=t,p=n,f=r):8===h&&(l=[e,t],f=[a,s],d=[n-e,r-t],p=[i-a,o-s]):(c=new D,u=new D),this._segment1=c||new D(l,null,d),this._segment2=u||new D(f,p,null)},_serialize:function(e,t){return l.serialize(this.hasHandles()?[this.getPoint1(),this.getHandle1(),this.getHandle2(),this.getPoint2()]:[this.getPoint1(),this.getPoint2()],e,!0,t)},_changed:function(){this._length=this._bounds=s},clone:function(){return new L(this._segment1,this._segment2)},toString:function(){var e=["point1: "+this._segment1._point];return this._segment1._handleOut.isZero()||e.push("handle1: "+this._segment1._handleOut),this._segment2._handleIn.isZero()||e.push("handle2: "+this._segment2._handleIn),e.push("point2: "+this._segment2._point),"{ "+e.join(", ")+" }"},classify:function(){return L.classify(this.getValues())},remove:function(){var e=!1;if(this._path){var t=this._segment2,n=t._handleOut;(e=t.remove())&&this._segment1._handleOut.set(n)}return e},getPoint1:function(){return this._segment1._point},setPoint1:function(){this._segment1._point.set(y.read(arguments))},getPoint2:function(){return this._segment2._point},setPoint2:function(){this._segment2._point.set(y.read(arguments))},getHandle1:function(){return this._segment1._handleOut},setHandle1:function(){this._segment1._handleOut.set(y.read(arguments))},getHandle2:function(){return this._segment2._handleIn},setHandle2:function(){this._segment2._handleIn.set(y.read(arguments))},getSegment1:function(){return this._segment1},getSegment2:function(){return this._segment2},getPath:function(){return this._path},getIndex:function(){return this._segment1._index},getNext:function(){var e=this._path&&this._path._curves;return e&&(e[this._segment1._index+1]||this._path._closed&&e[0])||null},getPrevious:function(){var e=this._path&&this._path._curves;return e&&(e[this._segment1._index-1]||this._path._closed&&e[e.length-1])||null},isFirst:function(){return!this._segment1._index},isLast:function(){var e=this._path;return e&&this._segment1._index===e._curves.length-1||!1},isSelected:function(){return this.getPoint1().isSelected()&&this.getHandle1().isSelected()&&this.getHandle2().isSelected()&&this.getPoint2().isSelected()},setSelected:function(e){this.getPoint1().setSelected(e),this.getHandle1().setSelected(e),this.getHandle2().setSelected(e),this.getPoint2().setSelected(e)},getValues:function(e){return L.getValues(this._segment1,this._segment2,e)},getPoints:function(){for(var e=this.getValues(),t=[],n=0;n<8;n+=2)t.push(new y(e[n],e[n+1]));return t}},{getLength:function(){return null==this._length&&(this._length=L.getLength(this.getValues(),0,1)),this._length},getArea:function(){return L.getArea(this.getValues())},getLine:function(){return new E(this._segment1._point,this._segment2._point)},getPart:function(e,t){return new L(L.getPart(this.getValues(),e,t))},getPartLength:function(e,t){return L.getLength(this.getValues(),e,t)},divideAt:function(e){return this.divideAtTime(e&&e.curve===this?e.time:this.getTimeAt(e))},divideAtTime:function(e,t){var n=null;if(e>=1e-8&&e<=1-1e-8){var r=L.subdivide(this.getValues(),e),i=r[0],o=r[1],a=t||this.hasHandles(),s=this._segment1,c=this._segment2,u=this._path;a&&(s._handleOut._set(i[2]-i[0],i[3]-i[1]),c._handleIn._set(o[4]-o[6],o[5]-o[7]));var l=i[6],f=i[7],d=new D(new y(l,f),a&&new y(i[4]-l,i[5]-f),a&&new y(o[2]-l,o[3]-f));u?(u.insert(s._index+1,d),n=this.getNext()):(this._segment2=d,this._changed(),n=new L(d,c))}return n},splitAt:function(e){var t=this._path;return t?t.splitAt(e):null},splitAtTime:function(e){return this.splitAt(this.getLocationAtTime(e))},divide:function(e,t){return this.divideAtTime(e===s?.5:t?e:this.getTimeAt(e))},split:function(e,t){return this.splitAtTime(e===s?.5:t?e:this.getTimeAt(e))},reversed:function(){return new L(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut._set(0,0),this._segment2._handleIn._set(0,0)},statics:{getValues:function(e,t,n,r){var i=e._point,o=e._handleOut,a=t._handleIn,s=t._point,c=i.x,u=i.y,l=s.x,f=s.y,d=r?[c,u,c,u,l,f,l,f]:[c,u,c+o._x,u+o._y,l+a._x,f+a._y,l,f];return n&&n._transformCoordinates(d,d,4),d},subdivide:function(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],l=e[7];t===s&&(t=.5);var f=1-t,d=f*n+t*i,p=f*r+t*o,h=f*i+t*a,g=f*o+t*c,v=f*a+t*u,m=f*c+t*l,y=f*d+t*h,b=f*p+t*g,w=f*h+t*v,_=f*g+t*m,x=f*y+t*w,O=f*b+t*_;return[[n,r,d,p,y,b,x,O],[x,O,w,_,v,m,u,l]]},getMonoCurves:function(e,t){var n=[],r=t?0:1,i=e[r+0],o=e[r+2],a=e[r+4],s=e[r+6];if(i>=o==o>=a&&o>=a==a>=s||L.isStraight(e))n.push(e);else{var c=3*(o-a)-i+s,u=2*(i+a)-4*o,l=o-i,f=[],d=v.solveQuadratic(c,u,l,f,1e-8,1-1e-8);if(d){f.sort();var p=f[0],h=L.subdivide(e,p);n.push(h[0]),d>1&&(p=(f[1]-p)/(1-p),h=L.subdivide(h[1],p),n.push(h[0])),n.push(h[1])}else n.push(e)}return n},solveCubic:function(e,t,n,r,i,o){var a=e[t],s=e[t+2],c=e[t+4],u=e[t+6],l=0;if(!(an&&u>n&&s>n&&c>n)){var f=3*(s-a),d=3*(c-s)-f,p=u-a-f-d;l=v.solveCubic(p,d,f,a-n,r,i,o)}return l},getTimeOf:function(e,t){var n=new y(e[0],e[1]),r=new y(e[6],e[7]);if(null===(t.isClose(n,1e-12)?0:t.isClose(r,1e-12)?1:null))for(var i=[t.x,t.y],o=[],a=0;a<2;a++)for(var s=L.solveCubic(e,a,i[a],o,0,1),c=0;c.999999999999?1:L.getTimeOf(e,new y(n+s*i,r+s*o))}var c=1/0,u=0;function l(n){if(n>=0&&n<=1){var r=t.getDistance(L.getPoint(e,n),!0);if(r1e-8;)l(u-d)||l(u+d)||(d/=2);return u},getPart:function(e,t,n){var r=t>n;if(r){var i=t;t=n,n=i}return t>0&&(e=L.subdivide(e,t)[1]),n<1&&(e=L.subdivide(e,(n-t)/(1-t))[0]),r?[e[6],e[7],e[4],e[5],e[2],e[3],e[0],e[1]]:e},isFlatEnough:function(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],u=e[7],l=3*i-2*n-c,f=3*o-2*r-u,d=3*a-2*c-n,p=3*s-2*u-r;return Math.max(l*l,d*d)+Math.max(f*f,p*p)<=16*t*t},getArea:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7];return 3*((c-n)*(r+o)-(s-t)*(i+a)+i*(t-o)-r*(n-a)+c*(o+t/3)-s*(a+n/3))/20},getBounds:function(e){for(var t=e.slice(0,2),n=t.slice(),r=[0,0],i=0;i<2;i++)L._addBounds(e[i],e[i+2],e[i+4],e[i+6],i,0,t,n,r);return new x(t[0],t[1],n[0]-t[0],n[1]-t[1])},_addBounds:function(e,t,n,r,i,o,a,s,c){function u(e,t){var n=e-t,r=e+t;ns[i]&&(s[i]=r)}o/=2;var l=a[i]+o,f=s[i]-o;if(ef||t>f||n>f||r>f)if(t=0&&s<=1&&c<=0&&c>=-1}}return!1},isLinear:function(e,t,n,r){var i=r.subtract(e).divide(3);return t.equals(i)&&n.negate().equals(i)}},(function(e,t){this[t]=function(t){var n=this._segment1,r=this._segment2;return e(n._point,n._handleOut,r._handleIn,r._point,t)},this.statics[t]=function(t,n){var r=t[0],i=t[1],o=t[6],a=t[7];return e(new y(r,i),new y(t[2]-r,t[3]-i),new y(t[4]-o,t[5]-a),new y(o,a),n)}}),{statics:{},hasHandles:function(){return!this._segment1._handleOut.isZero()||!this._segment2._handleIn.isZero()},hasLength:function(e){return(!this.getPoint1().equals(this.getPoint2())||this.hasHandles())&&this.getLength()>(e||0)},isCollinear:function(e){return e&&this.isStraight()&&e.isStraight()&&this.getLine().isCollinear(e.getLine())},isHorizontal:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).y)<1e-8},isVertical:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).x)<1e-8}}),{beans:!1,getLocationAt:function(e,t){return this.getLocationAtTime(t?e:this.getTimeAt(e))},getLocationAtTime:function(e){return null!=e&&e>=0&&e<=1?new z(this,e):null},getTimeAt:function(e,t){return L.getTimeAt(this.getValues(),e,t)},getParameterAt:"#getTimeAt",getTimesWithTangent:function(){var e=y.read(arguments);return e.isZero()?[]:L.getTimesWithTangent(this.getValues(),e)},getOffsetAtTime:function(e){return this.getPartLength(0,e)},getLocationOf:function(){return this.getLocationAtTime(this.getTimeOf(y.read(arguments)))},getOffsetOf:function(){var e=this.getLocationOf.apply(this,arguments);return e?e.getOffset():null},getTimeOf:function(){return L.getTimeOf(this.getValues(),y.read(arguments))},getParameterOf:"#getTimeOf",getNearestLocation:function(){var e=y.read(arguments),t=this.getValues(),n=L.getNearestTime(t,e),r=L.getPoint(t,n);return new z(this,n,r,null,e.getDistance(r))},getNearestPoint:function(){var e=this.getNearestLocation.apply(this,arguments);return e?e.getPoint():e}},new function(){var e=["getPoint","getTangent","getNormal","getWeightedTangent","getWeightedNormal","getCurvature"];return l.each(e,(function(e){this[e+"At"]=function(t,n){var r=this.getValues();return L[e](r,n?t:L.getTimeAt(r,t))},this[e+"AtTime"]=function(t){return L[e](this.getValues(),t)}}),{statics:{_evaluateMethods:e}})},new function(){function e(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],u=9*(r-o)+3*(s-t),l=6*(t+o)-12*r,f=3*(r-t),d=9*(i-a)+3*(c-n),p=6*(n+a)-12*i,h=3*(i-n);return function(e){var t=(u*e+l)*e+f,n=(d*e+p)*e+h;return Math.sqrt(t*t+n*n)}}function t(e,t){return Math.max(2,Math.min(16,Math.ceil(32*Math.abs(t-e))))}function n(e,t,n,r){if(null==t||t<0||t>1)return null;var i=e[0],o=e[1],a=e[2],s=e[3],c=e[4],u=e[5],l=e[6],f=e[7],d=v.isZero;d(a-i)&&d(s-o)&&(a=i,s=o),d(c-l)&&d(u-f)&&(c=l,u=f);var p,h,g=3*(a-i),m=3*(c-a)-g,b=l-i-g-m,w=3*(s-o),_=3*(u-s)-w,x=f-o-w-_;if(0===n)p=0===t?i:1===t?l:((b*t+m)*t+g)*t+i,h=0===t?o:1===t?f:((x*t+_)*t+w)*t+o;else{if(t<1e-8?(p=g,h=w):t>1-1e-8?(p=3*(l-c),h=3*(f-u)):(p=(3*b*t+2*m)*t+g,h=(3*x*t+2*_)*t+w),r){0===p&&0===h&&(t<1e-8||t>1-1e-8)&&(p=c-a,h=u-s);var O=Math.sqrt(p*p+h*h);O&&(p/=O,h/=O)}if(3===n){c=6*b*t+2*m,u=6*x*t+2*_;var S=Math.pow(p*p+h*h,1.5);p=0!==S?(p*u-h*c)/S:0,h=0}}return 2===n?new y(h,-p):new y(p,h)}return{statics:{classify:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],l=r*(n-u)+i*(c-t)+t*u-n*c,f=3*(o*(i-n)+a*(t-r)+r*n-i*t),d=f-l,p=d-l+(t*(u-a)+n*(o-c)+c*a-u*o),h=Math.sqrt(p*p+d*d+f*f),g=0!==h?1/h:0,m=v.isZero;function y(e,t,n){var r=t!==s,i=r&&t>0&&t<1,o=r&&n>0&&n<1;return!r||(i||o)&&("loop"!==e||i&&o)||(e="arch",i=o=!1),{type:e,roots:i||o?i&&o?t0?Math.sqrt(b/3):Math.sqrt(-b),_=2*p;return y(b>0?"serpentine":"loop",(d+w)/_,(d-w)/_)},getLength:function(n,r,i,o){if(r===s&&(r=0),i===s&&(i=1),L.isStraight(n)){var a=n;i<1&&(a=L.subdivide(a,i)[0],r/=i),r>0&&(a=L.subdivide(a,r)[1]);var c=a[6]-a[0],u=a[7]-a[1];return Math.sqrt(c*c+u*u)}return v.integrate(o||e(n),r,i,t(r,i))},getTimeAt:function(n,r,i){if(i===s&&(i=r<0?1:0),0===r)return i;var o=Math.abs,a=r>0,c=a?i:0,u=a?1:i,l=e(n),f=L.getLength(n,c,u,l),d=o(r)-f;if(o(d)<1e-12)return a?u:c;if(d>1e-12)return null;var p=r/f,h=0;return v.findRoot((function(e){return h+=v.integrate(l,i,e,t(i,e)),i=e,h-r}),l,i+p,c,u,32,1e-12)},getPoint:function(e,t){return n(e,t,0,!1)},getTangent:function(e,t){return n(e,t,1,!0)},getWeightedTangent:function(e,t){return n(e,t,1,!1)},getNormal:function(e,t){return n(e,t,2,!0)},getWeightedNormal:function(e,t){return n(e,t,2,!1)},getCurvature:function(e,t){return n(e,t,3,!1).x},getPeaks:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=3*r-t-3*o+e[6],c=3*t-6*r+3*o,u=-3*t+3*r,l=3*i-n-3*a+e[7],f=3*n-6*i+3*a,d=-3*n+3*i,p=[];return v.solveCubic(9*(s*s+l*l),9*(s*c+f*l),2*(c*c+f*f)+3*(u*s+d*l),u*c+f*d,p,1e-8,1-1e-8),p.sort()}}}},new function(){function e(e,t,n,r,i,o,a){var s=!a&&n.getPrevious()===i,c=!a&&n!==i&&n.getNext()===i;if(null!==r&&r>=(s?1e-8:0)&&r<=(c?1-1e-8:1)&&null!==o&&o>=(c?1e-8:0)&&o<=(s?1-1e-8:1)){var u=new z(n,r,null,a),l=new z(i,o,null,a);u._intersection=l,l._intersection=u,t&&!t(u)||z.insert(e,u,!0)}}function t(r,i,o,a,s,c,u,l,f,d,p,h,g){if(++f>=4096||++l>=40)return f;var v,m,y=i[0],b=i[1],w=i[6],_=i[7],x=E.getSignedDistance,O=x(y,b,w,_,i[2],i[3]),S=x(y,b,w,_,i[4],i[5]),C=O*S>0?3/4:4/9,k=C*Math.min(0,O,S),T=C*Math.max(0,O,S),j=x(y,b,w,_,r[0],r[1]),P=x(y,b,w,_,r[2],r[3]),I=x(y,b,w,_,r[4],r[5]),R=x(y,b,w,_,r[6],r[7]),A=function(e,t,n,r){var i,o=[0,e],a=[1/3,t],s=[2/3,n],c=[1,r],u=t-(2*e+r)/3,l=n-(e+2*r)/3;if(u*l<0)i=[[o,a,c],[o,s,c]];else{var f=u/l;i=[f>=2?[o,a,c]:f<=.5?[o,s,c]:[o,a,s,c],[o,c]]}return(u||l)<0?i.reverse():i}(j,P,I,R),M=A[0],D=A[1];if(0===O&&0===S&&0===j&&0===P&&0===I&&0===R||null==(v=n(M,D,k,T))||null==(m=n(M.reverse(),D.reverse(),k,T)))return f;var N=d+(p-d)*v,z=d+(p-d)*m;if(Math.max(g-h,z-N)<1e-9){var B=(N+z)/2,F=(h+g)/2;e(s,c,u?a:o,u?F:B,u?o:a,u?B:F)}else{r=L.getPart(r,v,m);var W=g-h;if(m-v>.8)if(z-N>W){B=(N+z)/2;f=t(i,(H=L.subdivide(r,.5))[0],a,o,s,c,!u,l,f,h,g,N,B),f=t(i,H[1],a,o,s,c,!u,l,f,h,g,B,z)}else{var H;F=(h+g)/2;f=t((H=L.subdivide(i,.5))[0],r,a,o,s,c,!u,l,f,h,F,N,z),f=t(H[1],r,a,o,s,c,!u,l,f,F,g,N,z)}else f=0===W||W>=1e-9?t(i,r,a,o,s,c,!u,l,f,h,g,N,z):t(r,i,o,a,s,c,u,l,f,N,z,h,g)}return f}function n(e,t,n,i){return e[0][1]i?r(t,!1,i):e[0][0]}function r(e,t,n){for(var r=e[0][0],i=e[0][1],o=1,a=e.length;o=n:c<=n)return c===n?s:r+(n-i)*(s-r)/(c-i);r=s,i=c}return null}function i(e,t,n,r,i){var o=v.isZero;if(o(r)&&o(i)){var a=L.getTimeOf(e,new y(t,n));return null===a?[]:[a]}for(var s=Math.atan2(-i,r),c=Math.sin(s),u=Math.cos(s),l=[],f=[],d=0;d<8;d+=2){var p=e[d]-t,h=e[d+1]-n;l.push(p*u-h*c,p*c+h*u)}return L.solveCubic(l,1,0,f,0,1),f}function o(t,n,r,o,a,s,c){for(var u=n[0],l=n[1],f=i(t,u,l,n[6]-u,n[7]-l),d=0,p=f.length;df(r[0],r[2],r[4],r[6])&&f(n[0],n[2],n[4],n[6])-1e-12f(r[1],r[3],r[5],r[7])&&f(n[1],n[3],n[5],n[7])-1e-12>1,O=1&h,S=6*x,E=6*O,C=new y(n[S],n[S+1]),k=new y(r[E],r[E+1]);C.isClose(k,1e-12)&&e(c,l,i,x,s,O)}}}return c}function c(t,n,r,i){var o=L.classify(t);if("loop"===o.type){var a=o.roots;e(r,i,n,a[0],n,a[1])}return r}function u(e,t){function n(e){var t=e[6]-e[0],n=e[7]-e[1];return t*t+n*n}var r=Math.abs,i=E.getDistance,o=L.isStraight(e),a=L.isStraight(t),s=o&&a,c=n(e)>1,x=L.getTimeOf(g[b],new y(g[w][_?6:0],g[w][_?7:1]));if(null!=x){var O=b?[_,x]:[x,_];(!v.length||r(O[0]-v[0][0])>1e-8&&r(O[1]-v[0][1])>1e-8)&&v.push(O)}if(m>2&&!v.length)break}if(2!==v.length)v=null;else if(!s){var S=L.getPart(e,v[0][0],v[1][0]),C=L.getPart(t,v[0][1],v[1][1]);(r(C[2]-S[2])>1e-7||r(C[3]-S[3])>1e-7||r(C[4]-S[4])>1e-7||r(C[5]-S[5])>1e-7)&&(v=null)}return v}return{getIntersections:function(e){var t=this.getValues(),n=e&&e!==this&&e.getValues();return n?s(t,n,this,e,[]):c(t,this,[])},statics:{getOverlaps:u,getIntersections:function(e,t,n,r,i,o){var a=!t;a&&(t=e);for(var u=e.length,l=t.length,f=new Array(u),d=a?f:new Array(l),p=[],g=0;gm){var O=t[x];s(b,d[x],y,O,p,n)}}}return p},getCurveLineIntersections:i,getTimesWithTangent:function(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],u=e[7],l=t.normalize(),f=l.x,d=l.y,p=3*c-9*a+9*i-3*n,h=3*u-9*s+9*o-3*r,g=6*a-12*i+6*n,m=6*s-12*o+6*r,y=3*i-3*n,b=3*o-3*r,w=2*p*d-2*h*f,_=[];if(Math.abs(w)=0&&x<=1&&_.push(x)}}else{var O=(g*g-4*p*y)*d*d+(-2*g*m+4*h*y+4*p*b)*f*d+(m*m-4*h*b)*f*f,S=g*d-m*f;if(O>=0&&0!=w){var E=Math.sqrt(O),C=-(S+E)/w,k=(-S+E)/w;C>=0&&C<=1&&_.push(C),k>=0&&k<=1&&_.push(k)}}return _}}}}),z=l.extend({_class:"CurveLocation",initialize:function(e,t,n,r,i){if(t>=.99999999){var o=e.getNext();o&&(t=0,e=o)}this._setCurve(e),this._time=t,this._point=n||e.getPointAtTime(t),this._overlap=r,this._distance=i,this._intersection=this._next=this._previous=null},_setPath:function(e){this._path=e,this._version=e?e._version:0},_setCurve:function(e){this._setPath(e._path),this._curve=e,this._segment=null,this._segment1=e._segment1,this._segment2=e._segment2},_setSegment:function(e){var t=e.getCurve();t?this._setCurve(t):(this._setPath(e._path),this._segment1=e,this._segment2=null),this._segment=e,this._time=e===this._segment1?0:1,this._point=e._point.clone()},getSegment:function(){var e=this._segment;if(!e){var t=this.getCurve(),n=this.getTime();0===n?e=t._segment1:1===n?e=t._segment2:null!=n&&(e=t.getPartLength(0,n)=1e-8&&t<=1-1e-8,i=n>=1e-8&&n<=1-1e-8;if(r&&i)return!this.isTouching();var o=this.getCurve(),a=o&&t<1e-8?o.getPrevious():o,s=e.getCurve(),c=s&&n<1e-8?s.getPrevious():s;if(t>1-1e-8&&(o=o.getNext()),n>1-1e-8&&(s=s.getNext()),!(a&&o&&c&&s))return!1;var u=[];function l(e,t){var n=e.getValues(),r=L.classify(n).roots||L.getPeaks(n),i=r.length,o=L.getLength(n,t&&i?r[i-1]:0,!t&&i?r[0]:1);u.push(i?o:o/32)}function f(e,t,n){return tt&&et||e=-1&&o<=r;o+=i){var a=e[(o%r+r)%r];if(!t.getPoint().isClose(a.getPoint(),1e-7))break;if(t.equals(a))return a}return null}for(;i<=o;){var s,c=i+o>>>1,u=e[c];if(n&&(s=t.equals(u)?u:a(c,-1)||a(c,1)))return t._overlap&&(s._overlap=s._intersection._overlap=!0),s;var l=t.getPath(),f=u.getPath();(l!==f?l._id-f._id:t.getIndex()+t.getTime()-(u.getIndex()+u.getTime()))<0?o=c-1:i=c+1}return e.splice(i,0,t),t}return{statics:{insert:e,expand:function(t){for(var n=t.slice(),r=t.length-1;r>=0;r--)e(n,t[r]._intersection,!1);return n}}}}),B=k.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(e){var t,n,r;if(l.isPlainObject(e)?(n=e.segments,t=e.pathData):Array.isArray(e)?n=e:"string"==typeof e&&(t=e),n){var i=n[0];r=i&&Array.isArray(i[0])}else t&&(r=(t.match(/m/gi)||[]).length>1||/z\s*\S+/i.test(t));return new(r?W:F)(e)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(e){this.isClockwise()!=(e=!!e)&&this.reverse()},setPathData:function(e){var t,n,r,i=e&&e.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),o=!1,a=new y,s=new y;function c(e,n){var r=+t[e];return o&&(r+=a[n]),r}function u(e){return new y(c(e,"x"),c(e+1,"y"))}this.clear();for(var l=0,f=i&&i.length;lu&&this[r?"removeSegments":"removeChildren"](u,c);for(f=0;f=0&&t;u--){var l=n[u];t=!1;var f=c[u];if(f)for(var d=f.length-1;d>=0&&!t;d--)l.compare(r[f[d]])&&(a[f[d]]||(a[f[d]]=!0,s++),t=!0)}t=t&&s===o}return t}}),F=B.extend({_class:"Path",_serializeFields:{segments:[],closed:!1},initialize:function(e){this._closed=!1,this._segments=[],this._version=0;var t=arguments,n=Array.isArray(e)?"object"==typeof e[0]?e:t:!e||e.size!==s||e.x===s&&e.point===s?null:t;n&&n.length>0?this.setSegments(n):(this._curves=s,this._segmentSelection=0,n||"string"!=typeof e||(this.setPathData(e),e=null)),this._initialize(!n&&e)},_equals:function(e){return this._closed===e._closed&&l.equals(this._segments,e._segments)},copyContent:function(e){this.setSegments(e._segments),this._closed=e._closed},_changed:function e(t){if(e.base.call(this,t),8&t){if(this._length=this._area=s,32&t)this._version++;else if(this._curves)for(var n=0,r=this._curves.length;n0&&(m(l[0],!0),v.push("z")),v.join("")},isEmpty:function(){return!this._segments.length},_transformContent:function(e){for(var t=this._segments,n=new Array(6),r=0,i=t.length;r0&&t+i-1===u?t-1:t,d=f,p=Math.min(f+i,u);e._curves&&(r.splice.apply(r,[f,0].concat(e._curves)),d+=e._curves.length);for(a=d;a0?e-1:e},add:function(e){var t=arguments;return t.length>1&&"number"!=typeof e?this._add(D.readList(t)):this._add([D.read(t)])[0]},insert:function(e,t){var n=arguments;return n.length>2&&"number"!=typeof t?this._add(D.readList(n,1),e):this._add([D.read(n,1)],e)[0]},addSegment:function(){return this._add([D.read(arguments)])[0]},insertSegment:function(e){return this._add([D.read(arguments,1)],e)[0]},addSegments:function(e){return this._add(D.readList(e))},insertSegments:function(e,t){return this._add(D.readList(t),e)},removeSegment:function(e){return this.removeSegments(e,e+1)[0]||null},removeSegments:function(e,t,n){e=e||0,t=l.pick(t,this._segments.length);var r=this._segments,i=this._curves,o=r.length,a=r.splice(e,t-e),s=a.length;if(!s)return a;for(var c=0;c0&&t===o+(this._closed?1:0)?e-1:e;for(c=(i=i.splice(d,s)).length-1;c>=0;c--)i[c]._path=null;n&&(a._curves=i.slice(1)),this._adjustCurves(d,d)}return this._changed(41),a},clear:"#removeSegments",hasHandles:function(){for(var e=this._segments,t=0,n=e.length;t0&&this._segmentSelection===7*e},setFullySelected:function(e){e&&this._selectSegments(!0),this.setSelected(e)},setSelection:function e(t){1&t||this._selectSegments(!1),e.base.call(this,t)},_selectSegments:function(e){var t=this._segments,n=t.length,r=e?7:0;this._segmentSelection=r*n;for(var i=0;i0&&this.setSelected(!0)},divideAt:function(e){var t,n=this.getLocationAt(e);return n&&(t=n.getCurve().divideAt(n.getCurveOffset()))?t._segment1:null},splitAt:function(e){var t=this.getLocationAt(e),n=t&&t.index,r=t&&t.time;r>1-1e-8&&(n++,r=0);var i=this.getCurves();if(n>=0&&n=1e-8&&i[n++].divideAtTime(r);var o,a=this.removeSegments(n,this._segments.length,!0);return this._closed?(this.setClosed(!1),o=this):((o=new F(k.NO_INSERT)).insertAbove(this),o.copyAttributes(this)),o._add(a,0),this.addSegment(a[0]),o}return null},split:function(e,t){var n,r=t===s?e:(n=this.getCurves()[e])&&n.getLocationAtTime(t);return null!=r?this.splitAt(r):null},join:function(e,t){var n=t||0;if(e&&e!==this){var r=e._segments,i=this.getLastSegment(),o=e.getLastSegment();if(!o)return this;i&&i._point.isClose(o._point,n)&&e.reverse();var a=e.getFirstSegment();if(i&&i._point.isClose(a._point,n))i.setHandleOut(a._handleOut),this._add(r.slice(1));else{var s=this.getFirstSegment();s&&s._point.isClose(a._point,n)&&e.reverse(),o=e.getLastSegment(),s&&s._point.isClose(o._point,n)?(s.setHandleIn(o._handleIn),this._add(r.slice(0,r.length-1),0)):this._add(r.slice())}e._closed&&this._add([r[0]]),e.remove()}var c=this.getFirstSegment(),u=this.getLastSegment();return c!==u&&c._point.isClose(u._point,n)&&(c.setHandleIn(u._handleIn),u.remove(),this.setClosed(!0)),this},reduce:function(e){for(var t=this.getCurves(),n=e&&e.simplify,r=n?1e-7:0,i=t.length-1;i>=0;i--){var o=t[i];!o.hasHandles()&&(!o.hasLength(r)||n&&o.isCollinear(o.getNext()))&&o.remove()}return this},reverse:function(){this._segments.reverse();for(var e=0,t=this._segments.length;e0&&r.push(new D(t[n-1].curve.slice(6))),this.setSegments(r)},simplify:function(e){var t=new V(this).fit(e||2.5);return t&&this.setSegments(t),!!t},smooth:function(e){var t=this,n=e||{},r=n.type||"asymmetric",i=this._segments,o=i.length,a=this._closed;function c(e,n){var r=e&&e.index;if(null!=r){var i=e.path;if(i&&i!==t)throw new Error(e._class+" "+r+" of "+i+" is not part of "+t);n&&e instanceof L&&r++}else r="number"==typeof e?e:n;return Math.min(r<0&&a?r%o:r<0?r+o:r,o-1)}var u=a&&n.from===s&&n.to===s,l=c(n.from,0),f=c(n.to,o-1);if(l>f)if(a)l-=o;else{var d=l;l=f,f=d}if(/^(?:asymmetric|continuous)$/.test(r)){var p="asymmetric"===r,h=Math.min,g=f-l+1,v=g-1,m=u?h(g,4):1,y=m,b=m,w=[];if(a||(y=h(1,l),b=h(1,o-f-1)),(v+=y+b)<=1)return;for(var _=0,x=l-y;_<=v;_++,x++)w[_]=i[(x<0?x+o:x)%o]._point;var O=w[0]._x+2*w[1]._x,S=w[0]._y+2*w[1]._y,E=2,C=v-1,k=[O],T=[S],j=[E],P=[],I=[];for(_=1;_=0;_--)P[_]=(k[_]-P[_+1])/j[_],I[_]=(T[_]-I[_+1])/j[_];P[v]=(3*w[v]._x-P[C])/2,I[v]=(3*w[v]._y-I[C])/2;_=y;var z=v-b;for(x=l;_<=z;_++,x++){var B=i[x<0?x+o:x],F=B._point,W=P[_]-F._x,H=I[_]-F._y;(u||_y)&&B.setHandleIn(-W,-H)}}else for(_=l;_<=f;_++)i[_<0?_+o:_].smooth(n,!u&&_===l,!u&&_===f)},toShape:function(e){if(!this._closed)return null;var t,n,r,i,o,a,c,u=this._segments;function l(e,t){var n=u[e],r=n.getNext(),i=u[t],o=i.getNext();return n._handleOut.isZero()&&r._handleIn.isZero()&&i._handleOut.isZero()&&o._handleIn.isZero()&&r._point.subtract(n._point).isCollinear(o._point.subtract(i._point))}function f(e){var t=u[e],n=t.getNext(),r=t._handleOut,i=n._handleIn,o=.5522847498307936;if(r.isOrthogonal(i)){var a=t._point,s=n._point,c=new E(a,r,!0).intersect(new E(s,i,!0),!0);return c&&v.isZero(r.getLength()/c.subtract(a).getLength()-o)&&v.isZero(i.getLength()/c.subtract(s).getLength()-o)}return!1}function d(e,t){return u[e]._point.getDistance(u[t]._point)}if(!this.hasHandles()&&4===u.length&&l(0,2)&&l(1,3)&&(o=u[1],a=o.getPrevious(),c=o.getNext(),a._handleOut.isZero()&&o._handleIn.isZero()&&o._handleOut.isZero()&&c._handleIn.isZero()&&o._point.subtract(a._point).isOrthogonal(c._point.subtract(o._point)))?(t=P.Rectangle,n=new w(d(0,3),d(0,1)),i=u[1]._point.add(u[2]._point).divide(2)):8===u.length&&f(0)&&f(2)&&f(4)&&f(6)&&l(1,5)&&l(3,7)?(t=P.Rectangle,r=(n=new w(d(1,6),d(0,3))).subtract(new w(d(0,7),d(1,2))).divide(2),i=u[3]._point.add(u[4]._point).divide(2)):4===u.length&&f(0)&&f(1)&&f(2)&&f(3)&&(v.isZero(d(0,2)-d(1,3))?(t=P.Circle,r=d(0,2)/2):(t=P.Ellipse,r=new w(d(2,0)/2,d(3,1)/2)),i=u[1]._point),t){var p=this.getPosition(!0),h=new t({center:p,size:n,radius:r,insert:!1});return h.copyAttributes(this,!0),h._matrix.prepend(this._matrix),h.rotate(i.subtract(p).getAngle()+90),(e===s||e)&&h.insertAbove(this),h}return null},toPath:"#clone",compare:function e(t){if(!t||t instanceof W)return e.base.call(this,t);var n=this.getCurves(),r=t.getCurves(),i=n.length,o=r.length;if(!i||!o)return i==o;for(var a,s,c=n[0].getValues(),u=[],l=0,f=0,d=0;d0?o-1:d,s=v[0][1];break}}var h,g=Math.abs;for(p=u[a];c&&p;){var v;if(v=L.getOverlaps(c,p))if(g(v[0][0]-f)<1e-8){1===(f=v[1][0])&&(c=++l=o&&(a=0),p=u[a]||r[a].getValues(),s=0),!c)return h[0]===a&&h[1]===s;continue}}break}return!1},_hitTestSelf:function(e,t,n,r){var i,o,a,s,c,u,l=this,f=this.getStyle(),d=this._segments,p=d.length,h=this._closed,g=t._tolerancePadding,v=g,m=t.stroke&&f.hasStroke(),y=t.fill&&f.hasFill(),b=t.curves,w=m?f.getStrokeWidth()/2:y&&t.tolerance>0||b?0:null;function _(t,n){return e.subtract(t).divide(n).length<=1}function x(e,n,r){if(!t.selected||n.isSelected()){var i=e._point;if(n!==i&&(n=n.add(i)),_(n,v))return new M(r,l,{segment:e,point:n})}}function O(e,n){return(n||t.segments)&&x(e,e._point,"segment")||!n&&t.handles&&(x(e,e._handleIn,"handle-in")||x(e,e._handleOut,"handle-out"))}function S(e){s.add(e)}function E(t){var n,c=h||t._index>0&&t._index0?(i=f.getStrokeJoin(),o=f.getStrokeCap(),a=f.getMiterLimit(),v=v.add(F._getStrokePadding(w,r))):i=o="round"),!t.ends||t.segments||h){if(t.segments||t.handles)for(var C=0;C1?E(c.getSegment())||(c=null):_(c.getPoint(),v)||(c=null)}if(!c&&"miter"===i&&p>1)for(C=0;Ce)return a.getLocationAt(e-o)}if(t.length>0&&e<=this.getLength())return new z(t[t.length-1],1)}else if(e&&e.getPath&&e.getPath()===this)return e;return null},getOffsetsWithTangent:function(){var e=y.read(arguments);if(e.isZero())return[];for(var t=[],n=0,r=this.getCurves(),i=0,o=r.length;i0&&g(f[0])}return{_draw:function(t,n,r,i){var o=n.dontStart,a=n.dontFinish||n.clip,s=this.getStyle(),c=s.hasFill(),u=s.hasStroke(),l=s.getDashArray(),f=!de.support.nativeDash&&u&&l&&l.length;function d(e){return l[(e%f+f)%f]}if(o||t.beginPath(),(c||u&&!f||a)&&(e(t,this,i),this._closed&&t.closePath()),!a&&(c||u)&&(this._setStyles(t,n,r),c&&(t.fill(s.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),u)){if(f){o||t.beginPath();for(var p,h=new H(this,.25,32,!1,i),g=h.length,v=-s.getDashOffset(),m=0;v>0;)v-=d(m--)+d(m--);for(;v0||p>0)&&h.drawPart(t,Math.max(v,0),Math.max(p,0)),v=p+d(m++)}t.stroke()}},_drawSelected:function(t,n){t.beginPath(),e(t,this,n),t.stroke(),function(e,t,n,r){if(!(r<=0))for(var i,o,a=r/2,s=r-2,c=a-1,u=new Array(6),l=0,f=t.length;l0&&!(1&p)){var h=e.fillStyle;e.fillStyle="#ffffff",e.fillRect(i-c,o-c,s,s),e.fillStyle=h}}function g(t){var n=u[t],r=u[t+1];i==n&&o==r||(e.beginPath(),e.moveTo(i,o),e.lineTo(n,r),e.stroke(),e.beginPath(),e.arc(n,r,a,0,2*Math.PI,!0),e.fill())}}(t,this._segments,n,de.settings.handleSize)}}},new function(){function e(e){var t=e._segments;if(!t.length)throw new Error("Use a moveTo() command first");return t[t.length-1]}return{moveTo:function(){var e=this._segments;1===e.length&&this.removeSegment(0),e.length||this._add([new D(y.read(arguments))])},moveBy:function(){throw new Error("moveBy() is unsupported on Path items.")},lineTo:function(){this._add([new D(y.read(arguments))])},cubicCurveTo:function(){var t=arguments,n=y.read(t),r=y.read(t),i=y.read(t),o=e(this);o.setHandleOut(n.subtract(o._point)),this._add([new D(i,r.subtract(i))])},quadraticCurveTo:function(){var t=arguments,n=y.read(t),r=y.read(t),i=e(this)._point;this.cubicCurveTo(n.add(i.subtract(n).multiply(1/3)),n.add(r.subtract(n).multiply(1/3)),r)},curveTo:function(){var t=arguments,n=y.read(t),r=y.read(t),i=l.pick(l.read(t),.5),o=1-i,a=e(this)._point,s=n.subtract(a.multiply(o*o)).subtract(r.multiply(i*i)).divide(2*i*o);if(s.isNaN())throw new Error("Cannot put a curve through points with parameter = "+i);this.quadraticCurveTo(s,r)},arcTo:function(){var t,n,r,i,o=arguments,a=Math.abs,s=Math.sqrt,c=e(this),u=c._point,f=y.read(o),d=l.peek(o);if("boolean"==typeof(b=l.pick(d,!0)))var p=(x=u.add(f).divide(2)).add(x.subtract(u).rotate(b?-90:90));else if(l.remain(o)<=2)p=f,f=y.read(o);else if(!u.equals(f)){var h=w.read(o),g=v.isZero;if(g(h.width)||g(h.height))return this.lineTo(f);var m=l.read(o),b=!!l.read(o),_=!!l.read(o),x=u.add(f).divide(2),O=($=u.subtract(x).rotate(-m)).x,C=$.y,k=a(h.width),T=a(h.height),j=k*k,P=T*T,I=O*O,R=C*C,A=s(I/j+R/P);if(A>1&&(j=(k*=A)*k,P=(T*=A)*T),a(A=(j*P-j*R-P*I)/(j*R+P*I))<1e-12&&(A=0),A<0)throw new Error("Cannot create an arc with the given arguments");t=new y(k*C/T,-T*O/k).multiply((_===b?-1:1)*s(A)).rotate(m).add(x),n=(r=(i=(new S).translate(t).rotate(m).scale(k,T))._inverseTransform(u)).getDirectedAngle(i._inverseTransform(f)),!b&&n>0?n-=360:b&&n<0&&(n+=360)}if(p){var M=new E(u.add(p).divide(2),p.subtract(u).rotate(90),!0),N=new E(p.add(f).divide(2),f.subtract(p).rotate(90),!0),L=new E(u,f),z=L.getSide(p);if(!(t=M.intersect(N,!0))){if(!z)return this.lineTo(f);throw new Error("Cannot create an arc with the given arguments")}n=(r=u.subtract(t)).getDirectedAngle(f.subtract(t));var B=L.getSide(t,!0);0===B?n=z*a(n):z===B&&(n+=n<0?360:-360)}if(n){for(var F=1e-7,W=a(n),H=W>=360?4:Math.ceil((W-F)/90),V=n/H,U=V*Math.PI/360,q=4/3*Math.sin(U)/(1+Math.cos(U)),G=[],K=0;K<=H;K++){var $=f,Z=null;if(K0){for(var O=1;O<_;O++)y(e[O],d);t?y(e[0],d):(b(e[0],p),b(e[e.length-1],p))}return l},_getStrokePadding:function(e,t){if(!t)return[e,e];var n=new y(e,0).transform(t),r=new y(0,e).transform(t),i=n.getAngleInRadians(),o=n.getLength(),a=r.getLength(),s=Math.sin(i),c=Math.cos(i),u=Math.tan(i),l=Math.atan2(a*u,o),f=Math.atan2(a,u*o);return[Math.abs(o*Math.cos(l)*c+a*Math.sin(l)*s),Math.abs(a*Math.sin(f)*c+o*Math.cos(f)*s)]},_addBevelJoin:function(e,t,n,r,i,o,a,s){var c=e.getCurve(),u=c.getPrevious(),l=c.getPoint1().transform(i),f=u.getNormalAtTime(1).multiply(n).transform(o),d=c.getNormalAtTime(0).multiply(n).transform(o),p=f.getDirectedAngle(d);if((p<0||p>=180)&&(f=f.negate(),d=d.negate()),s&&a(l),a(l.add(f)),"miter"===t){var h=new E(l.add(f),new y(-f.y,f.x),!0).intersect(new E(l.add(d),new y(-d.y,d.x),!0),!0);h&&l.getDistance(h)<=r*n&&a(h)}a(l.add(d))},_addSquareCap:function(e,t,n,r,i,o,a){var s=e._point.transform(r),c=e.getLocation(),u=c.getNormal().multiply(0===c.getTime()?n:-n).transform(i);"square"===t&&(a&&(o(s.subtract(u)),o(s.add(u))),s=s.add(u.rotate(-90))),o(s.add(u)),o(s.subtract(u))},getHandleBounds:function(e,t,n,r,i){var o,a,s=n.getStyle();if(i.stroke&&s.hasStroke()){var c=n._getStrokeMatrix(r,i),u=s.getStrokeWidth()/2,l=u;"miter"===s.getStrokeJoin()&&(l=u*s.getMiterLimit()),"square"===s.getStrokeCap()&&(l=Math.max(l,u*Math.SQRT2)),o=F._getStrokePadding(u,c),a=F._getStrokePadding(l,c)}for(var f=new Array(6),d=1/0,p=-d,h=d,g=p,v=0,m=e.length;vp&&(p=C),kg&&(g=T)}}return new x(d,h,p-d,g-h)}}});F.inject({statics:new function(){var e=.5522847498307936,t=[new D([-1,0],[0,e],[0,-e]),new D([0,-1],[-e,0],[e,0]),new D([1,0],[0,-e],[0,e]),new D([0,1],[e,0],[-e,0])];function n(e,t,n){var r=l.getNamed(n),i=new F(r&&0==r.insert&&k.NO_INSERT);return i._add(e),i._closed=t,i.set(r,{insert:!0})}function r(e,r,i){for(var o=new Array(4),a=0;a<4;a++){var s=t[a];o[a]=new D(s._point.multiply(r).add(e),s._handleIn.multiply(r),s._handleOut.multiply(r))}return n(o,!0,i)}return{Line:function(){var e=arguments;return n([new D(y.readNamed(e,"from")),new D(y.readNamed(e,"to"))],!1,e)},Circle:function(){var e=arguments,t=y.readNamed(e,"center"),n=l.readNamed(e,"radius");return r(t,new w(n),e)},Rectangle:function(){var t,r=arguments,i=x.readNamed(r,"rectangle"),o=w.readNamed(r,"radius",0,{readNull:!0}),a=i.getBottomLeft(!0),s=i.getTopLeft(!0),c=i.getTopRight(!0),u=i.getBottomRight(!0);if(!o||o.isZero())t=[new D(a),new D(s),new D(c),new D(u)];else{var l=(o=w.min(o,i.getSize(!0).divide(2))).width,f=o.height,d=l*e,p=f*e;t=[new D(a.add(l,0),null,[-d,0]),new D(a.subtract(0,f),[0,p]),new D(s.add(0,f),null,[0,-p]),new D(s.add(l,0),[-d,0],null),new D(c.subtract(l,0),null,[d,0]),new D(c.add(0,f),[0,-p],null),new D(u.subtract(0,f),null,[0,p]),new D(u.subtract(l,0),[d,0])]}return n(t,!0,r)},RoundRectangle:"#Rectangle",Ellipse:function(){var e=arguments,t=P._readEllipse(e);return r(t.center,t.radius,e)},Oval:"#Ellipse",Arc:function(){var e=arguments,t=y.readNamed(e,"from"),n=y.readNamed(e,"through"),r=y.readNamed(e,"to"),i=l.getNamed(e),o=new F(i&&0==i.insert&&k.NO_INSERT);return o.moveTo(t),o.arcTo(n,r),o.set(i)},RegularPolygon:function(){for(var e=arguments,t=y.readNamed(e,"center"),r=l.readNamed(e,"sides"),i=l.readNamed(e,"radius"),o=360/r,a=r%3==0,s=new y(0,a?-i:i),c=a?-1:.5,u=new Array(r),f=0;f=0;o--){var a=r[o];r!==n||a instanceof F||(r=l.slice(r)),Array.isArray(a)?r[o]=new F({segments:a,insert:!1}):a instanceof W&&(r.splice.apply(r,[o,1].concat(a.removeChildren())),a.remove())}return e.base.call(this,t,r)},reduce:function e(t){for(var n=this._children,r=n.length-1;r>=0;r--){var i;(i=n[r].reduce(t)).isEmpty()&&i.remove()}return n.length?e.base.call(this):((i=new F(k.NO_INSERT)).copyAttributes(this),i.insertAbove(this),this.remove(),i)},isClosed:function(){for(var e=this._children,t=0,n=e.length;t=0;h--){var g=s[h].split();g&&(p(g)&&g.getFirstSegment().setHandleIn(0,0),r.getLastSegment().setHandleOut(0,0))}return p(r),a(d,!1,e,t)}function d(e,t){for(var n=e;n;){if(n===t)return;n=n._previous}for(;e._next&&e._next!==t;)e=e._next;if(!e._next){for(;t._previous;)t=t._previous;e._next=t,t._previous=e}}function p(e){for(var t=e.length-1;t>=0;t--)e[t].clearHandles()}function g(e,t,r){var i=e&&e.length;if(i){var o=l.each(e,(function(e,t){this[e._id]={container:null,winding:e.isClockwise()?1:-1,index:t}}),{}),a=e.slice().sort((function(e,t){return n(t.getArea())-n(e.getArea())})),s=a[0],c=h.findItemBoundsCollisions(a,null,v.GEOMETRIC_EPSILON);null==r&&(r=s.isClockwise());for(var u=0;u=0;y--)if(g[y]=0;f--){(h=n[f])._path&&(u[l(h)]=!0)}for(f=e.length-1;f>=0;f--){var h,g,v=e[f],m=v._time,y=m,b=t&&!t(v);if((h=v._curve)&&(h!==i?(s=!h.hasHandles()||u&&u[l(h)],r=[],o=null,i=h):o>=1e-8&&(m/=o)),b)r&&r.push(v);else{if(t&&a.unshift(v),o=y,m<1e-8)g=h._segment1;else if(m>1-1e-8)g=h._segment2;else{var w=h.divideAtTime(m,!0);s&&c.push(h,w),g=w._segment1;for(var _=r.length-1;_>=0;_--){var x=r[_];x._time=(x._time-m)/(1-m)}}v._setSegment(g);var O=g._intersection,S=v._intersection;if(O){d(O,S);for(var E=O;E;)d(E._intersection,O),E=E._next}else g._intersection=S}}return n||p(c),a||e}function y(r,i,o,a,s){var c,u,l=Array.isArray(i)?i:i[o?"hor":"ver"],f=o?1:0,d=1^f,p=[r.x,r.y],h=p[f],g=p[d],v=h-1e-9,m=h+1e-9,b=0,w=0,_=0,x=0,O=!1,S=!1,E=1,C=[];function k(n){var u=n[d+0],l=n[d+6];if(!(gt(u,l))){var p=n[f+0],b=n[f+2],w=n[f+4],S=n[f+6];if(u!==l){var k=g===u?0:g===l||v>t(p,b,w,S)||m0?C[0]:1,T=0===k?p:1===k?S:L.getPoint(n,k)[o?"y":"x"],j=u>l?1:-1,P=c[d]>c[d+6]?1:-1,I=c[f+6];return g!==u?(Tm?x+=j:O=!0,T>h-1e-6&&Tm&&(x+=j):p!=I&&(Im?(x+=j,O=!0):I>v&&Tv&&Tv||Sv)&&(O=!0)}}function T(n){var r=n[d+0],i=n[d+2],a=n[d+4],s=n[d+6];if(g<=t(r,i,a,s)&&g>=e(r,i,a,s))for(var c,u=n[f+0],l=n[f+2],p=n[f+4],h=n[f+6],y=v>t(u,l,p,h)||mf.quality&&(f=C);break}u-=m}}for(p=a.length-1;p>=0;p--)a[p].segment._winding=f}function w(e,t){var n,r=[];function i(e){var n;return!(!e||e._visited||t&&(!t[(n=e._winding||{}).winding]||t.unite&&2===n.winding&&n.windingL&&n.windingR))}function o(e){if(e)for(var t=0,r=n.length;t=0;c--){var u=s[c],f=u._path,d=u._segment,h=d.getPrevious(),g=d.getNext();n(h,f)&&n(g,f)&&(d.remove(),h._handleOut._set(0,0),g._handleIn._set(0,0),h===d||h.getCurve().hasLength()||(g._handleIn.set(h._handleIn),h.remove()))}i&&(m(o,r&&function(e){var t=e.getCurve(),n=e.getSegment(),r=e._intersection,i=r._curve,o=r._segment;if(t&&i&&t._path&&i._path)return!0;n&&(n._intersection=null),o&&(o._intersection=null)},a),a&&p(a),t=w(l.each(t,(function(e){l.push(this,e._segments)}),[])));var v,y=t.length;return y>1&&e?(t!==e&&this.setChildren(t),v=this):1!==y||e||(t[0]!==this&&this.setSegments(t[0].removeSegments()),v=this),v||((v=new W(k.NO_INSERT)).addChildren(t),(v=v.reduce()).copyAttributes(this),this.replaceWith(v)),v},reorient:function(e,t){var n=this._children;return n&&n.length?this.setChildren(g(this.removeChildren(),(function(t){return!!(e?t:1&t)}),t)):t!==s&&this.setClockwise(t),this},getInteriorPoint:function(){var n=this.getBounds().getCenter(!0);if(!this.contains(n)){for(var r=this.getCurves(),i=n.y,o=[],a=[],s=0,c=r.length;s=e(l,f,d,p)&&i<=t(l,f,d,p))for(var h=L.getMonoCurves(u),g=0,v=h.length;g=y&&i<=b||i>=b&&i<=y)){var w=i===y?m[0]:i===b?m[6]:1===L.solveCubic(m,1,i,a,0,1)?L.getPoint(m,a[0]).x:(m[0]+m[6])/2;o.push(w)}}}o.length>1&&(o.sort((function(e,t){return e-t})),n.x=(o[0]+o[1])/2)}return n}}});var H=l.extend({_class:"PathFlattener",initialize:function(e,t,n,r,i){var o,a=[],s=[],c=0,u=1/(n||32),l=e._segments,f=l[0];function d(e,n){var o=L.getValues(e,n,i);a.push(o),function e(n,i,o,a){if(!(a-o>u)||r&&L.isStraight(n)||L.isFlatEnough(n,t||.25)){var l=n[6]-n[0],f=n[7]-n[1],d=Math.sqrt(l*l+f*f);d>0&&(c+=d,s.push({offset:c,curve:n,index:i,time:a}))}else{var p=L.subdivide(n,.5),h=(o+a)/2;e(p[0],i,o,h),e(p[1],i,h,a)}}(o,e._index,0,1)}for(var p=1,h=l.length;p=e){this.index=t;var a=n[t-1],s=a&&a.index===o.index?a.time:0,c=a?a.offset:0;return{index:o.index,time:s+(o.time-s)*(e-c)/(o.offset-c)}}}return{index:n[r-1].index,time:1}},drawPart:function(e,t,n){for(var r=this._get(t),i=this._get(n),o=r.index,a=i.index;o<=a;o++){var s=L.getPart(this.curves[o],o===r.index?r.time:0,o===i.index?i.time:1);o===r.index&&e.moveTo(s[0],s[1]),e.bezierCurveTo.apply(e,s.slice(2))}}},l.each(L._evaluateMethods,(function(e){this[e+"At"]=function(t){var n=this._get(t);return L[e](this.curves[n.index],n.time)}}),{})),V=l.extend({initialize:function(e){for(var t,n=this.points=[],r=e._segments,i=e._closed,o=0,a=r.length;o0&&(r=[new D(t[0])],n>1&&(this.fitCubic(r,e,0,n-1,t[1].subtract(t[0]),t[n-2].subtract(t[n-1])),this.closed&&(r.shift(),r.pop()))),r},fitCubic:function(e,t,n,r,i,o){var a=this.points;if(r-n!=1){for(var s,c=this.chordLengthParameterize(n,r),u=Math.max(t,t*t),l=!0,f=0;f<=4;f++){var d=this.generateBezier(n,r,c,i,o),p=this.findMaxError(n,r,d,c);if(p.error=u)break;l=this.reparameterize(n,r,c,d),u=p.error}var h=a[s-1].subtract(a[s+1]);this.fitCubic(e,t,n,s,i,h),this.fitCubic(e,t,s,r,h.negate(),o)}else{var g=a[n],v=a[r],m=g.getDistance(v)/3;this.addCurve(e,[g,g.add(i.normalize(m)),v.add(o.normalize(m)),v])}},addCurve:function(e,t){e[e.length-1].setHandleOut(t[1].subtract(t[0])),e.push(new D(t[3],t[2].subtract(t[3])))},generateBezier:function(e,t,n,r,i){for(var o=Math.abs,a=this.points,s=a[e],c=a[t],u=[[0,0],[0,0]],l=[0,0],f=0,d=t-e+1;f1e-12){var C=u[0][0]*l[1]-u[1][0]*l[0];O=(l[0]*u[1][1]-l[1]*u[0][1])/E,S=C/E}else{var k=u[0][0]+u[0][1],T=u[1][0]+u[1][1];O=S=o(k)>1e-12?l[0]/k:o(T)>1e-12?l[1]/T:0}var j,P,I=c.getDistance(s),R=1e-12*I;if(OI*I&&(O=S=I/3,j=P=null)}return[s,s.add(j||r.normalize(O)),c.add(P||i.normalize(S)),c]},reparameterize:function(e,t,n,r){for(var i=e;i<=t;i++)n[i-e]=this.findRoot(r,this.points[i],n[i-e]);i=1;for(var o=n.length;i=o&&(o=c,i=a)}return{error:o,index:i}}}),U=k.extend({_class:"TextItem",_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function(e){this._content="",this._lines=[];var t=e&&l.isPlainObject(e)&&e.x===s&&e.y===s;this._initialize(t&&e,!t&&y.read(arguments))},_equals:function(e){return this._content===e._content},copyContent:function(e){this.setContent(e._content)},getContent:function(){return this._content},setContent:function(e){this._content=""+e,this._lines=this._content.split(/\r\n|\n|\r/gm),this._changed(521)},isEmpty:function(){return!this._content},getCharacterStyle:"#getStyle",setCharacterStyle:"#setStyle",getParagraphStyle:"#getStyle",setParagraphStyle:"#setStyle"}),q=U.extend({_class:"PointText",initialize:function(){U.apply(this,arguments)},getPoint:function(){var e=this._matrix.getTranslation();return new b(e.x,e.y,this,"setPoint")},setPoint:function(){var e=y.read(arguments);this.translate(e.subtract(this._matrix.getTranslation()))},_draw:function(e,t,n){if(this._content){this._setStyles(e,t,n);var r=this._lines,i=this._style,o=i.hasFill(),a=i.hasStroke(),s=i.getLeading(),c=e.shadowColor;e.font=i.getFontStyle(),e.textAlign=i.getJustification();for(var u=0,l=r.length;u1&&(c-=1),a[s]=6*c<1?o+6*(i-o)*c:2*c<1?i:3*c<2?o+(i-o)*(2/3-c)*6:o}return a},"rgb-gray":function(e,t,n){return[.2989*e+.587*t+.114*n]},"gray-rgb":function(e){return[e,e,e]},"gray-hsb":function(e){return[0,0,e]},"gray-hsl":function(e){return[0,0,e]},"gradient-rgb":function(){return[]},"rgb-gradient":function(){return[]}};return l.each(t,(function(e,r){n[r]=[],l.each(e,(function(e,i){var o=l.capitalize(e),a=/^(hue|saturation)$/.test(e),s=n[r][i]="gradient"===r?"gradient"===e?function(e){var t=this._components[0];return t!==(e=K.read(Array.isArray(e)?e:arguments,0,{readNull:!0}))&&(t&&t._removeOwner(this),e&&e._addOwner(this)),e}:function(){return y.read(arguments,0,{readNull:"highlight"===e,clone:!0})}:function(e){return null==e||isNaN(e)?0:+e};this["get"+o]=function(){return this._type===r||a&&/^hs[bl]$/.test(this._type)?this._components[i]:this._convert(r)[i]},this["set"+o]=function(e){this._type===r||a&&/^hs[bl]$/.test(this._type)||(this._components=this._convert(r),this._properties=t[r],this._type=r),this._components[i]=s.call(this,e),this._changed()}}),this)}),{_class:"Color",_readIndex:!0,initialize:function e(r){var o,a,s,c,u=arguments,f=this.__read,d=0;Array.isArray(r)&&(r=(u=r)[0]);var p=null!=r&&typeof r;if("string"===p&&r in t&&(o=r,r=u[1],Array.isArray(r)?(a=r,s=u[2]):(f&&(d=1),u=l.slice(u,1),p=typeof r)),!a){if(c="number"===p?u:"object"===p&&null!=r.length?r:null){o||(o=c.length>=3?"rgb":"gray");var h=t[o].length;s=c[h],f&&(d+=c===arguments?h+(null!=s?1:0):1),c.length>h&&(c=l.slice(c,0,h))}else if("string"===p){var g=i(r);o=g[0],4===(a=g[1]).length&&(s=a[3],a.length--)}else if("object"===p)if(r.constructor===e){if(o=r._type,a=r._components.slice(),s=r._alpha,"gradient"===o)for(var v=1,m=a.length;v1?1:e))}return t=[r(t[0]),r(t[1]),r(t[2])],n<1&&t.push(n<0?0:n),e?"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1):(4==t.length?"rgba(":"rgb(")+t.join(",")+")"},toCanvasStyle:function(e,t){if(this._canvasStyle)return this._canvasStyle;if("gradient"!==this._type)return this._canvasStyle=this.toCSS();var n,r=this._components,i=r[0],o=i._stops,a=r[1],s=r[2],c=r[3],u=t&&t.inverted();if(u&&(a=u._transformPoint(a),s=u._transformPoint(s),c&&(c=u._transformPoint(c))),i._radial){var l=s.getDistance(a);if(c){var f=c.subtract(a);f.getLength()>l&&(c=a.add(f.normalize(l-.1)))}var d=c||a;n=e.createRadialGradient(d.x,d.y,0,a.x,a.y,l)}else n=e.createLinearGradient(a.x,a.y,s.x,s.y);for(var p=0,h=o.length;p0&&!(r instanceof W);if(o)for(var a=0,s=i.length;a0&&!(r instanceof W);if(o&&!e)for(var c=0,u=i.length;c0},hasStroke:function(){var e=this.getStrokeColor();return!!e&&e.alpha>0&&this.getStrokeWidth()>0},hasShadow:function(){var e=this.getShadowColor();return!!e&&e.alpha>0&&(this.getShadowBlur()>0||!this.getShadowOffset().isZero())},getView:function(){return this._project._view},getFontStyle:function(){var e=this.getFontSize();return this.getFontWeight()+" "+e+(/[a-z]/i.test(e+"")?" ":"px ")+this.getFontFamily()},getFont:"#getFontFamily",setFont:"#setFontFamily",getLeading:function e(){var t=e.base.call(this),n=this.getFontSize();return/pt|em|%|px/.test(n)&&(n=this.getView().getPixelSize(n)),null!=t?t:1.2*n}}),X=new function(){function e(e,t,n,r){for(var i=["","webkit","moz","Moz","ms","o"],o=t[0].toUpperCase()+t.substring(1),a=0;a<6;a++){var s=i[a],c=s?s+o:t;if(c in e){if(!n)return e[c];e[c]=r;break}}}return{getStyles:function(e){var t=e&&9!==e.nodeType?e.ownerDocument:e,n=t&&t.defaultView;return n&&n.getComputedStyle(e,"")},getBounds:function(e,t){var n,r=e.ownerDocument,i=r.body,o=r.documentElement;try{n=e.getBoundingClientRect()}catch(e){n={left:0,top:0,width:0,height:0}}var a=n.left-(o.clientLeft||i.clientLeft||0),s=n.top-(o.clientTop||i.clientTop||0);if(!t){var c=r.defaultView;a+=c.pageXOffset||o.scrollLeft||i.scrollLeft,s+=c.pageYOffset||o.scrollTop||i.scrollTop}return new x(a,s,n.width,n.height)},getViewportBounds:function(e){var t=e.ownerDocument,n=t.defaultView,r=t.documentElement;return new x(0,0,n.innerWidth||r.clientWidth,n.innerHeight||r.clientHeight)},getOffset:function(e,t){return X.getBounds(e,t).getPoint()},getSize:function(e){return X.getBounds(e,!0).getSize()},isInvisible:function(e){return X.getSize(e).equals(new w(0,0))},isInView:function(e){return!X.isInvisible(e)&&X.getViewportBounds(e).intersects(X.getBounds(e,!0))},isInserted:function(e){return u.body.contains(e)},getPrefixed:function(t,n){return t&&e(t,n)},setPrefixed:function(t,n,r){if("object"==typeof n)for(var i in n)e(t,i,!0,n[i]);else e(t,n,!0,r)}}},Q={add:function(e,t){if(e)for(var n in t)for(var r=t[n],i=n.split(/[\s,]+/g),o=0,a=i.length;o1?l.hyphenate(t):t.toLowerCase())}function d(t,n,r,s){var c,u=Y._focused;if(i[n]=t,t?o[n]=r:delete o[n],n.length>1&&(c=l.camelize(n))in a){a[c]=t;var f=de&&de.agent;if("meta"===c&&f&&f.mac)if(t)e={};else{for(var p in e)p in o&&d(!1,p,e[p],s);e=null}}else t&&e&&(e[n]=r);u&&u._handleKeyEvent(t?"keydown":"keyup",s,n,r)}return Q.add(u,{keydown:function(e){var n=f(e),i=de&&de.agent;n.length>1||i&&i.chrome&&(e.altKey||i.mac&&e.metaKey||!i.mac&&e.ctrlKey)?d(!0,n,r[n]||(n.length>1?"":n),e):t=n},keypress:function(e){if(t){var n=f(e),r=e.charCode,i=r>=32?String.fromCharCode(r):n.length>1?"":n;n!==t&&(n=i.toLowerCase()),d(!0,n,i,e),t=null}},keyup:function(e){var t=f(e);t in o&&d(!1,t,o[t],e)}}),Q.add(c,{blur:function(e){for(var t in o)d(!1,t,o[t],e)}}),{modifiers:a,isDown:function(e){return!!i[e]}}},re=ee.extend({_class:"MouseEvent",initialize:function(e,t,n,r,i){this.type=e,this.event=t,this.point=n,this.target=r,this.delta=i},toString:function(){return"{ type: '"+this.type+"', point: "+this.point+", target: "+this.target+(this.delta?", delta: "+this.delta:"")+", modifiers: "+this.getModifiers()+" }"}}),ie=ee.extend({_class:"ToolEvent",_item:null,initialize:function(e,t,n){this.tool=e,this.type=t,this.event=n},_choosePoint:function(e,t){return e||(t?t.clone():null)},getPoint:function(){return this._choosePoint(this._point,this.tool._point)},setPoint:function(e){this._point=e},getLastPoint:function(){return this._choosePoint(this._lastPoint,this.tool._lastPoint)},setLastPoint:function(e){this._lastPoint=e},getDownPoint:function(){return this._choosePoint(this._downPoint,this.tool._downPoint)},setDownPoint:function(e){this._downPoint=e},getMiddlePoint:function(){return!this._middlePoint&&this.tool._lastPoint?this.tool._point.add(this.tool._lastPoint).divide(2):this._middlePoint},setMiddlePoint:function(e){this._middlePoint=e},getDelta:function(){return!this._delta&&this.tool._lastPoint?this.tool._point.subtract(this.tool._lastPoint):this._delta},setDelta:function(e){this._delta=e},getCount:function(){return this.tool[/^mouse(down|up)$/.test(this.type)?"_downCount":"_moveCount"]},setCount:function(e){this.tool[/^mouse(down|up)$/.test(this.type)?"downCount":"count"]=e},getItem:function(){if(!this._item){var e=this.tool._scope.project.hitTest(this.getPoint());if(e){for(var t=e.item,n=t._parent;/^(Group|CompoundPath)$/.test(n._class);)t=n,n=n._parent;this._item=t}}return this._item},setItem:function(e){this._item=e},toString:function(){return"{ type: "+this.type+", point: "+this.getPoint()+", count: "+this.getCount()+", modifiers: "+this.getModifiers()+" }"}}),oe=p.extend({_class:"Tool",_list:"tools",_reference:"tool",_events:["onMouseDown","onMouseUp","onMouseDrag","onMouseMove","onActivate","onDeactivate","onEditOptions","onKeyDown","onKeyUp"],initialize:function(e){p.call(this),this._moveCount=-1,this._downCount=-1,this.set(e)},getMinDistance:function(){return this._minDistance},setMinDistance:function(e){this._minDistance=e,null!=e&&null!=this._maxDistance&&e>this._maxDistance&&(this._maxDistance=e)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(e){this._maxDistance=e,null!=this._minDistance&&null!=e&&e=0&&o.equals(a))return!1;if(a&&(null!=e||null!=t)){var s=o.subtract(a),c=s.getLength();if(c<(e||0))return!1;t&&(o=a.add(s.normalize(Math.min(c,t))))}u._moveCount++}return u._point=o,u._lastPoint=a||o,r.down&&(u._moveCount=-1,u._downPoint=o,u._downCount++),!0}function f(){o&&(c=u.emit(e,new ie(u,e,t))||c)}if(r.down)l(),f();else if(r.up)l(null,s),f();else if(o)for(;l(a,s);)f();return c}}),ae=l.extend(f,{_class:"Tween",statics:{easings:new l({linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:2*(2-e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}})},initialize:function e(t,n,r,i,o,a){this.object=t;var s=typeof o,c="function"===s;this.type=c?s:"string"===s?o:"linear",this.easing=c?o:e.easings[this.type],this.duration=i,this.running=!1,this._then=null,this._startTime=null;var u=n||r;this._keys=u?Object.keys(u):[],this._parsedKeys=this._parseKeys(this._keys),this._from=u&&this._getState(n),this._to=u&&this._getState(r),!1!==a&&this.start()},then:function(e){return this._then=e,this},start:function(){return this._startTime=null,this.running=!0,this},stop:function(){return this.running=!1,this},update:function(e){if(this.running){e>=1&&(e=1,this.running=!1);for(var t=this.easing(e),n=this._keys,r=function(n){return"function"==typeof n?n(t,e):n},i=0,o=n&&n.length;i255){var l=255-r,h=a-r;c=r+(c-r)*l/h,u=r+(u-r)*l/h,f=r+(f-r)*l/h}}function m(e,t,n){return p(e,t,n)-d(e,t,n)}function y(e,t,n,r){var i,o=[e,t,n],a=p(e,t,n),s=d(e,t,n);i=0===d(s=s===e?0:s===t?1:2,a=a===e?0:a===t?1:2)?1===p(s,a)?2:1:0,o[a]>o[s]?(o[i]=(o[i]-o[s])*r/(o[a]-o[s]),o[a]=r):o[i]=o[a]=0,o[s]=0,c=o[0],u=o[1],f=o[2]}var b={multiply:function(){c=i*e/255,u=o*t/255,f=a*n/255},screen:function(){c=i+e-i*e/255,u=o+t-o*t/255,f=a+n-a*n/255},overlay:function(){c=i<128?2*i*e/255:255-2*(255-i)*(255-e)/255,u=o<128?2*o*t/255:255-2*(255-o)*(255-t)/255,f=a<128?2*a*n/255:255-2*(255-a)*(255-n)/255},"soft-light":function(){var r=e*i/255;c=r+i*(255-(255-i)*(255-e)/255-r)/255,u=(r=t*o/255)+o*(255-(255-o)*(255-t)/255-r)/255,f=(r=n*a/255)+a*(255-(255-a)*(255-n)/255-r)/255},"hard-light":function(){c=e<128?2*e*i/255:255-2*(255-e)*(255-i)/255,u=t<128?2*t*o/255:255-2*(255-t)*(255-o)/255,f=n<128?2*n*a/255:255-2*(255-n)*(255-a)/255},"color-dodge":function(){c=0===i?0:255===e?255:d(255,255*i/(255-e)),u=0===o?0:255===t?255:d(255,255*o/(255-t)),f=0===a?0:255===n?255:d(255,255*a/(255-n))},"color-burn":function(){c=255===i?255:0===e?0:p(0,255-255*(255-i)/e),u=255===o?255:0===t?0:p(0,255-255*(255-o)/t),f=255===a?255:0===n?0:p(0,255-255*(255-a)/n)},darken:function(){c=ie?i:e,u=o>t?o:t,f=a>n?a:n},difference:function(){(c=i-e)<0&&(c=-c),(u=o-t)<0&&(u=-u),(f=a-n)<0&&(f=-f)},exclusion:function(){c=i+e*(255-i-i)/255,u=o+t*(255-o-o)/255,f=a+n*(255-a-a)/255},hue:function(){y(e,t,n,m(i,o,a)),v(c,u,f,g(i,o,a))},saturation:function(){y(i,o,a,m(e,t,n)),v(c,u,f,g(i,o,a))},luminosity:function(){v(i,o,a,g(e,t,n))},color:function(){v(e,t,n,g(i,o,a))},add:function(){c=d(i+e,255),u=d(o+t,255),f=d(a+n,255)},subtract:function(){c=p(i-e,0),u=p(o-t,0),f=p(a-n,0)},average:function(){c=(i+e)/2,u=(o+t)/2,f=(a+n)/2},negation:function(){c=255-h(255-e-i),u=255-h(255-t-o),f=255-h(255-n-a)}},w=this.nativeModes=l.each(["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","darker","copy","xor"],(function(e){this[e]=!0}),{}),_=ce.getContext(1,1);_&&(l.each(b,(function(e,t){var n="darken"===t,r=!1;_.save();try{_.fillStyle=n?"#300":"#a00",_.fillRect(0,0,1,1),_.globalCompositeOperation=t,_.globalCompositeOperation===t&&(_.fillStyle=n?"#a00":"#300",_.fillRect(0,0,1,1),r=_.getImageData(0,0,1,1).data[0]!==n?170:51)}catch(e){}_.restore(),w[t]=r})),ce.release(_)),this.process=function(l,d,p,h,g){var v=d.canvas,m="normal"===l;if(m||w[l])p.save(),p.setTransform(1,0,0,1,0,0),p.globalAlpha=h,m||(p.globalCompositeOperation=l),p.drawImage(v,g.x,g.y),p.restore();else{var y=b[l];if(!y)return;for(var _=p.getImageData(g.x,g.y,v.width,v.height),x=_.data,O=d.getImageData(0,0,v.width,v.height).data,S=0,E=x.length;S=2&&!n.hasHandles())if(u>2){s=n._closed?"polygon":"polyline";for(var f=[],d=0;d3){for(n.sort((function(e,t){return t.length-e.length})),t+="switch(str.length){",r=0;r=170&&Be.test(String.fromCharCode(e)))},Ue=e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||e>=170&&Fe.test(String.fromCharCode(e))))};function qe(){this.line=g,this.column=s-v}function Ge(){g=1,s=v=0,h=!0,Xe()}function Ke(e,n){u=s,t.locations&&(f=new qe),d=e,Xe(),p=n,h=e.beforeExpr}function $e(){var e,r=t.onComment&&t.locations&&new qe,i=s,o=n.indexOf("*/",s+=2);if(-1===o&&S(s-2,"Unterminated comment"),s=o+2,t.locations)for(He.lastIndex=i;(e=He.exec(n))&&e.index8&&e<14)++s;else if(47===e){var i;if(42===(i=n.charCodeAt(s+1)))$e();else{if(47!==i)break;Ze()}}else if(160===e)++s;else{if(!(e>=5760&&Le.test(String.fromCharCode(e))))break;++s}}}function Qe(e){switch(e){case 46:return function(){var e=n.charCodeAt(s+1);return e>=48&&e<=57?nt(!0):(++s,Ke(de))}();case 40:return++s,Ke(se);case 41:return++s,Ke(ce);case 59:return++s,Ke(le);case 44:return++s,Ke(ue);case 91:return++s,Ke(re);case 93:return++s,Ke(ie);case 123:return++s,Ke(oe);case 125:return++s,Ke(ae);case 58:return++s,Ke(fe);case 63:return++s,Ke(pe);case 48:var i=n.charCodeAt(s+1);if(120===i||88===i)return function(){s+=2;var e=tt(16);return null==e&&S(c+2,"Expected hexadecimal number"),Ve(n.charCodeAt(s))&&S(s,"Identifier directly after number"),Ke(C,e)}();case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return nt(!1);case 34:case 39:return function(e){s++;for(var i="";;){s>=r&&S(c,"Unterminated string constant");var o=n.charCodeAt(s);if(o===e)return++s,Ke(T,i);if(92===o){o=n.charCodeAt(++s);var a=/^[0-7]+/.exec(n.slice(s,s+3));for(a&&(a=a[0]);a&&parseInt(a,8)>255;)a=a.slice(0,-1);if("0"===a&&(a=null),++s,a)x&&S(s-2,"Octal literal in strict mode"),i+=String.fromCharCode(parseInt(a,8)),s+=a.length-1;else switch(o){case 110:i+="\n";break;case 114:i+="\r";break;case 120:i+=String.fromCharCode(rt(2));break;case 117:i+=String.fromCharCode(rt(4));break;case 85:i+=String.fromCharCode(rt(8));break;case 116:i+="\t";break;case 98:i+="\b";break;case 118:i+="\v";break;case 102:i+="\f";break;case 48:i+="\0";break;case 13:10===n.charCodeAt(s)&&++s;case 10:t.locations&&(v=s,++g);break;default:i+=String.fromCharCode(o)}}else 13!==o&&10!==o&&8232!==o&&8233!==o||S(c,"Unterminated string constant"),i+=String.fromCharCode(o),++s}}(e);case 47:return function(){var e=n.charCodeAt(s+1);return h?(++s,et()):61===e?Je(ve,2):Je(he,1)}();case 37:case 42:return 61===n.charCodeAt(s+1)?Je(ve,2):Je(Te,1);case 124:case 38:return function(e){var t=n.charCodeAt(s+1);return t===e?Je(124===e?be:we,2):61===t?Je(ve,2):Je(124===e?_e:Oe,1)}(e);case 94:return 61===n.charCodeAt(s+1)?Je(ve,2):Je(xe,1);case 43:case 45:return function(e){var t=n.charCodeAt(s+1);return t===e?45==t&&62==n.charCodeAt(s+2)&&We.test(n.slice(y,s))?(s+=3,Ze(),Xe(),Ye()):Je(me,2):61===t?Je(ve,2):Je(ke,1)}(e);case 60:case 62:return function(e){var t=n.charCodeAt(s+1),r=1;return t===e?(r=62===e&&62===n.charCodeAt(s+2)?3:2,61===n.charCodeAt(s+r)?Je(ve,r+1):Je(Ce,r)):33==t&&60==e&&45==n.charCodeAt(s+2)&&45==n.charCodeAt(s+3)?(s+=4,Ze(),Xe(),Ye()):(61===t&&(r=61===n.charCodeAt(s+2)?3:2),Je(Ee,r))}(e);case 61:case 33:return function(e){return 61===n.charCodeAt(s+1)?Je(Se,61===n.charCodeAt(s+2)?3:2):Je(61===e?ge:ye,1)}(e);case 126:return Je(ye,1)}return!1}function Ye(e){if(e?s=c+1:c=s,t.locations&&(l=new qe),e)return et();if(s>=r)return Ke(P);var i=n.charCodeAt(s);if(Ve(i)||92===i)return ot();var o=Qe(i);if(!1===o){var a=String.fromCharCode(i);if("\\"===a||Be.test(a))return ot();S(s,"Unexpected character '"+a+"'")}return o}function Je(e,t){var r=n.slice(s,s+t);s+=t,Ke(e,r)}function et(){for(var e,t,i=s;;){s>=r&&S(i,"Unterminated regular expression");var o=n.charAt(s);if(We.test(o)&&S(i,"Unterminated regular expression"),e)e=!1;else{if("["===o)t=!0;else if("]"===o&&t)t=!1;else if("/"===o&&!t)break;e="\\"===o}++s}var a=n.slice(i,s);++s;var c=it();c&&!/^[gmsiy]*$/.test(c)&&S(i,"Invalid regexp flag");try{var u=new RegExp(a,c)}catch(e){e instanceof SyntaxError&&S(i,e.message),S(e)}return Ke(k,u)}function tt(e,t){for(var r=s,i=0,o=0,a=null==t?1/0:t;o=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0)>=e)break;++s,i=i*e+c}return s===r||null!=t&&s-r!==t?null:i}function nt(e){var t=s,r=!1,i=48===n.charCodeAt(s);e||null!==tt(10)||S(t,"Invalid number"),46===n.charCodeAt(s)&&(++s,tt(10),r=!0);var o=n.charCodeAt(s);69!==o&&101!==o||(43!==(o=n.charCodeAt(++s))&&45!==o||++s,null===tt(10)&&S(t,"Invalid number"),r=!0),Ve(n.charCodeAt(s))&&S(s,"Identifier directly after number");var a,c=n.slice(t,s);return r?a=parseFloat(c):i&&1!==c.length?/[89]/.test(c)||x?S(t,"Invalid number"):a=parseInt(c,8):a=parseInt(c,10),Ke(C,a)}function rt(e){var t=tt(16,e);return null===t&&S(c,"Bad character escape sequence"),t}function it(){Ie=!1;for(var e,t=!0,r=s;;){var i=n.charCodeAt(s);if(Ue(i))Ie&&(e+=n.charAt(s)),++s;else{if(92!==i)break;Ie||(e=n.slice(r,s)),Ie=!0,117!=n.charCodeAt(++s)&&S(s,"Expecting Unicode escape sequence \\uXXXX"),++s;var o=rt(4),a=String.fromCharCode(o);a||S(s-1,"Invalid Unicode escape"),(t?Ve(o):Ue(o))||S(s-4,"Invalid Unicode escape"),e+=a}t=!1}return Ie?e:n.slice(r,s)}function ot(){var e=it(),t=j;return!Ie&&Ne(e)&&(t=ne[e]),Ke(t,e)}function at(){m=c,y=u,b=f,Ye()}function st(e){if(x=e,s=c,t.locations)for(;s=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"use strict"===e.expression.value}function ht(e){if(d===e)return at(),!0}function gt(){return!t.strictSemicolons&&(d===P||d===ae||We.test(n.slice(y,c)))}function vt(){ht(le)||gt()||yt()}function mt(e){d===e?at():yt()}function yt(){S(c,"Unexpected token")}function bt(e){"Identifier"!==e.type&&"MemberExpression"!==e.type&&S(e.start,"Assigning to rvalue"),x&&"Identifier"===e.type&&De(e.name)&&S(e.start,"Assigning to "+e.name+" in strict mode")}var wt={kind:"loop"},_t={kind:"switch"};function xt(){(d===he||d===ve&&"/="==p)&&Ye(!0);var e=d,r=lt();switch(e){case I:case M:at();var i=e===I;ht(le)||gt()?r.label=null:d!==j?yt():(r.label=Nt(),vt());for(var o=0;o<_.length;++o){var a=_[o];if(null==r.label||a.name===r.label.name){if(null!=a.kind&&(i||"loop"===a.kind))break;if(r.label&&i)break}}return o===_.length&&S(r.start,"Unsyntactic "+e.keyword),dt(r,i?"BreakStatement":"ContinueStatement");case D:return at(),vt(),dt(r,"DebuggerStatement");case L:return at(),_.push(wt),r.body=xt(),_.pop(),mt($),r.test=Ot(),vt(),dt(r,"DoWhileStatement");case F:if(at(),_.push(wt),mt(se),d===le)return Et(r,null);if(d===K){var s=lt();return at(),kt(s,!0),dt(s,"VariableDeclaration"),1===s.declarations.length&&ht(te)?Ct(r,s):Et(r,s)}return s=Tt(!1,!0),ht(te)?(bt(s),Ct(r,s)):Et(r,s);case W:return at(),Mt(r,!0);case H:return at(),r.test=Ot(),r.consequent=xt(),r.alternate=ht(z)?xt():null,dt(r,"IfStatement");case V:return w||t.allowReturnOutsideFunction||S(c,"'return' outside of function"),at(),ht(le)||gt()?r.argument=null:(r.argument=Tt(),vt()),dt(r,"ReturnStatement");case U:at(),r.discriminant=Ot(),r.cases=[],mt(oe),_.push(_t);for(var u,l;d!=ae;)if(d===R||d===N){var f=d===R;u&&dt(u,"SwitchCase"),r.cases.push(u=lt()),u.consequent=[],at(),f?u.test=Tt():(l&&S(m,"Multiple default clauses"),l=!0,u.test=null),mt(fe)}else u||yt(),u.consequent.push(xt());return u&&dt(u,"SwitchCase"),at(),_.pop(),dt(r,"SwitchStatement");case q:return at(),We.test(n.slice(y,c))&&S(y,"Illegal newline after throw"),r.argument=Tt(),vt(),dt(r,"ThrowStatement");case G:if(at(),r.block=St(),r.handler=null,d===A){var h=lt();at(),mt(se),h.param=Nt(),x&&De(h.param.name)&&S(h.param.start,"Binding "+h.param.name+" in strict mode"),mt(ce),h.guard=null,h.body=St(),r.handler=dt(h,"CatchClause")}return r.guardedHandlers=E,r.finalizer=ht(B)?St():null,r.handler||r.finalizer||S(r.start,"Missing catch or finally clause"),dt(r,"TryStatement");case K:return at(),kt(r),vt(),dt(r,"VariableDeclaration");case $:return at(),r.test=Ot(),_.push(wt),r.body=xt(),_.pop(),dt(r,"WhileStatement");case Z:return x&&S(c,"'with' in strict mode"),at(),r.object=Ot(),r.body=xt(),dt(r,"WithStatement");case oe:return St();case le:return at(),dt(r,"EmptyStatement");default:var g=p,v=Tt();if(e===j&&"Identifier"===v.type&&ht(fe)){for(o=0;o<_.length;++o)_[o].name===g&&S(v.start,"Label '"+g+"' is already declared");var b=d.isLoop?"loop":d===U?"switch":null;return _.push({name:g,kind:b}),r.body=xt(),_.pop(),r.label=v,dt(r,"LabeledStatement")}return r.expression=v,vt(),dt(r,"ExpressionStatement")}}function Ot(){mt(se);var e=Tt();return mt(ce),e}function St(e){var t,n=lt(),r=!0,i=!1;for(n.body=[],mt(oe);!ht(ae);){var o=xt();n.body.push(o),r&&e&&pt(o)&&(t=i,st(i=!0)),r=!1}return i&&!t&&st(!1),dt(n,"BlockStatement")}function Et(e,t){return e.init=t,mt(le),e.test=d===le?null:Tt(),mt(le),e.update=d===ce?null:Tt(),mt(ce),e.body=xt(),_.pop(),dt(e,"ForStatement")}function Ct(e,t){return e.left=t,e.right=Tt(),mt(ce),e.body=xt(),_.pop(),dt(e,"ForInStatement")}function kt(e,t){for(e.declarations=[],e.kind="var";;){var n=lt();if(n.id=Nt(),x&&De(n.id.name)&&S(n.id.start,"Binding "+n.id.name+" in strict mode"),n.init=ht(ge)?Tt(!0,t):null,e.declarations.push(dt(n,"VariableDeclarator")),!ht(ue))break}return e}function Tt(e,t){var n=jt(t);if(!e&&d===ue){var r=ft(n);for(r.expressions=[n];ht(ue);)r.expressions.push(jt(t));return dt(r,"SequenceExpression")}return n}function jt(e){var t=function(e){var t=function(e){return function e(t,n,r){var i=d.binop;if(null!=i&&(!r||d!==te)&&i>n){var o=ft(t);o.left=t,o.operator=p;var a=d;at(),o.right=e(Pt(),i,r);var s=dt(o,a===be||a===we?"LogicalExpression":"BinaryExpression");return e(s,n,r)}return t}(Pt(),-1,e)}(e);if(ht(pe)){var n=ft(t);return n.test=t,n.consequent=Tt(!0),mt(fe),n.alternate=Tt(!0,e),dt(n,"ConditionalExpression")}return t}(e);if(d.isAssign){var n=ft(t);return n.operator=p,n.left=t,at(),n.right=jt(e),bt(t),dt(n,"AssignmentExpression")}return t}function Pt(){if(d.prefix){var e=lt(),t=d.isUpdate;return e.operator=p,e.prefix=!0,h=!0,at(),e.argument=Pt(),t?bt(e.argument):x&&"delete"===e.operator&&"Identifier"===e.argument.type&&S(e.start,"Deleting local variable in strict mode"),dt(e,t?"UpdateExpression":"UnaryExpression")}for(var n=It(Rt());d.postfix&&!gt();)(e=ft(n)).operator=p,e.prefix=!1,e.argument=n,bt(n),at(),n=dt(e,"UpdateExpression");return n}function It(e,t){var n;return ht(de)?((n=ft(e)).object=e,n.property=Nt(!0),n.computed=!1,It(dt(n,"MemberExpression"),t)):ht(re)?((n=ft(e)).object=e,n.property=Tt(),n.computed=!0,mt(ie),It(dt(n,"MemberExpression"),t)):!t&&ht(se)?((n=ft(e)).callee=e,n.arguments=Dt(ce,!1),It(dt(n,"CallExpression"),t)):e}function Rt(){switch(d){case Q:var e=lt();return at(),dt(e,"ThisExpression");case j:return Nt();case C:case T:case k:return(e=lt()).value=p,e.raw=n.slice(c,u),at(),dt(e,"Literal");case Y:case J:case ee:return(e=lt()).value=d.atomValue,e.raw=d.keyword,at(),dt(e,"Literal");case se:var r=l,i=c;at();var o=Tt();return o.start=i,o.end=u,t.locations&&(o.loc.start=r,o.loc.end=f),t.ranges&&(o.range=[i,u]),mt(ce),o;case re:return e=lt(),at(),e.elements=Dt(ie,!0,!0),dt(e,"ArrayExpression");case oe:return function(){var e=lt(),n=!0,r=!1;for(e.properties=[],at();!ht(ae);){if(n)n=!1;else if(mt(ue),t.allowTrailingCommas&&ht(ae))break;var i,o={key:At()},a=!1;if(ht(fe)?(o.value=Tt(!0),i=o.kind="init"):t.ecmaVersion>=5&&"Identifier"===o.key.type&&("get"===o.key.name||"set"===o.key.name)?(a=r=!0,i=o.kind=o.key.name,o.key=At(),d!==se&&yt(),o.value=Mt(lt(),!1)):yt(),"Identifier"===o.key.type&&(x||r))for(var s=0;s=0)for(var s=0;s=e)break;e+=i[1]}return e}function i(t){return e.substring(r(t.range[0]),r(t.range[1]))}function o(t,i){for(var o=r(t.range[0]),a=r(t.range[1]),s=0,c=n.length-1;c>=0;c--)if(o>n[c][0]){s=c+1;break}n.splice(s,0,[o,i.length-a+o]),e=e.substring(0,o)+i+e.substring(a)}function s(t,n){switch(t.type){case"UnaryExpression":if(t.operator in m&&"Literal"!==t.argument.type){var a=i(t.argument);o(t,'$__("'+t.operator+'", '+a+")")}break;case"BinaryExpression":if(t.operator in v&&"Literal"!==t.left.type){var s=i(t.left),c=i(t.right),u=function(t,n){return e.substring(r(t.range[1]),r(n.range[0]))}(t.left,t.right),l=t.operator;o(t,"__$__("+s+","+u.replace(new RegExp("\\"+l),'"'+l+'"')+", "+c+")")}break;case"UpdateExpression":case"AssignmentExpression":var f=n&&n.type;if(!("ForStatement"===f||"BinaryExpression"===f&&/^[=!<>]/.test(n.operator)||"MemberExpression"===f&&n.computed))if("UpdateExpression"===t.type){var d=(a=i(t.argument))+" = "+(p="__$__("+a+', "'+t.operator[0]+'", 1)');t.prefix?d="("+d+")":"AssignmentExpression"!==f&&"VariableDeclarator"!==f&&"BinaryExpression"!==f||(i(n.left||n.id)===a&&(d=p),d=a+"; "+d),o(t,d)}else if(/^.=$/.test(t.operator)&&"Literal"!==t.left.type){s=i(t.left),c=i(t.right);var p=s+" = __$__("+s+', "'+t.operator[0]+'", '+c+")";o(t,/^\(.*\)$/.test(i(t))?"("+p+")":p)}}}var l,f=(t=t||{}).url||"",d=t.sourceMaps,p=t.paperFeatures||{},h=t.source||e,y=t.offset||0,b=de.agent,w=b.versionNumber,_=!1,x=/\r\n|\n|\r/gm;if(d&&(b.chrome&&w>=30||b.webkit&&w>=537.76||b.firefox&&w>=23||b.node)){if(b.node)y-=2;else if(c&&f&&!c.location.href.indexOf(f)){var O=u.getElementsByTagName("html")[0].innerHTML;y=O.substr(0,O.indexOf(e)+1).match(x).length+1}var S=["AA"+function(e){var t="";for(e=(Math.abs(e)<<1)+(e<0?1:0);e||!t;){var n=31&e;(e>>=5)&&(n|=32),t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}return t}((_=y>0&&!(b.chrome&&w>=36||b.safari&&w>=600||b.firefox&&w>=40||b.node))?0:y)+"A"];S.length=(e.match(x)||[]).length+1+(_?y:0),l={version:3,file:f,names:[],mappings:S.join(";AACA"),sourceRoot:"",sources:[f],sourcesContent:[h]}}return!1===p.operatorOverloading&&!1===p.moduleExports||function e(t,n,r){if(t){for(var a in t)if("range"!==a&&"loc"!==a){var c=t[a];if(Array.isArray(c))for(var u=0,l=c.length;u1||escape(e.first().getText()).replace(/%u200B/g,"").length>0},s.createEntity=function(e,t,n){return u.__create(e,t,n),this},s.mergeEntityData=function(e,t){return u.__mergeData(e,t),this},s.replaceEntityData=function(e,t){return u.__replaceData(e,t),this},s.addEntity=function(e){return u.__add(e),this},s.getEntity=function(e){return u.__get(e)},s.getAllEntities=function(){return u.__getAll()},s.loadWithEntities=function(e){return u.__loadWithEntities(e)},i.createFromBlockArray=function(e,t){var n=Array.isArray(e)?e:e.contentBlocks,r=o.createFromArray(n),a=r.isEmpty()?new l:l.createEmpty(r.first().getKey());return new i({blockMap:r,entityMap:t||u,selectionBefore:a,selectionAfter:a})},i.createFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,n=e.split(t),r=n.map((function(e){return e=g(e),new x({key:f(),text:e,type:"unstyled",characterList:v(y(a.EMPTY,e.length))})}));return i.createFromBlockArray(r)},i.fromJS=function(e){return new i(r({},e,{blockMap:w(e.blockMap).map(i.createContentBlockFromJS),selectionBefore:new l(e.selectionBefore),selectionAfter:new l(e.selectionAfter)}))},i.createContentBlockFromJS=function(e){var t=e.characterList;return new x(r({},e,{data:b(e.data),characterList:null!=t?v((Array.isArray(t)?t:d(t)).map((function(e){return a.fromJS(e)}))):void 0}))},i}(_);e.exports=O},function(e,t,n){"use strict";var r=n(309),i=n(42),o="֐־׀׃׆׈-׏א-ת׫-ׯװ-ײ׳-״׵-׿߀-߉ߊ-ߪߴ-ߵߺ߻-߿ࠀ-ࠕࠚࠤࠨ࠮-࠯࠰-࠾࠿ࡀ-ࡘ࡜-࡝࡞࡟-࢟‏יִײַ-ﬨשׁ-זּ﬷טּ-לּ﬽מּ﬿נּ-סּ﭂ףּ-פּ﭅צּ-ﭏ",a="؈؋؍؛؜؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍܎܏ܐܒ-ܯ݋-݌ݍ-ޥޱ޲-޿ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-﯒ﯓ-ﴽ﵀-﵏ﵐ-ﶏ﶐-﶑ﶒ-ﷇ﷈-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴ﹵ﹶ-ﻼ﻽-﻾",s=new RegExp("["+"A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-ッーア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ"+o+a+"]"),c=new RegExp("["+o+a+"]");function u(e){var t=s.exec(e);return null==t?null:t[0]}function l(e){var t=u(e);return null==t?r.NEUTRAL:c.exec(t)?r.RTL:r.LTR}function f(e,t){if(t=t||r.NEUTRAL,!e.length)return t;var n=l(e);return n===r.NEUTRAL?t:n}function d(e,t){return t||(t=r.getGlobalDir()),r.isStrong(t)||i(!1),f(e,t)}var p={firstStrongChar:u,firstStrongCharDir:l,resolveBlockDir:f,getDirection:d,isDirectionLTR:function(e,t){return d(e,t)===r.LTR},isDirectionRTL:function(e,t){return d(e,t)===r.RTL}};e.exports=p},function(e,t,n){"use strict";var r=n(0),i=n(172),o=(0,n(40).Map)({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},section:{element:"section"},article:{element:"article"},"unordered-list-item":{element:"li",wrapper:r.createElement("ul",{className:i("public/DraftStyleDefault/ul")})},"ordered-list-item":{element:"li",wrapper:r.createElement("ol",{className:i("public/DraftStyleDefault/ol")})},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:r.createElement("pre",{className:i("public/DraftStyleDefault/pre")})},unstyled:{element:"div",aliasedElements:["p"]}});e.exports=o},function(e,t,n){"use strict";var r=n(626).notEmptyKey;function i(e,t){return r(t)&&"MUTABLE"===e.__get(t).getMutability()?t:null}e.exports=function(e,t){var n;if(t.isCollapsed()){var r=t.getAnchorKey(),o=t.getAnchorOffset();return o>0?(n=e.getBlockForKey(r).getEntityAt(o-1))!==e.getBlockForKey(r).getEntityAt(o)?null:i(e.getEntityMap(),n):null}var a=t.getStartKey(),s=t.getStartOffset(),c=e.getBlockForKey(a);return n=s===c.getLength()?null:c.getEntityAt(s),i(e.getEntityMap(),n)}},function(e,t,n){"use strict";var r=n(978);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},function(e,t,n){"use strict";function r(e,t){return!!t&&(e===t.documentElement||e===t.body)}var i={getTop:function(e){var t=e.ownerDocument;return r(e,t)?t.body.scrollTop||t.documentElement.scrollTop:e.scrollTop},setTop:function(e,t){var n=e.ownerDocument;r(e,n)?n.body.scrollTop=n.documentElement.scrollTop=t:e.scrollTop=t},getLeft:function(e){var t=e.ownerDocument;return r(e,t)?t.body.scrollLeft||t.documentElement.scrollLeft:e.scrollLeft},setLeft:function(e,t){var n=e.ownerDocument;r(e,n)?n.body.scrollLeft=n.documentElement.scrollLeft=t:e.scrollLeft=t}};e.exports=i},function(e,t,n){"use strict";n(443);e.exports=function(e,t){var n=e.getSelection(),r=e.getCurrentContent(),i=n.getStartKey(),o=n.getStartOffset(),a=i,s=0;if(t>o){var c=r.getKeyBefore(i);if(null==c)a=i;else a=c,s=r.getBlockForKey(c).getText().length}else s=o-t;return n.merge({focusKey:a,focusOffset:s,isBackward:!0})}},function(e,t,n){"use strict";var r=n(635);e.exports=r},function(e,t,n){"use strict";var r=n(87),i=n(1006),o=r.isPlatform("Mac OS X"),a={isCtrlKeyCommand:function(e){return!!e.ctrlKey&&!e.altKey},isOptionKeyCommand:function(e){return o&&e.altKey},usesMacOSHeuristics:function(){return o},hasCommandModifier:function(e){return o?!!e.metaKey&&!e.altKey:a.isCtrlKeyCommand(e)},isSoftNewlineEvent:i};e.exports=a},function(e,t,n){var r=n(29),i=n(550),o=n(413);e.exports=function(e){return o(i(e,void 0,r),e+"")}},function(e,t,n){"use strict";n.r(t);var r=n(292);n.d(t,"borders",(function(){return r.h})),n.d(t,"border",(function(){return r.a})),n.d(t,"borderTop",(function(){return r.g})),n.d(t,"borderRight",(function(){return r.f})),n.d(t,"borderBottom",(function(){return r.b})),n.d(t,"borderLeft",(function(){return r.d})),n.d(t,"borderColor",(function(){return r.c})),n.d(t,"borderRadius",(function(){return r.e}));var i=n(208);n.d(t,"breakpoints",(function(){return i.a}));var o=n(69);n.d(t,"compose",(function(){return o.a}));var a=n(291);n.d(t,"styleFunctionSx",(function(){return a.b})),n.d(t,"css",(function(){return a.a}));var s=n(580);n.d(t,"display",(function(){return s.a}));var c=n(293);n.d(t,"flexbox",(function(){return c.d})),n.d(t,"flexBasis",(function(){return c.f})),n.d(t,"flexDirection",(function(){return c.g})),n.d(t,"flexWrap",(function(){return c.j})),n.d(t,"justifyContent",(function(){return c.k})),n.d(t,"alignItems",(function(){return c.b})),n.d(t,"alignContent",(function(){return c.a})),n.d(t,"order",(function(){return c.n})),n.d(t,"flex",(function(){return c.e})),n.d(t,"flexGrow",(function(){return c.h})),n.d(t,"flexShrink",(function(){return c.i})),n.d(t,"alignSelf",(function(){return c.c})),n.d(t,"justifyItems",(function(){return c.l})),n.d(t,"justifySelf",(function(){return c.m}));var u=n(294);n.d(t,"grid",(function(){return u.a})),n.d(t,"gridGap",(function(){return u.h})),n.d(t,"gridColumnGap",(function(){return u.g})),n.d(t,"gridRowGap",(function(){return u.j})),n.d(t,"gridColumn",(function(){return u.f})),n.d(t,"gridRow",(function(){return u.i})),n.d(t,"gridAutoFlow",(function(){return u.d})),n.d(t,"gridAutoColumns",(function(){return u.c})),n.d(t,"gridAutoRows",(function(){return u.e})),n.d(t,"gridTemplateColumns",(function(){return u.l})),n.d(t,"gridTemplateRows",(function(){return u.m})),n.d(t,"gridTemplateAreas",(function(){return u.k})),n.d(t,"gridArea",(function(){return u.b}));var l=n(296);n.d(t,"palette",(function(){return l.c})),n.d(t,"color",(function(){return l.b})),n.d(t,"bgcolor",(function(){return l.a}));var f=n(295);n.d(t,"positions",(function(){return f.b})),n.d(t,"position",(function(){return f.d})),n.d(t,"zIndex",(function(){return f.g})),n.d(t,"top",(function(){return f.f})),n.d(t,"right",(function(){return f.e})),n.d(t,"bottom",(function(){return f.a})),n.d(t,"left",(function(){return f.c}));var d=n(581);n.d(t,"shadows",(function(){return d.a}));var p=n(297);n.d(t,"sizing",(function(){return p.b})),n.d(t,"width",(function(){return p.j})),n.d(t,"maxWidth",(function(){return p.e})),n.d(t,"minWidth",(function(){return p.g})),n.d(t,"height",(function(){return p.c})),n.d(t,"maxHeight",(function(){return p.d})),n.d(t,"minHeight",(function(){return p.f})),n.d(t,"sizeWidth",(function(){return p.i})),n.d(t,"sizeHeight",(function(){return p.h})),n.d(t,"boxSizing",(function(){return p.a}));var h=n(318);n.d(t,"spacing",(function(){return h.b})),n.d(t,"createUnarySpacing",(function(){return h.a}));var g=n(22);n.d(t,"style",(function(){return g.a}));var v=n(298);n.d(t,"typography",(function(){return v.a})),n.d(t,"fontFamily",(function(){return v.b})),n.d(t,"fontSize",(function(){return v.c})),n.d(t,"fontStyle",(function(){return v.d})),n.d(t,"fontWeight",(function(){return v.e})),n.d(t,"letterSpacing",(function(){return v.f})),n.d(t,"lineHeight",(function(){return v.g})),n.d(t,"textAlign",(function(){return v.h}))},function(e,t){e.exports={}},function(e,t,n){var r=n(422),i=n(200),o=n(227),a=n(68),s=n(168);e.exports=function(e,t,n,c){if(!a(e))return e;for(var u=-1,l=(t=i(t,e)).length,f=l-1,d=e;null!=d&&++u=0:e===t)}var c=n(5),u=n(11),l=o.forwardRef((function(e,t){var n=e.children,c=e.classes,l=e.className,f=e.exclusive,d=void 0!==f&&f,p=e.onChange,h=e.orientation,g=void 0===h?"horizontal":h,v=e.size,m=void 0===v?"medium":v,y=e.value,b=Object(i.a)(e,["children","classes","className","exclusive","onChange","orientation","size","value"]),w=function(e,t){if(p){var n,r=y&&y.indexOf(t);y&&r>=0?(n=y.slice()).splice(r,1):n=y?y.concat(t):[t],p(e,n)}},_=function(e,t){p&&p(e,y===t?null:t)};return o.createElement("div",Object(r.a)({role:"group",className:Object(a.a)(c.root,l,"vertical"===g&&c.vertical),ref:t},b),o.Children.map(n,(function(e){return o.isValidElement(e)?o.cloneElement(e,{className:Object(a.a)(c.grouped,c["grouped".concat(Object(u.a)(g))],e.props.className),onChange:d?_:w,selected:void 0===e.props.selected?s(e.props.value,y):e.props.selected,size:e.props.size||m}):null})))})),f=Object(c.a)((function(e){return{root:{display:"inline-flex",borderRadius:e.shape.borderRadius},vertical:{flexDirection:"column"},grouped:{},groupedHorizontal:{"&:not(:first-child)":{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-child)":{borderTopRightRadius:0,borderBottomRightRadius:0}},groupedVertical:{"&:not(:first-child)":{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},"&:not(:last-child)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}}),{name:"MuiToggleButtonGroup"})(l)},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return d}));var r=n(4),i=n(1),o=n(0),a=(n(2),n(3)),s=n(24),c=n(5),u=n(190),l=n(11),f=o.forwardRef((function(e,t){var n=e.children,s=e.classes,c=e.className,f=e.disabled,d=void 0!==f&&f,p=e.disableFocusRipple,h=void 0!==p&&p,g=e.onChange,v=e.onClick,m=e.selected,y=e.size,b=void 0===y?"medium":y,w=e.value,_=Object(r.a)(e,["children","classes","className","disabled","disableFocusRipple","onChange","onClick","selected","size","value"]);return o.createElement(u.a,Object(i.a)({className:Object(a.a)(s.root,c,d&&s.disabled,m&&s.selected,"medium"!==b&&s["size".concat(Object(l.a)(b))]),disabled:d,focusRipple:!h,ref:t,onClick:function(e){v&&(v(e,w),e.isDefaultPrevented())||g&&g(e,w)},onChange:g,value:w,"aria-pressed":m},_),o.createElement("span",{className:s.label},n))})),d=Object(c.a)((function(e){return{root:Object(i.a)({},e.typography.button,{boxSizing:"border-box",borderRadius:e.shape.borderRadius,padding:11,border:"1px solid ".concat(Object(s.a)(e.palette.action.active,.12)),color:Object(s.a)(e.palette.action.active,.38),"&$selected":{color:e.palette.action.active,backgroundColor:Object(s.a)(e.palette.action.active,.12),"&:hover":{backgroundColor:Object(s.a)(e.palette.action.active,.15)},"& + &":{borderLeft:0,marginLeft:0}},"&$disabled":{color:Object(s.a)(e.palette.action.disabled,.12)},"&:hover":{textDecoration:"none",backgroundColor:Object(s.a)(e.palette.text.primary,.05),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}}}),disabled:{},selected:{},label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},sizeSmall:{padding:7,fontSize:e.typography.pxToRem(13)},sizeLarge:{padding:15,fontSize:e.typography.pxToRem(15)}}}),{name:"MuiToggleButton"})(f)},function(e,t,n){e.exports=self.fetch||(self.fetch=n(553).default||n(553))},function(e,t,n){"use strict";var r=n(1),i=n(4),o=n(0),a=(n(67),n(2),n(33)),s=n(47),c=n(1124),u=n(338),l=n(31);function f(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function d(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function p(e,t){if(void 0===t)return!0;var n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:0===n.indexOf(t.keys.join("")))}function h(e,t,n,r,i,o){for(var a=!1,s=i(e,t,!!t&&n);s;){if(s===e.firstChild){if(a)return;a=!0}var c=!r&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&p(s,o)&&!c)return void s.focus();s=i(e,s,n)}}var g="undefined"==typeof window?o.useEffect:o.useLayoutEffect,v=o.forwardRef((function(e,t){var n=e.actions,v=e.autoFocus,m=void 0!==v&&v,y=e.autoFocusItem,b=void 0!==y&&y,w=e.children,_=e.className,x=e.disabledItemsFocusable,O=void 0!==x&&x,S=e.disableListWrap,E=void 0!==S&&S,C=e.onKeyDown,k=e.variant,T=void 0===k?"selectedMenu":k,j=Object(i.a)(e,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),P=o.useRef(null),I=o.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});g((function(){m&&P.current.focus()}),[m]),o.useImperativeHandle(n,(function(){return{adjustStyleForScrollbar:function(e,t){var n=!P.current.style.width;if(e.clientHeight0&&(a-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&o!==i.keys[0]&&(i.repeating=!1)),i.lastTime=a,i.keys.push(o);var c=r&&!i.repeating&&p(r,i);i.previousKeyMatched&&(c||h(t,r,!1,O,f,i))?e.preventDefault():i.previousKeyMatched=!1}C&&C(e)},tabIndex:m?0:-1},j),D)}));t.a=v},function(e,t,n){"use strict";var r=n(0),i=n(33),o=(n(2),n(47)),a=n(31),s=n(39);function c(e){return e.substring(2).toLowerCase()}t.a=function(e){var t=e.children,n=e.disableReactTree,u=void 0!==n&&n,l=e.mouseEvent,f=void 0===l?"onClick":l,d=e.onClickAway,p=e.touchEvent,h=void 0===p?"onTouchEnd":p,g=r.useRef(!1),v=r.useRef(null),m=r.useRef(!1),y=r.useRef(!1);r.useEffect((function(){return setTimeout((function(){m.current=!0}),0),function(){m.current=!1}}),[]);var b=r.useCallback((function(e){v.current=i.findDOMNode(e)}),[]),w=Object(a.a)(t.ref,b),_=Object(s.a)((function(e){var t=y.current;if(y.current=!1,m.current&&v.current&&!function(e){return document.documentElement.clientWidth-1;else n=!Object(o.a)(v.current).documentElement.contains(e.target)||v.current.contains(e.target);n||!u&&t||d(e)}})),x=function(e){return function(n){y.current=!0;var r=t.props[e];r&&r(n)}},O={ref:w};return!1!==h&&(O[h]=x(h)),r.useEffect((function(){if(!1!==h){var e=c(h),t=Object(o.a)(v.current),n=function(){g.current=!0};return t.addEventListener(e,_),t.addEventListener("touchmove",n),function(){t.removeEventListener(e,_),t.removeEventListener("touchmove",n)}}}),[_,h]),!1!==f&&(O[f]=x(f)),r.useEffect((function(){if(!1!==f){var e=c(f),t=Object(o.a)(v.current);return t.addEventListener(e,_),function(){t.removeEventListener(e,_)}}}),[_,f]),r.createElement(r.Fragment,null,r.cloneElement(t,O))}},function(e,t,n){"use strict";var r=n(1),i=n(4),o=n(0),a=(n(2),n(3)),s=n(184),c=n(5),u=n(11),l=n(89),f=n(125),d=o.forwardRef((function(e,t){var n=e.children,c=e.classes,d=e.className,p=e.color,h=void 0===p?"primary":p,g=e.component,v=void 0===g?"div":g,m=e.disabled,y=void 0!==m&&m,b=e.error,w=void 0!==b&&b,_=e.fullWidth,x=void 0!==_&&_,O=e.focused,S=e.hiddenLabel,E=void 0!==S&&S,C=e.margin,k=void 0===C?"none":C,T=e.required,j=void 0!==T&&T,P=e.size,I=e.variant,R=void 0===I?"standard":I,A=Object(i.a)(e,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),M=o.useState((function(){var e=!1;return n&&o.Children.forEach(n,(function(t){if(Object(l.a)(t,["Input","Select"])){var n=Object(l.a)(t,["Select"])?t.props.input:t;n&&Object(s.a)(n.props)&&(e=!0)}})),e})),D=M[0],N=M[1],L=o.useState((function(){var e=!1;return n&&o.Children.forEach(n,(function(t){Object(l.a)(t,["Input","Select"])&&Object(s.b)(t.props,!0)&&(e=!0)})),e})),z=L[0],B=L[1],F=o.useState(!1),W=F[0],H=F[1],V=void 0!==O?O:W;y&&V&&H(!1);var U=o.useCallback((function(){B(!0)}),[]),q={adornedStart:D,setAdornedStart:N,color:h,disabled:y,error:w,filled:z,focused:V,fullWidth:x,hiddenLabel:E,margin:("small"===P?"dense":void 0)||k,onBlur:function(){H(!1)},onEmpty:o.useCallback((function(){B(!1)}),[]),onFilled:U,onFocus:function(){H(!0)},registerEffect:void 0,required:j,variant:R};return o.createElement(f.a.Provider,{value:q},o.createElement(v,Object(r.a)({className:Object(a.a)(c.root,d,"none"!==k&&c["margin".concat(Object(u.a)(k))],x&&c.fullWidth),ref:t},A),n))}));t.a=Object(c.a)({root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}},{name:"MuiFormControl"})(d)},function(e,t,n){"use strict";var r=n(1),i=n(4),o=n(0),a=(n(2),n(33)),s=n(73),c=n(3),u=n(47),l=n(149),f=n(82),d=n(5),p=n(255),h=n(476),g=n(140);function v(e,t){var n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function m(e,t){var n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function y(e){return[e.horizontal,e.vertical].map((function(e){return"number"==typeof e?"".concat(e,"px"):e})).join(" ")}function b(e){return"function"==typeof e?e():e}var w=o.forwardRef((function(e,t){var n=e.action,d=e.anchorEl,w=e.anchorOrigin,_=void 0===w?{vertical:"top",horizontal:"left"}:w,x=e.anchorPosition,O=e.anchorReference,S=void 0===O?"anchorEl":O,E=e.children,C=e.classes,k=e.className,T=e.container,j=e.elevation,P=void 0===j?8:j,I=e.getContentAnchorEl,R=e.marginThreshold,A=void 0===R?16:R,M=e.onEnter,D=e.onEntered,N=e.onEntering,L=e.onExit,z=e.onExited,B=e.onExiting,F=e.open,W=e.PaperProps,H=void 0===W?{}:W,V=e.transformOrigin,U=void 0===V?{vertical:"top",horizontal:"left"}:V,q=e.TransitionComponent,G=void 0===q?h.a:q,K=e.transitionDuration,$=void 0===K?"auto":K,Z=e.TransitionProps,X=void 0===Z?{}:Z,Q=Object(i.a)(e,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),Y=o.useRef(),J=o.useCallback((function(e){if("anchorPosition"===S)return x;var t=b(d),n=(t&&1===t.nodeType?t:Object(u.a)(Y.current).body).getBoundingClientRect(),r=0===e?_.vertical:"center";return{top:n.top+v(n,r),left:n.left+m(n,_.horizontal)}}),[d,_.horizontal,_.vertical,x,S]),ee=o.useCallback((function(e){var t=0;if(I&&"anchorEl"===S){var n=I(e);if(n&&e.contains(n)){var r=function(e,t){for(var n=t,r=0;n&&n!==e;)r+=(n=n.parentElement).scrollTop;return r}(e,n);t=n.offsetTop+n.clientHeight/2-r||0}0}return t}),[_.vertical,S,I]),te=o.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{vertical:v(e,U.vertical)+t,horizontal:m(e,U.horizontal)}}),[U.horizontal,U.vertical]),ne=o.useCallback((function(e){var t=ee(e),n={width:e.offsetWidth,height:e.offsetHeight},r=te(n,t);if("none"===S)return{top:null,left:null,transformOrigin:y(r)};var i=J(t),o=i.top-r.vertical,a=i.left-r.horizontal,s=o+n.height,c=a+n.width,u=Object(l.a)(b(d)),f=u.innerHeight-A,p=u.innerWidth-A;if(of){var g=s-f;o-=g,r.vertical+=g}if(ap){var m=c-p;a-=m,r.horizontal+=m}return{top:"".concat(Math.round(o),"px"),left:"".concat(Math.round(a),"px"),transformOrigin:y(r)}}),[d,S,J,ee,te,A]),re=o.useCallback((function(){var e=Y.current;if(e){var t=ne(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin}}),[ne]),ie=o.useCallback((function(e){Y.current=a.findDOMNode(e)}),[]);o.useEffect((function(){F&&re()})),o.useImperativeHandle(n,(function(){return F?{updatePosition:function(){re()}}:null}),[F,re]),o.useEffect((function(){if(F){var e=Object(s.a)((function(){re()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[F,re]);var oe=$;"auto"!==$||G.muiSupportAuto||(oe=void 0);var ae=T||(d?Object(u.a)(b(d)).body:void 0);return o.createElement(p.a,Object(r.a)({container:ae,open:F,ref:t,BackdropProps:{invisible:!0},className:Object(c.a)(C.root,k)},Q),o.createElement(G,Object(r.a)({appear:!0,in:F,onEnter:M,onEntered:D,onExit:L,onExited:z,onExiting:B,timeout:oe},X,{onEntering:Object(f.a)((function(e,t){N&&N(e,t),re()}),X.onEntering)}),o.createElement(g.a,Object(r.a)({elevation:P,ref:ie},H,{className:Object(c.a)(C.paper,H.className)}),E)))}));t.a=Object(d.a)({root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},{name:"MuiPopover"})(w)},function(e,t,n){var r=n(427);function i(e,t,n){var o=r(e,8,void 0,void 0,void 0,void 0,void 0,t=n?void 0:t);return o.placeholder=i.placeholder,o}i.placeholder={},e.exports=i},function(e,t,n){var r=n(1077),i=n(585);e.exports=function(e,t,n){return null==e?e:r(e,t,i(n))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(365)),i=a(n(1116)),o=n(117);function a(e){return e&&e.__esModule?e:{default:e}}var s={backends:[{backend:r.default,transition:o.MouseTransition},{backend:i.default,options:{enableMouseEvents:!0},preview:!0,transition:o.TouchTransition}]};t.default=s},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return r.default})),n.d(t,"HTML5DragTransition",(function(){return r.HTML5DragTransition})),n.d(t,"TouchTransition",(function(){return r.TouchTransition})),n.d(t,"MouseTransition",(function(){return r.MouseTransition})),n.d(t,"createTransition",(function(){return r.createTransition})),n.d(t,"Preview",(function(){return g}));var r=n(117),i=n(0),o=n.n(i),a=n(2),s=n.n(a),c=n(654),u=o.a.createContext(),l=function(e){var t=Object(c.a)((function(e){return{currentOffset:e.getSourceClientOffset(),isDragging:e.isDragging(),itemType:e.getItemType(),item:e.getItem()}}));if(!t.isDragging||null===t.currentOffset)return null;var n,r,i,a={itemType:t.itemType,item:t.item,style:(n=t.currentOffset,r="translate(".concat(n.x,"px, ").concat(n.y,"px)"),{pointerEvents:"none",position:"fixed",top:0,left:0,transform:r,WebkitTransform:r})};return i=e.children&&"function"==typeof e.children?e.children(a):e.children?e.children:e.generator(a),o.a.createElement(u.Provider,{value:a},i)};l.propTypes={generator:s.a.func,children:s.a.oneOfType([s.a.node,s.a.func])};var f=l;function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),i=1;i/gm),B=a(/^data-[\-\w.\u00B7-\uFFFF]/),F=a(/^aria-[\-\w]+$/),W=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),H=a(/^(?:\w+script|data):/i),V=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),U="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};function q(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:G(),n=function(t){return e(t)};if(n.version="2.3.4",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,i=t.document,a=t.DocumentFragment,s=t.HTMLTemplateElement,c=t.Node,u=t.Element,l=t.NodeFilter,f=t.NamedNodeMap,x=void 0===f?t.NamedNodeMap||t.MozNamedAttrMap:f,$=t.HTMLFormElement,Z=t.DOMParser,X=t.trustedTypes,Q=u.prototype,Y=E(Q,"cloneNode"),J=E(Q,"nextSibling"),ee=E(Q,"childNodes"),te=E(Q,"parentNode");if("function"==typeof s){var ne=i.createElement("template");ne.content&&ne.content.ownerDocument&&(i=ne.content.ownerDocument)}var re=K(X,r),ie=re&&Ne?re.createHTML(""):"",oe=i,ae=oe.implementation,se=oe.createNodeIterator,ce=oe.createDocumentFragment,ue=oe.getElementsByTagName,le=r.importNode,fe={};try{fe=S(i).documentMode?i.documentMode:{}}catch(e){}var de={};n.isSupported="function"==typeof te&&ae&&void 0!==ae.createHTMLDocument&&9!==fe;var pe=L,he=z,ge=B,ve=F,me=H,ye=V,be=W,we=null,_e=O({},[].concat(q(C),q(k),q(T),q(P),q(R))),xe=null,Oe=O({},[].concat(q(A),q(M),q(D),q(N))),Se=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ee=null,Ce=null,ke=!0,Te=!0,je=!1,Pe=!1,Ie=!1,Re=!1,Ae=!1,Me=!1,De=!1,Ne=!1,Le=!0,ze=!0,Be=!1,Fe={},We=null,He=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ve=null,Ue=O({},["audio","video","img","source","image","track"]),qe=null,Ge=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",$e="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml",Xe=Ze,Qe=!1,Ye=void 0,Je=["application/xhtml+xml","text/html"],et="text/html",tt=void 0,nt=null,rt=i.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},ot=function(e){nt&&nt===e||(e&&"object"===(void 0===e?"undefined":U(e))||(e={}),e=S(e),we="ALLOWED_TAGS"in e?O({},e.ALLOWED_TAGS):_e,xe="ALLOWED_ATTR"in e?O({},e.ALLOWED_ATTR):Oe,qe="ADD_URI_SAFE_ATTR"in e?O(S(Ge),e.ADD_URI_SAFE_ATTR):Ge,Ve="ADD_DATA_URI_TAGS"in e?O(S(Ue),e.ADD_DATA_URI_TAGS):Ue,We="FORBID_CONTENTS"in e?O({},e.FORBID_CONTENTS):He,Ee="FORBID_TAGS"in e?O({},e.FORBID_TAGS):{},Ce="FORBID_ATTR"in e?O({},e.FORBID_ATTR):{},Fe="USE_PROFILES"in e&&e.USE_PROFILES,ke=!1!==e.ALLOW_ARIA_ATTR,Te=!1!==e.ALLOW_DATA_ATTR,je=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=e.SAFE_FOR_TEMPLATES||!1,Ie=e.WHOLE_DOCUMENT||!1,Me=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Ne=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Le=!1!==e.SANITIZE_DOM,ze=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||be,Xe=e.NAMESPACE||Ze,e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Se.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Se.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ye=Ye=-1===Je.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Ye?function(e){return e}:g,Pe&&(Te=!1),De&&(Me=!0),Fe&&(we=O({},[].concat(q(R))),xe=[],!0===Fe.html&&(O(we,C),O(xe,A)),!0===Fe.svg&&(O(we,k),O(xe,M),O(xe,N)),!0===Fe.svgFilters&&(O(we,T),O(xe,M),O(xe,N)),!0===Fe.mathMl&&(O(we,P),O(xe,D),O(xe,N))),e.ADD_TAGS&&(we===_e&&(we=S(we)),O(we,e.ADD_TAGS)),e.ADD_ATTR&&(xe===Oe&&(xe=S(xe)),O(xe,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&O(qe,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(We===He&&(We=S(We)),O(We,e.FORBID_CONTENTS)),ze&&(we["#text"]=!0),Ie&&O(we,["html","head","body"]),we.table&&(O(we,["tbody"]),delete Ee.tbody),o&&o(e),nt=e)},at=O({},["mi","mo","mn","ms","mtext"]),st=O({},["foreignobject","desc","title","annotation-xml"]),ct=O({},k);O(ct,T),O(ct,j);var ut=O({},P);O(ut,I);var lt=function(e){var t=te(e);t&&t.tagName||(t={namespaceURI:Ze,tagName:"template"});var n=g(e.tagName),r=g(t.tagName);if(e.namespaceURI===$e)return t.namespaceURI===Ze?"svg"===n:t.namespaceURI===Ke?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(ct[n]);if(e.namespaceURI===Ke)return t.namespaceURI===Ze?"math"===n:t.namespaceURI===$e?"math"===n&&st[r]:Boolean(ut[n]);if(e.namespaceURI===Ze){if(t.namespaceURI===$e&&!st[r])return!1;if(t.namespaceURI===Ke&&!at[r])return!1;var i=O({},["title","style","font","a","script"]);return!ut[n]&&(i[n]||!ct[n])}return!1},ft=function(e){h(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ie}catch(t){e.remove()}}},dt=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(Me||De)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},pt=function(e){var t=void 0,n=void 0;if(Ae)e=""+e;else{var r=v(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===Ye&&(e=''+e+"");var o=re?re.createHTML(e):e;if(Xe===Ze)try{t=(new Z).parseFromString(o,Ye)}catch(e){}if(!t||!t.documentElement){t=ae.createDocument(Xe,"template",null);try{t.documentElement.innerHTML=Qe?"":o}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Xe===Ze?ue.call(t,Ie?"html":"body")[0]:Ie?t.documentElement:a},ht=function(e){return se.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},gt=function(e){return e instanceof $&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof x)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},vt=function(e){return"object"===(void 0===c?"undefined":U(c))?e instanceof c:e&&"object"===(void 0===e?"undefined":U(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},mt=function(e,t,r){de[e]&&d(de[e],(function(e){e.call(n,t,r,nt)}))},yt=function(e){var t=void 0;if(mt("beforeSanitizeElements",e,null),gt(e))return ft(e),!0;if(v(e.nodeName,/[\u0080-\uFFFF]/))return ft(e),!0;var r=tt(e.nodeName);if(mt("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!vt(e.firstElementChild)&&(!vt(e.content)||!vt(e.content.firstElementChild))&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return ft(e),!0;if("select"===r&&w(/