{"version":3,"file":"main.js","sources":["../frontend/node_modules/object-assign/index.js","../frontend/node_modules/react/cjs/react.production.min.js","../frontend/node_modules/react/index.js","../frontend/node_modules/scheduler/cjs/scheduler.production.min.js","../frontend/node_modules/scheduler/index.js","../frontend/node_modules/react-dom/cjs/react-dom.production.min.js","../frontend/node_modules/react-dom/index.js","../frontend/node_modules/react/cjs/react-jsx-runtime.production.min.js","../frontend/node_modules/react/jsx-runtime.js","../frontend/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../frontend/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../frontend/node_modules/prop-types/lib/ReactPropTypesSecret.js","../frontend/node_modules/prop-types/factoryWithThrowingShims.js","../frontend/node_modules/prop-types/index.js","../frontend/node_modules/react-redux/es/utils/PropTypes.js","../frontend/node_modules/react-redux/es/components/Provider.js","../frontend/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../frontend/node_modules/@babel/runtime/helpers/esm/extends.js","../frontend/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../frontend/node_modules/react-is/cjs/react-is.production.min.js","../frontend/node_modules/react-is/index.js","../frontend/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../frontend/node_modules/invariant/browser.js","../frontend/node_modules/react-redux/es/utils/Subscription.js","../frontend/node_modules/react-redux/es/components/connectAdvanced.js","../frontend/node_modules/react-redux/es/utils/shallowEqual.js","../frontend/node_modules/lodash-es/_freeGlobal.js","../frontend/node_modules/lodash-es/_root.js","../frontend/node_modules/lodash-es/_Symbol.js","../frontend/node_modules/lodash-es/_getRawTag.js","../frontend/node_modules/lodash-es/_objectToString.js","../frontend/node_modules/lodash-es/_baseGetTag.js","../frontend/node_modules/lodash-es/_overArg.js","../frontend/node_modules/lodash-es/_getPrototype.js","../frontend/node_modules/lodash-es/isObjectLike.js","../frontend/node_modules/lodash-es/isPlainObject.js","../frontend/node_modules/symbol-observable/es/ponyfill.js","../frontend/node_modules/symbol-observable/es/index.js","../frontend/node_modules/redux/es/createStore.js","../frontend/node_modules/redux/es/combineReducers.js","../frontend/node_modules/redux/es/bindActionCreators.js","../frontend/node_modules/redux/es/compose.js","../frontend/node_modules/redux/es/applyMiddleware.js","../frontend/node_modules/react-redux/es/connect/wrapMapToProps.js","../frontend/node_modules/react-redux/es/connect/mapDispatchToProps.js","../frontend/node_modules/react-redux/es/connect/mapStateToProps.js","../frontend/node_modules/react-redux/es/connect/mergeProps.js","../frontend/node_modules/react-redux/es/connect/selectorFactory.js","../frontend/node_modules/react-redux/es/connect/connect.js","../frontend/node_modules/redux-saga/es/internal/utils.js","../frontend/node_modules/redux-saga/es/internal/buffers.js","../frontend/node_modules/redux-saga/es/internal/scheduler.js","../frontend/node_modules/redux-saga/es/internal/channel.js","../frontend/node_modules/redux-saga/es/internal/sagaHelpers/fsmIterator.js","../frontend/node_modules/redux-saga/es/internal/sagaHelpers/takeLatest.js","../frontend/node_modules/redux-saga/es/internal/io.js","../frontend/node_modules/redux-saga/es/internal/proc.js","../frontend/node_modules/redux-saga/es/internal/runSaga.js","../frontend/node_modules/redux-saga/es/internal/middleware.js","../frontend/src/constants/actionTypes.js","../frontend/src/actions/actionCreators.js","../frontend/src/utils/updateFilter.js","../frontend/src/constants/map.js","../frontend/node_modules/phoenix/priv/static/phoenix.mjs","../frontend/src/sagas/sockets.js","../frontend/src/utils/sortByDistance.js","../frontend/node_modules/google-map-react/lib/utils/math/log2.js","../frontend/node_modules/google-map-react/lib/utils/utils.js","../frontend/node_modules/google-map-react/lib/utils/index.js","../frontend/node_modules/google-map-react/utils/index.js","../frontend/node_modules/whatwg-fetch/fetch.js","../frontend/src/constants/apiEndpoints.js","../frontend/src/api/api.js","../frontend/src/sagas/sagas.js","../frontend/src/reducers/map.js","../frontend/src/reducers/index.js","../frontend/src/store.js","../frontend/node_modules/classnames/index.js","../frontend/src/utils/analytics.js","../frontend/node_modules/google-map-react/lib/google_map_map.js","../frontend/node_modules/eventemitter3/index.js","../frontend/node_modules/google-map-react/lib/marker_dispatcher.js","../frontend/node_modules/google-map-react/lib/utils/omit.js","../frontend/node_modules/google-map-react/lib/utils/shallowEqual.js","../frontend/node_modules/google-map-react/lib/google_map_markers.js","../frontend/node_modules/google-map-react/lib/google_map_markers_prerender.js","../frontend/node_modules/google-map-react/lib/google_heatmap.js","../frontend/node_modules/scriptjs/dist/script.js","../frontend/node_modules/google-map-react/lib/loaders/google_map_loader.js","../frontend/node_modules/@mapbox/point-geometry/index.js","../frontend/node_modules/google-map-react/lib/utils/lib_geo/wrap.js","../frontend/node_modules/google-map-react/lib/utils/lib_geo/lat_lng.js","../frontend/node_modules/google-map-react/lib/utils/lib_geo/transform.js","../frontend/node_modules/google-map-react/lib/utils/geo.js","../frontend/node_modules/google-map-react/lib/utils/raf.js","../frontend/node_modules/google-map-react/lib/utils/pick.js","../frontend/node_modules/google-map-react/lib/utils/isEmpty.js","../frontend/node_modules/google-map-react/lib/utils/isNumber.js","../frontend/node_modules/google-map-react/lib/utils/detect.js","../frontend/node_modules/google-map-react/lib/utils/isPlainObject.js","../frontend/node_modules/google-map-react/lib/utils/isArraysEqualEps.js","../frontend/node_modules/google-map-react/lib/utils/passiveEvents.js","../frontend/node_modules/google-map-react/lib/utils/detectElementResize.js","../frontend/node_modules/google-map-react/lib/google_map.js","../frontend/node_modules/google-map-react/lib/index.js","../frontend/node_modules/points-cluster/lib/utils/latLng.js","../frontend/node_modules/rbush/rbush.js","../frontend/node_modules/points-cluster/lib/utils/createTree.js","../frontend/node_modules/points-cluster/lib/index.js","../frontend/node_modules/debounce/index.js","../frontend/src/components/Marker/Marker.jsx","../frontend/src/components/ClusterMarker/ClusterMarker.jsx","../frontend/src/components/UserPosMarker/UserPosMarker.jsx","../frontend/src/utils/fullScreen.js","../frontend/src/components/Map/Map.jsx","../frontend/src/components/MapSearch/MapSearch.jsx","../frontend/src/utils/getAvailableServices.js","../frontend/src/components/MapListItem/MapListItem.jsx","../frontend/src/utils/mediaCheck.js","../frontend/src/components/MapList/MapList.jsx","../frontend/node_modules/@babel/runtime/helpers/esm/typeof.js","../frontend/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../frontend/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../frontend/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../frontend/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../frontend/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../frontend/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../frontend/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../frontend/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../frontend/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../frontend/node_modules/react-select/dist/useStateManager-7e1e8489.esm.js","../frontend/node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../frontend/node_modules/@babel/runtime/helpers/esm/createClass.js","../frontend/node_modules/@babel/runtime/helpers/esm/inherits.js","../frontend/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../frontend/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../frontend/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../frontend/node_modules/@babel/runtime/helpers/esm/createSuper.js","../frontend/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../frontend/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../frontend/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../frontend/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../frontend/node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js","../frontend/node_modules/stylis/src/Enum.js","../frontend/node_modules/stylis/src/Utility.js","../frontend/node_modules/stylis/src/Tokenizer.js","../frontend/node_modules/stylis/src/Parser.js","../frontend/node_modules/stylis/src/Serializer.js","../frontend/node_modules/stylis/src/Middleware.js","../frontend/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../frontend/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","../frontend/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../frontend/node_modules/@emotion/hash/dist/emotion-hash.esm.js","../frontend/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../frontend/node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js","../frontend/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js","../frontend/node_modules/@emotion/react/dist/emotion-element-43c6fea0.browser.esm.js","../frontend/node_modules/@emotion/react/dist/emotion-react.browser.esm.js","../frontend/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","../frontend/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../frontend/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../frontend/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../frontend/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js","../frontend/node_modules/react-select/dist/index-a301f526.esm.js","../frontend/node_modules/memoize-one/dist/memoize-one.esm.js","../frontend/node_modules/react-select/dist/Select-49a62830.esm.js","../frontend/node_modules/react-select/dist/react-select.esm.js","../frontend/src/components/MapFilter/MapFilter.jsx","../frontend/src/components/MapClosestButton/MapClosestButton.jsx","../frontend/src/utils/greatCircleDistance.js","../frontend/src/utils/getDistanceLabel.js","../frontend/src/components/MobilePopup/MobilePopup.jsx","../frontend/node_modules/jquery/dist/jquery.js","../frontend/src/utils/openInfoWindow.js","../frontend/src/components/InfoWindow/InfoWindow.jsx","../frontend/src/components/Layout/Layout.jsx","../frontend/src/components/App/App.jsx","../frontend/src/components/Select/Select.jsx","../frontend/src/components/CurrencyCalculator/CurrencyCalculator.jsx","../frontend/src/components/index.js","../frontend/node_modules/intersection-observer/intersection-observer.js","../frontend/src/exchange-rate-block.js","../frontend/src/faq-listing-block.js","../frontend/src/accordion-toggle.js","../frontend/src/lazy-load.js","../frontend/src/menu.js","../frontend/src/youtube.js","../frontend/src/main.js"],"sourcesContent":["/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/** @license React v16.14.0\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var l=require(\"object-assign\"),n=\"function\"===typeof Symbol&&Symbol.for,p=n?Symbol.for(\"react.element\"):60103,q=n?Symbol.for(\"react.portal\"):60106,r=n?Symbol.for(\"react.fragment\"):60107,t=n?Symbol.for(\"react.strict_mode\"):60108,u=n?Symbol.for(\"react.profiler\"):60114,v=n?Symbol.for(\"react.provider\"):60109,w=n?Symbol.for(\"react.context\"):60110,x=n?Symbol.for(\"react.forward_ref\"):60112,y=n?Symbol.for(\"react.suspense\"):60113,z=n?Symbol.for(\"react.memo\"):60115,A=n?Symbol.for(\"react.lazy\"):\n60116,B=\"function\"===typeof Symbol&&Symbol.iterator;function C(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cQ.length&&Q.push(a)}\nfunction T(a,b,c,e){var d=typeof a;if(\"undefined\"===d||\"boolean\"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case \"string\":case \"number\":g=!0;break;case \"object\":switch(a.$$typeof){case p:case q:g=!0}}if(g)return c(e,a,\"\"===b?\".\"+U(a,0):b),1;g=0;b=\"\"===b?\".\":b+\":\";if(Array.isArray(a))for(var k=0;k=G};l=function(){};exports.unstable_forceFrameRate=function(a){0>a||125>>1,e=a[d];if(void 0!==e&&0K(n,c))void 0!==r&&0>K(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>K(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function K(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var N=[],O=[],P=1,Q=null,R=3,S=!1,T=!1,U=!1;\nfunction V(a){for(var b=L(O);null!==b;){if(null===b.callback)M(O);else if(b.startTime<=a)M(O),b.sortIndex=b.expirationTime,J(N,b);else break;b=L(O)}}function W(a){U=!1;V(a);if(!T)if(null!==L(N))T=!0,f(X);else{var b=L(O);null!==b&&g(W,b.startTime-a)}}\nfunction X(a,b){T=!1;U&&(U=!1,h());S=!0;var c=R;try{V(b);for(Q=L(N);null!==Q&&(!(Q.expirationTime>b)||a&&!k());){var d=Q.callback;if(null!==d){Q.callback=null;R=Q.priorityLevel;var e=d(Q.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?Q.callback=e:Q===L(N)&&M(N);V(b)}else M(N);Q=L(N)}if(null!==Q)var m=!0;else{var n=L(O);null!==n&&g(W,n.startTime-b);m=!1}return m}finally{Q=null,R=c,S=!1}}\nfunction Y(a){switch(a){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1E4;default:return 5E3}}var Z=l;exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){T||S||(T=!0,f(X))};\nexports.unstable_getCurrentPriorityLevel=function(){return R};exports.unstable_getFirstCallbackNode=function(){return L(N)};exports.unstable_next=function(a){switch(R){case 1:case 2:case 3:var b=3;break;default:b=R}var c=R;R=b;try{return a()}finally{R=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=Z;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=R;R=a;try{return b()}finally{R=c}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();if(\"object\"===typeof c&&null!==c){var e=c.delay;e=\"number\"===typeof e&&0d?(a.sortIndex=e,J(O,a),null===L(N)&&a===L(O)&&(U?h():U=!0,g(W,e-d))):(a.sortIndex=c,J(N,a),T||S||(T=!0,f(X)));return a};\nexports.unstable_shouldYield=function(){var a=exports.unstable_now();V(a);var b=L(N);return b!==Q&&null!==Q&&null!==b&&null!==b.callback&&b.startTime<=a&&b.expirationTimeb}return!1}function v(a,b,c,d,e,f){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f}var C={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){C[a]=new v(a,0,!1,a,null,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];C[b]=new v(b,1,!1,a[1],null,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){C[a]=new v(a,2,!1,a.toLowerCase(),null,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){C[a]=new v(a,2,!1,a,null,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){C[a]=new v(a,3,!1,a.toLowerCase(),null,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){C[a]=new v(a,3,!0,a,null,!1)});[\"capture\",\"download\"].forEach(function(a){C[a]=new v(a,4,!1,a,null,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){C[a]=new v(a,6,!1,a,null,!1)});[\"rowSpan\",\"start\"].forEach(function(a){C[a]=new v(a,5,!1,a.toLowerCase(),null,!1)});var Ua=/[\\-:]([a-z])/g;function Va(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(Ua,\nVa);C[b]=new v(b,1,!1,a,null,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(Ua,Va);C[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(Ua,Va);C[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){C[a]=new v(a,1,!1,a.toLowerCase(),null,!1)});\nC.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){C[a]=new v(a,1,!1,a.toLowerCase(),null,!0)});var Wa=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Wa.hasOwnProperty(\"ReactCurrentDispatcher\")||(Wa.ReactCurrentDispatcher={current:null});Wa.hasOwnProperty(\"ReactCurrentBatchConfig\")||(Wa.ReactCurrentBatchConfig={suspense:null});\nfunction Xa(a,b,c,d){var e=C.hasOwnProperty(b)?C[b]:null;var f=null!==e?0===e.type:d?!1:!(2=c.length))throw Error(u(93));c=c[0]}b=c}null==b&&(b=\"\");c=b}a._wrapperState={initialValue:rb(c)}}\nfunction Kb(a,b){var c=rb(b.value),d=rb(b.defaultValue);null!=c&&(c=\"\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=\"\"+d)}function Lb(a){var b=a.textContent;b===a._wrapperState.initialValue&&\"\"!==b&&null!==b&&(a.value=b)}var Mb={html:\"http://www.w3.org/1999/xhtml\",mathml:\"http://www.w3.org/1998/Math/MathML\",svg:\"http://www.w3.org/2000/svg\"};\nfunction Nb(a){switch(a){case \"svg\":return\"http://www.w3.org/2000/svg\";case \"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function Ob(a,b){return null==a||\"http://www.w3.org/1999/xhtml\"===a?Nb(b):\"http://www.w3.org/2000/svg\"===a&&\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":a}\nvar Pb,Qb=function(a){return\"undefined\"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==Mb.svg||\"innerHTML\"in a)a.innerHTML=b;else{Pb=Pb||document.createElement(\"div\");Pb.innerHTML=\"\"+b.valueOf().toString()+\"\";for(b=Pb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction Rb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}function Sb(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c[\"Webkit\"+a]=\"webkit\"+b;c[\"Moz\"+a]=\"moz\"+b;return c}var Tb={animationend:Sb(\"Animation\",\"AnimationEnd\"),animationiteration:Sb(\"Animation\",\"AnimationIteration\"),animationstart:Sb(\"Animation\",\"AnimationStart\"),transitionend:Sb(\"Transition\",\"TransitionEnd\")},Ub={},Vb={};\nya&&(Vb=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Tb.animationend.animation,delete Tb.animationiteration.animation,delete Tb.animationstart.animation),\"TransitionEvent\"in window||delete Tb.transitionend.transition);function Wb(a){if(Ub[a])return Ub[a];if(!Tb[a])return a;var b=Tb[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Vb)return Ub[a]=b[c];return a}\nvar Xb=Wb(\"animationend\"),Yb=Wb(\"animationiteration\"),Zb=Wb(\"animationstart\"),$b=Wb(\"transitionend\"),ac=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),bc=new (\"function\"===typeof WeakMap?WeakMap:Map);function cc(a){var b=bc.get(a);void 0===b&&(b=new Map,bc.set(a,b));return b}\nfunction dc(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.effectTag&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function ec(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function fc(a){if(dc(a)!==a)throw Error(u(188));}\nfunction gc(a){var b=a.alternate;if(!b){b=dc(a);if(null===b)throw Error(u(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return fc(e),a;if(f===d)return fc(e),b;f=f.sibling}throw Error(u(188));}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===\nc){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(u(189));}}if(c.alternate!==d)throw Error(u(190));}if(3!==c.tag)throw Error(u(188));return c.stateNode.current===c?a:b}function hc(a){a=gc(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}}return null}\nfunction ic(a,b){if(null==b)throw Error(u(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function jc(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}var kc=null;\nfunction lc(a){if(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;dpc.length&&pc.push(a)}\nfunction rc(a,b,c,d){if(pc.length){var e=pc.pop();e.topLevelType=a;e.eventSystemFlags=d;e.nativeEvent=b;e.targetInst=c;return e}return{topLevelType:a,eventSystemFlags:d,nativeEvent:b,targetInst:c,ancestors:[]}}\nfunction sc(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d=c;if(3===d.tag)d=d.stateNode.containerInfo;else{for(;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo}if(!d)break;b=c.tag;5!==b&&6!==b||a.ancestors.push(c);c=tc(d)}while(c);for(c=0;c=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=ud(c)}}\nfunction wd(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?wd(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function xd(){for(var a=window,b=td();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=td(a.document)}return b}\nfunction yd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}var zd=\"$\",Ad=\"/$\",Bd=\"$?\",Cd=\"$!\",Dd=null,Ed=null;function Fd(a,b){switch(a){case \"button\":case \"input\":case \"select\":case \"textarea\":return!!b.autoFocus}return!1}\nfunction Gd(a,b){return\"textarea\"===a||\"option\"===a||\"noscript\"===a||\"string\"===typeof b.children||\"number\"===typeof b.children||\"object\"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var Hd=\"function\"===typeof setTimeout?setTimeout:void 0,Id=\"function\"===typeof clearTimeout?clearTimeout:void 0;function Jd(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}\nfunction Kd(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if(c===zd||c===Cd||c===Bd){if(0===b)return a;b--}else c===Ad&&b++}a=a.previousSibling}return null}var Ld=Math.random().toString(36).slice(2),Md=\"__reactInternalInstance$\"+Ld,Nd=\"__reactEventHandlers$\"+Ld,Od=\"__reactContainere$\"+Ld;\nfunction tc(a){var b=a[Md];if(b)return b;for(var c=a.parentNode;c;){if(b=c[Od]||c[Md]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=Kd(a);null!==a;){if(c=a[Md])return c;a=Kd(a)}return b}a=c;c=a.parentNode}return null}function Nc(a){a=a[Md]||a[Od];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function Pd(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(u(33));}function Qd(a){return a[Nd]||null}\nfunction Rd(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}\nfunction Sd(a,b){var c=a.stateNode;if(!c)return null;var d=la(c);if(!d)return null;c=d[b];a:switch(b){case \"onClick\":case \"onClickCapture\":case \"onDoubleClick\":case \"onDoubleClickCapture\":case \"onMouseDown\":case \"onMouseDownCapture\":case \"onMouseMove\":case \"onMouseMoveCapture\":case \"onMouseUp\":case \"onMouseUpCapture\":case \"onMouseEnter\":(d=!d.disabled)||(a=a.type,d=!(\"button\"===a||\"input\"===a||\"select\"===a||\"textarea\"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&\"function\"!==typeof c)throw Error(u(231,\nb,typeof c));return c}function Td(a,b,c){if(b=Sd(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=ic(c._dispatchListeners,b),c._dispatchInstances=ic(c._dispatchInstances,a)}function Ud(a){if(a&&a.dispatchConfig.phasedRegistrationNames){for(var b=a._targetInst,c=[];b;)c.push(b),b=Rd(b);for(b=c.length;0this.eventPool.length&&this.eventPool.push(a)}function de(a){a.eventPool=[];a.getPooled=ee;a.release=fe}var ge=G.extend({data:null}),he=G.extend({data:null}),ie=[9,13,27,32],je=ya&&\"CompositionEvent\"in window,ke=null;ya&&\"documentMode\"in document&&(ke=document.documentMode);\nvar le=ya&&\"TextEvent\"in window&&!ke,me=ya&&(!je||ke&&8=ke),ne=String.fromCharCode(32),oe={beforeInput:{phasedRegistrationNames:{bubbled:\"onBeforeInput\",captured:\"onBeforeInputCapture\"},dependencies:[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]},compositionEnd:{phasedRegistrationNames:{bubbled:\"onCompositionEnd\",captured:\"onCompositionEndCapture\"},dependencies:\"blur compositionend keydown keypress keyup mousedown\".split(\" \")},compositionStart:{phasedRegistrationNames:{bubbled:\"onCompositionStart\",\ncaptured:\"onCompositionStartCapture\"},dependencies:\"blur compositionstart keydown keypress keyup mousedown\".split(\" \")},compositionUpdate:{phasedRegistrationNames:{bubbled:\"onCompositionUpdate\",captured:\"onCompositionUpdateCapture\"},dependencies:\"blur compositionupdate keydown keypress keyup mousedown\".split(\" \")}},pe=!1;\nfunction qe(a,b){switch(a){case \"keyup\":return-1!==ie.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"blur\":return!0;default:return!1}}function re(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var se=!1;function te(a,b){switch(a){case \"compositionend\":return re(b);case \"keypress\":if(32!==b.which)return null;pe=!0;return ne;case \"textInput\":return a=b.data,a===ne&&pe?null:a;default:return null}}\nfunction ue(a,b){if(se)return\"compositionend\"===a||!je&&qe(a,b)?(a=ae(),$d=Zd=Yd=null,se=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=document.documentMode,df={select:{phasedRegistrationNames:{bubbled:\"onSelect\",captured:\"onSelectCapture\"},dependencies:\"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange\".split(\" \")}},ef=null,ff=null,gf=null,hf=!1;\nfunction jf(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(hf||null==ef||ef!==td(c))return null;c=ef;\"selectionStart\"in c&&yd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return gf&&bf(gf,c)?null:(gf=c,a=G.getPooled(df.select,ff,a,b),a.type=\"select\",a.target=ef,Xd(a),a)}\nvar kf={eventTypes:df,extractEvents:function(a,b,c,d,e,f){e=f||(d.window===d?d.document:9===d.nodeType?d:d.ownerDocument);if(!(f=!e)){a:{e=cc(e);f=wa.onSelect;for(var g=0;gzf||(a.current=yf[zf],yf[zf]=null,zf--)}\nfunction I(a,b){zf++;yf[zf]=a.current;a.current=b}var Af={},J={current:Af},K={current:!1},Bf=Af;function Cf(a,b){var c=a.type.contextTypes;if(!c)return Af;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function L(a){a=a.childContextTypes;return null!==a&&void 0!==a}\nfunction Df(){H(K);H(J)}function Ef(a,b,c){if(J.current!==Af)throw Error(u(168));I(J,b);I(K,c)}function Ff(a,b,c){var d=a.stateNode;a=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(u(108,pb(b)||\"Unknown\",e));return n({},c,{},d)}function Gf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Af;Bf=J.current;I(J,a);I(K,K.current);return!0}\nfunction Hf(a,b,c){var d=a.stateNode;if(!d)throw Error(u(169));c?(a=Ff(a,b,Bf),d.__reactInternalMemoizedMergedChildContext=a,H(K),H(J),I(J,a)):H(K);I(K,c)}\nvar If=r.unstable_runWithPriority,Jf=r.unstable_scheduleCallback,Kf=r.unstable_cancelCallback,Lf=r.unstable_requestPaint,Mf=r.unstable_now,Nf=r.unstable_getCurrentPriorityLevel,Of=r.unstable_ImmediatePriority,Pf=r.unstable_UserBlockingPriority,Qf=r.unstable_NormalPriority,Rf=r.unstable_LowPriority,Sf=r.unstable_IdlePriority,Tf={},Uf=r.unstable_shouldYield,Vf=void 0!==Lf?Lf:function(){},Wf=null,Xf=null,Yf=!1,Zf=Mf(),$f=1E4>Zf?Mf:function(){return Mf()-Zf};\nfunction ag(){switch(Nf()){case Of:return 99;case Pf:return 98;case Qf:return 97;case Rf:return 96;case Sf:return 95;default:throw Error(u(332));}}function bg(a){switch(a){case 99:return Of;case 98:return Pf;case 97:return Qf;case 96:return Rf;case 95:return Sf;default:throw Error(u(332));}}function cg(a,b){a=bg(a);return If(a,b)}function dg(a,b,c){a=bg(a);return Jf(a,b,c)}function eg(a){null===Wf?(Wf=[a],Xf=Jf(Of,fg)):Wf.push(a);return Tf}function gg(){if(null!==Xf){var a=Xf;Xf=null;Kf(a)}fg()}\nfunction fg(){if(!Yf&&null!==Wf){Yf=!0;var a=0;try{var b=Wf;cg(99,function(){for(;a=b&&(rg=!0),a.firstContext=null)}\nfunction sg(a,b){if(mg!==a&&!1!==b&&0!==b){if(\"number\"!==typeof b||1073741823===b)mg=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===lg){if(null===kg)throw Error(u(308));lg=b;kg.dependencies={expirationTime:0,firstContext:b,responders:null}}else lg=lg.next=b}return a._currentValue}var tg=!1;function ug(a){a.updateQueue={baseState:a.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}\nfunction vg(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,baseQueue:a.baseQueue,shared:a.shared,effects:a.effects})}function wg(a,b){a={expirationTime:a,suspenseConfig:b,tag:0,payload:null,callback:null,next:null};return a.next=a}function xg(a,b){a=a.updateQueue;if(null!==a){a=a.shared;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}}\nfunction yg(a,b){var c=a.alternate;null!==c&&vg(c,a);a=a.updateQueue;c=a.baseQueue;null===c?(a.baseQueue=b.next=b,b.next=b):(b.next=c.next,c.next=b)}\nfunction zg(a,b,c,d){var e=a.updateQueue;tg=!1;var f=e.baseQueue,g=e.shared.pending;if(null!==g){if(null!==f){var h=f.next;f.next=g.next;g.next=h}f=g;e.shared.pending=null;h=a.alternate;null!==h&&(h=h.updateQueue,null!==h&&(h.baseQueue=g))}if(null!==f){h=f.next;var k=e.baseState,l=0,m=null,p=null,x=null;if(null!==h){var z=h;do{g=z.expirationTime;if(gl&&(l=g)}else{null!==x&&(x=x.next={expirationTime:1073741823,suspenseConfig:z.suspenseConfig,tag:z.tag,payload:z.payload,callback:z.callback,next:null});Ag(g,z.suspenseConfig);a:{var D=a,t=z;g=b;ca=c;switch(t.tag){case 1:D=t.payload;if(\"function\"===typeof D){k=D.call(ca,k,g);break a}k=D;break a;case 3:D.effectTag=D.effectTag&-4097|64;case 0:D=t.payload;g=\"function\"===typeof D?D.call(ca,k,g):D;if(null===g||void 0===g)break a;k=n({},k,g);break a;case 2:tg=!0}}null!==z.callback&&\n(a.effectTag|=32,g=e.effects,null===g?e.effects=[z]:g.push(z))}z=z.next;if(null===z||z===h)if(g=e.shared.pending,null===g)break;else z=f.next=g.next,g.next=h,e.baseQueue=f=g,e.shared.pending=null}while(1)}null===x?m=k:x.next=p;e.baseState=m;e.baseQueue=x;Bg(l);a.expirationTime=l;a.memoizedState=k}}\nfunction Cg(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;by?(A=m,m=null):A=m.sibling;var q=x(e,m,h[y],k);if(null===q){null===m&&(m=A);break}a&&\nm&&null===q.alternate&&b(e,m);g=f(q,g,y);null===t?l=q:t.sibling=q;t=q;m=A}if(y===h.length)return c(e,m),l;if(null===m){for(;yy?(A=t,t=null):A=t.sibling;var D=x(e,t,q.value,l);if(null===D){null===t&&(t=A);break}a&&t&&null===D.alternate&&b(e,t);g=f(D,g,y);null===m?k=D:m.sibling=D;m=D;t=A}if(q.done)return c(e,t),k;if(null===t){for(;!q.done;y++,q=h.next())q=p(e,q.value,l),null!==q&&(g=f(q,g,y),null===m?k=q:m.sibling=q,m=q);return k}for(t=d(e,t);!q.done;y++,q=h.next())q=z(t,e,y,q.value,l),null!==q&&(a&&null!==\nq.alternate&&t.delete(null===q.key?y:q.key),g=f(q,g,y),null===m?k=q:m.sibling=q,m=q);a&&t.forEach(function(a){return b(e,a)});return k}return function(a,d,f,h){var k=\"object\"===typeof f&&null!==f&&f.type===ab&&null===f.key;k&&(f=f.props.children);var l=\"object\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Za:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ab){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a,\nk.sibling);d=e(k,f.props);d.ref=Pg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling}f.type===ab?(d=Wg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ug(f.type,f.key,f.props,null,a.mode,h),h.ref=Pg(a,d,f),h.return=a,a=h)}return g(a);case $a:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=\nd.sibling}d=Vg(f,a.mode,h);d.return=a;a=d}return g(a)}if(\"string\"===typeof f||\"number\"===typeof f)return f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Tg(f,a.mode,h),d.return=a,a=d),g(a);if(Og(f))return ca(a,d,f,h);if(nb(f))return D(a,d,f,h);l&&Qg(a,f);if(\"undefined\"===typeof f&&!k)switch(a.tag){case 1:case 0:throw a=a.type,Error(u(152,a.displayName||a.name||\"Component\"));}return c(a,d)}}var Xg=Rg(!0),Yg=Rg(!1),Zg={},$g={current:Zg},ah={current:Zg},bh={current:Zg};\nfunction ch(a){if(a===Zg)throw Error(u(174));return a}function dh(a,b){I(bh,b);I(ah,a);I($g,Zg);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:Ob(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=Ob(b,a)}H($g);I($g,b)}function eh(){H($g);H(ah);H(bh)}function fh(a){ch(bh.current);var b=ch($g.current);var c=Ob(b,a.type);b!==c&&(I(ah,a),I($g,c))}function gh(a){ah.current===a&&(H($g),H(ah))}var M={current:0};\nfunction hh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||c.data===Bd||c.data===Cd))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.effectTag&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}function ih(a,b){return{responder:a,props:b}}\nvar jh=Wa.ReactCurrentDispatcher,kh=Wa.ReactCurrentBatchConfig,lh=0,N=null,O=null,P=null,mh=!1;function Q(){throw Error(u(321));}function nh(a,b){if(null===b)return!1;for(var c=0;cf))throw Error(u(301));f+=1;P=O=null;b.updateQueue=null;jh.current=rh;a=c(d,e)}while(b.expirationTime===lh)}jh.current=sh;b=null!==O&&null!==O.next;lh=0;P=O=N=null;mh=!1;if(b)throw Error(u(300));return a}\nfunction th(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===P?N.memoizedState=P=a:P=P.next=a;return P}function uh(){if(null===O){var a=N.alternate;a=null!==a?a.memoizedState:null}else a=O.next;var b=null===P?N.memoizedState:P.next;if(null!==b)P=b,O=a;else{if(null===a)throw Error(u(310));O=a;a={memoizedState:O.memoizedState,baseState:O.baseState,baseQueue:O.baseQueue,queue:O.queue,next:null};null===P?N.memoizedState=P=a:P=P.next=a}return P}\nfunction vh(a,b){return\"function\"===typeof b?b(a):b}\nfunction wh(a){var b=uh(),c=b.queue;if(null===c)throw Error(u(311));c.lastRenderedReducer=a;var d=O,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){e=e.next;d=d.baseState;var h=g=f=null,k=e;do{var l=k.expirationTime;if(lN.expirationTime&&\n(N.expirationTime=l,Bg(l))}else null!==h&&(h=h.next={expirationTime:1073741823,suspenseConfig:k.suspenseConfig,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),Ag(l,k.suspenseConfig),d=k.eagerReducer===a?k.eagerState:a(d,k.action);k=k.next}while(null!==k&&k!==e);null===h?f=d:h.next=g;$e(d,b.memoizedState)||(rg=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d}return[b.memoizedState,c.dispatch]}\nfunction xh(a){var b=uh(),c=b.queue;if(null===c)throw Error(u(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);$e(f,b.memoizedState)||(rg=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}\nfunction yh(a){var b=th();\"function\"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={pending:null,dispatch:null,lastRenderedReducer:vh,lastRenderedState:a};a=a.dispatch=zh.bind(null,N,a);return[b.memoizedState,a]}function Ah(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=N.updateQueue;null===b?(b={lastEffect:null},N.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}\nfunction Bh(){return uh().memoizedState}function Ch(a,b,c,d){var e=th();N.effectTag|=a;e.memoizedState=Ah(1|b,c,void 0,void 0===d?null:d)}function Dh(a,b,c,d){var e=uh();d=void 0===d?null:d;var f=void 0;if(null!==O){var g=O.memoizedState;f=g.destroy;if(null!==d&&nh(d,g.deps)){Ah(b,c,f,d);return}}N.effectTag|=a;e.memoizedState=Ah(1|b,c,f,d)}function Eh(a,b){return Ch(516,4,a,b)}function Fh(a,b){return Dh(516,4,a,b)}function Gh(a,b){return Dh(4,2,a,b)}\nfunction Hh(a,b){if(\"function\"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function Ih(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Dh(4,2,Hh.bind(null,b,a),c)}function Jh(){}function Kh(a,b){th().memoizedState=[a,void 0===b?null:b];return a}function Lh(a,b){var c=uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&nh(b,d[1]))return d[0];c.memoizedState=[a,b];return a}\nfunction Mh(a,b){var c=uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&nh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}function Nh(a,b,c){var d=ag();cg(98>d?98:d,function(){a(!0)});cg(97\\x3c/script>\",a=a.removeChild(a.firstChild)):\"string\"===typeof d.is?a=g.createElement(e,{is:d.is}):(a=g.createElement(e),\"select\"===e&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,e);a[Md]=b;a[Nd]=d;ni(a,b,!1,!1);b.stateNode=a;g=pd(e,d);switch(e){case \"iframe\":case \"object\":case \"embed\":F(\"load\",\na);h=d;break;case \"video\":case \"audio\":for(h=0;hd.tailExpiration&&1b)&&tj.set(a,b)))}}\nfunction xj(a,b){a.expirationTimea?c:a;return 2>=a&&b!==a?0:a}\nfunction Z(a){if(0!==a.lastExpiredTime)a.callbackExpirationTime=1073741823,a.callbackPriority=99,a.callbackNode=eg(yj.bind(null,a));else{var b=zj(a),c=a.callbackNode;if(0===b)null!==c&&(a.callbackNode=null,a.callbackExpirationTime=0,a.callbackPriority=90);else{var d=Gg();1073741823===b?d=99:1===b||2===b?d=95:(d=10*(1073741821-b)-10*(1073741821-d),d=0>=d?99:250>=d?98:5250>=d?97:95);if(null!==c){var e=a.callbackPriority;if(a.callbackExpirationTime===b&&e>=d)return;c!==Tf&&Kf(c)}a.callbackExpirationTime=\nb;a.callbackPriority=d;b=1073741823===b?eg(yj.bind(null,a)):dg(d,Bj.bind(null,a),{timeout:10*(1073741821-b)-$f()});a.callbackNode=b}}}\nfunction Bj(a,b){wj=0;if(b)return b=Gg(),Cj(a,b),Z(a),null;var c=zj(a);if(0!==c){b=a.callbackNode;if((W&(fj|gj))!==V)throw Error(u(327));Dj();a===T&&c===U||Ej(a,c);if(null!==X){var d=W;W|=fj;var e=Fj();do try{Gj();break}catch(h){Hj(a,h)}while(1);ng();W=d;cj.current=e;if(S===hj)throw b=kj,Ej(a,c),xi(a,c),Z(a),b;if(null===X)switch(e=a.finishedWork=a.current.alternate,a.finishedExpirationTime=c,d=S,T=null,d){case ti:case hj:throw Error(u(345));case ij:Cj(a,2=c){a.lastPingedTime=c;Ej(a,c);break}}f=zj(a);if(0!==f&&f!==c)break;if(0!==d&&d!==c){a.lastPingedTime=d;break}a.timeoutHandle=Hd(Jj.bind(null,a),e);break}Jj(a);break;case vi:xi(a,c);d=a.lastSuspendedTime;c===d&&(a.nextKnownPendingLevel=Ij(e));if(oj&&(e=a.lastPingedTime,0===e||e>=c)){a.lastPingedTime=c;Ej(a,c);break}e=zj(a);if(0!==e&&e!==c)break;if(0!==d&&d!==c){a.lastPingedTime=\nd;break}1073741823!==mj?d=10*(1073741821-mj)-$f():1073741823===lj?d=0:(d=10*(1073741821-lj)-5E3,e=$f(),c=10*(1073741821-c)-e,d=e-d,0>d&&(d=0),d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*bj(d/1960))-d,c=d?d=0:(e=g.busyDelayMs|0,f=$f()-(10*(1073741821-f)-(g.timeoutMs|0||5E3)),d=f<=e?0:e+d-f);if(10 component higher in the tree to provide a loading indicator or placeholder to display.\"+qb(g))}S!==\njj&&(S=ij);h=Ai(h,g);p=f;do{switch(p.tag){case 3:k=h;p.effectTag|=4096;p.expirationTime=b;var B=Xi(p,k,b);yg(p,B);break a;case 1:k=h;var w=p.type,ub=p.stateNode;if(0===(p.effectTag&64)&&(\"function\"===typeof w.getDerivedStateFromError||null!==ub&&\"function\"===typeof ub.componentDidCatch&&(null===aj||!aj.has(ub)))){p.effectTag|=4096;p.expirationTime=b;var vb=$i(p,k,b);yg(p,vb);break a}}p=p.return}while(null!==p)}X=Pj(X)}catch(Xc){b=Xc;continue}break}while(1)}\nfunction Fj(){var a=cj.current;cj.current=sh;return null===a?sh:a}function Ag(a,b){awi&&(wi=a)}function Kj(){for(;null!==X;)X=Qj(X)}function Gj(){for(;null!==X&&!Uf();)X=Qj(X)}function Qj(a){var b=Rj(a.alternate,a,U);a.memoizedProps=a.pendingProps;null===b&&(b=Pj(a));dj.current=null;return b}\nfunction Pj(a){X=a;do{var b=X.alternate;a=X.return;if(0===(X.effectTag&2048)){b=si(b,X,U);if(1===U||1!==X.childExpirationTime){for(var c=0,d=X.child;null!==d;){var e=d.expirationTime,f=d.childExpirationTime;e>c&&(c=e);f>c&&(c=f);d=d.sibling}X.childExpirationTime=c}if(null!==b)return b;null!==a&&0===(a.effectTag&2048)&&(null===a.firstEffect&&(a.firstEffect=X.firstEffect),null!==X.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=X.firstEffect),a.lastEffect=X.lastEffect),1a?b:a}function Jj(a){var b=ag();cg(99,Sj.bind(null,a,b));return null}\nfunction Sj(a,b){do Dj();while(null!==rj);if((W&(fj|gj))!==V)throw Error(u(327));var c=a.finishedWork,d=a.finishedExpirationTime;if(null===c)return null;a.finishedWork=null;a.finishedExpirationTime=0;if(c===a.current)throw Error(u(177));a.callbackNode=null;a.callbackExpirationTime=0;a.callbackPriority=90;a.nextKnownPendingLevel=0;var e=Ij(c);a.firstPendingTime=e;d<=a.lastSuspendedTime?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:d<=a.firstSuspendedTime&&(a.firstSuspendedTime=\nd-1);d<=a.lastPingedTime&&(a.lastPingedTime=0);d<=a.lastExpiredTime&&(a.lastExpiredTime=0);a===T&&(X=T=null,U=0);1h&&(l=h,h=g,g=l),l=vd(q,g),m=vd(q,h),l&&m&&(1!==w.rangeCount||w.anchorNode!==l.node||w.anchorOffset!==l.offset||w.focusNode!==m.node||w.focusOffset!==m.offset)&&(B=B.createRange(),B.setStart(l.node,l.offset),w.removeAllRanges(),g>h?(w.addRange(B),w.extend(m.node,m.offset)):(B.setEnd(m.node,m.offset),w.addRange(B))))));B=[];for(w=q;w=w.parentNode;)1===w.nodeType&&B.push({element:w,left:w.scrollLeft,\ntop:w.scrollTop});\"function\"===typeof q.focus&&q.focus();for(q=0;q=c)return ji(a,b,c);I(M,M.current&1);b=$h(a,b,c);return null!==b?b.sibling:null}I(M,M.current&1);break;case 19:d=b.childExpirationTime>=c;if(0!==(a.effectTag&64)){if(d)return mi(a,b,c);b.effectTag|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null);I(M,M.current);if(!d)return null}return $h(a,b,c)}rg=!1}}else rg=!1;b.expirationTime=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;e=Cf(b,J.current);qg(b,c);e=oh(null,\nb,d,a,e,c);b.effectTag|=1;if(\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(L(d)){var f=!0;Gf(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;ug(b);var g=d.getDerivedStateFromProps;\"function\"===typeof g&&Fg(b,d,g,a);e.updater=Jg;b.stateNode=e;e._reactInternalFiber=b;Ng(b,d,a,c);b=gi(null,b,d,!0,f,c)}else b.tag=0,R(null,b,e,c),b=b.child;return b;case 16:a:{e=b.elementType;null!==a&&(a.alternate=\nnull,b.alternate=null,b.effectTag|=2);a=b.pendingProps;ob(e);if(1!==e._status)throw e._result;e=e._result;b.type=e;f=b.tag=Xj(e);a=ig(e,a);switch(f){case 0:b=di(null,b,e,a,c);break a;case 1:b=fi(null,b,e,a,c);break a;case 11:b=Zh(null,b,e,a,c);break a;case 14:b=ai(null,b,e,ig(e.type,a),d,c);break a}throw Error(u(306,e,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),di(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),fi(a,b,d,e,c);\ncase 3:hi(b);d=b.updateQueue;if(null===a||null===d)throw Error(u(282));d=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;vg(a,b);zg(b,d,null,c);d=b.memoizedState.element;if(d===e)Xh(),b=$h(a,b,c);else{if(e=b.stateNode.hydrate)Ph=Jd(b.stateNode.containerInfo.firstChild),Oh=b,e=Qh=!0;if(e)for(c=Yg(b,null,d,c),b.child=c;c;)c.effectTag=c.effectTag&-3|1024,c=c.sibling;else R(a,b,d,c),Xh();b=b.child}return b;case 5:return fh(b),null===a&&Uh(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:\nnull,g=e.children,Gd(d,e)?g=null:null!==f&&Gd(d,f)&&(b.effectTag|=16),ei(a,b),b.mode&4&&1!==c&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(R(a,b,g,c),b=b.child),b;case 6:return null===a&&Uh(b),null;case 13:return ji(a,b,c);case 4:return dh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Xg(b,null,d,c):R(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),Zh(a,b,d,e,c);case 7:return R(a,b,b.pendingProps,c),b.child;case 8:return R(a,\nb,b.pendingProps.children,c),b.child;case 12:return R(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;var h=b.type._context;I(jg,h._currentValue);h._currentValue=f;if(null!==g)if(h=g.value,f=$e(h,f)?0:(\"function\"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0,0===f){if(g.children===e.children&&!K.current){b=$h(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==\nk){g=h.child;for(var l=k.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=wg(c,null),l.tag=2,xg(h,l));h.expirationTime=b&&a<=b}function xi(a,b){var c=a.firstSuspendedTime,d=a.lastSuspendedTime;cb||0===c)a.lastSuspendedTime=b;b<=a.lastPingedTime&&(a.lastPingedTime=0);b<=a.lastExpiredTime&&(a.lastExpiredTime=0)}\nfunction yi(a,b){b>a.firstPendingTime&&(a.firstPendingTime=b);var c=a.firstSuspendedTime;0!==c&&(b>=c?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:b>=a.lastSuspendedTime&&(a.lastSuspendedTime=b+1),b>a.nextKnownPendingLevel&&(a.nextKnownPendingLevel=b))}function Cj(a,b){var c=a.lastExpiredTime;if(0===c||c>b)a.lastExpiredTime=b}\nfunction bk(a,b,c,d){var e=b.current,f=Gg(),g=Dg.suspense;f=Hg(f,e,g);a:if(c){c=c._reactInternalFiber;b:{if(dc(c)!==c||1!==c.tag)throw Error(u(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(L(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return}while(null!==h);throw Error(u(171));}if(1===c.tag){var k=c.type;if(L(k)){c=Ff(c,k,h);break a}}c=h}else c=Af;null===b.context?b.context=c:b.pendingContext=c;b=wg(f,g);b.payload={element:a};d=void 0===\nd?null:d;null!==d&&(b.callback=d);xg(e,b);Ig(e,f);return f}function ck(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function dk(a,b){a=a.memoizedState;null!==a&&null!==a.dehydrated&&a.retryTime does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reduxjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');\n}\n\nexport function createProvider(storeKey) {\n var _Provider$childContex;\n\n if (storeKey === void 0) {\n storeKey = 'store';\n }\n\n var subscriptionKey = storeKey + \"Subscription\";\n\n var Provider =\n /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(Provider, _Component);\n\n var _proto = Provider.prototype;\n\n _proto.getChildContext = function getChildContext() {\n var _ref;\n\n return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref;\n };\n\n function Provider(props, context) {\n var _this;\n\n _this = _Component.call(this, props, context) || this;\n _this[storeKey] = props.store;\n return _this;\n }\n\n _proto.render = function render() {\n return Children.only(this.props.children);\n };\n\n return Provider;\n }(Component);\n\n if (process.env.NODE_ENV !== 'production') {\n // Use UNSAFE_ event name where supported\n var eventName = prefixUnsafeLifecycleMethods ? 'UNSAFE_componentWillReceiveProps' : 'componentWillReceiveProps';\n\n Provider.prototype[eventName] = function (nextProps) {\n if (this[storeKey] !== nextProps.store) {\n warnAboutReceivingStore();\n }\n };\n }\n\n Provider.propTypes = {\n store: storeShape.isRequired,\n children: PropTypes.element.isRequired\n };\n Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = storeShape.isRequired, _Provider$childContex[subscriptionKey] = subscriptionShape, _Provider$childContex);\n return Provider;\n}\nexport default createProvider();","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","// encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\nvar CLEARED = null;\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n // the current/next pattern is copied from redux's createStore code.\n // TODO: refactor+expose that code to be reusable here?\n var current = [];\n var next = [];\n return {\n clear: function clear() {\n next = CLEARED;\n current = CLEARED;\n },\n notify: function notify() {\n var listeners = current = next;\n\n for (var i = 0; i < listeners.length; i++) {\n listeners[i]();\n }\n },\n get: function get() {\n return next;\n },\n subscribe: function subscribe(listener) {\n var isSubscribed = true;\n if (next === current) next = current.slice();\n next.push(listener);\n return function unsubscribe() {\n if (!isSubscribed || current === CLEARED) return;\n isSubscribed = false;\n if (next === current) next = current.slice();\n next.splice(next.indexOf(listener), 1);\n };\n }\n };\n}\n\nvar Subscription =\n/*#__PURE__*/\nfunction () {\n function Subscription(store, parentSub, onStateChange) {\n this.store = store;\n this.parentSub = parentSub;\n this.onStateChange = onStateChange;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n }\n\n var _proto = Subscription.prototype;\n\n _proto.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n _proto.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n _proto.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n _proto.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);\n this.listeners = createListenerCollection();\n }\n };\n\n _proto.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nexport { Subscription as default };","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport hoistStatics from 'hoist-non-react-statics';\nimport invariant from 'invariant';\nimport React, { Component, createElement } from 'react';\nimport { isValidElementType } from 'react-is';\nimport Subscription from '../utils/Subscription';\nimport { storeShape, subscriptionShape } from '../utils/PropTypes';\nvar prefixUnsafeLifecycleMethods = typeof React.forwardRef !== \"undefined\";\nvar hotReloadingVersion = 0;\nvar dummyState = {};\n\nfunction noop() {}\n\nfunction makeSelectorStateful(sourceSelector, store) {\n // wrap the selector in an object that tracks its results between runs.\n var selector = {\n run: function runComponentSelector(props) {\n try {\n var nextProps = sourceSelector(store.getState(), props);\n\n if (nextProps !== selector.props || selector.error) {\n selector.shouldComponentUpdate = true;\n selector.props = nextProps;\n selector.error = null;\n }\n } catch (error) {\n selector.shouldComponentUpdate = true;\n selector.error = error;\n }\n }\n };\n return selector;\n}\n\nexport default function connectAdvanced(\n/*\n selectorFactory is a func that is responsible for returning the selector function used to\n compute new props from state, props, and dispatch. For example:\n export default connectAdvanced((dispatch, options) => (state, props) => ({\n thing: state.things[props.thingId],\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\n }))(YourComponent)\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\n props. Do not use connectAdvanced directly without memoizing results between calls to your\n selector, otherwise the Connect component will re-render on every state or props change.\n*/\nselectorFactory, // options object:\n_ref) {\n var _contextTypes, _childContextTypes;\n\n if (_ref === void 0) {\n _ref = {};\n }\n\n var _ref2 = _ref,\n _ref2$getDisplayName = _ref2.getDisplayName,\n getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {\n return \"ConnectAdvanced(\" + name + \")\";\n } : _ref2$getDisplayName,\n _ref2$methodName = _ref2.methodName,\n methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,\n _ref2$renderCountProp = _ref2.renderCountProp,\n renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,\n _ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,\n shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,\n _ref2$storeKey = _ref2.storeKey,\n storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,\n _ref2$withRef = _ref2.withRef,\n withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,\n connectOptions = _objectWithoutPropertiesLoose(_ref2, [\"getDisplayName\", \"methodName\", \"renderCountProp\", \"shouldHandleStateChanges\", \"storeKey\", \"withRef\"]);\n\n var subscriptionKey = storeKey + 'Subscription';\n var version = hotReloadingVersion++;\n var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = subscriptionShape, _contextTypes);\n var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = subscriptionShape, _childContextTypes);\n return function wrapWithConnect(WrappedComponent) {\n invariant(isValidElementType(WrappedComponent), \"You must pass a component to the function returned by \" + (methodName + \". Instead received \" + JSON.stringify(WrappedComponent)));\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n withRef: withRef,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent // TODO Actually fix our use of componentWillReceiveProps\n\n /* eslint-disable react/no-deprecated */\n\n });\n\n var Connect =\n /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(Connect, _Component);\n\n function Connect(props, context) {\n var _this;\n\n _this = _Component.call(this, props, context) || this;\n _this.version = version;\n _this.state = {};\n _this.renderCount = 0;\n _this.store = props[storeKey] || context[storeKey];\n _this.propsMode = Boolean(props[storeKey]);\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n invariant(_this.store, \"Could not find \\\"\" + storeKey + \"\\\" in either the context or props of \" + (\"\\\"\" + displayName + \"\\\". Either wrap the root component in a , \") + (\"or explicitly pass \\\"\" + storeKey + \"\\\" as a prop to \\\"\" + displayName + \"\\\".\"));\n\n _this.initSelector();\n\n _this.initSubscription();\n\n return _this;\n }\n\n var _proto = Connect.prototype;\n\n _proto.getChildContext = function getChildContext() {\n var _ref3;\n\n // If this component received store from props, its subscription should be transparent\n // to any descendants receiving store+subscription from context; it passes along\n // subscription passed to it. Otherwise, it shadows the parent subscription, which allows\n // Connect to control ordering of notifications to flow top-down.\n var subscription = this.propsMode ? null : this.subscription;\n return _ref3 = {}, _ref3[subscriptionKey] = subscription || this.context[subscriptionKey], _ref3;\n };\n\n _proto.componentDidMount = function componentDidMount() {\n if (!shouldHandleStateChanges) return; // componentWillMount fires during server side rendering, but componentDidMount and\n // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.\n // Otherwise, unsubscription would never take place during SSR, causing a memory leak.\n // To handle the case where a child component may have triggered a state change by\n // dispatching an action in its componentWillMount, we have to re-run the select and maybe\n // re-render.\n\n this.subscription.trySubscribe();\n this.selector.run(this.props);\n if (this.selector.shouldComponentUpdate) this.forceUpdate();\n }; // Note: this is renamed below to the UNSAFE_ version in React >=16.3.0\n\n\n _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n this.selector.run(nextProps);\n };\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate() {\n return this.selector.shouldComponentUpdate;\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this.subscription) this.subscription.tryUnsubscribe();\n this.subscription = null;\n this.notifyNestedSubs = noop;\n this.store = null;\n this.selector.run = noop;\n this.selector.shouldComponentUpdate = false;\n };\n\n _proto.getWrappedInstance = function getWrappedInstance() {\n invariant(withRef, \"To access the wrapped instance, you need to specify \" + (\"{ withRef: true } in the options argument of the \" + methodName + \"() call.\"));\n return this.wrappedInstance;\n };\n\n _proto.setWrappedInstance = function setWrappedInstance(ref) {\n this.wrappedInstance = ref;\n };\n\n _proto.initSelector = function initSelector() {\n var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions);\n this.selector = makeSelectorStateful(sourceSelector, this.store);\n this.selector.run(this.props);\n };\n\n _proto.initSubscription = function initSubscription() {\n if (!shouldHandleStateChanges) return; // parentSub's source should match where store came from: props vs. context. A component\n // connected to the store via props shouldn't use subscription from context, or vice versa.\n\n var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey];\n this.subscription = new Subscription(this.store, parentSub, this.onStateChange.bind(this)); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in\n // the middle of the notification loop, where `this.subscription` will then be null. An\n // extra null check every change can be avoided by copying the method onto `this` and then\n // replacing it with a no-op on unmount. This can probably be avoided if Subscription's\n // listeners logic is changed to not call listeners that have been unsubscribed in the\n // middle of the notification loop.\n\n this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription);\n };\n\n _proto.onStateChange = function onStateChange() {\n this.selector.run(this.props);\n\n if (!this.selector.shouldComponentUpdate) {\n this.notifyNestedSubs();\n } else {\n this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate;\n this.setState(dummyState);\n }\n };\n\n _proto.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() {\n // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it\n // needs to notify nested subs. Once called, it unimplements itself until further state\n // changes occur. Doing it this way vs having a permanent `componentDidUpdate` that does\n // a boolean check every time avoids an extra method call most of the time, resulting\n // in some perf boost.\n this.componentDidUpdate = undefined;\n this.notifyNestedSubs();\n };\n\n _proto.isSubscribed = function isSubscribed() {\n return Boolean(this.subscription) && this.subscription.isSubscribed();\n };\n\n _proto.addExtraProps = function addExtraProps(props) {\n if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props; // make a shallow copy so that fields added don't leak to the original selector.\n // this is especially important for 'ref' since that's a reference back to the component\n // instance. a singleton memoized selector would then be holding a reference to the\n // instance, preventing the instance from being garbage collected, and that would be bad\n\n var withExtras = _extends({}, props);\n\n if (withRef) withExtras.ref = this.setWrappedInstance;\n if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;\n if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription;\n return withExtras;\n };\n\n _proto.render = function render() {\n var selector = this.selector;\n selector.shouldComponentUpdate = false;\n\n if (selector.error) {\n throw selector.error;\n } else {\n return createElement(WrappedComponent, this.addExtraProps(selector.props));\n }\n };\n\n return Connect;\n }(Component);\n\n if (prefixUnsafeLifecycleMethods) {\n // Use UNSAFE_ event name where supported\n Connect.prototype.UNSAFE_componentWillReceiveProps = Connect.prototype.componentWillReceiveProps;\n delete Connect.prototype.componentWillReceiveProps;\n }\n /* eslint-enable react/no-deprecated */\n\n\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n Connect.childContextTypes = childContextTypes;\n Connect.contextTypes = contextTypes;\n Connect.propTypes = contextTypes;\n\n if (process.env.NODE_ENV !== 'production') {\n // Use UNSAFE_ event name where supported\n var eventName = prefixUnsafeLifecycleMethods ? 'UNSAFE_componentWillUpdate' : 'componentWillUpdate';\n\n Connect.prototype[eventName] = function componentWillUpdate() {\n var _this2 = this;\n\n // We are hot reloading!\n if (this.version !== version) {\n this.version = version;\n this.initSelector(); // If any connected descendants don't hot reload (and resubscribe in the process), their\n // listeners will be lost when we unsubscribe. Unfortunately, by copying over all\n // listeners, this does mean that the old versions of connected descendants will still be\n // notified of state changes; however, their onStateChange function is a no-op so this\n // isn't a huge deal.\n\n var oldListeners = [];\n\n if (this.subscription) {\n oldListeners = this.subscription.listeners.get();\n this.subscription.tryUnsubscribe();\n }\n\n this.initSubscription();\n\n if (shouldHandleStateChanges) {\n this.subscription.trySubscribe();\n oldListeners.forEach(function (listener) {\n return _this2.subscription.listeners.subscribe(listener);\n });\n }\n }\n };\n }\n\n return hoistStatics(Connect, WrappedComponent);\n };\n}","var hasOwn = Object.prototype.hasOwnProperty;\n\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nexport default function shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","import isPlainObject from 'lodash-es/isPlainObject';\nimport $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nexport var ActionTypes = {\n INIT: '@@redux/INIT'\n\n /**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n};export default function createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected listener to be a function.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.INIT });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object') {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}","import { ActionTypes } from './createStore';\nimport isPlainObject from 'lodash-es/isPlainObject';\nimport warning from './utils/warning';\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionName = actionType && '\"' + actionType.toString() + '\"' || 'an action';\n\n return 'Given action ' + actionName + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: ActionTypes.INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + ActionTypes.INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nexport default function combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n var unexpectedKeyCache = void 0;\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError = void 0;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}","function bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(undefined, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nexport default function bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}","/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nexport default function compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nimport compose from './compose';\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nexport default function applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var _dispatch = store.dispatch;\n var chain = [];\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch(action) {\n return _dispatch(action);\n }\n };\n chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}","import verifyPlainObject from '../utils/verifyPlainObject';\nexport function wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n// \n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\n\nexport function getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n// \n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n// \n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n// \n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n// \n\nexport function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}","import { bindActionCreators } from 'redux';\nimport { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\nexport function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return {\n dispatch: dispatch\n };\n }) : undefined;\n}\nexport function whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\nexport default [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];","import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\nexport function whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\nexport default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport verifyPlainObject from '../utils/verifyPlainObject';\nexport function defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, stateProps, dispatchProps);\n}\nexport function wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName,\n pure = _ref.pure,\n areMergedPropsEqual = _ref.areMergedPropsEqual;\n var hasRunOnce = false;\n var mergedProps;\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\nexport function whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\nexport function whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\nexport default [whenMergePropsIsFunction, whenMergePropsIsOmitted];","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport verifySubselectors from './verifySubselectors';\nexport function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\nexport function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual,\n areOwnPropsEqual = _ref.areOwnPropsEqual,\n areStatePropsEqual = _ref.areStatePropsEqual;\n var hasRunAtLeastOnce = false;\n var state;\n var ownProps;\n var stateProps;\n var dispatchProps;\n var mergedProps;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n} // TODO: Add more comments\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nexport default function finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps,\n initMapDispatchToProps = _ref2.initMapDispatchToProps,\n initMergeProps = _ref2.initMergeProps,\n options = _objectWithoutPropertiesLoose(_ref2, [\"initMapStateToProps\", \"initMapDispatchToProps\", \"initMergeProps\"]);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n if (process.env.NODE_ENV !== 'production') {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport connectAdvanced from '../components/connectAdvanced';\nimport shallowEqual from '../utils/shallowEqual';\nimport defaultMapDispatchToPropsFactories from './mapDispatchToProps';\nimport defaultMapStateToPropsFactories from './mapStateToProps';\nimport defaultMergePropsFactories from './mergeProps';\nimport defaultSelectorFactory from './selectorFactory';\n/*\n connect is a facade over connectAdvanced. It turns its args into a compatible\n selectorFactory, which has the signature:\n\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\n \n connect passes its args to connectAdvanced as options, which will in turn pass them to\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\n\n selectorFactory returns a final props selector from its mapStateToProps,\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\n mergePropsFactories, and pure args.\n\n The resulting final props selector is called by the Connect component instance whenever\n it receives new props or store state.\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error(\"Invalid value of type \" + typeof arg + \" for \" + name + \" argument when connecting component \" + options.wrappedComponentName + \".\");\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n} // createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\n\n\nexport function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? defaultSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}\nexport default createConnect();","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexport var sym = function sym(id) {\n return '@@redux-saga/' + id;\n};\n\nexport var TASK = sym('TASK');\nexport var HELPER = sym('HELPER');\nexport var MATCH = sym('MATCH');\nexport var CANCEL = sym('CANCEL_PROMISE');\nexport var SAGA_ACTION = sym('SAGA_ACTION');\nexport var SELF_CANCELLATION = sym('SELF_CANCELLATION');\nexport var konst = function konst(v) {\n return function () {\n return v;\n };\n};\nexport var kTrue = konst(true);\nexport var kFalse = konst(false);\nexport var noop = function noop() {};\nexport var ident = function ident(v) {\n return v;\n};\n\nexport function check(value, predicate, error) {\n if (!predicate(value)) {\n log('error', 'uncaught at check', error);\n throw new Error(error);\n }\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function hasOwn(object, property) {\n return is.notUndef(object) && hasOwnProperty.call(object, property);\n}\n\nexport var is = {\n undef: function undef(v) {\n return v === null || v === undefined;\n },\n notUndef: function notUndef(v) {\n return v !== null && v !== undefined;\n },\n func: function func(f) {\n return typeof f === 'function';\n },\n number: function number(n) {\n return typeof n === 'number';\n },\n string: function string(s) {\n return typeof s === 'string';\n },\n array: Array.isArray,\n object: function object(obj) {\n return obj && !is.array(obj) && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object';\n },\n promise: function promise(p) {\n return p && is.func(p.then);\n },\n iterator: function iterator(it) {\n return it && is.func(it.next) && is.func(it.throw);\n },\n iterable: function iterable(it) {\n return it && is.func(Symbol) ? is.func(it[Symbol.iterator]) : is.array(it);\n },\n task: function task(t) {\n return t && t[TASK];\n },\n observable: function observable(ob) {\n return ob && is.func(ob.subscribe);\n },\n buffer: function buffer(buf) {\n return buf && is.func(buf.isEmpty) && is.func(buf.take) && is.func(buf.put);\n },\n pattern: function pattern(pat) {\n return pat && (is.string(pat) || (typeof pat === 'undefined' ? 'undefined' : _typeof(pat)) === 'symbol' || is.func(pat) || is.array(pat));\n },\n channel: function channel(ch) {\n return ch && is.func(ch.take) && is.func(ch.close);\n },\n helper: function helper(it) {\n return it && it[HELPER];\n },\n stringableFunc: function stringableFunc(f) {\n return is.func(f) && hasOwn(f, 'toString');\n }\n};\n\nexport var object = {\n assign: function assign(target, source) {\n for (var i in source) {\n if (hasOwn(source, i)) {\n target[i] = source[i];\n }\n }\n }\n};\n\nexport function remove(array, item) {\n var index = array.indexOf(item);\n if (index >= 0) {\n array.splice(index, 1);\n }\n}\n\nexport var array = {\n from: function from(obj) {\n var arr = Array(obj.length);\n for (var i in obj) {\n if (hasOwn(obj, i)) {\n arr[i] = obj[i];\n }\n }\n return arr;\n }\n};\n\nexport function deferred() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var def = _extends({}, props);\n var promise = new Promise(function (resolve, reject) {\n def.resolve = resolve;\n def.reject = reject;\n });\n def.promise = promise;\n return def;\n}\n\nexport function arrayOfDeffered(length) {\n var arr = [];\n for (var i = 0; i < length; i++) {\n arr.push(deferred());\n }\n return arr;\n}\n\nexport function delay(ms) {\n var val = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var timeoutId = void 0;\n var promise = new Promise(function (resolve) {\n timeoutId = setTimeout(function () {\n return resolve(val);\n }, ms);\n });\n\n promise[CANCEL] = function () {\n return clearTimeout(timeoutId);\n };\n\n return promise;\n}\n\nexport function createMockTask() {\n var _ref;\n\n var running = true;\n var _result = void 0,\n _error = void 0;\n\n return _ref = {}, _ref[TASK] = true, _ref.isRunning = function isRunning() {\n return running;\n }, _ref.result = function result() {\n return _result;\n }, _ref.error = function error() {\n return _error;\n }, _ref.setRunning = function setRunning(b) {\n return running = b;\n }, _ref.setResult = function setResult(r) {\n return _result = r;\n }, _ref.setError = function setError(e) {\n return _error = e;\n }, _ref;\n}\n\nexport function autoInc() {\n var seed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n return function () {\n return ++seed;\n };\n}\n\nexport var uid = autoInc();\n\nvar kThrow = function kThrow(err) {\n throw err;\n};\nvar kReturn = function kReturn(value) {\n return { value: value, done: true };\n};\nexport function makeIterator(next) {\n var thro = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : kThrow;\n var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n var isHelper = arguments[3];\n\n var iterator = { name: name, next: next, throw: thro, return: kReturn };\n\n if (isHelper) {\n iterator[HELPER] = true;\n }\n if (typeof Symbol !== 'undefined') {\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n }\n return iterator;\n}\n\n/**\n Print error in a useful way whether in a browser environment\n (with expandable error stack traces), or in a node.js environment\n (text-only log output)\n **/\nexport function log(level, message) {\n var error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n\n /*eslint-disable no-console*/\n if (typeof window === 'undefined') {\n console.log('redux-saga ' + level + ': ' + message + '\\n' + (error && error.stack || error));\n } else {\n console[level](message, error);\n }\n}\n\nexport function deprecate(fn, deprecationWarning) {\n return function () {\n if (process.env.NODE_ENV === 'development') log('warn', deprecationWarning);\n return fn.apply(undefined, arguments);\n };\n}\n\nexport var updateIncentive = function updateIncentive(deprecated, preferred) {\n return deprecated + ' has been deprecated in favor of ' + preferred + ', please update your code';\n};\n\nexport var internalErr = function internalErr(err) {\n return new Error('\\n redux-saga: Error checking hooks detected an inconsistent state. This is likely a bug\\n in redux-saga code and not yours. Thanks for reporting this in the project\\'s github repo.\\n Error: ' + err + '\\n');\n};\n\nexport var createSetContextWarning = function createSetContextWarning(ctx, props) {\n return (ctx ? ctx + '.' : '') + 'setContext(props): argument ' + props + ' is not a plain object';\n};\n\nexport var wrapSagaDispatch = function wrapSagaDispatch(dispatch) {\n return function (action) {\n return dispatch(Object.defineProperty(action, SAGA_ACTION, { value: true }));\n };\n};\n\nexport var cloneableGenerator = function cloneableGenerator(generatorFunc) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var history = [];\n var gen = generatorFunc.apply(undefined, args);\n return {\n next: function next(arg) {\n history.push(arg);\n return gen.next(arg);\n },\n clone: function clone() {\n var clonedGen = cloneableGenerator(generatorFunc).apply(undefined, args);\n history.forEach(function (arg) {\n return clonedGen.next(arg);\n });\n return clonedGen;\n },\n return: function _return(value) {\n return gen.return(value);\n },\n throw: function _throw(exception) {\n return gen.throw(exception);\n }\n };\n };\n};","import { kTrue, noop } from './utils';\n\nexport var BUFFER_OVERFLOW = \"Channel's Buffer overflow!\";\n\nvar ON_OVERFLOW_THROW = 1;\nvar ON_OVERFLOW_DROP = 2;\nvar ON_OVERFLOW_SLIDE = 3;\nvar ON_OVERFLOW_EXPAND = 4;\n\nvar zeroBuffer = { isEmpty: kTrue, put: noop, take: noop };\n\nfunction ringBuffer() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n var overflowAction = arguments[1];\n\n var arr = new Array(limit);\n var length = 0;\n var pushIndex = 0;\n var popIndex = 0;\n\n var push = function push(it) {\n arr[pushIndex] = it;\n pushIndex = (pushIndex + 1) % limit;\n length++;\n };\n\n var take = function take() {\n if (length != 0) {\n var it = arr[popIndex];\n arr[popIndex] = null;\n length--;\n popIndex = (popIndex + 1) % limit;\n return it;\n }\n };\n\n var flush = function flush() {\n var items = [];\n while (length) {\n items.push(take());\n }\n return items;\n };\n\n return {\n isEmpty: function isEmpty() {\n return length == 0;\n },\n put: function put(it) {\n if (length < limit) {\n push(it);\n } else {\n var doubledLimit = void 0;\n switch (overflowAction) {\n case ON_OVERFLOW_THROW:\n throw new Error(BUFFER_OVERFLOW);\n case ON_OVERFLOW_SLIDE:\n arr[pushIndex] = it;\n pushIndex = (pushIndex + 1) % limit;\n popIndex = pushIndex;\n break;\n case ON_OVERFLOW_EXPAND:\n doubledLimit = 2 * limit;\n\n arr = flush();\n\n length = arr.length;\n pushIndex = arr.length;\n popIndex = 0;\n\n arr.length = doubledLimit;\n limit = doubledLimit;\n\n push(it);\n break;\n default:\n // DROP\n }\n }\n },\n take: take,\n flush: flush\n };\n}\n\nexport var buffers = {\n none: function none() {\n return zeroBuffer;\n },\n fixed: function fixed(limit) {\n return ringBuffer(limit, ON_OVERFLOW_THROW);\n },\n dropping: function dropping(limit) {\n return ringBuffer(limit, ON_OVERFLOW_DROP);\n },\n sliding: function sliding(limit) {\n return ringBuffer(limit, ON_OVERFLOW_SLIDE);\n },\n expanding: function expanding(initialSize) {\n return ringBuffer(initialSize, ON_OVERFLOW_EXPAND);\n }\n};","var queue = [];\n/**\n Variable to hold a counting semaphore\n - Incrementing adds a lock and puts the scheduler in a `suspended` state (if it's not\n already suspended)\n - Decrementing releases a lock. Zero locks puts the scheduler in a `released` state. This\n triggers flushing the queued tasks.\n**/\nvar semaphore = 0;\n\n/**\n Executes a task 'atomically'. Tasks scheduled during this execution will be queued\n and flushed after this task has finished (assuming the scheduler endup in a released\n state).\n**/\nfunction exec(task) {\n try {\n suspend();\n task();\n } finally {\n release();\n }\n}\n\n/**\n Executes or queues a task depending on the state of the scheduler (`suspended` or `released`)\n**/\nexport function asap(task) {\n queue.push(task);\n\n if (!semaphore) {\n suspend();\n flush();\n }\n}\n\n/**\n Puts the scheduler in a `suspended` state. Scheduled tasks will be queued until the\n scheduler is released.\n**/\nexport function suspend() {\n semaphore++;\n}\n\n/**\n Puts the scheduler in a `released` state.\n**/\nfunction release() {\n semaphore--;\n}\n\n/**\n Releases the current lock. Executes all queued tasks if the scheduler is in the released state.\n**/\nexport function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nimport { is, check, remove, MATCH, internalErr, SAGA_ACTION } from './utils';\nimport { buffers } from './buffers';\nimport { asap } from './scheduler';\n\nvar CHANNEL_END_TYPE = '@@redux-saga/CHANNEL_END';\nexport var END = { type: CHANNEL_END_TYPE };\nexport var isEnd = function isEnd(a) {\n return a && a.type === CHANNEL_END_TYPE;\n};\n\nexport function emitter() {\n var subscribers = [];\n\n function subscribe(sub) {\n subscribers.push(sub);\n return function () {\n return remove(subscribers, sub);\n };\n }\n\n function emit(item) {\n var arr = subscribers.slice();\n for (var i = 0, len = arr.length; i < len; i++) {\n arr[i](item);\n }\n }\n\n return {\n subscribe: subscribe,\n emit: emit\n };\n}\n\nexport var INVALID_BUFFER = 'invalid buffer passed to channel factory function';\nexport var UNDEFINED_INPUT_ERROR = 'Saga was provided with an undefined action';\n\nif (process.env.NODE_ENV !== 'production') {\n UNDEFINED_INPUT_ERROR += '\\nHints:\\n - check that your Action Creator returns a non-undefined value\\n - if the Saga was started using runSaga, check that your subscribe source provides the action to its listeners\\n ';\n}\n\nexport function channel() {\n var buffer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : buffers.fixed();\n\n var closed = false;\n var takers = [];\n\n check(buffer, is.buffer, INVALID_BUFFER);\n\n function checkForbiddenStates() {\n if (closed && takers.length) {\n throw internalErr('Cannot have a closed channel with pending takers');\n }\n if (takers.length && !buffer.isEmpty()) {\n throw internalErr('Cannot have pending takers with non empty buffer');\n }\n }\n\n function put(input) {\n checkForbiddenStates();\n check(input, is.notUndef, UNDEFINED_INPUT_ERROR);\n if (closed) {\n return;\n }\n if (!takers.length) {\n return buffer.put(input);\n }\n for (var i = 0; i < takers.length; i++) {\n var cb = takers[i];\n if (!cb[MATCH] || cb[MATCH](input)) {\n takers.splice(i, 1);\n return cb(input);\n }\n }\n }\n\n function take(cb) {\n checkForbiddenStates();\n check(cb, is.func, \"channel.take's callback must be a function\");\n\n if (closed && buffer.isEmpty()) {\n cb(END);\n } else if (!buffer.isEmpty()) {\n cb(buffer.take());\n } else {\n takers.push(cb);\n cb.cancel = function () {\n return remove(takers, cb);\n };\n }\n }\n\n function flush(cb) {\n checkForbiddenStates(); // TODO: check if some new state should be forbidden now\n check(cb, is.func, \"channel.flush' callback must be a function\");\n if (closed && buffer.isEmpty()) {\n cb(END);\n return;\n }\n cb(buffer.flush());\n }\n\n function close() {\n checkForbiddenStates();\n if (!closed) {\n closed = true;\n if (takers.length) {\n var arr = takers;\n takers = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n arr[i](END);\n }\n }\n }\n }\n\n return {\n take: take,\n put: put,\n flush: flush,\n close: close,\n get __takers__() {\n return takers;\n },\n get __closed__() {\n return closed;\n }\n };\n}\n\nexport function eventChannel(subscribe) {\n var buffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : buffers.none();\n var matcher = arguments[2];\n\n /**\n should be if(typeof matcher !== undefined) instead?\n see PR #273 for a background discussion\n **/\n if (arguments.length > 2) {\n check(matcher, is.func, 'Invalid match function passed to eventChannel');\n }\n\n var chan = channel(buffer);\n var close = function close() {\n if (!chan.__closed__) {\n if (unsubscribe) {\n unsubscribe();\n }\n chan.close();\n }\n };\n var unsubscribe = subscribe(function (input) {\n if (isEnd(input)) {\n close();\n return;\n }\n if (matcher && !matcher(input)) {\n return;\n }\n chan.put(input);\n });\n if (chan.__closed__) {\n unsubscribe();\n }\n\n if (!is.func(unsubscribe)) {\n throw new Error('in eventChannel: subscribe should return a function to unsubscribe');\n }\n\n return {\n take: chan.take,\n flush: chan.flush,\n close: close\n };\n}\n\nexport function stdChannel(subscribe) {\n var chan = eventChannel(function (cb) {\n return subscribe(function (input) {\n if (input[SAGA_ACTION]) {\n cb(input);\n return;\n }\n asap(function () {\n return cb(input);\n });\n });\n });\n\n return _extends({}, chan, {\n take: function take(cb, matcher) {\n if (arguments.length > 1) {\n check(matcher, is.func, \"channel.take's matcher argument must be a function\");\n cb[MATCH] = matcher;\n }\n chan.take(cb);\n }\n });\n}","import { is, makeIterator } from '../utils';\n\nvar done = { done: true, value: undefined };\nexport var qEnd = {};\n\nexport function safeName(patternOrChannel) {\n if (is.channel(patternOrChannel)) {\n return 'channel';\n } else if (Array.isArray(patternOrChannel)) {\n return String(patternOrChannel.map(function (entry) {\n return String(entry);\n }));\n } else {\n return String(patternOrChannel);\n }\n}\n\nexport default function fsmIterator(fsm, q0) {\n var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'iterator';\n\n var updateState = void 0,\n qNext = q0;\n\n function next(arg, error) {\n if (qNext === qEnd) {\n return done;\n }\n\n if (error) {\n qNext = qEnd;\n throw error;\n } else {\n updateState && updateState(arg);\n\n var _fsm$qNext = fsm[qNext](),\n q = _fsm$qNext[0],\n output = _fsm$qNext[1],\n _updateState = _fsm$qNext[2];\n\n qNext = q;\n updateState = _updateState;\n return qNext === qEnd ? done : output;\n }\n }\n\n return makeIterator(next, function (error) {\n return next(null, error);\n }, name, true);\n}","import fsmIterator, { qEnd, safeName } from './fsmIterator';\nimport { cancel, take, fork } from '../io';\nimport { END } from '../channel';\n\nexport default function takeLatest(patternOrChannel, worker) {\n for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n var yTake = { done: false, value: take(patternOrChannel) };\n var yFork = function yFork(ac) {\n return { done: false, value: fork.apply(undefined, [worker].concat(args, [ac])) };\n };\n var yCancel = function yCancel(task) {\n return { done: false, value: cancel(task) };\n };\n\n var task = void 0,\n action = void 0;\n var setTask = function setTask(t) {\n return task = t;\n };\n var setAction = function setAction(ac) {\n return action = ac;\n };\n\n return fsmIterator({\n q1: function q1() {\n return ['q2', yTake, setAction];\n },\n q2: function q2() {\n return action === END ? [qEnd] : task ? ['q3', yCancel(task)] : ['q1', yFork(action), setTask];\n },\n q3: function q3() {\n return ['q1', yFork(action), setTask];\n }\n }, 'q1', 'takeLatest(' + safeName(patternOrChannel) + ', ' + worker.name + ')');\n}","import { sym, is, ident, check, deprecate, updateIncentive, createSetContextWarning, SELF_CANCELLATION } from './utils';\nimport { takeEveryHelper, takeLatestHelper, throttleHelper } from './sagaHelpers';\n\nvar IO = sym('IO');\nvar TAKE = 'TAKE';\nvar PUT = 'PUT';\nvar ALL = 'ALL';\nvar RACE = 'RACE';\nvar CALL = 'CALL';\nvar CPS = 'CPS';\nvar FORK = 'FORK';\nvar JOIN = 'JOIN';\nvar CANCEL = 'CANCEL';\nvar SELECT = 'SELECT';\nvar ACTION_CHANNEL = 'ACTION_CHANNEL';\nvar CANCELLED = 'CANCELLED';\nvar FLUSH = 'FLUSH';\nvar GET_CONTEXT = 'GET_CONTEXT';\nvar SET_CONTEXT = 'SET_CONTEXT';\n\nvar TEST_HINT = '\\n(HINT: if you are getting this errors in tests, consider using createMockTask from redux-saga/utils)';\n\nvar effect = function effect(type, payload) {\n var _ref;\n\n return _ref = {}, _ref[IO] = true, _ref[type] = payload, _ref;\n};\n\nexport function take() {\n var patternOrChannel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '*';\n\n if (arguments.length) {\n check(arguments[0], is.notUndef, 'take(patternOrChannel): patternOrChannel is undefined');\n }\n if (is.pattern(patternOrChannel)) {\n return effect(TAKE, { pattern: patternOrChannel });\n }\n if (is.channel(patternOrChannel)) {\n return effect(TAKE, { channel: patternOrChannel });\n }\n throw new Error('take(patternOrChannel): argument ' + String(patternOrChannel) + ' is not valid channel or a valid pattern');\n}\n\ntake.maybe = function () {\n var eff = take.apply(undefined, arguments);\n eff[TAKE].maybe = true;\n return eff;\n};\n\nexport var takem = /*#__PURE__*/deprecate(take.maybe, /*#__PURE__*/updateIncentive('takem', 'take.maybe'));\n\nexport function put(channel, action) {\n if (arguments.length > 1) {\n check(channel, is.notUndef, 'put(channel, action): argument channel is undefined');\n check(channel, is.channel, 'put(channel, action): argument ' + channel + ' is not a valid channel');\n check(action, is.notUndef, 'put(channel, action): argument action is undefined');\n } else {\n check(channel, is.notUndef, 'put(action): argument action is undefined');\n action = channel;\n channel = null;\n }\n return effect(PUT, { channel: channel, action: action });\n}\n\nput.resolve = function () {\n var eff = put.apply(undefined, arguments);\n eff[PUT].resolve = true;\n return eff;\n};\n\nput.sync = deprecate(put.resolve, updateIncentive('put.sync', 'put.resolve'));\n\nexport function all(effects) {\n return effect(ALL, effects);\n}\n\nexport function race(effects) {\n return effect(RACE, effects);\n}\n\nfunction getFnCallDesc(meth, fn, args) {\n check(fn, is.notUndef, meth + ': argument fn is undefined');\n\n var context = null;\n if (is.array(fn)) {\n var _fn = fn;\n context = _fn[0];\n fn = _fn[1];\n } else if (fn.fn) {\n var _fn2 = fn;\n context = _fn2.context;\n fn = _fn2.fn;\n }\n if (context && is.string(fn) && is.func(context[fn])) {\n fn = context[fn];\n }\n check(fn, is.func, meth + ': argument ' + fn + ' is not a function');\n\n return { context: context, fn: fn, args: args };\n}\n\nexport function call(fn) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return effect(CALL, getFnCallDesc('call', fn, args));\n}\n\nexport function apply(context, fn) {\n var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n\n return effect(CALL, getFnCallDesc('apply', { context: context, fn: fn }, args));\n}\n\nexport function cps(fn) {\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return effect(CPS, getFnCallDesc('cps', fn, args));\n}\n\nexport function fork(fn) {\n for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n return effect(FORK, getFnCallDesc('fork', fn, args));\n}\n\nexport function spawn(fn) {\n for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n var eff = fork.apply(undefined, [fn].concat(args));\n eff[FORK].detached = true;\n return eff;\n}\n\nexport function join() {\n for (var _len5 = arguments.length, tasks = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n tasks[_key5] = arguments[_key5];\n }\n\n if (tasks.length > 1) {\n return all(tasks.map(function (t) {\n return join(t);\n }));\n }\n var task = tasks[0];\n check(task, is.notUndef, 'join(task): argument task is undefined');\n check(task, is.task, 'join(task): argument ' + task + ' is not a valid Task object ' + TEST_HINT);\n return effect(JOIN, task);\n}\n\nexport function cancel() {\n for (var _len6 = arguments.length, tasks = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n tasks[_key6] = arguments[_key6];\n }\n\n if (tasks.length > 1) {\n return all(tasks.map(function (t) {\n return cancel(t);\n }));\n }\n var task = tasks[0];\n if (tasks.length === 1) {\n check(task, is.notUndef, 'cancel(task): argument task is undefined');\n check(task, is.task, 'cancel(task): argument ' + task + ' is not a valid Task object ' + TEST_HINT);\n }\n return effect(CANCEL, task || SELF_CANCELLATION);\n}\n\nexport function select(selector) {\n for (var _len7 = arguments.length, args = Array(_len7 > 1 ? _len7 - 1 : 0), _key7 = 1; _key7 < _len7; _key7++) {\n args[_key7 - 1] = arguments[_key7];\n }\n\n if (arguments.length === 0) {\n selector = ident;\n } else {\n check(selector, is.notUndef, 'select(selector,[...]): argument selector is undefined');\n check(selector, is.func, 'select(selector,[...]): argument ' + selector + ' is not a function');\n }\n return effect(SELECT, { selector: selector, args: args });\n}\n\n/**\n channel(pattern, [buffer]) => creates an event channel for store actions\n**/\nexport function actionChannel(pattern, buffer) {\n check(pattern, is.notUndef, 'actionChannel(pattern,...): argument pattern is undefined');\n if (arguments.length > 1) {\n check(buffer, is.notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');\n check(buffer, is.buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');\n }\n return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });\n}\n\nexport function cancelled() {\n return effect(CANCELLED, {});\n}\n\nexport function flush(channel) {\n check(channel, is.channel, 'flush(channel): argument ' + channel + ' is not valid channel');\n return effect(FLUSH, channel);\n}\n\nexport function getContext(prop) {\n check(prop, is.string, 'getContext(prop): argument ' + prop + ' is not a string');\n return effect(GET_CONTEXT, prop);\n}\n\nexport function setContext(props) {\n check(props, is.object, createSetContextWarning(null, props));\n return effect(SET_CONTEXT, props);\n}\n\nexport function takeEvery(patternOrChannel, worker) {\n for (var _len8 = arguments.length, args = Array(_len8 > 2 ? _len8 - 2 : 0), _key8 = 2; _key8 < _len8; _key8++) {\n args[_key8 - 2] = arguments[_key8];\n }\n\n return fork.apply(undefined, [takeEveryHelper, patternOrChannel, worker].concat(args));\n}\n\nexport function takeLatest(patternOrChannel, worker) {\n for (var _len9 = arguments.length, args = Array(_len9 > 2 ? _len9 - 2 : 0), _key9 = 2; _key9 < _len9; _key9++) {\n args[_key9 - 2] = arguments[_key9];\n }\n\n return fork.apply(undefined, [takeLatestHelper, patternOrChannel, worker].concat(args));\n}\n\nexport function throttle(ms, pattern, worker) {\n for (var _len10 = arguments.length, args = Array(_len10 > 3 ? _len10 - 3 : 0), _key10 = 3; _key10 < _len10; _key10++) {\n args[_key10 - 3] = arguments[_key10];\n }\n\n return fork.apply(undefined, [throttleHelper, ms, pattern, worker].concat(args));\n}\n\nvar createAsEffectType = function createAsEffectType(type) {\n return function (effect) {\n return effect && effect[IO] && effect[type];\n };\n};\n\nexport var asEffect = {\n take: createAsEffectType(TAKE),\n put: createAsEffectType(PUT),\n all: createAsEffectType(ALL),\n race: createAsEffectType(RACE),\n call: createAsEffectType(CALL),\n cps: createAsEffectType(CPS),\n fork: createAsEffectType(FORK),\n join: createAsEffectType(JOIN),\n cancel: createAsEffectType(CANCEL),\n select: createAsEffectType(SELECT),\n actionChannel: createAsEffectType(ACTION_CHANNEL),\n cancelled: createAsEffectType(CANCELLED),\n flush: createAsEffectType(FLUSH),\n getContext: createAsEffectType(GET_CONTEXT),\n setContext: createAsEffectType(SET_CONTEXT)\n};","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _defineEnumerableProperties(obj, descs) { for (var key in descs) { var desc = descs[key]; desc.configurable = desc.enumerable = true; if (\"value\" in desc) desc.writable = true; Object.defineProperty(obj, key, desc); } return obj; }\n\nimport { noop, kTrue, is, log as _log, check, deferred, uid as nextEffectId, array, remove, object, TASK, CANCEL, SELF_CANCELLATION, makeIterator, createSetContextWarning, deprecate, updateIncentive } from './utils';\nimport { asap, suspend, flush } from './scheduler';\nimport { asEffect } from './io';\nimport { stdChannel as _stdChannel, eventChannel, isEnd } from './channel';\nimport { buffers } from './buffers';\n\nexport var NOT_ITERATOR_ERROR = 'proc first argument (Saga function result) must be an iterator';\n\nexport var CHANNEL_END = {\n toString: function toString() {\n return '@@redux-saga/CHANNEL_END';\n }\n};\nexport var TASK_CANCEL = {\n toString: function toString() {\n return '@@redux-saga/TASK_CANCEL';\n }\n};\n\nvar matchers = {\n wildcard: function wildcard() {\n return kTrue;\n },\n default: function _default(pattern) {\n return (typeof pattern === 'undefined' ? 'undefined' : _typeof(pattern)) === 'symbol' ? function (input) {\n return input.type === pattern;\n } : function (input) {\n return input.type === String(pattern);\n };\n },\n array: function array(patterns) {\n return function (input) {\n return patterns.some(function (p) {\n return matcher(p)(input);\n });\n };\n },\n predicate: function predicate(_predicate) {\n return function (input) {\n return _predicate(input);\n };\n }\n};\n\nfunction matcher(pattern) {\n // prettier-ignore\n return (pattern === '*' ? matchers.wildcard : is.array(pattern) ? matchers.array : is.stringableFunc(pattern) ? matchers.default : is.func(pattern) ? matchers.predicate : matchers.default)(pattern);\n}\n\n/**\n Used to track a parent task and its forks\n In the new fork model, forked tasks are attached by default to their parent\n We model this using the concept of Parent task && main Task\n main task is the main flow of the current Generator, the parent tasks is the\n aggregation of the main tasks + all its forked tasks.\n Thus the whole model represents an execution tree with multiple branches (vs the\n linear execution tree in sequential (non parallel) programming)\n\n A parent tasks has the following semantics\n - It completes if all its forks either complete or all cancelled\n - If it's cancelled, all forks are cancelled as well\n - It aborts if any uncaught error bubbles up from forks\n - If it completes, the return value is the one returned by the main task\n**/\nfunction forkQueue(name, mainTask, cb) {\n var tasks = [],\n result = void 0,\n completed = false;\n addTask(mainTask);\n\n function abort(err) {\n cancelAll();\n cb(err, true);\n }\n\n function addTask(task) {\n tasks.push(task);\n task.cont = function (res, isErr) {\n if (completed) {\n return;\n }\n\n remove(tasks, task);\n task.cont = noop;\n if (isErr) {\n abort(res);\n } else {\n if (task === mainTask) {\n result = res;\n }\n if (!tasks.length) {\n completed = true;\n cb(result);\n }\n }\n };\n // task.cont.cancel = task.cancel\n }\n\n function cancelAll() {\n if (completed) {\n return;\n }\n completed = true;\n tasks.forEach(function (t) {\n t.cont = noop;\n t.cancel();\n });\n tasks = [];\n }\n\n return {\n addTask: addTask,\n cancelAll: cancelAll,\n abort: abort,\n getTasks: function getTasks() {\n return tasks;\n },\n taskNames: function taskNames() {\n return tasks.map(function (t) {\n return t.name;\n });\n }\n };\n}\n\nfunction createTaskIterator(_ref) {\n var context = _ref.context,\n fn = _ref.fn,\n args = _ref.args;\n\n if (is.iterator(fn)) {\n return fn;\n }\n\n // catch synchronous failures; see #152 and #441\n var result = void 0,\n error = void 0;\n try {\n result = fn.apply(context, args);\n } catch (err) {\n error = err;\n }\n\n // i.e. a generator function returns an iterator\n if (is.iterator(result)) {\n return result;\n }\n\n // do not bubble up synchronous failures for detached forks\n // instead create a failed task. See #152 and #441\n return error ? makeIterator(function () {\n throw error;\n }) : makeIterator(function () {\n var pc = void 0;\n var eff = { done: false, value: result };\n var ret = function ret(value) {\n return { done: true, value: value };\n };\n return function (arg) {\n if (!pc) {\n pc = true;\n return eff;\n } else {\n return ret(arg);\n }\n };\n }());\n}\n\nvar wrapHelper = function wrapHelper(helper) {\n return { fn: helper };\n};\n\nexport default function proc(iterator) {\n var subscribe = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {\n return noop;\n };\n var dispatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;\n var getState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop;\n var parentContext = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};\n var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};\n var parentEffectId = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;\n var name = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'anonymous';\n var cont = arguments[8];\n\n check(iterator, is.iterator, NOT_ITERATOR_ERROR);\n\n var effectsString = '[...effects]';\n var runParallelEffect = deprecate(runAllEffect, updateIncentive(effectsString, 'all(' + effectsString + ')'));\n\n var sagaMonitor = options.sagaMonitor,\n logger = options.logger,\n onError = options.onError;\n\n var log = logger || _log;\n var stdChannel = _stdChannel(subscribe);\n var taskContext = Object.create(parentContext);\n /**\n Tracks the current effect cancellation\n Each time the generator progresses. calling runEffect will set a new value\n on it. It allows propagating cancellation to child effects\n **/\n next.cancel = noop;\n\n /**\n Creates a new task descriptor for this generator, We'll also create a main task\n to track the main flow (besides other forked tasks)\n **/\n var task = newTask(parentEffectId, name, iterator, cont);\n var mainTask = { name: name, cancel: cancelMain, isRunning: true };\n var taskQueue = forkQueue(name, mainTask, end);\n\n /**\n cancellation of the main task. We'll simply resume the Generator with a Cancel\n **/\n function cancelMain() {\n if (mainTask.isRunning && !mainTask.isCancelled) {\n mainTask.isCancelled = true;\n next(TASK_CANCEL);\n }\n }\n\n /**\n This may be called by a parent generator to trigger/propagate cancellation\n cancel all pending tasks (including the main task), then end the current task.\n Cancellation propagates down to the whole execution tree holded by this Parent task\n It's also propagated to all joiners of this task and their execution tree/joiners\n Cancellation is noop for terminated/Cancelled tasks tasks\n **/\n function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }\n /**\n attaches cancellation logic to this task's continuation\n this will permit cancellation to propagate down the call chain\n **/\n cont && (cont.cancel = cancel);\n\n // tracks the running status\n iterator._isRunning = true;\n\n // kicks up the generator\n next();\n\n // then return the task descriptor to the caller\n return task;\n\n /**\n This is the generator driver\n It's a recursive async/continuation function which calls itself\n until the generator terminates or throws\n **/\n function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = is.func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = is.func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n log('error', 'uncaught at ' + name, error.message);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }\n\n function end(result, isErr) {\n iterator._isRunning = false;\n stdChannel.close();\n if (!isErr) {\n if (process.env.NODE_ENV === 'development' && result === TASK_CANCEL) {\n log('info', name + ' has been cancelled', '');\n }\n iterator._result = result;\n iterator._deferredEnd && iterator._deferredEnd.resolve(result);\n } else {\n if (result instanceof Error) {\n result.sagaStack = 'at ' + name + ' \\n ' + (result.sagaStack || result.stack);\n }\n if (!task.cont) {\n log('error', 'uncaught', result.sagaStack || result.stack);\n if (result instanceof Error && onError) {\n onError(result);\n }\n }\n iterator._error = result;\n iterator._isAborted = true;\n iterator._deferredEnd && iterator._deferredEnd.reject(result);\n }\n task.cont && task.cont(result, isErr);\n task.joiners.forEach(function (j) {\n return j.cb(result, isErr);\n });\n task.joiners = null;\n }\n\n function runEffect(effect, parentEffectId) {\n var label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n var cb = arguments[3];\n\n var effectId = nextEffectId();\n sagaMonitor && sagaMonitor.effectTriggered({ effectId: effectId, parentEffectId: parentEffectId, label: label, effect: effect });\n\n /**\n completion callback and cancel callback are mutually exclusive\n We can't cancel an already completed effect\n And We can't complete an already cancelled effectId\n **/\n var effectSettled = void 0;\n\n // Completion callback passed to the appropriate effect runner\n function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = noop; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }\n // tracks down the current cancel\n currCb.cancel = noop;\n\n // setup cancellation logic on the parent cb\n cb.cancel = function () {\n // prevents cancelling an already completed effect\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n /**\n propagates cancel downward\n catch uncaught cancellations errors; since we can no longer call the completion\n callback, log errors raised during cancellations into the console\n **/\n try {\n currCb.cancel();\n } catch (err) {\n log('error', 'uncaught at ' + name, err.message);\n }\n currCb.cancel = noop; // defensive measure\n\n sagaMonitor && sagaMonitor.effectCancelled(effectId);\n };\n\n /**\n each effect runner must attach its own logic of cancellation to the provided callback\n it allows this generator to propagate cancellation downward.\n ATTENTION! effect runners must setup the cancel logic by setting cb.cancel = [cancelMethod]\n And the setup must occur before calling the callback\n This is a sort of inversion of control: called async functions are responsible\n for completing the flow by calling the provided continuation; while caller functions\n are responsible for aborting the current flow by calling the attached cancel function\n Library users can attach their own cancellation logic to promises by defining a\n promise[CANCEL] method in their returned promises\n ATTENTION! calling cancel must have no effect on an already completed or cancelled effect\n **/\n var data = void 0;\n // prettier-ignore\n return (\n // Non declarative effect\n is.promise(effect) ? resolvePromise(effect, currCb) : is.helper(effect) ? runForkEffect(wrapHelper(effect), effectId, currCb) : is.iterator(effect) ? resolveIterator(effect, effectId, name, currCb)\n\n // declarative effects\n : is.array(effect) ? runParallelEffect(effect, effectId, currCb) : (data = asEffect.take(effect)) ? runTakeEffect(data, currCb) : (data = asEffect.put(effect)) ? runPutEffect(data, currCb) : (data = asEffect.all(effect)) ? runAllEffect(data, effectId, currCb) : (data = asEffect.race(effect)) ? runRaceEffect(data, effectId, currCb) : (data = asEffect.call(effect)) ? runCallEffect(data, effectId, currCb) : (data = asEffect.cps(effect)) ? runCPSEffect(data, currCb) : (data = asEffect.fork(effect)) ? runForkEffect(data, effectId, currCb) : (data = asEffect.join(effect)) ? runJoinEffect(data, currCb) : (data = asEffect.cancel(effect)) ? runCancelEffect(data, currCb) : (data = asEffect.select(effect)) ? runSelectEffect(data, currCb) : (data = asEffect.actionChannel(effect)) ? runChannelEffect(data, currCb) : (data = asEffect.flush(effect)) ? runFlushEffect(data, currCb) : (data = asEffect.cancelled(effect)) ? runCancelledEffect(data, currCb) : (data = asEffect.getContext(effect)) ? runGetContextEffect(data, currCb) : (data = asEffect.setContext(effect)) ? runSetContextEffect(data, currCb) : /* anything else returned as is */currCb(effect)\n );\n }\n\n function resolvePromise(promise, cb) {\n var cancelPromise = promise[CANCEL];\n if (is.func(cancelPromise)) {\n cb.cancel = cancelPromise;\n } else if (is.func(promise.abort)) {\n cb.cancel = function () {\n return promise.abort();\n };\n // TODO: add support for the fetch API, whenever they get around to\n // adding cancel support\n }\n promise.then(cb, function (error) {\n return cb(error, true);\n });\n }\n\n function resolveIterator(iterator, effectId, name, cb) {\n proc(iterator, subscribe, dispatch, getState, taskContext, options, effectId, name, cb);\n }\n\n function runTakeEffect(_ref2, cb) {\n var channel = _ref2.channel,\n pattern = _ref2.pattern,\n maybe = _ref2.maybe;\n\n channel = channel || stdChannel;\n var takeCb = function takeCb(inp) {\n return inp instanceof Error ? cb(inp, true) : isEnd(inp) && !maybe ? cb(CHANNEL_END) : cb(inp);\n };\n try {\n channel.take(takeCb, matcher(pattern));\n } catch (err) {\n return cb(err, true);\n }\n cb.cancel = takeCb.cancel;\n }\n\n function runPutEffect(_ref3, cb) {\n var channel = _ref3.channel,\n action = _ref3.action,\n resolve = _ref3.resolve;\n\n /**\n Schedule the put in case another saga is holding a lock.\n The put will be executed atomically. ie nested puts will execute after\n this put has terminated.\n **/\n asap(function () {\n var result = void 0;\n try {\n result = (channel ? channel.put : dispatch)(action);\n } catch (error) {\n // If we have a channel or `put.resolve` was used then bubble up the error.\n if (channel || resolve) return cb(error, true);\n log('error', 'uncaught at ' + name, error.stack || error.message || error);\n }\n\n if (resolve && is.promise(result)) {\n resolvePromise(result, cb);\n } else {\n return cb(result);\n }\n });\n // Put effects are non cancellables\n }\n\n function runCallEffect(_ref4, effectId, cb) {\n var context = _ref4.context,\n fn = _ref4.fn,\n args = _ref4.args;\n\n var result = void 0;\n // catch synchronous failures; see #152\n try {\n result = fn.apply(context, args);\n } catch (error) {\n return cb(error, true);\n }\n return is.promise(result) ? resolvePromise(result, cb) : is.iterator(result) ? resolveIterator(result, effectId, fn.name, cb) : cb(result);\n }\n\n function runCPSEffect(_ref5, cb) {\n var context = _ref5.context,\n fn = _ref5.fn,\n args = _ref5.args;\n\n // CPS (ie node style functions) can define their own cancellation logic\n // by setting cancel field on the cb\n\n // catch synchronous failures; see #152\n try {\n var cpsCb = function cpsCb(err, res) {\n return is.undef(err) ? cb(res) : cb(err, true);\n };\n fn.apply(context, args.concat(cpsCb));\n if (cpsCb.cancel) {\n cb.cancel = function () {\n return cpsCb.cancel();\n };\n }\n } catch (error) {\n return cb(error, true);\n }\n }\n\n function runForkEffect(_ref6, effectId, cb) {\n var context = _ref6.context,\n fn = _ref6.fn,\n args = _ref6.args,\n detached = _ref6.detached;\n\n var taskIterator = createTaskIterator({ context: context, fn: fn, args: args });\n\n try {\n suspend();\n var _task = proc(taskIterator, subscribe, dispatch, getState, taskContext, options, effectId, fn.name, detached ? null : noop);\n\n if (detached) {\n cb(_task);\n } else {\n if (taskIterator._isRunning) {\n taskQueue.addTask(_task);\n cb(_task);\n } else if (taskIterator._error) {\n taskQueue.abort(taskIterator._error);\n } else {\n cb(_task);\n }\n }\n } finally {\n flush();\n }\n // Fork effects are non cancellables\n }\n\n function runJoinEffect(t, cb) {\n if (t.isRunning()) {\n var joiner = { task: task, cb: cb };\n cb.cancel = function () {\n return remove(t.joiners, joiner);\n };\n t.joiners.push(joiner);\n } else {\n t.isAborted() ? cb(t.error(), true) : cb(t.result());\n }\n }\n\n function runCancelEffect(taskToCancel, cb) {\n if (taskToCancel === SELF_CANCELLATION) {\n taskToCancel = task;\n }\n if (taskToCancel.isRunning()) {\n taskToCancel.cancel();\n }\n cb();\n // cancel effects are non cancellables\n }\n\n function runAllEffect(effects, effectId, cb) {\n var keys = Object.keys(effects);\n\n if (!keys.length) {\n return cb(is.array(effects) ? [] : {});\n }\n\n var completedCount = 0;\n var completed = void 0;\n var results = {};\n var childCbs = {};\n\n function checkEffectEnd() {\n if (completedCount === keys.length) {\n completed = true;\n cb(is.array(effects) ? array.from(_extends({}, results, { length: keys.length })) : results);\n }\n }\n\n keys.forEach(function (key) {\n var chCbAtKey = function chCbAtKey(res, isErr) {\n if (completed) {\n return;\n }\n if (isErr || isEnd(res) || res === CHANNEL_END || res === TASK_CANCEL) {\n cb.cancel();\n cb(res, isErr);\n } else {\n results[key] = res;\n completedCount++;\n checkEffectEnd();\n }\n };\n chCbAtKey.cancel = noop;\n childCbs[key] = chCbAtKey;\n });\n\n cb.cancel = function () {\n if (!completed) {\n completed = true;\n keys.forEach(function (key) {\n return childCbs[key].cancel();\n });\n }\n };\n\n keys.forEach(function (key) {\n return runEffect(effects[key], effectId, key, childCbs[key]);\n });\n }\n\n function runRaceEffect(effects, effectId, cb) {\n var completed = void 0;\n var keys = Object.keys(effects);\n var childCbs = {};\n\n keys.forEach(function (key) {\n var chCbAtKey = function chCbAtKey(res, isErr) {\n if (completed) {\n return;\n }\n\n if (isErr) {\n // Race Auto cancellation\n cb.cancel();\n cb(res, true);\n } else if (!isEnd(res) && res !== CHANNEL_END && res !== TASK_CANCEL) {\n var _cb;\n\n cb.cancel();\n completed = true;\n cb((_cb = {}, _cb[key] = res, _cb));\n }\n };\n chCbAtKey.cancel = noop;\n childCbs[key] = chCbAtKey;\n });\n\n cb.cancel = function () {\n // prevents unnecessary cancellation\n if (!completed) {\n completed = true;\n keys.forEach(function (key) {\n return childCbs[key].cancel();\n });\n }\n };\n keys.forEach(function (key) {\n if (completed) {\n return;\n }\n runEffect(effects[key], effectId, key, childCbs[key]);\n });\n }\n\n function runSelectEffect(_ref7, cb) {\n var selector = _ref7.selector,\n args = _ref7.args;\n\n try {\n var state = selector.apply(undefined, [getState()].concat(args));\n cb(state);\n } catch (error) {\n cb(error, true);\n }\n }\n\n function runChannelEffect(_ref8, cb) {\n var pattern = _ref8.pattern,\n buffer = _ref8.buffer;\n\n var match = matcher(pattern);\n match.pattern = pattern;\n cb(eventChannel(subscribe, buffer || buffers.fixed(), match));\n }\n\n function runCancelledEffect(data, cb) {\n cb(!!mainTask.isCancelled);\n }\n\n function runFlushEffect(channel, cb) {\n channel.flush(cb);\n }\n\n function runGetContextEffect(prop, cb) {\n cb(taskContext[prop]);\n }\n\n function runSetContextEffect(props, cb) {\n object.assign(taskContext, props);\n cb();\n }\n\n function newTask(id, name, iterator, cont) {\n var _done, _ref9, _mutatorMap;\n\n iterator._deferredEnd = null;\n return _ref9 = {}, _ref9[TASK] = true, _ref9.id = id, _ref9.name = name, _done = 'done', _mutatorMap = {}, _mutatorMap[_done] = _mutatorMap[_done] || {}, _mutatorMap[_done].get = function () {\n if (iterator._deferredEnd) {\n return iterator._deferredEnd.promise;\n } else {\n var def = deferred();\n iterator._deferredEnd = def;\n if (!iterator._isRunning) {\n iterator._error ? def.reject(iterator._error) : def.resolve(iterator._result);\n }\n return def.promise;\n }\n }, _ref9.cont = cont, _ref9.joiners = [], _ref9.cancel = cancel, _ref9.isRunning = function isRunning() {\n return iterator._isRunning;\n }, _ref9.isCancelled = function isCancelled() {\n return iterator._isCancelled;\n }, _ref9.isAborted = function isAborted() {\n return iterator._isAborted;\n }, _ref9.result = function result() {\n return iterator._result;\n }, _ref9.error = function error() {\n return iterator._error;\n }, _ref9.setContext = function setContext(props) {\n check(props, is.object, createSetContextWarning('task', props));\n object.assign(taskContext, props);\n }, _defineEnumerableProperties(_ref9, _mutatorMap), _ref9;\n }\n}","import { is, check, uid as nextSagaId, wrapSagaDispatch, noop, log } from './utils';\nimport proc from './proc';\n\nvar RUN_SAGA_SIGNATURE = 'runSaga(storeInterface, saga, ...args)';\nvar NON_GENERATOR_ERR = RUN_SAGA_SIGNATURE + ': saga argument must be a Generator function!';\n\nexport function runSaga(storeInterface, saga) {\n for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n var iterator = void 0;\n\n if (is.iterator(storeInterface)) {\n if (process.env.NODE_ENV === 'development') {\n log('warn', 'runSaga(iterator, storeInterface) has been deprecated in favor of ' + RUN_SAGA_SIGNATURE);\n }\n iterator = storeInterface;\n storeInterface = saga;\n } else {\n check(saga, is.func, NON_GENERATOR_ERR);\n iterator = saga.apply(undefined, args);\n check(iterator, is.iterator, NON_GENERATOR_ERR);\n }\n\n var _storeInterface = storeInterface,\n subscribe = _storeInterface.subscribe,\n dispatch = _storeInterface.dispatch,\n getState = _storeInterface.getState,\n context = _storeInterface.context,\n sagaMonitor = _storeInterface.sagaMonitor,\n logger = _storeInterface.logger,\n onError = _storeInterface.onError;\n\n\n var effectId = nextSagaId();\n\n if (sagaMonitor) {\n // monitors are expected to have a certain interface, let's fill-in any missing ones\n sagaMonitor.effectTriggered = sagaMonitor.effectTriggered || noop;\n sagaMonitor.effectResolved = sagaMonitor.effectResolved || noop;\n sagaMonitor.effectRejected = sagaMonitor.effectRejected || noop;\n sagaMonitor.effectCancelled = sagaMonitor.effectCancelled || noop;\n sagaMonitor.actionDispatched = sagaMonitor.actionDispatched || noop;\n\n sagaMonitor.effectTriggered({ effectId: effectId, root: true, parentEffectId: 0, effect: { root: true, saga: saga, args: args } });\n }\n\n var task = proc(iterator, subscribe, wrapSagaDispatch(dispatch), getState, context, { sagaMonitor: sagaMonitor, logger: logger, onError: onError }, effectId, saga.name);\n\n if (sagaMonitor) {\n sagaMonitor.effectResolved(effectId, task);\n }\n\n return task;\n}","function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nimport { is, check, object, createSetContextWarning } from './utils';\nimport { emitter } from './channel';\nimport { ident } from './utils';\nimport { runSaga } from './runSaga';\n\nexport default function sagaMiddlewareFactory() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _ref$context = _ref.context,\n context = _ref$context === undefined ? {} : _ref$context,\n options = _objectWithoutProperties(_ref, ['context']);\n\n var sagaMonitor = options.sagaMonitor,\n logger = options.logger,\n onError = options.onError;\n\n\n if (is.func(options)) {\n if (process.env.NODE_ENV === 'production') {\n throw new Error('Saga middleware no longer accept Generator functions. Use sagaMiddleware.run instead');\n } else {\n throw new Error('You passed a function to the Saga middleware. You are likely trying to start a Saga by directly passing it to the middleware. This is no longer possible starting from 0.10.0. To run a Saga, you must do it dynamically AFTER mounting the middleware into the store.\\n Example:\\n import createSagaMiddleware from \\'redux-saga\\'\\n ... other imports\\n\\n const sagaMiddleware = createSagaMiddleware()\\n const store = createStore(reducer, applyMiddleware(sagaMiddleware))\\n sagaMiddleware.run(saga, ...args)\\n ');\n }\n }\n\n if (logger && !is.func(logger)) {\n throw new Error('`options.logger` passed to the Saga middleware is not a function!');\n }\n\n if (process.env.NODE_ENV === 'development' && options.onerror) {\n throw new Error('`options.onerror` was removed. Use `options.onError` instead.');\n }\n\n if (onError && !is.func(onError)) {\n throw new Error('`options.onError` passed to the Saga middleware is not a function!');\n }\n\n if (options.emitter && !is.func(options.emitter)) {\n throw new Error('`options.emitter` passed to the Saga middleware is not a function!');\n }\n\n function sagaMiddleware(_ref2) {\n var getState = _ref2.getState,\n dispatch = _ref2.dispatch;\n\n var sagaEmitter = emitter();\n sagaEmitter.emit = (options.emitter || ident)(sagaEmitter.emit);\n\n sagaMiddleware.run = runSaga.bind(null, {\n context: context,\n subscribe: sagaEmitter.subscribe,\n dispatch: dispatch,\n getState: getState,\n sagaMonitor: sagaMonitor,\n logger: logger,\n onError: onError\n });\n\n return function (next) {\n return function (action) {\n if (sagaMonitor && sagaMonitor.actionDispatched) {\n sagaMonitor.actionDispatched(action);\n }\n var result = next(action); // hit reducers\n sagaEmitter.emit(action);\n return result;\n };\n };\n }\n\n sagaMiddleware.run = function () {\n throw new Error('Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware');\n };\n\n sagaMiddleware.setContext = function (props) {\n check(props, is.object, createSetContextWarning('sagaMiddleware', props));\n object.assign(context, props);\n };\n\n return sagaMiddleware;\n}","export const INIT = 'INIT';\nexport const FETCH_MACHINES = 'FETCH_MACHINES';\nexport const FETCH_MACHINES_SUCCESS = 'FETCH_MACHINES_SUCCESS';\nexport const FETCH_MACHINES_FAILURE = 'FETCH_MACHINES_FAILURE';\nexport const FETCH_MACHINES_UPDATED = 'FETCH_MACHINES_UPDATED';\nexport const FETCH_MACHINES_UPDATED_SUCCESS = 'FETCH_MACHINES_UPDATED_SUCCESS';\nexport const FETCH_MACHINES_UPDATED_FAILURE = 'FETCH_MACHINES_UPDATED_FAILURE';\nexport const FETCH_EXCHANGERATES = 'FETCH_EXCHANGERATES';\nexport const FETCH_EXCHANGERATES_SUCCESS = 'FETCH_EXCHANGERATES_SUCCESS';\nexport const FETCH_EXCHANGERATES_FAILURE = 'FETCH_EXCHANGERATES_FAILURE';\nexport const SET_CENTER = 'SET_CENTER';\nexport const SET_CENTER_TO_CURRENT_COORDINATES =\n 'SET_CENTER_TO_CURRENT_COORDINATES';\nexport const SET_ZOOM = 'SET_ZOOM';\nexport const SET_MARKER = 'SET_MARKER';\nexport const SET_LIST_MARKERS = 'SET_LIST_MARKERS';\nexport const SET_LIST_ACTIVE = 'SET_LIST_ACTIVE';\nexport const SET_FILTER = 'SET_FILTER';\nexport const SET_FILTERED_ITEMS = 'SET_FILTERED_ITEMS';\nexport const SET_CLOSEST_FILTERED_MARKER = 'SET_CLOSEST_FILTERED_MARKER';\nexport const SET_USER_POS = 'SET_USER_POS';\nexport const SET_USER_POS_ERROR = 'SET_USER_POS_ERROR';\nexport const SET_MAP = 'SET_MAP';\nexport const SET_INFOWINDOW = 'SET_INFOWINDOW';\nexport const SET_EXTERNAL_GEOLOCATION = 'EXTERNAL_GEOLOCATION';\nexport const SET_SEARCH_VALUE = 'SET_SEARCH_VALUE';\nexport const CHECK_DEVICE = 'CHECK_DEVICE';\nexport const USER_POSITION_FETCHED = 'USER_POSITION_FETCHED';\nexport const WEBSOCKET_CONNECT_AND_LISTEN = 'WEBSOCKET_CONNECT_AND_LISTEN';\nexport const WEBSOCKET_MESSAGE_ADD = 'WEBSOCKET_MESSAGE_ADD';\nexport const WEBSOCKET_MESSAGE_CHANGE = 'WEBSOCKET_MESSAGE_CHANGE';\nexport const WEBSOCKET_MESSAGE_REMOVE = 'WEBSOCKET_MESSAGE_REMOVE';\nexport const WEBSOCKET_URL = 'WEBSOCKET_URL';\nexport const QUERY_MARKER_OPENED = 'QUERY_MARKER_OPENED';\nexport const SET_MAP_CONTAINER_DIMENSIONS = 'SET_MAP_CONTAINER_DIMENSIONS';\n","import {\n FETCH_MACHINES_SUCCESS,\n FETCH_MACHINES_FAILURE,\n FETCH_EXCHANGERATES_SUCCESS,\n FETCH_EXCHANGERATES_FAILURE,\n FETCH_MACHINES_UPDATED_SUCCESS,\n FETCH_MACHINES_UPDATED_FAILURE,\n SET_CENTER,\n SET_CENTER_TO_CURRENT_COORDINATES,\n SET_ZOOM,\n SET_MARKER,\n SET_LIST_MARKERS,\n SET_LIST_ACTIVE,\n SET_FILTER,\n SET_FILTERED_ITEMS,\n SET_CLOSEST_FILTERED_MARKER,\n SET_USER_POS,\n SET_USER_POS_ERROR,\n SET_MAP,\n SET_INFOWINDOW,\n SET_EXTERNAL_GEOLOCATION,\n SET_SEARCH_VALUE,\n USER_POSITION_FETCHED,\n QUERY_MARKER_OPENED,\n SET_MAP_CONTAINER_DIMENSIONS\n} from '../constants/actionTypes';\n\nexport function fetchMachinesSuccess(data, timestamp) {\n return {\n type: FETCH_MACHINES_SUCCESS,\n data: data,\n timestamp: timestamp\n };\n}\n\nexport function fetchMachinesFailure(message) {\n return {\n type: FETCH_MACHINES_FAILURE,\n message: message\n };\n}\n\nexport function fetchMachinesUpdatedSuccess(data, timestamp) {\n return {\n type: FETCH_MACHINES_UPDATED_SUCCESS,\n data: data,\n timestamp: timestamp\n };\n}\n\nexport function fetchMachinesUpdatedFailure(message) {\n return {\n type: FETCH_MACHINES_UPDATED_FAILURE,\n message: message\n };\n}\n\nexport function fetchExchangeRatesSuccess(data) {\n return {\n type: FETCH_EXCHANGERATES_SUCCESS,\n data: data\n };\n}\n\nexport function fetchExchangeRatesFailure(message) {\n return {\n type: FETCH_EXCHANGERATES_FAILURE,\n message: message\n };\n}\n\nexport function setCenter(center) {\n return {\n type: SET_CENTER,\n center: center,\n };\n}\n\nexport function setCenterToCurrentCoordinates() {\n return {\n type: SET_CENTER_TO_CURRENT_COORDINATES\n };\n}\n\nexport function setZoom(zoom) {\n return {\n type: SET_ZOOM,\n zoom: zoom,\n };\n}\n\nexport function setMarker(activeMarker) {\n return {\n type: SET_MARKER,\n activeMarker: activeMarker,\n };\n}\n\nexport function setListMarkers(listMarkers) {\n return {\n type: SET_LIST_MARKERS,\n listMarkers: listMarkers\n };\n}\n\nexport function setListActive(listActive) {\n return {\n type: SET_LIST_ACTIVE,\n listActive: listActive\n };\n}\n\nexport function setFilter(filter) {\n return {\n type: SET_FILTER,\n filter: filter,\n };\n}\n\nexport function setFilteredItems(items) {\n return {\n type: SET_FILTERED_ITEMS,\n filteredItems: items\n }\n}\n\nexport function setClosestFilteredMarker() {\n return {\n type: SET_CLOSEST_FILTERED_MARKER\n };\n}\n\nexport function setUserPos(userPos) {\n return {\n type: SET_USER_POS,\n userPos: userPos\n };\n}\n\nexport function setUserPosError(error) {\n return {\n type: SET_USER_POS_ERROR,\n error: error,\n };\n}\n\nexport function setMap(map) {\n return {\n type: SET_MAP,\n map: map\n };\n}\n\nexport function setInfoWindow(infowindow) {\n return {\n type: SET_INFOWINDOW,\n infowindow: infowindow\n };\n}\n\nexport function setExternalGeolocation(externalGeolocation) {\n return {\n type: SET_EXTERNAL_GEOLOCATION,\n externalGeolocation: externalGeolocation\n };\n}\n\nexport function userPositionFetched() {\n return {\n type: USER_POSITION_FETCHED\n };\n}\n\nexport function setQueryMarkerOpened() {\n return {\n type: QUERY_MARKER_OPENED\n };\n}\n\nexport function setSearchvalue(searchValue) {\n return {\n type: SET_SEARCH_VALUE,\n searchValue: searchValue\n };\n}\n\nexport function setMapContainerDimensions(dims) {\n return {\n type: SET_MAP_CONTAINER_DIMENSIONS,\n dimensions: dims\n };\n}\n","export const updateFilter = (filter, id, denomination = false) => {\n return filter.map((item) => {\n if (item.id === id && !denomination) {\n const newActiveState = !item.active;\n return {\n ...item,\n active: newActiveState,\n options: item.options.map((option) => ({\n ...option,\n active: newActiveState\n }))\n };\n } else {\n const optionsUpdated = item.options.map((option) => {\n if (option.id === id) {\n return {\n ...option,\n active: !option.active\n };\n }\n return option;\n });\n\n if (\n optionsUpdated.some(\n (option, index) => option !== item.options[index]\n )\n ) {\n return {\n ...item,\n options: optionsUpdated\n };\n }\n return item;\n }\n });\n};\n","export const MAX_ZOOM = 20;\nexport const MIN_ZOOM = 5;\nexport const INITIAL_ZOOM = 6;\nexport const DEFAULT_ZOOM = 16;\nexport const CENTER_ZOOM = 16;\nexport const SEARCH_ZOOM = 16;\nexport const DEFAULT_CENTER = { lat: 59, lng: 15 };\nexport const BREAKPOINT = 1024;\n","// js/phoenix/utils.js\nvar closure = (value) => {\n if (typeof value === \"function\") {\n return value;\n } else {\n let closure2 = function() {\n return value;\n };\n return closure2;\n }\n};\n\n// js/phoenix/constants.js\nvar globalSelf = typeof self !== \"undefined\" ? self : null;\nvar phxWindow = typeof window !== \"undefined\" ? window : null;\nvar global = globalSelf || phxWindow || global;\nvar DEFAULT_VSN = \"2.0.0\";\nvar SOCKET_STATES = { connecting: 0, open: 1, closing: 2, closed: 3 };\nvar DEFAULT_TIMEOUT = 1e4;\nvar WS_CLOSE_NORMAL = 1e3;\nvar CHANNEL_STATES = {\n closed: \"closed\",\n errored: \"errored\",\n joined: \"joined\",\n joining: \"joining\",\n leaving: \"leaving\"\n};\nvar CHANNEL_EVENTS = {\n close: \"phx_close\",\n error: \"phx_error\",\n join: \"phx_join\",\n reply: \"phx_reply\",\n leave: \"phx_leave\"\n};\nvar TRANSPORTS = {\n longpoll: \"longpoll\",\n websocket: \"websocket\"\n};\nvar XHR_STATES = {\n complete: 4\n};\n\n// js/phoenix/push.js\nvar Push = class {\n constructor(channel, event, payload, timeout) {\n this.channel = channel;\n this.event = event;\n this.payload = payload || function() {\n return {};\n };\n this.receivedResp = null;\n this.timeout = timeout;\n this.timeoutTimer = null;\n this.recHooks = [];\n this.sent = false;\n }\n /**\n *\n * @param {number} timeout\n */\n resend(timeout) {\n this.timeout = timeout;\n this.reset();\n this.send();\n }\n /**\n *\n */\n send() {\n if (this.hasReceived(\"timeout\")) {\n return;\n }\n this.startTimeout();\n this.sent = true;\n this.channel.socket.push({\n topic: this.channel.topic,\n event: this.event,\n payload: this.payload(),\n ref: this.ref,\n join_ref: this.channel.joinRef()\n });\n }\n /**\n *\n * @param {*} status\n * @param {*} callback\n */\n receive(status, callback) {\n if (this.hasReceived(status)) {\n callback(this.receivedResp.response);\n }\n this.recHooks.push({ status, callback });\n return this;\n }\n /**\n * @private\n */\n reset() {\n this.cancelRefEvent();\n this.ref = null;\n this.refEvent = null;\n this.receivedResp = null;\n this.sent = false;\n }\n /**\n * @private\n */\n matchReceive({ status, response, _ref }) {\n this.recHooks.filter((h) => h.status === status).forEach((h) => h.callback(response));\n }\n /**\n * @private\n */\n cancelRefEvent() {\n if (!this.refEvent) {\n return;\n }\n this.channel.off(this.refEvent);\n }\n /**\n * @private\n */\n cancelTimeout() {\n clearTimeout(this.timeoutTimer);\n this.timeoutTimer = null;\n }\n /**\n * @private\n */\n startTimeout() {\n if (this.timeoutTimer) {\n this.cancelTimeout();\n }\n this.ref = this.channel.socket.makeRef();\n this.refEvent = this.channel.replyEventName(this.ref);\n this.channel.on(this.refEvent, (payload) => {\n this.cancelRefEvent();\n this.cancelTimeout();\n this.receivedResp = payload;\n this.matchReceive(payload);\n });\n this.timeoutTimer = setTimeout(() => {\n this.trigger(\"timeout\", {});\n }, this.timeout);\n }\n /**\n * @private\n */\n hasReceived(status) {\n return this.receivedResp && this.receivedResp.status === status;\n }\n /**\n * @private\n */\n trigger(status, response) {\n this.channel.trigger(this.refEvent, { status, response });\n }\n};\n\n// js/phoenix/timer.js\nvar Timer = class {\n constructor(callback, timerCalc) {\n this.callback = callback;\n this.timerCalc = timerCalc;\n this.timer = null;\n this.tries = 0;\n }\n reset() {\n this.tries = 0;\n clearTimeout(this.timer);\n }\n /**\n * Cancels any previous scheduleTimeout and schedules callback\n */\n scheduleTimeout() {\n clearTimeout(this.timer);\n this.timer = setTimeout(() => {\n this.tries = this.tries + 1;\n this.callback();\n }, this.timerCalc(this.tries + 1));\n }\n};\n\n// js/phoenix/channel.js\nvar Channel = class {\n constructor(topic, params, socket) {\n this.state = CHANNEL_STATES.closed;\n this.topic = topic;\n this.params = closure(params || {});\n this.socket = socket;\n this.bindings = [];\n this.bindingRef = 0;\n this.timeout = this.socket.timeout;\n this.joinedOnce = false;\n this.joinPush = new Push(this, CHANNEL_EVENTS.join, this.params, this.timeout);\n this.pushBuffer = [];\n this.stateChangeRefs = [];\n this.rejoinTimer = new Timer(() => {\n if (this.socket.isConnected()) {\n this.rejoin();\n }\n }, this.socket.rejoinAfterMs);\n this.stateChangeRefs.push(this.socket.onError(() => this.rejoinTimer.reset()));\n this.stateChangeRefs.push(\n this.socket.onOpen(() => {\n this.rejoinTimer.reset();\n if (this.isErrored()) {\n this.rejoin();\n }\n })\n );\n this.joinPush.receive(\"ok\", () => {\n this.state = CHANNEL_STATES.joined;\n this.rejoinTimer.reset();\n this.pushBuffer.forEach((pushEvent) => pushEvent.send());\n this.pushBuffer = [];\n });\n this.joinPush.receive(\"error\", () => {\n this.state = CHANNEL_STATES.errored;\n if (this.socket.isConnected()) {\n this.rejoinTimer.scheduleTimeout();\n }\n });\n this.onClose(() => {\n this.rejoinTimer.reset();\n if (this.socket.hasLogger())\n this.socket.log(\"channel\", `close ${this.topic} ${this.joinRef()}`);\n this.state = CHANNEL_STATES.closed;\n this.socket.remove(this);\n });\n this.onError((reason) => {\n if (this.socket.hasLogger())\n this.socket.log(\"channel\", `error ${this.topic}`, reason);\n if (this.isJoining()) {\n this.joinPush.reset();\n }\n this.state = CHANNEL_STATES.errored;\n if (this.socket.isConnected()) {\n this.rejoinTimer.scheduleTimeout();\n }\n });\n this.joinPush.receive(\"timeout\", () => {\n if (this.socket.hasLogger())\n this.socket.log(\"channel\", `timeout ${this.topic} (${this.joinRef()})`, this.joinPush.timeout);\n let leavePush = new Push(this, CHANNEL_EVENTS.leave, closure({}), this.timeout);\n leavePush.send();\n this.state = CHANNEL_STATES.errored;\n this.joinPush.reset();\n if (this.socket.isConnected()) {\n this.rejoinTimer.scheduleTimeout();\n }\n });\n this.on(CHANNEL_EVENTS.reply, (payload, ref) => {\n this.trigger(this.replyEventName(ref), payload);\n });\n }\n /**\n * Join the channel\n * @param {integer} timeout\n * @returns {Push}\n */\n join(timeout = this.timeout) {\n if (this.joinedOnce) {\n throw new Error(\"tried to join multiple times. 'join' can only be called a single time per channel instance\");\n } else {\n this.timeout = timeout;\n this.joinedOnce = true;\n this.rejoin();\n return this.joinPush;\n }\n }\n /**\n * Hook into channel close\n * @param {Function} callback\n */\n onClose(callback) {\n this.on(CHANNEL_EVENTS.close, callback);\n }\n /**\n * Hook into channel errors\n * @param {Function} callback\n */\n onError(callback) {\n return this.on(CHANNEL_EVENTS.error, (reason) => callback(reason));\n }\n /**\n * Subscribes on channel events\n *\n * Subscription returns a ref counter, which can be used later to\n * unsubscribe the exact event listener\n *\n * @example\n * const ref1 = channel.on(\"event\", do_stuff)\n * const ref2 = channel.on(\"event\", do_other_stuff)\n * channel.off(\"event\", ref1)\n * // Since unsubscription, do_stuff won't fire,\n * // while do_other_stuff will keep firing on the \"event\"\n *\n * @param {string} event\n * @param {Function} callback\n * @returns {integer} ref\n */\n on(event, callback) {\n let ref = this.bindingRef++;\n this.bindings.push({ event, ref, callback });\n return ref;\n }\n /**\n * Unsubscribes off of channel events\n *\n * Use the ref returned from a channel.on() to unsubscribe one\n * handler, or pass nothing for the ref to unsubscribe all\n * handlers for the given event.\n *\n * @example\n * // Unsubscribe the do_stuff handler\n * const ref1 = channel.on(\"event\", do_stuff)\n * channel.off(\"event\", ref1)\n *\n * // Unsubscribe all handlers from event\n * channel.off(\"event\")\n *\n * @param {string} event\n * @param {integer} ref\n */\n off(event, ref) {\n this.bindings = this.bindings.filter((bind) => {\n return !(bind.event === event && (typeof ref === \"undefined\" || ref === bind.ref));\n });\n }\n /**\n * @private\n */\n canPush() {\n return this.socket.isConnected() && this.isJoined();\n }\n /**\n * Sends a message `event` to phoenix with the payload `payload`.\n * Phoenix receives this in the `handle_in(event, payload, socket)`\n * function. if phoenix replies or it times out (default 10000ms),\n * then optionally the reply can be received.\n *\n * @example\n * channel.push(\"event\")\n * .receive(\"ok\", payload => console.log(\"phoenix replied:\", payload))\n * .receive(\"error\", err => console.log(\"phoenix errored\", err))\n * .receive(\"timeout\", () => console.log(\"timed out pushing\"))\n * @param {string} event\n * @param {Object} payload\n * @param {number} [timeout]\n * @returns {Push}\n */\n push(event, payload, timeout = this.timeout) {\n payload = payload || {};\n if (!this.joinedOnce) {\n throw new Error(`tried to push '${event}' to '${this.topic}' before joining. Use channel.join() before pushing events`);\n }\n let pushEvent = new Push(this, event, function() {\n return payload;\n }, timeout);\n if (this.canPush()) {\n pushEvent.send();\n } else {\n pushEvent.startTimeout();\n this.pushBuffer.push(pushEvent);\n }\n return pushEvent;\n }\n /** Leaves the channel\n *\n * Unsubscribes from server events, and\n * instructs channel to terminate on server\n *\n * Triggers onClose() hooks\n *\n * To receive leave acknowledgements, use the `receive`\n * hook to bind to the server ack, ie:\n *\n * @example\n * channel.leave().receive(\"ok\", () => alert(\"left!\") )\n *\n * @param {integer} timeout\n * @returns {Push}\n */\n leave(timeout = this.timeout) {\n this.rejoinTimer.reset();\n this.joinPush.cancelTimeout();\n this.state = CHANNEL_STATES.leaving;\n let onClose = () => {\n if (this.socket.hasLogger())\n this.socket.log(\"channel\", `leave ${this.topic}`);\n this.trigger(CHANNEL_EVENTS.close, \"leave\");\n };\n let leavePush = new Push(this, CHANNEL_EVENTS.leave, closure({}), timeout);\n leavePush.receive(\"ok\", () => onClose()).receive(\"timeout\", () => onClose());\n leavePush.send();\n if (!this.canPush()) {\n leavePush.trigger(\"ok\", {});\n }\n return leavePush;\n }\n /**\n * Overridable message hook\n *\n * Receives all events for specialized message handling\n * before dispatching to the channel callbacks.\n *\n * Must return the payload, modified or unmodified\n * @param {string} event\n * @param {Object} payload\n * @param {integer} ref\n * @returns {Object}\n */\n onMessage(_event, payload, _ref) {\n return payload;\n }\n /**\n * @private\n */\n isMember(topic, event, payload, joinRef) {\n if (this.topic !== topic) {\n return false;\n }\n if (joinRef && joinRef !== this.joinRef()) {\n if (this.socket.hasLogger())\n this.socket.log(\"channel\", \"dropping outdated message\", { topic, event, payload, joinRef });\n return false;\n } else {\n return true;\n }\n }\n /**\n * @private\n */\n joinRef() {\n return this.joinPush.ref;\n }\n /**\n * @private\n */\n rejoin(timeout = this.timeout) {\n if (this.isLeaving()) {\n return;\n }\n this.socket.leaveOpenTopic(this.topic);\n this.state = CHANNEL_STATES.joining;\n this.joinPush.resend(timeout);\n }\n /**\n * @private\n */\n trigger(event, payload, ref, joinRef) {\n let handledPayload = this.onMessage(event, payload, ref, joinRef);\n if (payload && !handledPayload) {\n throw new Error(\"channel onMessage callbacks must return the payload, modified or unmodified\");\n }\n let eventBindings = this.bindings.filter((bind) => bind.event === event);\n for (let i = 0; i < eventBindings.length; i++) {\n let bind = eventBindings[i];\n bind.callback(handledPayload, ref, joinRef || this.joinRef());\n }\n }\n /**\n * @private\n */\n replyEventName(ref) {\n return `chan_reply_${ref}`;\n }\n /**\n * @private\n */\n isClosed() {\n return this.state === CHANNEL_STATES.closed;\n }\n /**\n * @private\n */\n isErrored() {\n return this.state === CHANNEL_STATES.errored;\n }\n /**\n * @private\n */\n isJoined() {\n return this.state === CHANNEL_STATES.joined;\n }\n /**\n * @private\n */\n isJoining() {\n return this.state === CHANNEL_STATES.joining;\n }\n /**\n * @private\n */\n isLeaving() {\n return this.state === CHANNEL_STATES.leaving;\n }\n};\n\n// js/phoenix/ajax.js\nvar Ajax = class {\n static request(method, endPoint, accept, body, timeout, ontimeout, callback) {\n if (global.XDomainRequest) {\n let req = new global.XDomainRequest();\n return this.xdomainRequest(req, method, endPoint, body, timeout, ontimeout, callback);\n } else {\n let req = new global.XMLHttpRequest();\n return this.xhrRequest(req, method, endPoint, accept, body, timeout, ontimeout, callback);\n }\n }\n static xdomainRequest(req, method, endPoint, body, timeout, ontimeout, callback) {\n req.timeout = timeout;\n req.open(method, endPoint);\n req.onload = () => {\n let response = this.parseJSON(req.responseText);\n callback && callback(response);\n };\n if (ontimeout) {\n req.ontimeout = ontimeout;\n }\n req.onprogress = () => {\n };\n req.send(body);\n return req;\n }\n static xhrRequest(req, method, endPoint, accept, body, timeout, ontimeout, callback) {\n req.open(method, endPoint, true);\n req.timeout = timeout;\n req.setRequestHeader(\"Content-Type\", accept);\n req.onerror = () => callback && callback(null);\n req.onreadystatechange = () => {\n if (req.readyState === XHR_STATES.complete && callback) {\n let response = this.parseJSON(req.responseText);\n callback(response);\n }\n };\n if (ontimeout) {\n req.ontimeout = ontimeout;\n }\n req.send(body);\n return req;\n }\n static parseJSON(resp) {\n if (!resp || resp === \"\") {\n return null;\n }\n try {\n return JSON.parse(resp);\n } catch (e) {\n console && console.log(\"failed to parse JSON response\", resp);\n return null;\n }\n }\n static serialize(obj, parentKey) {\n let queryStr = [];\n for (var key in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) {\n continue;\n }\n let paramKey = parentKey ? `${parentKey}[${key}]` : key;\n let paramVal = obj[key];\n if (typeof paramVal === \"object\") {\n queryStr.push(this.serialize(paramVal, paramKey));\n } else {\n queryStr.push(encodeURIComponent(paramKey) + \"=\" + encodeURIComponent(paramVal));\n }\n }\n return queryStr.join(\"&\");\n }\n static appendParams(url, params) {\n if (Object.keys(params).length === 0) {\n return url;\n }\n let prefix = url.match(/\\?/) ? \"&\" : \"?\";\n return `${url}${prefix}${this.serialize(params)}`;\n }\n};\n\n// js/phoenix/longpoll.js\nvar arrayBufferToBase64 = (buffer) => {\n let binary = \"\";\n let bytes = new Uint8Array(buffer);\n let len = bytes.byteLength;\n for (let i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n};\nvar LongPoll = class {\n constructor(endPoint) {\n this.endPoint = null;\n this.token = null;\n this.skipHeartbeat = true;\n this.reqs = /* @__PURE__ */ new Set();\n this.awaitingBatchAck = false;\n this.currentBatch = null;\n this.currentBatchTimer = null;\n this.batchBuffer = [];\n this.onopen = function() {\n };\n this.onerror = function() {\n };\n this.onmessage = function() {\n };\n this.onclose = function() {\n };\n this.pollEndpoint = this.normalizeEndpoint(endPoint);\n this.readyState = SOCKET_STATES.connecting;\n setTimeout(() => this.poll(), 0);\n }\n normalizeEndpoint(endPoint) {\n return endPoint.replace(\"ws://\", \"http://\").replace(\"wss://\", \"https://\").replace(new RegExp(\"(.*)/\" + TRANSPORTS.websocket), \"$1/\" + TRANSPORTS.longpoll);\n }\n endpointURL() {\n return Ajax.appendParams(this.pollEndpoint, { token: this.token });\n }\n closeAndRetry(code, reason, wasClean) {\n this.close(code, reason, wasClean);\n this.readyState = SOCKET_STATES.connecting;\n }\n ontimeout() {\n this.onerror(\"timeout\");\n this.closeAndRetry(1005, \"timeout\", false);\n }\n isActive() {\n return this.readyState === SOCKET_STATES.open || this.readyState === SOCKET_STATES.connecting;\n }\n poll() {\n this.ajax(\"GET\", \"application/json\", null, () => this.ontimeout(), (resp) => {\n if (resp) {\n var { status, token, messages } = resp;\n this.token = token;\n } else {\n status = 0;\n }\n switch (status) {\n case 200:\n messages.forEach((msg) => {\n setTimeout(() => this.onmessage({ data: msg }), 0);\n });\n this.poll();\n break;\n case 204:\n this.poll();\n break;\n case 410:\n this.readyState = SOCKET_STATES.open;\n this.onopen({});\n this.poll();\n break;\n case 403:\n this.onerror(403);\n this.close(1008, \"forbidden\", false);\n break;\n case 0:\n case 500:\n this.onerror(500);\n this.closeAndRetry(1011, \"internal server error\", 500);\n break;\n default:\n throw new Error(`unhandled poll status ${status}`);\n }\n });\n }\n // we collect all pushes within the current event loop by\n // setTimeout 0, which optimizes back-to-back procedural\n // pushes against an empty buffer\n send(body) {\n if (typeof body !== \"string\") {\n body = arrayBufferToBase64(body);\n }\n if (this.currentBatch) {\n this.currentBatch.push(body);\n } else if (this.awaitingBatchAck) {\n this.batchBuffer.push(body);\n } else {\n this.currentBatch = [body];\n this.currentBatchTimer = setTimeout(() => {\n this.batchSend(this.currentBatch);\n this.currentBatch = null;\n }, 0);\n }\n }\n batchSend(messages) {\n this.awaitingBatchAck = true;\n this.ajax(\"POST\", \"application/x-ndjson\", messages.join(\"\\n\"), () => this.onerror(\"timeout\"), (resp) => {\n this.awaitingBatchAck = false;\n if (!resp || resp.status !== 200) {\n this.onerror(resp && resp.status);\n this.closeAndRetry(1011, \"internal server error\", false);\n } else if (this.batchBuffer.length > 0) {\n this.batchSend(this.batchBuffer);\n this.batchBuffer = [];\n }\n });\n }\n close(code, reason, wasClean) {\n for (let req of this.reqs) {\n req.abort();\n }\n this.readyState = SOCKET_STATES.closed;\n let opts = Object.assign({ code: 1e3, reason: void 0, wasClean: true }, { code, reason, wasClean });\n this.batchBuffer = [];\n clearTimeout(this.currentBatchTimer);\n this.currentBatchTimer = null;\n if (typeof CloseEvent !== \"undefined\") {\n this.onclose(new CloseEvent(\"close\", opts));\n } else {\n this.onclose(opts);\n }\n }\n ajax(method, contentType, body, onCallerTimeout, callback) {\n let req;\n let ontimeout = () => {\n this.reqs.delete(req);\n onCallerTimeout();\n };\n req = Ajax.request(method, this.endpointURL(), contentType, body, this.timeout, ontimeout, (resp) => {\n this.reqs.delete(req);\n if (this.isActive()) {\n callback(resp);\n }\n });\n this.reqs.add(req);\n }\n};\n\n// js/phoenix/presence.js\nvar Presence = class {\n constructor(channel, opts = {}) {\n let events = opts.events || { state: \"presence_state\", diff: \"presence_diff\" };\n this.state = {};\n this.pendingDiffs = [];\n this.channel = channel;\n this.joinRef = null;\n this.caller = {\n onJoin: function() {\n },\n onLeave: function() {\n },\n onSync: function() {\n }\n };\n this.channel.on(events.state, (newState) => {\n let { onJoin, onLeave, onSync } = this.caller;\n this.joinRef = this.channel.joinRef();\n this.state = Presence.syncState(this.state, newState, onJoin, onLeave);\n this.pendingDiffs.forEach((diff) => {\n this.state = Presence.syncDiff(this.state, diff, onJoin, onLeave);\n });\n this.pendingDiffs = [];\n onSync();\n });\n this.channel.on(events.diff, (diff) => {\n let { onJoin, onLeave, onSync } = this.caller;\n if (this.inPendingSyncState()) {\n this.pendingDiffs.push(diff);\n } else {\n this.state = Presence.syncDiff(this.state, diff, onJoin, onLeave);\n onSync();\n }\n });\n }\n onJoin(callback) {\n this.caller.onJoin = callback;\n }\n onLeave(callback) {\n this.caller.onLeave = callback;\n }\n onSync(callback) {\n this.caller.onSync = callback;\n }\n list(by) {\n return Presence.list(this.state, by);\n }\n inPendingSyncState() {\n return !this.joinRef || this.joinRef !== this.channel.joinRef();\n }\n // lower-level public static API\n /**\n * Used to sync the list of presences on the server\n * with the client's state. An optional `onJoin` and `onLeave` callback can\n * be provided to react to changes in the client's local presences across\n * disconnects and reconnects with the server.\n *\n * @returns {Presence}\n */\n static syncState(currentState, newState, onJoin, onLeave) {\n let state = this.clone(currentState);\n let joins = {};\n let leaves = {};\n this.map(state, (key, presence) => {\n if (!newState[key]) {\n leaves[key] = presence;\n }\n });\n this.map(newState, (key, newPresence) => {\n let currentPresence = state[key];\n if (currentPresence) {\n let newRefs = newPresence.metas.map((m) => m.phx_ref);\n let curRefs = currentPresence.metas.map((m) => m.phx_ref);\n let joinedMetas = newPresence.metas.filter((m) => curRefs.indexOf(m.phx_ref) < 0);\n let leftMetas = currentPresence.metas.filter((m) => newRefs.indexOf(m.phx_ref) < 0);\n if (joinedMetas.length > 0) {\n joins[key] = newPresence;\n joins[key].metas = joinedMetas;\n }\n if (leftMetas.length > 0) {\n leaves[key] = this.clone(currentPresence);\n leaves[key].metas = leftMetas;\n }\n } else {\n joins[key] = newPresence;\n }\n });\n return this.syncDiff(state, { joins, leaves }, onJoin, onLeave);\n }\n /**\n *\n * Used to sync a diff of presence join and leave\n * events from the server, as they happen. Like `syncState`, `syncDiff`\n * accepts optional `onJoin` and `onLeave` callbacks to react to a user\n * joining or leaving from a device.\n *\n * @returns {Presence}\n */\n static syncDiff(state, diff, onJoin, onLeave) {\n let { joins, leaves } = this.clone(diff);\n if (!onJoin) {\n onJoin = function() {\n };\n }\n if (!onLeave) {\n onLeave = function() {\n };\n }\n this.map(joins, (key, newPresence) => {\n let currentPresence = state[key];\n state[key] = this.clone(newPresence);\n if (currentPresence) {\n let joinedRefs = state[key].metas.map((m) => m.phx_ref);\n let curMetas = currentPresence.metas.filter((m) => joinedRefs.indexOf(m.phx_ref) < 0);\n state[key].metas.unshift(...curMetas);\n }\n onJoin(key, currentPresence, newPresence);\n });\n this.map(leaves, (key, leftPresence) => {\n let currentPresence = state[key];\n if (!currentPresence) {\n return;\n }\n let refsToRemove = leftPresence.metas.map((m) => m.phx_ref);\n currentPresence.metas = currentPresence.metas.filter((p) => {\n return refsToRemove.indexOf(p.phx_ref) < 0;\n });\n onLeave(key, currentPresence, leftPresence);\n if (currentPresence.metas.length === 0) {\n delete state[key];\n }\n });\n return state;\n }\n /**\n * Returns the array of presences, with selected metadata.\n *\n * @param {Object} presences\n * @param {Function} chooser\n *\n * @returns {Presence}\n */\n static list(presences, chooser) {\n if (!chooser) {\n chooser = function(key, pres) {\n return pres;\n };\n }\n return this.map(presences, (key, presence) => {\n return chooser(key, presence);\n });\n }\n // private\n static map(obj, func) {\n return Object.getOwnPropertyNames(obj).map((key) => func(key, obj[key]));\n }\n static clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n};\n\n// js/phoenix/serializer.js\nvar serializer_default = {\n HEADER_LENGTH: 1,\n META_LENGTH: 4,\n KINDS: { push: 0, reply: 1, broadcast: 2 },\n encode(msg, callback) {\n if (msg.payload.constructor === ArrayBuffer) {\n return callback(this.binaryEncode(msg));\n } else {\n let payload = [msg.join_ref, msg.ref, msg.topic, msg.event, msg.payload];\n return callback(JSON.stringify(payload));\n }\n },\n decode(rawPayload, callback) {\n if (rawPayload.constructor === ArrayBuffer) {\n return callback(this.binaryDecode(rawPayload));\n } else {\n let [join_ref, ref, topic, event, payload] = JSON.parse(rawPayload);\n return callback({ join_ref, ref, topic, event, payload });\n }\n },\n // private\n binaryEncode(message) {\n let { join_ref, ref, event, topic, payload } = message;\n let metaLength = this.META_LENGTH + join_ref.length + ref.length + topic.length + event.length;\n let header = new ArrayBuffer(this.HEADER_LENGTH + metaLength);\n let view = new DataView(header);\n let offset = 0;\n view.setUint8(offset++, this.KINDS.push);\n view.setUint8(offset++, join_ref.length);\n view.setUint8(offset++, ref.length);\n view.setUint8(offset++, topic.length);\n view.setUint8(offset++, event.length);\n Array.from(join_ref, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n Array.from(ref, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n Array.from(topic, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n Array.from(event, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n var combined = new Uint8Array(header.byteLength + payload.byteLength);\n combined.set(new Uint8Array(header), 0);\n combined.set(new Uint8Array(payload), header.byteLength);\n return combined.buffer;\n },\n binaryDecode(buffer) {\n let view = new DataView(buffer);\n let kind = view.getUint8(0);\n let decoder = new TextDecoder();\n switch (kind) {\n case this.KINDS.push:\n return this.decodePush(buffer, view, decoder);\n case this.KINDS.reply:\n return this.decodeReply(buffer, view, decoder);\n case this.KINDS.broadcast:\n return this.decodeBroadcast(buffer, view, decoder);\n }\n },\n decodePush(buffer, view, decoder) {\n let joinRefSize = view.getUint8(1);\n let topicSize = view.getUint8(2);\n let eventSize = view.getUint8(3);\n let offset = this.HEADER_LENGTH + this.META_LENGTH - 1;\n let joinRef = decoder.decode(buffer.slice(offset, offset + joinRefSize));\n offset = offset + joinRefSize;\n let topic = decoder.decode(buffer.slice(offset, offset + topicSize));\n offset = offset + topicSize;\n let event = decoder.decode(buffer.slice(offset, offset + eventSize));\n offset = offset + eventSize;\n let data = buffer.slice(offset, buffer.byteLength);\n return { join_ref: joinRef, ref: null, topic, event, payload: data };\n },\n decodeReply(buffer, view, decoder) {\n let joinRefSize = view.getUint8(1);\n let refSize = view.getUint8(2);\n let topicSize = view.getUint8(3);\n let eventSize = view.getUint8(4);\n let offset = this.HEADER_LENGTH + this.META_LENGTH;\n let joinRef = decoder.decode(buffer.slice(offset, offset + joinRefSize));\n offset = offset + joinRefSize;\n let ref = decoder.decode(buffer.slice(offset, offset + refSize));\n offset = offset + refSize;\n let topic = decoder.decode(buffer.slice(offset, offset + topicSize));\n offset = offset + topicSize;\n let event = decoder.decode(buffer.slice(offset, offset + eventSize));\n offset = offset + eventSize;\n let data = buffer.slice(offset, buffer.byteLength);\n let payload = { status: event, response: data };\n return { join_ref: joinRef, ref, topic, event: CHANNEL_EVENTS.reply, payload };\n },\n decodeBroadcast(buffer, view, decoder) {\n let topicSize = view.getUint8(1);\n let eventSize = view.getUint8(2);\n let offset = this.HEADER_LENGTH + 2;\n let topic = decoder.decode(buffer.slice(offset, offset + topicSize));\n offset = offset + topicSize;\n let event = decoder.decode(buffer.slice(offset, offset + eventSize));\n offset = offset + eventSize;\n let data = buffer.slice(offset, buffer.byteLength);\n return { join_ref: null, ref: null, topic, event, payload: data };\n }\n};\n\n// js/phoenix/socket.js\nvar Socket = class {\n constructor(endPoint, opts = {}) {\n this.stateChangeCallbacks = { open: [], close: [], error: [], message: [] };\n this.channels = [];\n this.sendBuffer = [];\n this.ref = 0;\n this.timeout = opts.timeout || DEFAULT_TIMEOUT;\n this.transport = opts.transport || global.WebSocket || LongPoll;\n this.longPollFallbackMs = opts.longPollFallbackMs;\n this.fallbackTimer = null;\n this.sessionStore = opts.sessionStorage || global.sessionStorage;\n this.establishedConnections = 0;\n this.defaultEncoder = serializer_default.encode.bind(serializer_default);\n this.defaultDecoder = serializer_default.decode.bind(serializer_default);\n this.closeWasClean = false;\n this.binaryType = opts.binaryType || \"arraybuffer\";\n this.connectClock = 1;\n if (this.transport !== LongPoll) {\n this.encode = opts.encode || this.defaultEncoder;\n this.decode = opts.decode || this.defaultDecoder;\n } else {\n this.encode = this.defaultEncoder;\n this.decode = this.defaultDecoder;\n }\n let awaitingConnectionOnPageShow = null;\n if (phxWindow && phxWindow.addEventListener) {\n phxWindow.addEventListener(\"pagehide\", (_e) => {\n if (this.conn) {\n this.disconnect();\n awaitingConnectionOnPageShow = this.connectClock;\n }\n });\n phxWindow.addEventListener(\"pageshow\", (_e) => {\n if (awaitingConnectionOnPageShow === this.connectClock) {\n awaitingConnectionOnPageShow = null;\n this.connect();\n }\n });\n }\n this.heartbeatIntervalMs = opts.heartbeatIntervalMs || 3e4;\n this.rejoinAfterMs = (tries) => {\n if (opts.rejoinAfterMs) {\n return opts.rejoinAfterMs(tries);\n } else {\n return [1e3, 2e3, 5e3][tries - 1] || 1e4;\n }\n };\n this.reconnectAfterMs = (tries) => {\n if (opts.reconnectAfterMs) {\n return opts.reconnectAfterMs(tries);\n } else {\n return [10, 50, 100, 150, 200, 250, 500, 1e3, 2e3][tries - 1] || 5e3;\n }\n };\n this.logger = opts.logger || null;\n if (!this.logger && opts.debug) {\n this.logger = (kind, msg, data) => {\n console.log(`${kind}: ${msg}`, data);\n };\n }\n this.longpollerTimeout = opts.longpollerTimeout || 2e4;\n this.params = closure(opts.params || {});\n this.endPoint = `${endPoint}/${TRANSPORTS.websocket}`;\n this.vsn = opts.vsn || DEFAULT_VSN;\n this.heartbeatTimeoutTimer = null;\n this.heartbeatTimer = null;\n this.pendingHeartbeatRef = null;\n this.reconnectTimer = new Timer(() => {\n this.teardown(() => this.connect());\n }, this.reconnectAfterMs);\n }\n /**\n * Returns the LongPoll transport reference\n */\n getLongPollTransport() {\n return LongPoll;\n }\n /**\n * Disconnects and replaces the active transport\n *\n * @param {Function} newTransport - The new transport class to instantiate\n *\n */\n replaceTransport(newTransport) {\n this.connectClock++;\n this.closeWasClean = true;\n clearTimeout(this.fallbackTimer);\n this.reconnectTimer.reset();\n if (this.conn) {\n this.conn.close();\n this.conn = null;\n }\n this.transport = newTransport;\n }\n /**\n * Returns the socket protocol\n *\n * @returns {string}\n */\n protocol() {\n return location.protocol.match(/^https/) ? \"wss\" : \"ws\";\n }\n /**\n * The fully qualified socket url\n *\n * @returns {string}\n */\n endPointURL() {\n let uri = Ajax.appendParams(\n Ajax.appendParams(this.endPoint, this.params()),\n { vsn: this.vsn }\n );\n if (uri.charAt(0) !== \"/\") {\n return uri;\n }\n if (uri.charAt(1) === \"/\") {\n return `${this.protocol()}:${uri}`;\n }\n return `${this.protocol()}://${location.host}${uri}`;\n }\n /**\n * Disconnects the socket\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes for valid status codes.\n *\n * @param {Function} callback - Optional callback which is called after socket is disconnected.\n * @param {integer} code - A status code for disconnection (Optional).\n * @param {string} reason - A textual description of the reason to disconnect. (Optional)\n */\n disconnect(callback, code, reason) {\n this.connectClock++;\n this.closeWasClean = true;\n clearTimeout(this.fallbackTimer);\n this.reconnectTimer.reset();\n this.teardown(callback, code, reason);\n }\n /**\n *\n * @param {Object} params - The params to send when connecting, for example `{user_id: userToken}`\n *\n * Passing params to connect is deprecated; pass them in the Socket constructor instead:\n * `new Socket(\"/socket\", {params: {user_id: userToken}})`.\n */\n connect(params) {\n if (params) {\n console && console.log(\"passing params to connect is deprecated. Instead pass :params to the Socket constructor\");\n this.params = closure(params);\n }\n if (this.conn) {\n return;\n }\n if (this.longPollFallbackMs && this.transport !== LongPoll) {\n this.connectWithFallback(LongPoll, this.longPollFallbackMs);\n } else {\n this.transportConnect();\n }\n }\n /**\n * Logs the message. Override `this.logger` for specialized logging. noops by default\n * @param {string} kind\n * @param {string} msg\n * @param {Object} data\n */\n log(kind, msg, data) {\n this.logger && this.logger(kind, msg, data);\n }\n /**\n * Returns true if a logger has been set on this socket.\n */\n hasLogger() {\n return this.logger !== null;\n }\n /**\n * Registers callbacks for connection open events\n *\n * @example socket.onOpen(function(){ console.info(\"the socket was opened\") })\n *\n * @param {Function} callback\n */\n onOpen(callback) {\n let ref = this.makeRef();\n this.stateChangeCallbacks.open.push([ref, callback]);\n return ref;\n }\n /**\n * Registers callbacks for connection close events\n * @param {Function} callback\n */\n onClose(callback) {\n let ref = this.makeRef();\n this.stateChangeCallbacks.close.push([ref, callback]);\n return ref;\n }\n /**\n * Registers callbacks for connection error events\n *\n * @example socket.onError(function(error){ alert(\"An error occurred\") })\n *\n * @param {Function} callback\n */\n onError(callback) {\n let ref = this.makeRef();\n this.stateChangeCallbacks.error.push([ref, callback]);\n return ref;\n }\n /**\n * Registers callbacks for connection message events\n * @param {Function} callback\n */\n onMessage(callback) {\n let ref = this.makeRef();\n this.stateChangeCallbacks.message.push([ref, callback]);\n return ref;\n }\n /**\n * Pings the server and invokes the callback with the RTT in milliseconds\n * @param {Function} callback\n *\n * Returns true if the ping was pushed or false if unable to be pushed.\n */\n ping(callback) {\n if (!this.isConnected()) {\n return false;\n }\n let ref = this.makeRef();\n let startTime = Date.now();\n this.push({ topic: \"phoenix\", event: \"heartbeat\", payload: {}, ref });\n let onMsgRef = this.onMessage((msg) => {\n if (msg.ref === ref) {\n this.off([onMsgRef]);\n callback(Date.now() - startTime);\n }\n });\n return true;\n }\n /**\n * @private\n */\n transportConnect() {\n this.connectClock++;\n this.closeWasClean = false;\n this.conn = new this.transport(this.endPointURL());\n this.conn.binaryType = this.binaryType;\n this.conn.timeout = this.longpollerTimeout;\n this.conn.onopen = () => this.onConnOpen();\n this.conn.onerror = (error) => this.onConnError(error);\n this.conn.onmessage = (event) => this.onConnMessage(event);\n this.conn.onclose = (event) => this.onConnClose(event);\n }\n getSession(key) {\n return this.sessionStore && this.sessionStore.getItem(key);\n }\n storeSession(key, val) {\n this.sessionStore && this.sessionStore.setItem(key, val);\n }\n connectWithFallback(fallbackTransport, fallbackThreshold = 2500) {\n clearTimeout(this.fallbackTimer);\n let established = false;\n let primaryTransport = true;\n let openRef, errorRef;\n let fallback = (reason) => {\n this.log(\"transport\", `falling back to ${fallbackTransport.name}...`, reason);\n this.off([openRef, errorRef]);\n primaryTransport = false;\n this.storeSession(\"phx:longpoll\", \"true\");\n this.replaceTransport(fallbackTransport);\n this.transportConnect();\n };\n if (this.getSession(\"phx:longpoll\")) {\n return fallback(\"memorized\");\n }\n this.fallbackTimer = setTimeout(fallback, fallbackThreshold);\n errorRef = this.onError((reason) => {\n this.log(\"transport\", \"error\", reason);\n if (primaryTransport && !established) {\n clearTimeout(this.fallbackTimer);\n fallback(reason);\n }\n });\n this.onOpen(() => {\n established = true;\n if (!primaryTransport) {\n return console.log(\"transport\", `established ${fallbackTransport.name} fallback`);\n }\n clearTimeout(this.fallbackTimer);\n this.fallbackTimer = setTimeout(fallback, fallbackThreshold);\n this.ping((rtt) => {\n this.log(\"transport\", \"connected to primary after\", rtt);\n clearTimeout(this.fallbackTimer);\n });\n });\n this.transportConnect();\n }\n clearHeartbeats() {\n clearTimeout(this.heartbeatTimer);\n clearTimeout(this.heartbeatTimeoutTimer);\n }\n onConnOpen() {\n if (this.hasLogger())\n this.log(\"transport\", `${this.transport.name} connected to ${this.endPointURL()}`);\n this.closeWasClean = false;\n this.establishedConnections++;\n this.flushSendBuffer();\n this.reconnectTimer.reset();\n this.resetHeartbeat();\n this.stateChangeCallbacks.open.forEach(([, callback]) => callback());\n }\n /**\n * @private\n */\n heartbeatTimeout() {\n if (this.pendingHeartbeatRef) {\n this.pendingHeartbeatRef = null;\n if (this.hasLogger()) {\n this.log(\"transport\", \"heartbeat timeout. Attempting to re-establish connection\");\n }\n this.triggerChanError();\n this.closeWasClean = false;\n this.teardown(() => this.reconnectTimer.scheduleTimeout(), WS_CLOSE_NORMAL, \"heartbeat timeout\");\n }\n }\n resetHeartbeat() {\n if (this.conn && this.conn.skipHeartbeat) {\n return;\n }\n this.pendingHeartbeatRef = null;\n this.clearHeartbeats();\n this.heartbeatTimer = setTimeout(() => this.sendHeartbeat(), this.heartbeatIntervalMs);\n }\n teardown(callback, code, reason) {\n if (!this.conn) {\n return callback && callback();\n }\n this.waitForBufferDone(() => {\n if (this.conn) {\n if (code) {\n this.conn.close(code, reason || \"\");\n } else {\n this.conn.close();\n }\n }\n this.waitForSocketClosed(() => {\n if (this.conn) {\n this.conn.onopen = function() {\n };\n this.conn.onerror = function() {\n };\n this.conn.onmessage = function() {\n };\n this.conn.onclose = function() {\n };\n this.conn = null;\n }\n callback && callback();\n });\n });\n }\n waitForBufferDone(callback, tries = 1) {\n if (tries === 5 || !this.conn || !this.conn.bufferedAmount) {\n callback();\n return;\n }\n setTimeout(() => {\n this.waitForBufferDone(callback, tries + 1);\n }, 150 * tries);\n }\n waitForSocketClosed(callback, tries = 1) {\n if (tries === 5 || !this.conn || this.conn.readyState === SOCKET_STATES.closed) {\n callback();\n return;\n }\n setTimeout(() => {\n this.waitForSocketClosed(callback, tries + 1);\n }, 150 * tries);\n }\n onConnClose(event) {\n let closeCode = event && event.code;\n if (this.hasLogger())\n this.log(\"transport\", \"close\", event);\n this.triggerChanError();\n this.clearHeartbeats();\n if (!this.closeWasClean && closeCode !== 1e3) {\n this.reconnectTimer.scheduleTimeout();\n }\n this.stateChangeCallbacks.close.forEach(([, callback]) => callback(event));\n }\n /**\n * @private\n */\n onConnError(error) {\n if (this.hasLogger())\n this.log(\"transport\", error);\n let transportBefore = this.transport;\n let establishedBefore = this.establishedConnections;\n this.stateChangeCallbacks.error.forEach(([, callback]) => {\n callback(error, transportBefore, establishedBefore);\n });\n if (transportBefore === this.transport || establishedBefore > 0) {\n this.triggerChanError();\n }\n }\n /**\n * @private\n */\n triggerChanError() {\n this.channels.forEach((channel) => {\n if (!(channel.isErrored() || channel.isLeaving() || channel.isClosed())) {\n channel.trigger(CHANNEL_EVENTS.error);\n }\n });\n }\n /**\n * @returns {string}\n */\n connectionState() {\n switch (this.conn && this.conn.readyState) {\n case SOCKET_STATES.connecting:\n return \"connecting\";\n case SOCKET_STATES.open:\n return \"open\";\n case SOCKET_STATES.closing:\n return \"closing\";\n default:\n return \"closed\";\n }\n }\n /**\n * @returns {boolean}\n */\n isConnected() {\n return this.connectionState() === \"open\";\n }\n /**\n * @private\n *\n * @param {Channel}\n */\n remove(channel) {\n this.off(channel.stateChangeRefs);\n this.channels = this.channels.filter((c) => c.joinRef() !== channel.joinRef());\n }\n /**\n * Removes `onOpen`, `onClose`, `onError,` and `onMessage` registrations.\n *\n * @param {refs} - list of refs returned by calls to\n * `onOpen`, `onClose`, `onError,` and `onMessage`\n */\n off(refs) {\n for (let key in this.stateChangeCallbacks) {\n this.stateChangeCallbacks[key] = this.stateChangeCallbacks[key].filter(([ref]) => {\n return refs.indexOf(ref) === -1;\n });\n }\n }\n /**\n * Initiates a new channel for the given topic\n *\n * @param {string} topic\n * @param {Object} chanParams - Parameters for the channel\n * @returns {Channel}\n */\n channel(topic, chanParams = {}) {\n let chan = new Channel(topic, chanParams, this);\n this.channels.push(chan);\n return chan;\n }\n /**\n * @param {Object} data\n */\n push(data) {\n if (this.hasLogger()) {\n let { topic, event, payload, ref, join_ref } = data;\n this.log(\"push\", `${topic} ${event} (${join_ref}, ${ref})`, payload);\n }\n if (this.isConnected()) {\n this.encode(data, (result) => this.conn.send(result));\n } else {\n this.sendBuffer.push(() => this.encode(data, (result) => this.conn.send(result)));\n }\n }\n /**\n * Return the next message ref, accounting for overflows\n * @returns {string}\n */\n makeRef() {\n let newRef = this.ref + 1;\n if (newRef === this.ref) {\n this.ref = 0;\n } else {\n this.ref = newRef;\n }\n return this.ref.toString();\n }\n sendHeartbeat() {\n if (this.pendingHeartbeatRef && !this.isConnected()) {\n return;\n }\n this.pendingHeartbeatRef = this.makeRef();\n this.push({ topic: \"phoenix\", event: \"heartbeat\", payload: {}, ref: this.pendingHeartbeatRef });\n this.heartbeatTimeoutTimer = setTimeout(() => this.heartbeatTimeout(), this.heartbeatIntervalMs);\n }\n flushSendBuffer() {\n if (this.isConnected() && this.sendBuffer.length > 0) {\n this.sendBuffer.forEach((callback) => callback());\n this.sendBuffer = [];\n }\n }\n onConnMessage(rawMessage) {\n this.decode(rawMessage.data, (msg) => {\n let { topic, event, payload, ref, join_ref } = msg;\n if (ref && ref === this.pendingHeartbeatRef) {\n this.clearHeartbeats();\n this.pendingHeartbeatRef = null;\n this.heartbeatTimer = setTimeout(() => this.sendHeartbeat(), this.heartbeatIntervalMs);\n }\n if (this.hasLogger())\n this.log(\"receive\", `${payload.status || \"\"} ${topic} ${event} ${ref && \"(\" + ref + \")\" || \"\"}`, payload);\n for (let i = 0; i < this.channels.length; i++) {\n const channel = this.channels[i];\n if (!channel.isMember(topic, event, payload, join_ref)) {\n continue;\n }\n channel.trigger(event, payload, ref, join_ref);\n }\n for (let i = 0; i < this.stateChangeCallbacks.message.length; i++) {\n let [, callback] = this.stateChangeCallbacks.message[i];\n callback(msg);\n }\n });\n }\n leaveOpenTopic(topic) {\n let dupChannel = this.channels.find((c) => c.topic === topic && (c.isJoined() || c.isJoining()));\n if (dupChannel) {\n if (this.hasLogger())\n this.log(\"transport\", `leaving duplicate topic \"${topic}\"`);\n dupChannel.leave();\n }\n }\n};\nexport {\n Channel,\n LongPoll,\n Presence,\n serializer_default as Serializer,\n Socket\n};\n//# sourceMappingURL=phoenix.mjs.map\n","import { take, put, call } from 'redux-saga/effects'\nimport { eventChannel } from 'redux-saga'\nimport { Socket } from \"phoenix\"\nimport {\n WEBSOCKET_MESSAGE_CHANGE,\n WEBSOCKET_MESSAGE_REMOVE,\n WEBSOCKET_MESSAGE_ADD,\n WEBSOCKET_URL,\n} from '../constants/actionTypes';\n\nconst createWebSocketConnection = (socketUrl) => {\n return new Promise((resolve, reject) => {\n if(!socketUrl) {\n reject('No socket url provided')\n return\n }\n\n let socket = new Socket(socketUrl)\n\n socket.connect()\n resolve(socket);\n });\n}\n\nfunction createSocketChannel(socket) {\n return eventChannel(emit => {\n\n const errorHandler = (errorEvent) => {\n const msg = errorEvent ? errorEvent.reason : \"Unknown error\"\n emit(new Error(msg))\n }\n\n let channel = socket.channel(\"realtime_updates\", {})\n\n channel.join()\n channel.onError(errorHandler)\n\n const add = channel.on('add', (payload) => {\n emit({ type: WEBSOCKET_MESSAGE_ADD, payload })\n })\n const change = channel.on('change', (payload) => {\n emit({ type: WEBSOCKET_MESSAGE_CHANGE, payload })\n })\n const remove = channel.on('remove', (payload) => {\n emit({ type: WEBSOCKET_MESSAGE_REMOVE, payload })\n })\n\n const unsubscribe = () => {\n channel.off('add', add)\n channel.off('change', change)\n channel.off('remove', remove)\n }\n\n return unsubscribe\n })\n}\n\nexport function* listenForSocketMessages() {\n const socketUrl = yield take(WEBSOCKET_URL)\n\n try {\n const socket = yield call(createWebSocketConnection, socketUrl.payload)\n const socketChannel = yield call(createSocketChannel, socket)\n\n while (true) {\n try {\n const action = yield take(socketChannel)\n yield put(action)\n } catch(err) {\n console.error('socket error:', err)\n // socketChannel.close()\n }\n }\n } catch(e) {\n console.error(e)\n }\n}\n","export const sortByDistance = (origin, points, opts = {}) => {\n const newPoints = JSON.parse(JSON.stringify(points));\n newPoints.sort((a, b) => {\n a.distance = distanceBetweenPoints(origin, a);\n b.distance = distanceBetweenPoints(origin, b);\n\n return a.distance - b.distance;\n });\n\n return newPoints;\n};\n\nconst distanceBetweenPoints = (p1, p2) => {\n return Math.abs(\n Math.sqrt((p1.y - p2.y) * (p1.y - p2.y) + (p1.x - p2.x) * (p1.x - p2.x))\n );\n};\n","\"use strict\";\n\nexports.__esModule = true;\nvar log2 = Math.log2 ? Math.log2 : function (x) {\n return Math.log(x) / Math.LN2;\n};\n\nexports.default = log2;","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.convertNeSwToNwSe = convertNeSwToNwSe;\nexports.convertNwSeToNeSw = convertNwSeToNeSw;\nexports.fitBounds = fitBounds;\nexports.meters2ScreenPixels = meters2ScreenPixels;\nexports.tile2LatLng = tile2LatLng;\nexports.latLng2Tile = latLng2Tile;\nexports.getTilesIds = getTilesIds;\n\nvar _log = require('./math/log2');\n\nvar _log2 = _interopRequireDefault(_log);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar GOOGLE_TILE_SIZE = 256;\n\nfunction latLng2World(_ref) {\n var lat = _ref.lat,\n lng = _ref.lng;\n\n var sin = Math.sin(lat * Math.PI / 180);\n var x = lng / 360 + 0.5;\n var y = 0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;\n\n y = y < 0 // eslint-disable-line\n ? 0 : y > 1 ? 1 : y;\n return { x: x, y: y };\n}\n\nfunction world2LatLng(_ref2) {\n var x = _ref2.x,\n y = _ref2.y;\n\n var n = Math.PI - 2 * Math.PI * y;\n\n // TODO test that this is faster\n // 360 * Math.atan(Math.exp((180 - y * 360) * Math.PI / 180)) / Math.PI - 90;\n return {\n lat: 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n))),\n lng: x * 360 - 180\n };\n}\n\n// Thank you wiki https://en.wikipedia.org/wiki/Geographic_coordinate_system\nfunction latLng2MetersPerDegree(_ref3) {\n var lat = _ref3.lat;\n\n var phi = lat * Math.PI / 180;\n var metersPerLatDegree = 111132.92 - 559.82 * Math.cos(2 * phi) + 1.175 * Math.cos(4 * phi) - 0.0023 * Math.cos(6 * phi);\n var metersPerLngDegree = 111412.84 * Math.cos(phi) - 93.5 * Math.cos(3 * phi) + 0.118 * Math.cos(5 * phi);\n return { metersPerLatDegree: metersPerLatDegree, metersPerLngDegree: metersPerLngDegree };\n}\n\nfunction meters2LatLngBounds(meters, _ref4) {\n var lat = _ref4.lat,\n lng = _ref4.lng;\n\n var _latLng2MetersPerDegr = latLng2MetersPerDegree({\n lat: lat\n }),\n metersPerLatDegree = _latLng2MetersPerDegr.metersPerLatDegree,\n metersPerLngDegree = _latLng2MetersPerDegr.metersPerLngDegree;\n\n var latDelta = 0.5 * meters / metersPerLatDegree;\n var lngDelta = 0.5 * meters / metersPerLngDegree;\n\n return {\n nw: {\n lat: lat - latDelta,\n lng: lng - lngDelta\n },\n se: {\n lat: lat + latDelta,\n lng: lng + lngDelta\n }\n };\n}\n\nfunction meters2WorldSize(meters, _ref5) {\n var lat = _ref5.lat,\n lng = _ref5.lng;\n\n var _meters2LatLngBounds = meters2LatLngBounds(meters, { lat: lat, lng: lng }),\n nw = _meters2LatLngBounds.nw,\n se = _meters2LatLngBounds.se;\n\n var nwWorld = latLng2World(nw);\n var seWorld = latLng2World(se);\n var w = Math.abs(seWorld.x - nwWorld.x);\n var h = Math.abs(seWorld.y - nwWorld.y);\n\n return { w: w, h: h };\n}\n\nfunction fitNwSe(nw, se, width, height) {\n var EPS = 0.000000001;\n var nwWorld = latLng2World(nw);\n var seWorld = latLng2World(se);\n var dx = nwWorld.x < seWorld.x ? seWorld.x - nwWorld.x : 1 - nwWorld.x + seWorld.x;\n var dy = seWorld.y - nwWorld.y;\n\n if (dx <= 0 && dy <= 0) {\n return null;\n }\n\n var zoomX = (0, _log2.default)(width / GOOGLE_TILE_SIZE / Math.abs(dx));\n var zoomY = (0, _log2.default)(height / GOOGLE_TILE_SIZE / Math.abs(dy));\n var zoom = Math.floor(EPS + Math.min(zoomX, zoomY));\n\n // TODO find center just unproject middle world point\n var middle = {\n x: nwWorld.x < seWorld.x // eslint-disable-line\n ? 0.5 * (nwWorld.x + seWorld.x) : nwWorld.x + seWorld.x - 1 > 0 ? 0.5 * (nwWorld.x + seWorld.x - 1) : 0.5 * (1 + nwWorld.x + seWorld.x),\n y: 0.5 * (nwWorld.y + seWorld.y)\n };\n\n var scale = Math.pow(2, zoom);\n var halfW = width / scale / GOOGLE_TILE_SIZE / 2;\n var halfH = height / scale / GOOGLE_TILE_SIZE / 2;\n\n var newNW = world2LatLng({\n x: middle.x - halfW,\n y: middle.y - halfH\n });\n\n var newSE = world2LatLng({\n x: middle.x + halfW,\n y: middle.y + halfH\n });\n\n return {\n center: world2LatLng(middle),\n zoom: zoom,\n newBounds: {\n nw: newNW,\n se: newSE\n }\n };\n}\n\nfunction convertNeSwToNwSe(_ref6) {\n var ne = _ref6.ne,\n sw = _ref6.sw;\n\n return {\n nw: {\n lat: ne.lat,\n lng: sw.lng\n },\n se: {\n lat: sw.lat,\n lng: ne.lng\n }\n };\n}\n\nfunction convertNwSeToNeSw(_ref7) {\n var nw = _ref7.nw,\n se = _ref7.se;\n\n return {\n ne: {\n lat: nw.lat,\n lng: se.lng\n },\n sw: {\n lat: se.lat,\n lng: nw.lng\n }\n };\n}\n\nfunction fitBounds(_ref8, _ref9) {\n var nw = _ref8.nw,\n se = _ref8.se,\n ne = _ref8.ne,\n sw = _ref8.sw;\n var width = _ref9.width,\n height = _ref9.height;\n\n var fittedData = void 0;\n\n if (nw && se) {\n fittedData = fitNwSe(nw, se, width, height);\n } else {\n var calculatedNwSe = convertNeSwToNwSe({ ne: ne, sw: sw });\n fittedData = fitNwSe(calculatedNwSe.nw, calculatedNwSe.se, width, height);\n }\n\n return _extends({}, fittedData, {\n newBounds: _extends({}, fittedData.newBounds, convertNwSeToNeSw(fittedData.newBounds))\n });\n}\n\n// -------------------------------------------------------------------\n// Helpers to calc some markers size\n\nfunction meters2ScreenPixels(meters, _ref10, zoom) {\n var lat = _ref10.lat,\n lng = _ref10.lng;\n\n var _meters2WorldSize = meters2WorldSize(meters, { lat: lat, lng: lng }),\n w = _meters2WorldSize.w,\n h = _meters2WorldSize.h;\n\n var scale = Math.pow(2, zoom);\n var wScreen = w * scale * GOOGLE_TILE_SIZE;\n var hScreen = h * scale * GOOGLE_TILE_SIZE;\n return {\n w: wScreen,\n h: hScreen\n };\n}\n\n// --------------------------------------------------\n// Helper functions for working with svg tiles, (examples coming soon)\n\nfunction tile2LatLng(_ref11, zoom) {\n var x = _ref11.x,\n y = _ref11.y;\n\n var n = Math.PI - 2 * Math.PI * y / Math.pow(2, zoom);\n\n return {\n lat: 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n))),\n lng: x / Math.pow(2, zoom) * 360 - 180\n };\n}\n\nfunction latLng2Tile(_ref12, zoom) {\n var lat = _ref12.lat,\n lng = _ref12.lng;\n\n var worldCoords = latLng2World({ lat: lat, lng: lng });\n var scale = Math.pow(2, zoom);\n\n return {\n x: Math.floor(worldCoords.x * scale),\n y: Math.floor(worldCoords.y * scale)\n };\n}\n\nfunction getTilesIds(_ref13, zoom) {\n var from = _ref13.from,\n to = _ref13.to;\n\n var scale = Math.pow(2, zoom);\n\n var ids = [];\n for (var x = from.x; x !== (to.x + 1) % scale; x = (x + 1) % scale) {\n for (var y = from.y; y !== (to.y + 1) % scale; y = (y + 1) % scale) {\n ids.push([zoom, x, y]);\n }\n }\n\n return ids;\n}","'use strict';\n\nexports.__esModule = true;\n\nvar _utils = require('./utils.js');\n\nObject.keys(_utils).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _utils[key];\n }\n });\n});","var utils = require('../lib/utils'); // eslint-disable-line\nmodule.exports = utils;\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isDataView = function(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n var isArrayBufferView = ArrayBuffer.isView || function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue+','+value : value\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this, { body: this._bodyInit })\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = 'statusText' in options ? options.statusText : 'OK'\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n var xhr = new XMLHttpRequest()\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","export const ENDPOINT_MACHINES = '/proxy.php?service=places';\nexport const ENDPOINT_MACHINES_UPDATED = '/proxy.php?service=updated';\nexport const ENDPOINT_DISTANCE_MATRIX = '/proxy-google.php?service=distance-matrix';\nexport const ENDPOINT_SEND_FEEDBACK = '/wp-json/bankomat/feedback';\n","import 'whatwg-fetch';\n\nimport {\n ENDPOINT_MACHINES,\n ENDPOINT_MACHINES_UPDATED,\n ENDPOINT_DISTANCE_MATRIX\n} from '../constants/apiEndpoints';\n\nimport {\n sortByDistance\n} from '../utils/sortByDistance';\n\nexport function getMachines() {\n let timestamp = 0;\n\n const excludeMachineIds = ['B312CB31EE867C85887CD9A73E2D427D'];\n\n return fetch(ENDPOINT_MACHINES, {\n method: 'get'\n })\n .then(response => {\n timestamp = response.headers.get('Timestamp');\n return response.json();\n })\n .then(json => {\n const filteredJson = json.filter(\n item => !excludeMachineIds.includes(item.identifier)\n );\n return {\n status: 'ok',\n data: filteredJson,\n timestamp: timestamp\n };\n })\n .catch(function (error) {\n return {\n status: 'error',\n message: error.message\n };\n });\n}\n\nexport function getMachinesUpdated(requestTimestamp) {\n let timestamp = 0;\n return fetch(\n `${ENDPOINT_MACHINES_UPDATED}&last_updated=${requestTimestamp}`,\n {\n method: 'get'\n }\n )\n .then(response => {\n timestamp = response.headers.get('Timestamp');\n return response.json();\n })\n .then(json => {\n return {\n status: 'ok',\n data: json,\n timestamp: timestamp\n };\n })\n .catch(function (error) {\n return {\n status: 'error',\n message: error.message\n };\n });\n}\n\nexport function getDistanceMatrixClosestItem(userPos, items) {\n if (!userPos) {\n return {\n status: 'ok',\n data: {\n closestItem: []\n },\n };\n }\n\n let sortedFilteredItems = sortByDistance({\n x: userPos.lng,\n y: userPos.lat\n }, items);\n\n\n sortedFilteredItems = sortedFilteredItems.slice(0, 24);\n\n const destinations = sortedFilteredItems.map(item => [\n parseFloat(item.point.coordinates[1]),\n parseFloat(item.point.coordinates[0]),\n ]);\n\n\n return fetch(ENDPOINT_DISTANCE_MATRIX, {\n method: 'post',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n destinations,\n origins: [\n [userPos.lat, userPos.lng]\n ],\n })\n })\n .then(response => {\n return response.json();\n })\n .then(json => {\n const rows = json.rows[0].elements;\n let enumeratedRows = rows.map((row, index) => {\n return { index: index, row };\n });\n\n enumeratedRows = enumeratedRows.filter(\n ({ row }) => row.status === 'OK'\n );\n enumeratedRows.sort(({ row: rowA }, { row: rowB }) => {\n return rowA.duration.value - rowB.duration.value;\n });\n\n let closestIndex = 0;\n\n if (enumeratedRows.length) {\n closestIndex = enumeratedRows[0].index;\n }\n\n const closestItem = sortedFilteredItems[closestIndex];\n\n return {\n status: 'ok',\n data: {\n closestItem: closestItem\n },\n };\n })\n .catch(function (error) {\n return {\n status: 'error',\n message: error.message\n };\n });\n}\n","import {\n call,\n put,\n select,\n all,\n takeLatest,\n takeEvery\n} from 'redux-saga/effects';\nimport { delay } from 'redux-saga';\nimport * as actionCreators from '../actions/actionCreators';\nimport { updateFilter } from '../utils/updateFilter';\nimport { MIN_ZOOM, INITIAL_ZOOM, CENTER_ZOOM, DEFAULT_CENTER } from '../constants/map';\n\nimport {\n INIT,\n FETCH_MACHINES,\n FETCH_MACHINES_SUCCESS,\n FETCH_MACHINES_UPDATED,\n FETCH_EXCHANGERATES,\n SET_CENTER_TO_CURRENT_COORDINATES,\n CHECK_DEVICE,\n USER_POSITION_FETCHED,\n WEBSOCKET_CONNECT_AND_LISTEN,\n SET_FILTER,\n SET_CLOSEST_FILTERED_MARKER\n} from '../constants/actionTypes';\nimport { listenForSocketMessages } from './sockets';\nimport {\n sortByDistance\n} from '../utils/sortByDistance';\nimport { fitBounds } from 'google-map-react/utils';\n\nimport {\n getMachines,\n getMachinesUpdated,\n getDistanceMatrixClosestItem\n} from '../api';\n\nfunction* callGetMachines() {\n const result = yield call(getMachines);\n\n if (result.status === 'ok') {\n yield put(\n actionCreators.fetchMachinesSuccess(result.data, result.timestamp)\n );\n } else {\n yield put(actionCreators.fetchMachinesFailure(result.message));\n }\n}\n\nfunction* callGetMachinesUpdated() {\n const state = yield select();\n const { items, timestamp } = state.map;\n const result = yield call(getMachinesUpdated, timestamp);\n\n if (result.status === 'ok') {\n const data = result.data;\n const newTimestamp = result.timestamp;\n const ids = data.map(item => item.identifier);\n const updatedItems = items.filter(item =>\n ids.includes(item.identifier)\n );\n const updatedIds = updatedItems.map(item => item.identifier);\n const newIds = ids.filter(id => !updatedIds.includes(id));\n const newItems = data.filter(item => newIds.includes(item.identifier));\n\n updatedIds.forEach(id => {\n const index = items.findIndex(x => x.identifier === id);\n const indexUpdated = data.findIndex(x => x.identifier === id);\n items[index] = data[indexUpdated];\n });\n\n const finalItems = items.concat(newItems);\n\n yield put(\n actionCreators.fetchMachinesUpdatedSuccess(finalItems, newTimestamp)\n );\n } else {\n yield put(actionCreators.fetchMachinesUpdatedFailure(result.message));\n }\n}\n\nfunction* getUserPosition() {\n const state = yield select();\n const externalGeolocation = state.map.externalGeolocation;\n\n const position = {};\n\n if (externalGeolocation) {\n window.onExternalLocationSuccess = (lat, lng) => {\n const location = { coords: { latitude: lat, longitude: lng } };\n position.on({ location });\n };\n window.onExternalLocationError = error => position.on({ error });\n window.webkit.messageHandlers['scriptHandler'].postMessage(\n 'requestLocation'\n );\n\n return {\n getLocation: () => new Promise(resolve => (position.on = resolve))\n };\n }\n\n if (navigator.geolocation) {\n const timeoutId = setTimeout(() => {\n let error = new Error(\"No choice made by user, time out\");\n error.code = 99; // Custom error\n position.on({ error })\n }, 20000);\n\n navigator.geolocation.getCurrentPosition(\n location => {\n clearTimeout(timeoutId);\n position.on({ location })\n },\n error => {\n clearTimeout(timeoutId);\n position.on({ error })\n },\n {timeout: 5000}\n );\n\n return {\n getLocation: () => new Promise(resolve => (position.on = resolve))\n };\n }\n\n return {\n getLocation: null,\n };\n}\n\nfunction* callGetUserPosition() {\n const { getLocation } = yield call(getUserPosition);\n const { error, location } = getLocation ? yield call(getLocation) : {};\n\n if (error || !getLocation) {\n yield put(actionCreators.setUserPosError(error));\n yield put(actionCreators.setCenter(DEFAULT_CENTER, false));\n yield put(actionCreators.setZoom(INITIAL_ZOOM, false));\n } else {\n yield put(\n actionCreators.setCenter({\n lat: location.coords.latitude,\n lng: location.coords.longitude\n })\n );\n yield put(\n actionCreators.setUserPos({\n lat: location.coords.latitude,\n lng: location.coords.longitude\n })\n );\n yield put(\n actionCreators.setZoom(CENTER_ZOOM)\n )\n }\n\n yield put(\n actionCreators.userPositionFetched()\n );\n}\n\nfunction* callCheckForQueryParameters() {\n if (!('URLSearchParams' in window)) {\n return;\n }\n\n const urlParams = new URLSearchParams(window.location.search);\n const state = yield select();\n\n const { userPos } = state.map;\n\n if (urlParams.has('marker')) {\n const { items } = state.map;\n const marker = items.find(\n item => item.identifier === urlParams.get('marker')\n );\n yield put(actionCreators.setMarker(marker));\n const center = {\n lat: marker.point.coordinates[1],\n lng: marker.point.coordinates[0]\n };\n yield put(actionCreators.setCenter(center, false));\n yield put(actionCreators.setZoom(CENTER_ZOOM, false));\n } else if (urlParams.has('filter')) { // only apply filter if no marker is selected\n const urlFilters = JSON.parse(decodeURIComponent(urlParams.get('filter')));\n const { filter } = state.map;\n let updatedFilter = [...filter];\n\n Object.keys(urlFilters).forEach((currency) => {\n urlFilters[currency].forEach((denomination) => {\n if (currency === 'deposit') {\n updatedFilter = [\n ...updateFilter(\n updatedFilter,\n currency\n )\n ];\n } else {\n updatedFilter = [\n ...updateFilter(\n updatedFilter,\n `${currency}_${denomination}`\n )\n ];\n }\n });\n });\n\n yield put(actionCreators.setFilter(updatedFilter));\n\n if (userPos && urlParams.has('showClosestFiltered') && urlParams.get('showClosestFiltered')) {\n yield put(actionCreators.setClosestFilteredMarker());\n } else {\n yield put(actionCreators.setCenter(DEFAULT_CENTER, false));\n yield put(actionCreators.setZoom(INITIAL_ZOOM, false));\n }\n }\n}\n\nfunction* callSetFilteredItems() {\n const state = yield select();\n const { filter, items } = state.map;\n\n if(!items || !filter) {\n actionCreators.setFilteredItems([])\n }\n\n const filteredItems = items.filter(item => {\n let groups = item.groups\n ? item.groups\n : [];\n\n const identifiers = [\n ...item.services.map(service => service.identifier),\n ...groups\n ];\n\n return identifiers.includes(filter) && Array.isArray(item.point.coordinates);\n });\n\n yield put(\n actionCreators.setFilteredItems(filteredItems)\n );\n}\n\nfunction* callSetClosestFilteredMarker() {\n // This drove me insane;\n // The delay here causes the userPos value to reach high enough granularity in decimals.\n // Without it, the closest machine calculation is slightly off, by around ~1-2km!?\n // I have no idea why this is ¯\\_(ツ)_/¯\n yield delay(300);\n\n const state = yield select();\n const { filteredItems, userPos, mapContainerDimensions } = state.map;\n\n if (!userPos) return;\n\n // set closest item by naive/simple distance calc. before triggering a call to the dist. matrix api\n // this acts as a fallback and also gives the user a somewhat\n // correct result while waiting for the api call to finish\n\n\n const sorted = sortByDistance({\n x: userPos.lng,\n y: userPos.lat\n }, filteredItems);\n\n\n const closestNaiveItem = sorted[0];\n const closestNaiveCoords = {\n lat: closestNaiveItem.point.coordinates[1],\n lng: closestNaiveItem.point.coordinates[0]\n };\n\n const naiveBounds = {\n ne: {\n lat: Math.max(closestNaiveCoords.lat, userPos.lat),\n lng: Math.max(closestNaiveCoords.lng, userPos.lng)\n },\n sw: {\n lat: Math.min(closestNaiveCoords.lat, userPos.lat),\n lng: Math.min(closestNaiveCoords.lng, userPos.lng)\n }\n };\n\n const { center, zoom } = fitBounds(naiveBounds, mapContainerDimensions);\n yield put(actionCreators.setCenter(center, false));\n yield put(actionCreators.setZoom(zoom));\n\n\n // make the api call to get a better/proper dist. calc.\n const result = yield call(getDistanceMatrixClosestItem, userPos, filteredItems);\n if (result.status === 'ok') {\n const { closestItem } = result.data;\n\n if(!closestItem || !closestItem.point) {\n return;\n }\n\n const closestCoords = {\n lat: closestItem.point.coordinates[1],\n lng: closestItem.point.coordinates[0]\n };\n\n const bounds = {\n ne: {\n lat: Math.max(closestCoords.lat, userPos.lat),\n lng: Math.max(closestCoords.lng, userPos.lng)\n },\n sw: {\n lat: Math.min(closestCoords.lat, userPos.lat),\n lng: Math.min(closestCoords.lng, userPos.lng)\n }\n };\n\n const { center, zoom } = fitBounds(bounds, mapContainerDimensions);\n\n yield put(actionCreators.setCenter(center, false));\n yield put(actionCreators.setZoom(zoom));\n }\n}\n\nfunction* init() {\n yield put({ type: FETCH_MACHINES });\n yield put({ type: FETCH_EXCHANGERATES });\n yield put({ type: CHECK_DEVICE });\n yield put({ type: WEBSOCKET_CONNECT_AND_LISTEN });\n}\n\nexport default function* root() {\n // DEBUG\n // uncomment this to log every state change to the console\n // yield takeEvery('*', function* logger(action) {\n // const state = yield select();\n // console.log('action', action);\n // console.log('state after', state);\n // });\n\n yield all([\n takeLatest(WEBSOCKET_CONNECT_AND_LISTEN, listenForSocketMessages),\n takeLatest(FETCH_MACHINES, callGetMachines),\n takeLatest(FETCH_MACHINES_SUCCESS, callGetUserPosition),\n takeLatest(FETCH_MACHINES_UPDATED, callGetMachinesUpdated),\n takeLatest(SET_CENTER_TO_CURRENT_COORDINATES, callGetUserPosition),\n takeLatest(USER_POSITION_FETCHED, callCheckForQueryParameters),\n takeLatest(SET_FILTER, callSetFilteredItems),\n takeLatest(SET_CLOSEST_FILTERED_MARKER, callSetClosestFilteredMarker),\n takeLatest(INIT, init)\n ]);\n}\n\n","import { INITIAL_ZOOM, DEFAULT_CENTER } from '../constants/map';\nimport {\n FETCH_MACHINES_SUCCESS,\n FETCH_MACHINES_UPDATED_SUCCESS,\n SET_CENTER,\n SET_ZOOM,\n SET_MARKER,\n SET_LIST_MARKERS,\n SET_LIST_ACTIVE,\n SET_FILTER,\n SET_FILTERED_ITEMS,\n SET_USER_POS,\n SET_USER_POS_ERROR,\n SET_MAP,\n SET_INFOWINDOW,\n SET_EXTERNAL_GEOLOCATION,\n SET_SEARCH_VALUE,\n USER_POSITION_FETCHED,\n WEBSOCKET_MESSAGE_CHANGE,\n WEBSOCKET_MESSAGE_REMOVE,\n WEBSOCKET_MESSAGE_ADD,\n WEBSOCKET_URL,\n QUERY_MARKER_OPENED,\n SET_MAP_CONTAINER_DIMENSIONS\n} from '../constants/actionTypes';\n\nconst initialState = {\n map: {},\n items: [],\n filteredItems: [],\n services: [],\n center: DEFAULT_CENTER,\n zoom: INITIAL_ZOOM,\n timestamp: 0,\n activeMarker: {},\n listMarkers: [],\n listActive: false,\n filter: [],\n userPos: null,\n externalGeolocation: false,\n fetchedMachines: false,\n fetchedUserPosition: false,\n socketUrl: null,\n infowindow: {},\n queryMarkerOpened: false,\n searchValue: '',\n mapContainerDimensions: {\n width: 500,\n height: 500\n }\n};\n\nexport default function map(state = initialState, action) {\n let newItems;\n\n switch (action.type) {\n case WEBSOCKET_URL:\n return Object.assign({}, state, {\n socketUrl: action.payload\n });\n case WEBSOCKET_MESSAGE_ADD:\n return Object.assign({}, state, {\n items: [...state.items, action.payload],\n });\n case WEBSOCKET_MESSAGE_CHANGE:\n // Switch item in items with payload\n // where item.identifier == payload.identifier\n newItems = state.items.map(\n (item) => item.identifier === action.payload.identifier ? action.payload : item\n )\n\n // Update active marker if changed\n let activeMarker = state.activeMarker\n if (state.activeMarker.identifier === action.payload.identifier) {\n activeMarker = action.payload;\n }\n\n return Object.assign({}, state, {\n items: newItems,\n activeMarker,\n });\n case WEBSOCKET_MESSAGE_REMOVE:\n newItems = state.items.filter(\n (item) => item.identifier !== action.payload.id\n )\n\n return Object.assign({}, state, {\n items: newItems,\n });\n case FETCH_MACHINES_UPDATED_SUCCESS:\n return Object.assign({}, state, {\n items: action.data,\n timestamp: action.timestamp\n });\n case FETCH_MACHINES_SUCCESS:\n return Object.assign({}, state, {\n items: action.data,\n timestamp: action.timestamp,\n fetchedMachines: true\n });\n case SET_CENTER:\n return Object.assign({}, state, {\n center: action.center\n });\n case SET_ZOOM:\n return Object.assign({}, state, {\n zoom: action.zoom\n });\n case SET_MARKER:\n return Object.assign({}, state, {\n activeMarker: action.activeMarker\n });\n case SET_LIST_MARKERS:\n return Object.assign({}, state, {\n listMarkers: action.listMarkers\n });\n case SET_LIST_ACTIVE:\n return Object.assign({}, state, {\n listActive: action.listActive\n });\n case SET_FILTER:\n return Object.assign({}, state, {\n filter: action.filter\n });\n case SET_FILTERED_ITEMS:\n return Object.assign({}, state, {\n filteredItems: action.filteredItems\n });\n case SET_USER_POS:\n return Object.assign({}, state, {\n userPos: action.userPos\n });\n case SET_USER_POS_ERROR:\n return Object.assign({}, state, {\n userPosError: action.error,\n });\n case SET_MAP:\n return Object.assign({}, state, {\n map: action.map\n });\n case SET_INFOWINDOW:\n return Object.assign({}, state, {\n infowindow: action.infowindow\n });\n case SET_EXTERNAL_GEOLOCATION:\n return Object.assign({}, state, {\n externalGeolocation: action.externalGeolocation\n });\n case SET_SEARCH_VALUE:\n return Object.assign({}, state, {\n searchValue: action.searchValue\n });\n case USER_POSITION_FETCHED:\n return Object.assign({}, state, {\n fetchedUserPosition: true\n });\n case QUERY_MARKER_OPENED:\n return Object.assign({}, state, {\n queryMarkerOpened: true\n });\n case SET_MAP_CONTAINER_DIMENSIONS:\n return Object.assign({}, state, {\n mapContainerDimensions: action.dimensions\n });\n default:\n return state;\n }\n}\n","import { combineReducers } from 'redux';\nimport map from './map';\n\nexport default combineReducers({\n map,\n});\n","import { createStore, applyMiddleware, compose } from 'redux';\nimport createSagaMiddleware from 'redux-saga'\nimport sagas from './sagas/sagas'\nimport rootReducer from './reducers';\n\nconst defaultState = {};\nconst sagaMiddleware = createSagaMiddleware();\nconst composeEnhancers =\n typeof window === 'object' &&\n window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?\n window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n }) : compose;\n\nconst store = createStore(\n rootReducer,\n defaultState,\n composeEnhancers(applyMiddleware(sagaMiddleware))\n);\nsagaMiddleware.run(sagas)\n\nexport default store;\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import {INITIAL_ZOOM, DEFAULT_ZOOM} from '../constants/map';\n\nlet dataLayer = window.dataLayer = window.dataLayer || [];\n\nexport function trackMapSearch(searchValue) {\n dataLayer.push({\n mapSearchTerm: searchValue,\n event: 'mapSearch'\n });\n}\n\nexport function trackMapFilterSelect(filterValue) {\n dataLayer.push({\n mapFilterTerm: filterValue,\n event: 'mapFilterSelect'\n });\n}\n\nexport function trackMapFindClosest() {\n dataLayer.push({\n event: 'MapFindClosest'\n });\n}\n\nexport function trackLocationListMarkerClick(marker) {\n const { machineIds, address } = parseMarker(marker);\n dataLayer.push({\n machineId: machineIds,\n machineAddress: address,\n event: 'mapLocationListClick'\n });\n}\n\nexport function trackMapMarkerClick(marker) {\n const {machineIds, address} = parseMarker(marker);\n dataLayer.push({\n machineId: machineIds,\n machineAddress: address,\n event: 'mapMarkerClick'\n });\n}\n\nlet initialZoomCompleted = false;\nexport function trackMapZoomChange(currZoomLevel, newZoomLevel) {\n if (typeof currZoomLevel === 'undefined' || currZoomLevel === newZoomLevel) {\n return;\n }\n\n // hacky way to avoid tracking the initial map zoom\n\n // handle case where user loc available\n if (!initialZoomCompleted &&\n currZoomLevel === INITIAL_ZOOM && newZoomLevel === DEFAULT_ZOOM) {\n initialZoomCompleted = true;\n return;\n }\n\n // handle case where user loc not available\n if (!initialZoomCompleted && currZoomLevel === INITIAL_ZOOM) {\n initialZoomCompleted = true;\n }\n\n if (initialZoomCompleted) {\n const zoomAction = currZoomLevel - newZoomLevel < 0\n ? 'zoomed in'\n : 'zoomed out';\n\n dataLayer.push({\n mapZoomChange: zoomAction,\n event: 'mapZoomChange'\n });\n }\n}\n\nexport function trackMapTypeSelect(mapType) {\n dataLayer.push({\n mapType,\n event: 'mapTypeSelect'\n });\n}\n\n// helpers\n\nconst parseMarker = (marker) => ({\n machineIds: marker.machines\n .map(m => m.machine_id)\n .join(', '),\n\n address: marker.address1\n + (marker.address2\n ? `, ${marker.address2}, `\n : ', ')\n + marker.city\n});\n\n","'use strict';\n\nexports.__esModule = true;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar style = {\n width: '100%',\n height: '100%',\n left: 0,\n top: 0,\n margin: 0,\n padding: 0,\n position: 'absolute'\n};\n\nvar GoogleMapMap = function (_Component) {\n _inherits(GoogleMapMap, _Component);\n\n function GoogleMapMap() {\n _classCallCheck(this, GoogleMapMap);\n\n return _possibleConstructorReturn(this, _Component.apply(this, arguments));\n }\n\n GoogleMapMap.prototype.shouldComponentUpdate = function shouldComponentUpdate() {\n return false; // disable react on this div\n };\n\n GoogleMapMap.prototype.render = function render() {\n var registerChild = this.props.registerChild;\n\n return _react2.default.createElement('div', { ref: registerChild, style: style });\n };\n\n return GoogleMapMap;\n}(_react.Component);\n\nexports.default = GoogleMapMap;","'use strict';\n\nvar has = Object.prototype.hasOwnProperty;\n\n//\n// We store our EE objects in a plain object whose properties are event names.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// `~` to make sure that the built-in object properties are not overridden or\n// used as an attack vector.\n// We also assume that `Object.create(null)` is available when the event name\n// is an ES6 Symbol.\n//\nvar prefix = typeof Object.create !== 'function' ? '~' : false;\n\n/**\n * Representation of a single EventEmitter function.\n *\n * @param {Function} fn Event handler to be called.\n * @param {Mixed} context Context for function execution.\n * @param {Boolean} [once=false] Only emit once\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal EventEmitter interface that is molded against the Node.js\n * EventEmitter interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() { /* Nothing to set */ }\n\n/**\n * Hold the assigned EventEmitters by name.\n *\n * @type {Object}\n * @private\n */\nEventEmitter.prototype._events = undefined;\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var events = this._events\n , names = []\n , name;\n\n if (!events) return names;\n\n for (name in events) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return a list of assigned event listeners.\n *\n * @param {String} event The events that should be listed.\n * @param {Boolean} exists We only need to know if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events && this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Emit an event to all registered event listeners.\n *\n * @param {String} event The name of the event.\n * @returns {Boolean} Indication if we've emitted an event.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events || !this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if ('function' === typeof listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Register a new EventListener for the given event.\n *\n * @param {String} event Name of the event.\n * @param {Function} fn Callback function.\n * @param {Mixed} [context=this] The context of the function.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events) this._events = prefix ? {} : Object.create(null);\n if (!this._events[evt]) this._events[evt] = listener;\n else {\n if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [\n this._events[evt], listener\n ];\n }\n\n return this;\n};\n\n/**\n * Add an EventListener that's only called once.\n *\n * @param {String} event Name of the event.\n * @param {Function} fn Callback function.\n * @param {Mixed} [context=this] The context of the function.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events) this._events = prefix ? {} : Object.create(null);\n if (!this._events[evt]) this._events[evt] = listener;\n else {\n if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [\n this._events[evt], listener\n ];\n }\n\n return this;\n};\n\n/**\n * Remove event listeners.\n *\n * @param {String} event The event we want to remove.\n * @param {Function} fn The listener that we need to find.\n * @param {Mixed} context Only remove listeners matching this context.\n * @param {Boolean} once Only remove once listeners.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events || !this._events[evt]) return this;\n\n var listeners = this._events[evt]\n , events = [];\n\n if (fn) {\n if (listeners.fn) {\n if (\n listeners.fn !== fn\n || (once && !listeners.once)\n || (context && listeners.context !== context)\n ) {\n events.push(listeners);\n }\n } else {\n for (var i = 0, length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) {\n this._events[evt] = events.length === 1 ? events[0] : events;\n } else {\n delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners or only the listeners for the specified event.\n *\n * @param {String} event The event want to remove all listeners for.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n if (!this._events) return this;\n\n if (event) delete this._events[prefix ? prefix + event : event];\n else this._events = prefix ? {} : Object.create(null);\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","'use strict';\n\nexports.__esModule = true;\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar MarkerDispatcher = function (_EventEmitter) {\n _inherits(MarkerDispatcher, _EventEmitter);\n\n function MarkerDispatcher(gmapInstance) {\n _classCallCheck(this, MarkerDispatcher);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n _this.gmapInstance = gmapInstance;\n return _this;\n }\n\n MarkerDispatcher.prototype.getChildren = function getChildren() {\n return this.gmapInstance.props.children;\n };\n\n MarkerDispatcher.prototype.getMousePosition = function getMousePosition() {\n return this.gmapInstance.mouse_;\n };\n\n MarkerDispatcher.prototype.getUpdateCounter = function getUpdateCounter() {\n return this.gmapInstance.updateCounter_;\n };\n\n MarkerDispatcher.prototype.dispose = function dispose() {\n this.gmapInstance = null;\n this.removeAllListeners();\n };\n\n return MarkerDispatcher;\n}(_eventemitter2.default);\n\nexports.default = MarkerDispatcher;","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n// https://github.com/acdlite/recompose/blob/master/src/packages/recompose/utils/omit.js\nvar omit = function omit(obj, keys) {\n var rest = _objectWithoutProperties(obj, []);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (key in rest) {\n delete rest[key];\n }\n }\n return rest;\n};\n\nexports.default = omit;","'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule shallowEqual\n * @typechecks\n * \n */\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Added the nonzero y check to make Flow happy, but it is redundant\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n }\n // Step 6.a: NaN == NaN\n // eslint-disable-next-line no-self-compare\n return x !== x && y !== y;\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA, objB) {\n if (is(objA, objB)) {\n return true;\n }\n\n if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = shallowEqual;\n/* src: https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/shallowEqual.js */","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _omit = require('./utils/omit');\n\nvar _omit2 = _interopRequireDefault(_omit);\n\nvar _shallowEqual = require('./utils/shallowEqual');\n\nvar _shallowEqual2 = _interopRequireDefault(_shallowEqual);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// utils\n\n\nvar mainStyle = {\n width: '100%',\n height: '100%',\n left: 0,\n top: 0,\n margin: 0,\n padding: 0,\n position: 'absolute'\n};\n\nvar style = {\n width: 0,\n height: 0,\n left: 0,\n top: 0,\n backgroundColor: 'transparent',\n position: 'absolute'\n};\n\nvar GoogleMapMarkers = function (_Component) {\n _inherits(GoogleMapMarkers, _Component);\n\n /* eslint-disable react/forbid-prop-types */\n function GoogleMapMarkers(props) {\n _classCallCheck(this, GoogleMapMarkers);\n\n var _this = _possibleConstructorReturn(this, _Component.call(this, props));\n\n _this._getState = function () {\n return {\n children: _this.props.dispatcher.getChildren(),\n updateCounter: _this.props.dispatcher.getUpdateCounter()\n };\n };\n\n _this._onChangeHandler = function () {\n if (!_this.dimensionsCache_) {\n return;\n }\n\n var prevChildCount = (_this.state.children || []).length;\n var state = _this._getState();\n\n _this.setState(state, function () {\n return (state.children || []).length !== prevChildCount && _this._onMouseChangeHandler();\n });\n };\n\n _this._onChildClick = function () {\n if (_this.props.onChildClick) {\n if (_this.hoverChildProps_) {\n var hoverKey = _this.hoverKey_;\n var childProps = _this.hoverChildProps_;\n // click works only on hovered item\n _this.props.onChildClick(hoverKey, childProps);\n }\n }\n };\n\n _this._onChildMouseDown = function () {\n if (_this.props.onChildMouseDown) {\n if (_this.hoverChildProps_) {\n var hoverKey = _this.hoverKey_;\n var childProps = _this.hoverChildProps_;\n // works only on hovered item\n _this.props.onChildMouseDown(hoverKey, childProps);\n }\n }\n };\n\n _this._onChildMouseEnter = function (hoverKey, childProps) {\n if (!_this.dimensionsCache_) {\n return;\n }\n\n if (_this.props.onChildMouseEnter) {\n _this.props.onChildMouseEnter(hoverKey, childProps);\n }\n\n _this.hoverChildProps_ = childProps;\n _this.hoverKey_ = hoverKey;\n _this.setState({ hoverKey: hoverKey });\n };\n\n _this._onChildMouseLeave = function () {\n if (!_this.dimensionsCache_) {\n return;\n }\n\n var hoverKey = _this.hoverKey_;\n var childProps = _this.hoverChildProps_;\n\n if (hoverKey !== undefined && hoverKey !== null) {\n if (_this.props.onChildMouseLeave) {\n _this.props.onChildMouseLeave(hoverKey, childProps);\n }\n\n _this.hoverKey_ = null;\n _this.hoverChildProps_ = null;\n _this.setState({ hoverKey: null });\n }\n };\n\n _this._onMouseAllow = function (value) {\n if (!value) {\n _this._onChildMouseLeave();\n }\n\n _this.allowMouse_ = value;\n };\n\n _this._onMouseChangeHandler = function () {\n if (_this.allowMouse_) {\n _this._onMouseChangeHandlerRaf();\n }\n };\n\n _this._onMouseChangeHandlerRaf = function () {\n if (!_this.dimensionsCache_) {\n return;\n }\n\n var mp = _this.props.dispatcher.getMousePosition();\n\n if (mp) {\n var distances = [];\n var hoverDistance = _this.props.getHoverDistance();\n\n _react2.default.Children.forEach(_this.state.children, function (child, childIndex) {\n if (!child) return;\n // layers\n if (child.props.latLng === undefined && child.props.lat === undefined && child.props.lng === undefined) {\n return;\n }\n\n var childKey = child.key !== undefined && child.key !== null ? child.key : childIndex;\n var dist = _this.props.distanceToMouse(_this.dimensionsCache_[childKey], mp, child.props);\n if (dist < hoverDistance) {\n distances.push({\n key: childKey,\n dist: dist,\n props: child.props\n });\n }\n });\n\n if (distances.length) {\n distances.sort(function (a, b) {\n return a.dist - b.dist;\n });\n var hoverKey = distances[0].key;\n var childProps = distances[0].props;\n\n if (_this.hoverKey_ !== hoverKey) {\n _this._onChildMouseLeave();\n\n _this._onChildMouseEnter(hoverKey, childProps);\n }\n } else {\n _this._onChildMouseLeave();\n }\n } else {\n _this._onChildMouseLeave();\n }\n };\n\n _this._getDimensions = function (key) {\n var childKey = key;\n return _this.dimensionsCache_[childKey];\n };\n\n _this.props.dispatcher.on('kON_CHANGE', _this._onChangeHandler);\n _this.props.dispatcher.on('kON_MOUSE_POSITION_CHANGE', _this._onMouseChangeHandler);\n _this.props.dispatcher.on('kON_CLICK', _this._onChildClick);\n _this.props.dispatcher.on('kON_MDOWN', _this._onChildMouseDown);\n\n _this.dimensionsCache_ = {};\n _this.hoverKey_ = null;\n _this.hoverChildProps_ = null;\n _this.allowMouse_ = true;\n\n _this.state = _extends({}, _this._getState(), { hoverKey: null });\n return _this;\n }\n /* eslint-enable react/forbid-prop-types */\n\n GoogleMapMarkers.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {\n if (this.props.experimental === true) {\n return !(0, _shallowEqual2.default)(this.props, nextProps) || !(0, _shallowEqual2.default)((0, _omit2.default)(this.state, ['hoverKey']), (0, _omit2.default)(nextState, ['hoverKey']));\n }\n\n return !(0, _shallowEqual2.default)(this.props, nextProps) || !(0, _shallowEqual2.default)(this.state, nextState);\n };\n\n GoogleMapMarkers.prototype.componentWillUnmount = function componentWillUnmount() {\n this.props.dispatcher.removeListener('kON_CHANGE', this._onChangeHandler);\n this.props.dispatcher.removeListener('kON_MOUSE_POSITION_CHANGE', this._onMouseChangeHandler);\n this.props.dispatcher.removeListener('kON_CLICK', this._onChildClick);\n this.props.dispatcher.removeListener('kON_MDOWN', this._onChildMouseDown);\n\n this.dimensionsCache_ = null;\n };\n\n GoogleMapMarkers.prototype.render = function render() {\n var _this2 = this;\n\n var mainElementStyle = this.props.style || mainStyle;\n this.dimensionsCache_ = {};\n\n var markers = _react2.default.Children.map(this.state.children, function (child, childIndex) {\n if (!child) return undefined;\n if (child.props.latLng === undefined && child.props.lat === undefined && child.props.lng === undefined) {\n return _react2.default.cloneElement(child, {\n $geoService: _this2.props.geoService,\n $onMouseAllow: _this2._onMouseAllow,\n $prerender: _this2.props.prerender\n });\n }\n\n var latLng = child.props.latLng !== undefined ? child.props.latLng : { lat: child.props.lat, lng: child.props.lng };\n\n var pt = _this2.props.insideMapPanes ? _this2.props.geoService.fromLatLngToDivPixel(latLng) : _this2.props.geoService.fromLatLngToCenterPixel(latLng);\n\n var stylePtPos = {\n left: pt.x,\n top: pt.y\n };\n\n // If the component has a southeast corner defined (either as a LatLng, or a separate\n // lat and lng pair), set the width and height based on the distance between the northwest\n // and the southeast corner to lock the overlay to the correct geographic bounds.\n if (child.props.seLatLng !== undefined || child.props.seLat !== undefined && child.props.seLng !== undefined) {\n var seLatLng = child.props.seLatLng !== undefined ? child.props.seLatLng : { lat: child.props.seLat, lng: child.props.seLng };\n\n var sePt = _this2.props.insideMapPanes ? _this2.props.geoService.fromLatLngToDivPixel(seLatLng) : _this2.props.geoService.fromLatLngToCenterPixel(seLatLng);\n\n stylePtPos.width = sePt.x - pt.x;\n stylePtPos.height = sePt.y - pt.y;\n }\n\n var containerPt = _this2.props.geoService.fromLatLngToContainerPixel(latLng);\n\n // to prevent rerender on child element i need to pass\n // const params $getDimensions and $dimensionKey instead of dimension object\n var childKey = child.key !== undefined && child.key !== null ? child.key : childIndex;\n\n _this2.dimensionsCache_[childKey] = _extends({\n x: containerPt.x,\n y: containerPt.y\n }, latLng);\n\n return _react2.default.createElement(\n 'div',\n {\n key: childKey,\n style: _extends({}, style, stylePtPos),\n className: child.props.$markerHolderClassName\n },\n _react2.default.cloneElement(child, {\n $hover: childKey === _this2.state.hoverKey,\n $getDimensions: _this2._getDimensions,\n $dimensionKey: childKey,\n $geoService: _this2.props.geoService,\n $onMouseAllow: _this2._onMouseAllow,\n $prerender: _this2.props.prerender\n })\n );\n });\n\n return _react2.default.createElement(\n 'div',\n { style: mainElementStyle },\n markers\n );\n };\n\n return GoogleMapMarkers;\n}(_react.Component);\n\nGoogleMapMarkers.propTypes = {\n geoService: _propTypes2.default.any,\n style: _propTypes2.default.any,\n distanceToMouse: _propTypes2.default.func,\n dispatcher: _propTypes2.default.any,\n onChildClick: _propTypes2.default.func,\n onChildMouseDown: _propTypes2.default.func,\n onChildMouseLeave: _propTypes2.default.func,\n onChildMouseEnter: _propTypes2.default.func,\n getHoverDistance: _propTypes2.default.func,\n insideMapPanes: _propTypes2.default.bool,\n prerender: _propTypes2.default.bool\n};\nGoogleMapMarkers.defaultProps = {\n insideMapPanes: false,\n prerender: false\n};\nexports.default = GoogleMapMarkers;","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.default = function (props) {\n return _react2.default.createElement(\n 'div',\n { style: style },\n _react2.default.createElement(_google_map_markers2.default, _extends({}, props, { prerender: true }))\n );\n};\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _google_map_markers = require('./google_map_markers');\n\nvar _google_map_markers2 = _interopRequireDefault(_google_map_markers);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar style = {\n width: '50%',\n height: '50%',\n left: '50%',\n top: '50%',\n // backgroundColor: 'red',\n margin: 0,\n padding: 0,\n position: 'absolute'\n // opacity: 0.3\n};","\"use strict\";\n\nexports.__esModule = true;\nvar generateHeatmap = exports.generateHeatmap = function generateHeatmap(instance, _ref) {\n var positions = _ref.positions;\n return new instance.visualization.HeatmapLayer({\n data: positions.reduce(function (acc, _ref2) {\n var lat = _ref2.lat,\n lng = _ref2.lng,\n _ref2$weight = _ref2.weight,\n weight = _ref2$weight === undefined ? 1 : _ref2$weight;\n\n acc.push({\n location: new instance.LatLng(lat, lng),\n weight: weight\n });\n return acc;\n }, [])\n });\n};\n\nvar optionsHeatmap = exports.optionsHeatmap = function optionsHeatmap(instance, _ref3) {\n var _ref3$options = _ref3.options,\n options = _ref3$options === undefined ? {} : _ref3$options;\n return Object.keys(options).map(function (option) {\n return instance.set(option, options[option]);\n });\n};","/*!\n * $script.js JS loader & dependency manager\n * https://github.com/ded/script.js\n * (c) Dustin Diaz 2014 | License MIT\n */\n\n(function (name, definition) {\n if (typeof module != 'undefined' && module.exports) module.exports = definition()\n else if (typeof define == 'function' && define.amd) define(definition)\n else this[name] = definition()\n})('$script', function () {\n var doc = document\n , head = doc.getElementsByTagName('head')[0]\n , s = 'string'\n , f = false\n , push = 'push'\n , readyState = 'readyState'\n , onreadystatechange = 'onreadystatechange'\n , list = {}\n , ids = {}\n , delay = {}\n , scripts = {}\n , scriptpath\n , urlArgs\n\n function every(ar, fn) {\n for (var i = 0, j = ar.length; i < j; ++i) if (!fn(ar[i])) return f\n return 1\n }\n function each(ar, fn) {\n every(ar, function (el) {\n fn(el)\n return 1\n })\n }\n\n function $script(paths, idOrDone, optDone) {\n paths = paths[push] ? paths : [paths]\n var idOrDoneIsDone = idOrDone && idOrDone.call\n , done = idOrDoneIsDone ? idOrDone : optDone\n , id = idOrDoneIsDone ? paths.join('') : idOrDone\n , queue = paths.length\n function loopFn(item) {\n return item.call ? item() : list[item]\n }\n function callback() {\n if (!--queue) {\n list[id] = 1\n done && done()\n for (var dset in delay) {\n every(dset.split('|'), loopFn) && !each(delay[dset], loopFn) && (delay[dset] = [])\n }\n }\n }\n setTimeout(function () {\n each(paths, function loading(path, force) {\n if (path === null) return callback()\n \n if (!force && !/^https?:\\/\\//.test(path) && scriptpath) {\n path = (path.indexOf('.js') === -1) ? scriptpath + path + '.js' : scriptpath + path;\n }\n \n if (scripts[path]) {\n if (id) ids[id] = 1\n return (scripts[path] == 2) ? callback() : setTimeout(function () { loading(path, true) }, 0)\n }\n\n scripts[path] = 1\n if (id) ids[id] = 1\n create(path, callback)\n })\n }, 0)\n return $script\n }\n\n function create(path, fn) {\n var el = doc.createElement('script'), loaded\n el.onload = el.onerror = el[onreadystatechange] = function () {\n if ((el[readyState] && !(/^c|loade/.test(el[readyState]))) || loaded) return;\n el.onload = el[onreadystatechange] = null\n loaded = 1\n scripts[path] = 2\n fn()\n }\n el.async = 1\n el.src = urlArgs ? path + (path.indexOf('?') === -1 ? '?' : '&') + urlArgs : path;\n head.insertBefore(el, head.lastChild)\n }\n\n $script.get = create\n\n $script.order = function (scripts, id, done) {\n (function callback(s) {\n s = scripts.shift()\n !scripts.length ? $script(s, id, done) : $script(s, callback)\n }())\n }\n\n $script.path = function (p) {\n scriptpath = p\n }\n $script.urlArgs = function (str) {\n urlArgs = str;\n }\n $script.ready = function (deps, ready, req) {\n deps = deps[push] ? deps : [deps]\n var missing = [];\n !each(deps, function (dep) {\n list[dep] || missing[push](dep);\n }) && every(deps, function (dep) {return list[dep]}) ?\n ready() : !function (key) {\n delay[key] = delay[key] || []\n delay[key][push](ready)\n req && req(missing)\n }(deps.join('|'))\n return $script\n }\n\n $script.done = function (idOrDone) {\n $script([null], idOrDone)\n }\n\n return $script\n});\n","'use strict';\n\nexports.__esModule = true;\nvar BASE_URL = 'https://maps';\nvar DEFAULT_URL = BASE_URL + '.googleapis.com';\nvar API_PATH = '/maps/api/js?callback=_$_google_map_initialize_$_';\n\nvar $script_ = null;\n\nvar loadPromise_ = void 0;\n\nvar resolveCustomPromise_ = void 0;\n\nvar _customPromise = new Promise(function (resolve) {\n resolveCustomPromise_ = resolve;\n});\n\n// TODO add libraries language and other map options\n\nexports.default = function (bootstrapURLKeys, heatmapLibrary) {\n if (!$script_) {\n $script_ = require('scriptjs'); // eslint-disable-line\n }\n\n // call from outside google-map-react\n // will be as soon as loadPromise_ resolved\n if (!bootstrapURLKeys) {\n return _customPromise;\n }\n\n if (loadPromise_) {\n return loadPromise_;\n }\n\n loadPromise_ = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined') {\n reject(new Error('google map cannot be loaded outside browser env'));\n return;\n }\n\n if (window.google && window.google.maps) {\n resolve(window.google.maps);\n return;\n }\n\n if (typeof window._$_google_map_initialize_$_ !== 'undefined') {\n reject(new Error('google map initialization error'));\n }\n\n window._$_google_map_initialize_$_ = function () {\n delete window._$_google_map_initialize_$_;\n resolve(window.google.maps);\n };\n\n if (process.env.NODE_ENV !== 'production') {\n if (Object.keys(bootstrapURLKeys).indexOf('callback') > -1) {\n var message = '\"callback\" key in bootstrapURLKeys is not allowed,\\n use onGoogleApiLoaded property instead';\n // eslint-disable-next-line no-console\n console.error(message);\n throw new Error(message);\n }\n }\n\n var params = Object.keys(bootstrapURLKeys).reduce(function (r, key) {\n return r + '&' + key + '=' + bootstrapURLKeys[key];\n }, '');\n\n var libraries = heatmapLibrary ? '&libraries=visualization' : '';\n\n $script_('' + DEFAULT_URL + API_PATH + params + libraries, function () {\n return typeof window.google === 'undefined' && reject(new Error('google map initialization error (not loaded)'));\n });\n });\n\n resolveCustomPromise_(loadPromise_);\n\n return loadPromise_;\n};","'use strict';\n\nmodule.exports = Point;\n\n/**\n * A standalone point geometry with useful accessor, comparison, and\n * modification methods.\n *\n * @class Point\n * @param {Number} x the x-coordinate. this could be longitude or screen\n * pixels, or any other sort of unit.\n * @param {Number} y the y-coordinate. this could be latitude or screen\n * pixels, or any other sort of unit.\n * @example\n * var point = new Point(-77, 38);\n */\nfunction Point(x, y) {\n this.x = x;\n this.y = y;\n}\n\nPoint.prototype = {\n\n /**\n * Clone this point, returning a new point that can be modified\n * without affecting the old one.\n * @return {Point} the clone\n */\n clone: function() { return new Point(this.x, this.y); },\n\n /**\n * Add this point's x & y coordinates to another point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n add: function(p) { return this.clone()._add(p); },\n\n /**\n * Subtract this point's x & y coordinates to from point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n sub: function(p) { return this.clone()._sub(p); },\n\n /**\n * Multiply this point's x & y coordinates by point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n multByPoint: function(p) { return this.clone()._multByPoint(p); },\n\n /**\n * Divide this point's x & y coordinates by point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n divByPoint: function(p) { return this.clone()._divByPoint(p); },\n\n /**\n * Multiply this point's x & y coordinates by a factor,\n * yielding a new point.\n * @param {Point} k factor\n * @return {Point} output point\n */\n mult: function(k) { return this.clone()._mult(k); },\n\n /**\n * Divide this point's x & y coordinates by a factor,\n * yielding a new point.\n * @param {Point} k factor\n * @return {Point} output point\n */\n div: function(k) { return this.clone()._div(k); },\n\n /**\n * Rotate this point around the 0, 0 origin by an angle a,\n * given in radians\n * @param {Number} a angle to rotate around, in radians\n * @return {Point} output point\n */\n rotate: function(a) { return this.clone()._rotate(a); },\n\n /**\n * Rotate this point around p point by an angle a,\n * given in radians\n * @param {Number} a angle to rotate around, in radians\n * @param {Point} p Point to rotate around\n * @return {Point} output point\n */\n rotateAround: function(a,p) { return this.clone()._rotateAround(a,p); },\n\n /**\n * Multiply this point by a 4x1 transformation matrix\n * @param {Array} m transformation matrix\n * @return {Point} output point\n */\n matMult: function(m) { return this.clone()._matMult(m); },\n\n /**\n * Calculate this point but as a unit vector from 0, 0, meaning\n * that the distance from the resulting point to the 0, 0\n * coordinate will be equal to 1 and the angle from the resulting\n * point to the 0, 0 coordinate will be the same as before.\n * @return {Point} unit vector point\n */\n unit: function() { return this.clone()._unit(); },\n\n /**\n * Compute a perpendicular point, where the new y coordinate\n * is the old x coordinate and the new x coordinate is the old y\n * coordinate multiplied by -1\n * @return {Point} perpendicular point\n */\n perp: function() { return this.clone()._perp(); },\n\n /**\n * Return a version of this point with the x & y coordinates\n * rounded to integers.\n * @return {Point} rounded point\n */\n round: function() { return this.clone()._round(); },\n\n /**\n * Return the magitude of this point: this is the Euclidean\n * distance from the 0, 0 coordinate to this point's x and y\n * coordinates.\n * @return {Number} magnitude\n */\n mag: function() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n },\n\n /**\n * Judge whether this point is equal to another point, returning\n * true or false.\n * @param {Point} other the other point\n * @return {boolean} whether the points are equal\n */\n equals: function(other) {\n return this.x === other.x &&\n this.y === other.y;\n },\n\n /**\n * Calculate the distance from this point to another point\n * @param {Point} p the other point\n * @return {Number} distance\n */\n dist: function(p) {\n return Math.sqrt(this.distSqr(p));\n },\n\n /**\n * Calculate the distance from this point to another point,\n * without the square root step. Useful if you're comparing\n * relative distances.\n * @param {Point} p the other point\n * @return {Number} distance\n */\n distSqr: function(p) {\n var dx = p.x - this.x,\n dy = p.y - this.y;\n return dx * dx + dy * dy;\n },\n\n /**\n * Get the angle from the 0, 0 coordinate to this point, in radians\n * coordinates.\n * @return {Number} angle\n */\n angle: function() {\n return Math.atan2(this.y, this.x);\n },\n\n /**\n * Get the angle from this point to another point, in radians\n * @param {Point} b the other point\n * @return {Number} angle\n */\n angleTo: function(b) {\n return Math.atan2(this.y - b.y, this.x - b.x);\n },\n\n /**\n * Get the angle between this point and another point, in radians\n * @param {Point} b the other point\n * @return {Number} angle\n */\n angleWith: function(b) {\n return this.angleWithSep(b.x, b.y);\n },\n\n /*\n * Find the angle of the two vectors, solving the formula for\n * the cross product a x b = |a||b|sin(θ) for θ.\n * @param {Number} x the x-coordinate\n * @param {Number} y the y-coordinate\n * @return {Number} the angle in radians\n */\n angleWithSep: function(x, y) {\n return Math.atan2(\n this.x * y - this.y * x,\n this.x * x + this.y * y);\n },\n\n _matMult: function(m) {\n var x = m[0] * this.x + m[1] * this.y,\n y = m[2] * this.x + m[3] * this.y;\n this.x = x;\n this.y = y;\n return this;\n },\n\n _add: function(p) {\n this.x += p.x;\n this.y += p.y;\n return this;\n },\n\n _sub: function(p) {\n this.x -= p.x;\n this.y -= p.y;\n return this;\n },\n\n _mult: function(k) {\n this.x *= k;\n this.y *= k;\n return this;\n },\n\n _div: function(k) {\n this.x /= k;\n this.y /= k;\n return this;\n },\n\n _multByPoint: function(p) {\n this.x *= p.x;\n this.y *= p.y;\n return this;\n },\n\n _divByPoint: function(p) {\n this.x /= p.x;\n this.y /= p.y;\n return this;\n },\n\n _unit: function() {\n this._div(this.mag());\n return this;\n },\n\n _perp: function() {\n var y = this.y;\n this.y = this.x;\n this.x = -y;\n return this;\n },\n\n _rotate: function(angle) {\n var cos = Math.cos(angle),\n sin = Math.sin(angle),\n x = cos * this.x - sin * this.y,\n y = sin * this.x + cos * this.y;\n this.x = x;\n this.y = y;\n return this;\n },\n\n _rotateAround: function(angle, p) {\n var cos = Math.cos(angle),\n sin = Math.sin(angle),\n x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y),\n y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);\n this.x = x;\n this.y = y;\n return this;\n },\n\n _round: function() {\n this.x = Math.round(this.x);\n this.y = Math.round(this.y);\n return this;\n }\n};\n\n/**\n * Construct a point from an array if necessary, otherwise if the input\n * is already a Point, or an unknown type, return it unchanged\n * @param {Array|Point|*} a any kind of input value\n * @return {Point} constructed point, or passed-through value.\n * @example\n * // this\n * var point = Point.convert([0, 1]);\n * // is equivalent to\n * var point = new Point(0, 1);\n */\nPoint.convert = function (a) {\n if (a instanceof Point) {\n return a;\n }\n if (Array.isArray(a)) {\n return new Point(a[0], a[1]);\n }\n return a;\n};\n","\"use strict\";\n\nexports.__esModule = true;\nexports.wrap = wrap;\n/* eslint-disable import/prefer-default-export */\n\nfunction wrap(n, min, max) {\n var d = max - min;\n return n === max ? n : ((n - min) % d + d) % d + min;\n}","'use strict';\n\nexports.__esModule = true;\n\nvar _wrap2 = require('./wrap');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LatLng = function () {\n function LatLng(lat, lng) {\n _classCallCheck(this, LatLng);\n\n if (isNaN(lat) || isNaN(lng)) {\n throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');\n }\n this.lat = +lat;\n this.lng = +lng;\n }\n\n LatLng.prototype.wrap = function wrap() {\n return new LatLng(this.lat, (0, _wrap2.wrap)(this.lng, -180, 180));\n };\n\n return LatLng;\n}();\n\nLatLng.convert = function (a) {\n if (a instanceof LatLng) {\n return a;\n }\n\n if (Array.isArray(a)) {\n return new LatLng(a[0], a[1]);\n }\n\n if ('lng' in a && 'lat' in a) {\n return new LatLng(a.lat, a.lng);\n }\n\n return a;\n};\n\nexports.default = LatLng;","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* eslint-disable class-methods-use-this */\n\n\nvar _pointGeometry = require('@mapbox/point-geometry');\n\nvar _pointGeometry2 = _interopRequireDefault(_pointGeometry);\n\nvar _lat_lng = require('./lat_lng');\n\nvar _lat_lng2 = _interopRequireDefault(_lat_lng);\n\nvar _wrap = require('./wrap');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// A single transform, generally used for a single tile to be scaled, rotated, and zoomed.\nvar Transform = function () {\n function Transform(tileSize, minZoom, maxZoom) {\n _classCallCheck(this, Transform);\n\n this.tileSize = tileSize || 512; // constant\n\n this._minZoom = minZoom || 0;\n this._maxZoom = maxZoom || 52;\n\n this.latRange = [-85.05113, 85.05113];\n\n this.width = 0;\n this.height = 0;\n this.zoom = 0;\n this.center = new _lat_lng2.default(0, 0);\n this.angle = 0;\n }\n\n Transform.prototype.zoomScale = function zoomScale(zoom) {\n return Math.pow(2, zoom);\n };\n\n Transform.prototype.scaleZoom = function scaleZoom(scale) {\n return Math.log(scale) / Math.LN2;\n };\n\n Transform.prototype.project = function project(latlng, worldSize) {\n return new _pointGeometry2.default(this.lngX(latlng.lng, worldSize), this.latY(latlng.lat, worldSize));\n };\n\n Transform.prototype.unproject = function unproject(point, worldSize) {\n return new _lat_lng2.default(this.yLat(point.y, worldSize), this.xLng(point.x, worldSize));\n };\n\n // lat/lon <-> absolute pixel coords convertion\n Transform.prototype.lngX = function lngX(lon, worldSize) {\n return (180 + lon) * (worldSize || this.worldSize) / 360;\n };\n\n // latitude to absolute y coord\n\n\n Transform.prototype.latY = function latY(lat, worldSize) {\n var y = 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360));\n return (180 - y) * (worldSize || this.worldSize) / 360;\n };\n\n Transform.prototype.xLng = function xLng(x, worldSize) {\n return x * 360 / (worldSize || this.worldSize) - 180;\n };\n\n Transform.prototype.yLat = function yLat(y, worldSize) {\n var y2 = 180 - y * 360 / (worldSize || this.worldSize);\n return 360 / Math.PI * Math.atan(Math.exp(y2 * Math.PI / 180)) - 90;\n };\n\n Transform.prototype.locationPoint = function locationPoint(latlng) {\n var p = this.project(latlng);\n return this.centerPoint._sub(this.point._sub(p)._rotate(this.angle));\n };\n\n Transform.prototype.pointLocation = function pointLocation(p) {\n var p2 = this.centerPoint._sub(p)._rotate(-this.angle);\n return this.unproject(this.point.sub(p2));\n };\n\n _createClass(Transform, [{\n key: 'minZoom',\n get: function get() {\n return this._minZoom;\n },\n set: function set(zoom) {\n this._minZoom = zoom;\n this.zoom = Math.max(this.zoom, zoom);\n }\n }, {\n key: 'maxZoom',\n get: function get() {\n return this._maxZoom;\n },\n set: function set(zoom) {\n this._maxZoom = zoom;\n this.zoom = Math.min(this.zoom, zoom);\n }\n }, {\n key: 'worldSize',\n get: function get() {\n return this.tileSize * this.scale;\n }\n }, {\n key: 'centerPoint',\n get: function get() {\n return new _pointGeometry2.default(0, 0); // this.size._div(2);\n }\n }, {\n key: 'size',\n get: function get() {\n return new _pointGeometry2.default(this.width, this.height);\n }\n }, {\n key: 'bearing',\n get: function get() {\n return -this.angle / Math.PI * 180;\n },\n set: function set(bearing) {\n this.angle = -(0, _wrap.wrap)(bearing, -180, 180) * Math.PI / 180;\n }\n }, {\n key: 'zoom',\n get: function get() {\n return this._zoom;\n },\n set: function set(zoom) {\n var zoomV = Math.min(Math.max(zoom, this.minZoom), this.maxZoom);\n this._zoom = zoomV;\n this.scale = this.zoomScale(zoomV);\n this.tileZoom = Math.floor(zoomV);\n this.zoomFraction = zoomV - this.tileZoom;\n }\n }, {\n key: 'x',\n get: function get() {\n return this.lngX(this.center.lng);\n }\n }, {\n key: 'y',\n get: function get() {\n return this.latY(this.center.lat);\n }\n }, {\n key: 'point',\n get: function get() {\n return new _pointGeometry2.default(this.x, this.y);\n }\n }]);\n\n return Transform;\n}();\n\nexports.default = Transform;","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _pointGeometry = require('@mapbox/point-geometry');\n\nvar _pointGeometry2 = _interopRequireDefault(_pointGeometry);\n\nvar _lat_lng = require('./lib_geo/lat_lng');\n\nvar _lat_lng2 = _interopRequireDefault(_lat_lng);\n\nvar _transform = require('./lib_geo/transform');\n\nvar _transform2 = _interopRequireDefault(_transform);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Geo = function () {\n function Geo(tileSize) {\n _classCallCheck(this, Geo);\n\n // left_top view пользует гугл\n // super();\n this.hasSize_ = false;\n this.hasView_ = false;\n this.transform_ = new _transform2.default(tileSize || 512);\n }\n\n Geo.prototype.setView = function setView(center, zoom, bearing) {\n this.transform_.center = _lat_lng2.default.convert(center);\n this.transform_.zoom = +zoom;\n this.transform_.bearing = +bearing;\n this.hasView_ = true;\n };\n\n Geo.prototype.setViewSize = function setViewSize(width, height) {\n this.transform_.width = width;\n this.transform_.height = height;\n this.hasSize_ = true;\n };\n\n Geo.prototype.setMapCanvasProjection = function setMapCanvasProjection(maps, mapCanvasProjection) {\n this.maps_ = maps;\n this.mapCanvasProjection_ = mapCanvasProjection;\n };\n\n Geo.prototype.canProject = function canProject() {\n return this.hasSize_ && this.hasView_;\n };\n\n Geo.prototype.hasSize = function hasSize() {\n return this.hasSize_;\n };\n\n /** Returns the pixel position relative to the map center. */\n\n\n Geo.prototype.fromLatLngToCenterPixel = function fromLatLngToCenterPixel(ptLatLng) {\n return this.transform_.locationPoint(_lat_lng2.default.convert(ptLatLng));\n };\n\n /**\n * Returns the pixel position relative to the map panes,\n * or relative to the map center if there are no panes.\n */\n\n\n Geo.prototype.fromLatLngToDivPixel = function fromLatLngToDivPixel(ptLatLng) {\n if (this.mapCanvasProjection_) {\n var latLng = new this.maps_.LatLng(ptLatLng.lat, ptLatLng.lng);\n return this.mapCanvasProjection_.fromLatLngToDivPixel(latLng);\n }\n return this.fromLatLngToCenterPixel(ptLatLng);\n };\n\n /** Returns the pixel position relative to the map top-left. */\n\n\n Geo.prototype.fromLatLngToContainerPixel = function fromLatLngToContainerPixel(ptLatLng) {\n if (this.mapCanvasProjection_) {\n var latLng = new this.maps_.LatLng(ptLatLng.lat, ptLatLng.lng);\n return this.mapCanvasProjection_.fromLatLngToContainerPixel(latLng);\n }\n\n var pt = this.fromLatLngToCenterPixel(ptLatLng);\n pt.x -= this.transform_.worldSize * Math.round(pt.x / this.transform_.worldSize);\n\n pt.x += this.transform_.width / 2;\n pt.y += this.transform_.height / 2;\n\n return pt;\n };\n\n /** Returns the LatLng for the given offset from the map top-left. */\n\n\n Geo.prototype.fromContainerPixelToLatLng = function fromContainerPixelToLatLng(ptXY) {\n if (this.mapCanvasProjection_) {\n var latLng = this.mapCanvasProjection_.fromContainerPixelToLatLng(ptXY);\n return { lat: latLng.lat(), lng: latLng.lng() };\n }\n\n var ptxy = _extends({}, ptXY);\n ptxy.x -= this.transform_.width / 2;\n ptxy.y -= this.transform_.height / 2;\n var ptRes = this.transform_.pointLocation(_pointGeometry2.default.convert(ptxy));\n\n ptRes.lng -= 360 * Math.round(ptRes.lng / 360); // convert 2 google format\n return ptRes;\n };\n\n Geo.prototype.getWidth = function getWidth() {\n return this.transform_.width;\n };\n\n Geo.prototype.getHeight = function getHeight() {\n return this.transform_.height;\n };\n\n Geo.prototype.getZoom = function getZoom() {\n return this.transform_.zoom;\n };\n\n Geo.prototype.getCenter = function getCenter() {\n var ptRes = this.transform_.pointLocation({ x: 0, y: 0 });\n\n return ptRes;\n };\n\n Geo.prototype.getBounds = function getBounds(margins, roundFactor) {\n var bndT = margins && margins[0] || 0;\n var bndR = margins && margins[1] || 0;\n var bndB = margins && margins[2] || 0;\n var bndL = margins && margins[3] || 0;\n\n if (this.getWidth() - bndR - bndL > 0 && this.getHeight() - bndT - bndB > 0) {\n var topLeftCorner = this.transform_.pointLocation(_pointGeometry2.default.convert({\n x: bndL - this.getWidth() / 2,\n y: bndT - this.getHeight() / 2\n }));\n var bottomRightCorner = this.transform_.pointLocation(_pointGeometry2.default.convert({\n x: this.getWidth() / 2 - bndR,\n y: this.getHeight() / 2 - bndB\n }));\n\n var res = [topLeftCorner.lat, topLeftCorner.lng, // NW\n bottomRightCorner.lat, bottomRightCorner.lng, // SE\n bottomRightCorner.lat, topLeftCorner.lng, // SW\n topLeftCorner.lat, bottomRightCorner.lng];\n\n if (roundFactor) {\n res = res.map(function (r) {\n return Math.round(r * roundFactor) / roundFactor;\n });\n }\n return res;\n }\n\n return [0, 0, 0, 0];\n };\n\n return Geo;\n}();\n\nexports.default = Geo;","\"use strict\";\n\nexports.__esModule = true;\nexports.default = raf;\nfunction raf(callback) {\n if (window.requestAnimationFrame) {\n return window.requestAnimationFrame(callback);\n }\n\n var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;\n\n return nativeRaf ? nativeRaf(callback) : window.setTimeout(callback, 1e3 / 60);\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.default = pick;\n// source taken from https://github.com/rackt/redux/blob/master/src/utils/pick.js\n\nfunction pick(obj, fn) {\n return Object.keys(obj).reduce(function (result, key) {\n if (fn(obj[key])) {\n result[key] = obj[key]; // eslint-disable-line\n }\n return result;\n }, {});\n}","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar isEmpty = function isEmpty(val) {\n // check for empty object {}, array []\n if (val !== null && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object') {\n if (Object.keys(val).length === 0) {\n return true;\n }\n } else if (val === null || val === undefined || val === '') {\n // check for undefined, null and \"\"\n return true;\n }\n return false;\n};\n\nexports.default = isEmpty;","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = isNumber;\nfunction isObjectLike(value) {\n return !!value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object';\n}\n\nvar objectToString = Object.prototype.toString;\n\nfunction isNumber(value) {\n var numberTag = '[object Number]';\n return typeof value === 'number' || isObjectLike(value) && objectToString.call(value) === numberTag;\n}","'use strict';\n\nexports.__esModule = true;\nexports.default = detectBrowser;\n// http://stackoverflow.com/questions/5899783/detect-safari-chrome-ie-firefox-opera-with-user-agent\nvar detectBrowserResult_ = null;\n\nfunction detectBrowser() {\n if (detectBrowserResult_) {\n return detectBrowserResult_;\n }\n\n if (typeof navigator !== 'undefined') {\n var isExplorer = navigator.userAgent.indexOf('MSIE') > -1;\n var isFirefox = navigator.userAgent.indexOf('Firefox') > -1;\n var isOpera = navigator.userAgent.toLowerCase().indexOf('op') > -1;\n\n var isChrome = navigator.userAgent.indexOf('Chrome') > -1;\n var isSafari = navigator.userAgent.indexOf('Safari') > -1;\n\n if (isChrome && isSafari) {\n isSafari = false;\n }\n\n if (isChrome && isOpera) {\n isChrome = false;\n }\n\n detectBrowserResult_ = {\n isExplorer: isExplorer,\n isFirefox: isFirefox,\n isOpera: isOpera,\n isChrome: isChrome,\n isSafari: isSafari\n };\n return detectBrowserResult_;\n }\n\n detectBrowserResult_ = {\n isChrome: true,\n isExplorer: false,\n isFirefox: false,\n isOpera: false,\n isSafari: false\n };\n\n return detectBrowserResult_;\n}","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = isPlainObject;\n// source taken from https://github.com/rackt/redux/blob/master/src/utils/isPlainObject.js\nvar fnToString = function fnToString(fn) {\n return Function.prototype.toString.call(fn);\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (!obj || (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') {\n return false;\n }\n\n var proto = typeof obj.constructor === 'function' ? Object.getPrototypeOf(obj) : Object.prototype;\n\n if (proto === null) {\n return true;\n }\n\n var constructor = proto.constructor;\n\n return typeof constructor === 'function' && constructor instanceof constructor && fnToString(constructor) === fnToString(Object);\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.default = isArraysEqualEps;\nfunction isArraysEqualEps(arrayA, arrayB, eps) {\n if (arrayA && arrayB) {\n for (var i = 0; i !== arrayA.length; ++i) {\n if (Math.abs(arrayA[i] - arrayB[i]) > eps) {\n return false;\n }\n }\n return true;\n }\n return false;\n}","'use strict';\n\nexports.__esModule = true;\nexports.default = addPassiveEventListener;\n// feature detection for passive support\n// see: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\nfunction hasPassiveSupport() {\n var passiveSupported = false;\n\n try {\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passiveSupported = true;\n }\n });\n\n window.addEventListener('test', options, options);\n window.removeEventListener('test', options, options);\n } catch (err) {\n passiveSupported = false;\n }\n\n return passiveSupported;\n}\n\nfunction addPassiveEventListener(element, eventName, func, capture) {\n element.addEventListener(eventName, func, hasPassiveSupport() ? {\n capture: capture,\n passive: true\n } : capture);\n}","'use strict';\n\nvar _passiveEvents = require('./passiveEvents');\n\nvar _passiveEvents2 = _interopRequireDefault(_passiveEvents);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Reliable `window` and `document` detection\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\n// Check `document` and `window` in case of server-side rendering\n/* eslint-disable */\n/**\n* Detect Element Resize.\n* Forked in order to guard against unsafe 'window' and 'document' references.\n*\n* https://github.com/sdecima/javascript-detect-element-resize\n* Sebastian Decima\n*\n* version: 0.5.3\n**/\n\nvar _window;\nif (canUseDOM) {\n _window = window;\n} else if (typeof self !== 'undefined') {\n _window = self;\n} else {\n _window = undefined;\n}\n\nvar attachEvent = typeof document !== 'undefined' && document.attachEvent;\nvar stylesCreated = false;\n\nif (canUseDOM && !attachEvent) {\n var requestFrame = function () {\n var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || function (fn) {\n return _window.setTimeout(fn, 20);\n };\n return function (fn) {\n return raf(fn);\n };\n }();\n\n var cancelFrame = function () {\n var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || _window.clearTimeout;\n return function (id) {\n return cancel(id);\n };\n }();\n\n var resetTriggers = function resetTriggers(element) {\n var triggers = element.__resizeTriggers__,\n expand = triggers.firstElementChild,\n contract = triggers.lastElementChild,\n expandChild = expand.firstElementChild;\n contract.scrollLeft = contract.scrollWidth;\n contract.scrollTop = contract.scrollHeight;\n expandChild.style.width = expand.offsetWidth + 1 + 'px';\n expandChild.style.height = expand.offsetHeight + 1 + 'px';\n expand.scrollLeft = expand.scrollWidth;\n expand.scrollTop = expand.scrollHeight;\n };\n\n var checkTriggers = function checkTriggers(element) {\n return element.offsetWidth != element.__resizeLast__.width || element.offsetHeight != element.__resizeLast__.height;\n };\n\n var scrollListener = function scrollListener(e) {\n var element = this;\n resetTriggers(this);\n if (this.__resizeRAF__) cancelFrame(this.__resizeRAF__);\n this.__resizeRAF__ = requestFrame(function () {\n if (checkTriggers(element)) {\n element.__resizeLast__.width = element.offsetWidth;\n element.__resizeLast__.height = element.offsetHeight;\n element.__resizeListeners__.forEach(function (fn) {\n fn.call(element, e);\n });\n }\n });\n };\n\n /* Detect CSS Animations support to detect element display/re-attach */\n var animation = false,\n animationstring = 'animation',\n keyframeprefix = '',\n animationstartevent = 'animationstart',\n domPrefixes = 'Webkit Moz O ms'.split(' '),\n startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' '),\n pfx = '';\n\n if (canUseDOM) {\n var elm = document.createElement('fakeelement');\n if (elm.style.animationName !== undefined) {\n animation = true;\n }\n\n if (animation === false) {\n for (var i = 0; i < domPrefixes.length; i++) {\n if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {\n pfx = domPrefixes[i];\n animationstring = pfx + 'Animation';\n keyframeprefix = '-' + pfx.toLowerCase() + '-';\n animationstartevent = startEvents[i];\n animation = true;\n break;\n }\n }\n }\n }\n\n var animationName = 'resizeanim';\n var animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';\n var animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';\n}\n\nvar createStyles = function createStyles() {\n if (!stylesCreated) {\n //opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360\n var css = (animationKeyframes ? animationKeyframes : '') + '.resize-triggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',\n head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n stylesCreated = true;\n }\n};\n\nvar addResizeListener = function addResizeListener(element, fn) {\n if (element.parentNode === undefined) {\n var tempParentDiv = document.createElement('div');\n element.parentNode = tempParentDiv;\n }\n element = element.parentNode;\n if (attachEvent) element.attachEvent('onresize', fn);else {\n if (!element.__resizeTriggers__) {\n if (getComputedStyle(element).position == 'static') element.style.position = 'relative';\n createStyles();\n element.__resizeLast__ = {};\n element.__resizeListeners__ = [];\n (element.__resizeTriggers__ = document.createElement('div')).className = 'resize-triggers';\n element.__resizeTriggers__.innerHTML = '
' + '
';\n element.appendChild(element.__resizeTriggers__);\n resetTriggers(element);\n\n (0, _passiveEvents2.default)(element, 'scroll', scrollListener, true);\n\n /* Listen for a css animation to detect element display/re-attach */\n animationstartevent && element.__resizeTriggers__.addEventListener(animationstartevent, function (e) {\n if (e.animationName == animationName) resetTriggers(element);\n });\n }\n element.__resizeListeners__.push(fn);\n }\n};\n\nvar removeResizeListener = function removeResizeListener(element, fn) {\n element = element.parentNode;\n if (attachEvent) element.detachEvent('onresize', fn);else {\n element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);\n if (!element.__resizeListeners__.length) {\n element.removeEventListener('scroll', scrollListener);\n element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);\n }\n }\n};\n\nmodule.exports = {\n addResizeListener: addResizeListener,\n removeResizeListener: removeResizeListener\n};","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = require('react-dom');\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _google_map_map = require('./google_map_map');\n\nvar _google_map_map2 = _interopRequireDefault(_google_map_map);\n\nvar _marker_dispatcher = require('./marker_dispatcher');\n\nvar _marker_dispatcher2 = _interopRequireDefault(_marker_dispatcher);\n\nvar _google_map_markers = require('./google_map_markers');\n\nvar _google_map_markers2 = _interopRequireDefault(_google_map_markers);\n\nvar _google_map_markers_prerender = require('./google_map_markers_prerender');\n\nvar _google_map_markers_prerender2 = _interopRequireDefault(_google_map_markers_prerender);\n\nvar _google_heatmap = require('./google_heatmap');\n\nvar _google_map_loader = require('./loaders/google_map_loader');\n\nvar _google_map_loader2 = _interopRequireDefault(_google_map_loader);\n\nvar _geo = require('./utils/geo');\n\nvar _geo2 = _interopRequireDefault(_geo);\n\nvar _raf = require('./utils/raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _pick = require('./utils/pick');\n\nvar _pick2 = _interopRequireDefault(_pick);\n\nvar _omit = require('./utils/omit');\n\nvar _omit2 = _interopRequireDefault(_omit);\n\nvar _log = require('./utils/math/log2');\n\nvar _log2 = _interopRequireDefault(_log);\n\nvar _isEmpty = require('./utils/isEmpty');\n\nvar _isEmpty2 = _interopRequireDefault(_isEmpty);\n\nvar _isNumber = require('./utils/isNumber');\n\nvar _isNumber2 = _interopRequireDefault(_isNumber);\n\nvar _detect = require('./utils/detect');\n\nvar _detect2 = _interopRequireDefault(_detect);\n\nvar _shallowEqual = require('./utils/shallowEqual');\n\nvar _shallowEqual2 = _interopRequireDefault(_shallowEqual);\n\nvar _isPlainObject = require('./utils/isPlainObject');\n\nvar _isPlainObject2 = _interopRequireDefault(_isPlainObject);\n\nvar _isArraysEqualEps = require('./utils/isArraysEqualEps');\n\nvar _isArraysEqualEps2 = _interopRequireDefault(_isArraysEqualEps);\n\nvar _detectElementResize = require('./utils/detectElementResize');\n\nvar _detectElementResize2 = _interopRequireDefault(_detectElementResize);\n\nvar _passiveEvents = require('./utils/passiveEvents');\n\nvar _passiveEvents2 = _interopRequireDefault(_passiveEvents);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint-disable import/no-extraneous-dependencies, react/forbid-prop-types, react/no-find-dom-node, no-console */\n\n\n// helpers\n\n\n// loaders\n\n\n// utils\n\n\n// consts\nvar kEPS = 0.00001;\nvar K_GOOGLE_TILE_SIZE = 256;\n// real minZoom calculated here _getMinZoom\nvar K_IDLE_TIMEOUT = 100;\nvar K_IDLE_CLICK_TIMEOUT = 300;\nvar DEFAULT_MIN_ZOOM = 3;\n// Starting with version 3.32, the maps API calls `draw()` each frame during\n// a zoom animation.\nvar DRAW_CALLED_DURING_ANIMATION_VERSION = 32;\nvar IS_REACT_16 = _reactDom2.default.createPortal !== undefined;\n\nvar createPortal = IS_REACT_16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;\n\nfunction defaultOptions_() /* maps */{\n return {\n overviewMapControl: false,\n streetViewControl: false,\n rotateControl: true,\n mapTypeControl: false,\n // disable poi\n styles: [{\n featureType: 'poi',\n elementType: 'labels',\n stylers: [{ visibility: 'off' }]\n }],\n minZoom: DEFAULT_MIN_ZOOM // dynamically recalculted if possible during init\n };\n}\n\nvar latLng2Obj = function latLng2Obj(latLng) {\n return (0, _isPlainObject2.default)(latLng) ? latLng : { lat: latLng[0], lng: latLng[1] };\n};\n\nvar _checkMinZoom = function _checkMinZoom(zoom, minZoom) {\n if (process.env.NODE_ENV !== 'production') {\n if (zoom < minZoom) {\n console.warn('GoogleMap: ' + // eslint-disable-line\n 'minZoom option is less than recommended ' + 'minZoom option for your map sizes.\\n' + 'overrided to value ' + minZoom);\n }\n }\n\n if (minZoom < zoom) {\n return zoom;\n }\n return minZoom;\n};\n\nvar isFullScreen = function isFullScreen() {\n return document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || document.msFullscreenElement;\n};\n\nvar GoogleMap = function (_Component) {\n _inherits(GoogleMap, _Component);\n\n // eslint-disable-line\n\n function GoogleMap(props) {\n _classCallCheck(this, GoogleMap);\n\n var _this = _possibleConstructorReturn(this, _Component.call(this, props));\n\n _this._getMinZoom = function () {\n if (_this.geoService_.getWidth() > 0 || _this.geoService_.getHeight() > 0) {\n var tilesPerWidth = Math.ceil(_this.geoService_.getWidth() / K_GOOGLE_TILE_SIZE) + 2;\n var tilesPerHeight = Math.ceil(_this.geoService_.getHeight() / K_GOOGLE_TILE_SIZE) + 2;\n var maxTilesPerDim = Math.max(tilesPerWidth, tilesPerHeight);\n return Math.ceil((0, _log2.default)(maxTilesPerDim));\n }\n return DEFAULT_MIN_ZOOM;\n };\n\n _this._computeMinZoom = function (minZoom) {\n if (!(0, _isEmpty2.default)(minZoom)) {\n return minZoom;\n }\n return _this._getMinZoom();\n };\n\n _this._mapDomResizeCallback = function () {\n _this.resetSizeOnIdle_ = true;\n if (_this.maps_) {\n var originalCenter = _this.props.center || _this.props.defaultCenter;\n var currentCenter = _this.map_.getCenter();\n _this.maps_.event.trigger(_this.map_, 'resize');\n _this.map_.setCenter(_this.props.resetBoundsOnResize ? originalCenter : currentCenter);\n }\n };\n\n _this._setLayers = function (layerTypes) {\n layerTypes.forEach(function (layerType) {\n _this.layers_[layerType] = new _this.maps_[layerType]();\n _this.layers_[layerType].setMap(_this.map_);\n });\n };\n\n _this._renderPortal = function () {\n return _react2.default.createElement(_google_map_markers2.default, {\n experimental: _this.props.experimental,\n onChildClick: _this._onChildClick,\n onChildMouseDown: _this._onChildMouseDown,\n onChildMouseEnter: _this._onChildMouseEnter,\n onChildMouseLeave: _this._onChildMouseLeave,\n geoService: _this.geoService_,\n insideMapPanes: true,\n distanceToMouse: _this.props.distanceToMouse,\n getHoverDistance: _this._getHoverDistance,\n dispatcher: _this.markersDispatcher_\n });\n };\n\n _this._initMap = function () {\n // only initialize the map once\n if (_this.initialized_) {\n return;\n }\n _this.initialized_ = true;\n\n var propsCenter = latLng2Obj(_this.props.center || _this.props.defaultCenter);\n _this.geoService_.setView(propsCenter, _this.props.zoom || _this.props.defaultZoom, 0);\n\n _this._onBoundsChanged(); // now we can calculate map bounds center etc...\n\n var bootstrapURLKeys = _extends({}, _this.props.apiKey && { key: _this.props.apiKey }, _this.props.bootstrapURLKeys);\n\n _this.props.googleMapLoader(bootstrapURLKeys, _this.props.heatmapLibrary).then(function (maps) {\n if (!_this.mounted_) {\n return;\n }\n\n var centerLatLng = _this.geoService_.getCenter();\n\n var propsOptions = {\n zoom: _this.props.zoom || _this.props.defaultZoom,\n center: new maps.LatLng(centerLatLng.lat, centerLatLng.lng)\n };\n\n // Start Heatmap\n if (_this.props.heatmap.positions) {\n Object.assign(_this, {\n heatmap: (0, _google_heatmap.generateHeatmap)(maps, _this.props.heatmap)\n });\n (0, _google_heatmap.optionsHeatmap)(_this.heatmap, _this.props.heatmap);\n }\n // End Heatmap\n\n // prevent to exapose full api\n // next props must be exposed (console.log(Object.keys(pick(maps, isPlainObject))))\n // \"Animation\", \"ControlPosition\", \"MapTypeControlStyle\", \"MapTypeId\",\n // \"NavigationControlStyle\", \"ScaleControlStyle\", \"StrokePosition\",\n // \"SymbolPath\", \"ZoomControlStyle\",\n // \"event\", \"DirectionsStatus\", \"DirectionsTravelMode\", \"DirectionsUnitSystem\",\n // \"DistanceMatrixStatus\",\n // \"DistanceMatrixElementStatus\", \"ElevationStatus\", \"GeocoderLocationType\",\n // \"GeocoderStatus\", \"KmlLayerStatus\",\n // \"MaxZoomStatus\", \"StreetViewStatus\", \"TransitMode\", \"TransitRoutePreference\",\n // \"TravelMode\", \"UnitSystem\"\n var mapPlainObjects = (0, _pick2.default)(maps, _isPlainObject2.default);\n var options = typeof _this.props.options === 'function' ? _this.props.options(mapPlainObjects) : _this.props.options;\n var defaultOptions = defaultOptions_(mapPlainObjects);\n\n var draggableOptions = !(0, _isEmpty2.default)(_this.props.draggable) && {\n draggable: _this.props.draggable\n };\n\n var minZoom = _this._computeMinZoom(options.minZoom);\n _this.minZoom_ = minZoom;\n\n var preMapOptions = _extends({}, defaultOptions, {\n minZoom: minZoom\n }, options, propsOptions);\n\n _this.defaultDraggableOption_ = !(0, _isEmpty2.default)(preMapOptions.draggable) ? preMapOptions.draggable : _this.defaultDraggableOption_;\n\n var mapOptions = _extends({}, preMapOptions, draggableOptions);\n\n mapOptions.minZoom = _checkMinZoom(mapOptions.minZoom, minZoom);\n\n var map = new maps.Map(_reactDom2.default.findDOMNode(_this.googleMapDom_), mapOptions);\n\n _this.map_ = map;\n _this.maps_ = maps;\n\n _this._setLayers(_this.props.layerTypes);\n\n // Parse `google.maps.version` to capture the major version number.\n var versionMatch = maps.version.match(/^3\\.(\\d+)\\./);\n // The major version is the first (and only) captured group.\n var mapsVersion = versionMatch && Number(versionMatch[1]);\n\n // render in overlay\n var this_ = _this;\n var overlay = Object.assign(new maps.OverlayView(), {\n onAdd: function onAdd() {\n var K_MAX_WIDTH = typeof screen !== 'undefined' ? screen.width + 'px' : '2000px';\n var K_MAX_HEIGHT = typeof screen !== 'undefined' ? screen.height + 'px' : '2000px';\n\n var div = document.createElement('div');\n div.style.backgroundColor = 'transparent';\n div.style.position = 'absolute';\n div.style.left = '0px';\n div.style.top = '0px';\n div.style.width = K_MAX_WIDTH; // prevents some chrome draw defects\n div.style.height = K_MAX_HEIGHT;\n\n if (this_.props.overlayViewDivStyle) {\n var overlayViewDivStyle = this_.props.overlayViewDivStyle;\n\n if ((typeof overlayViewDivStyle === 'undefined' ? 'undefined' : _typeof(overlayViewDivStyle)) === 'object') {\n Object.keys(overlayViewDivStyle).forEach(function (property) {\n div.style[property] = overlayViewDivStyle[property];\n });\n }\n }\n\n var panes = this.getPanes();\n panes.overlayMouseTarget.appendChild(div);\n this_.geoService_.setMapCanvasProjection(maps, overlay.getProjection());\n\n if (!IS_REACT_16) {\n createPortal(this_, this_._renderPortal(), div,\n // remove prerendered markers\n function () {\n return this_.setState({ overlay: div });\n });\n } else {\n this_.setState({ overlay: div });\n }\n },\n onRemove: function onRemove() {\n var renderedOverlay = this_.state.overlay;\n if (renderedOverlay && !IS_REACT_16) {\n _reactDom2.default.unmountComponentAtNode(renderedOverlay);\n }\n this_.setState({ overlay: null });\n },\n draw: function draw() {\n this_.updateCounter_++;\n this_._onBoundsChanged(map, maps, !this_.props.debounced);\n\n if (!this_.googleApiLoadedCalled_) {\n this_._onGoogleApiLoaded({ map: map, maps: maps, ref: this_.googleMapDom_ });\n this_.googleApiLoadedCalled_ = true;\n }\n\n if (this_.mouse_) {\n var latLng = this_.geoService_.fromContainerPixelToLatLng(this_.mouse_);\n this_.mouse_.lat = latLng.lat;\n this_.mouse_.lng = latLng.lng;\n }\n\n this_._onChildMouseMove();\n\n if (this_.markersDispatcher_) {\n this_.markersDispatcher_.emit('kON_CHANGE');\n if (this_.fireMouseEventOnIdle_) {\n this_.markersDispatcher_.emit('kON_MOUSE_POSITION_CHANGE');\n }\n }\n }\n });\n\n _this.overlay_ = overlay;\n\n overlay.setMap(map);\n if (_this.props.heatmap.positions) {\n _this.heatmap.setMap(map);\n }\n\n if (_this.props.onTilesLoaded) {\n maps.event.addListener(map, 'tilesloaded', function () {\n this_._onTilesLoaded();\n });\n }\n\n maps.event.addListener(map, 'zoom_changed', function () {\n // recalc position at zoom start\n if (this_.geoService_.getZoom() !== map.getZoom()) {\n if (!this_.zoomAnimationInProgress_) {\n this_.zoomAnimationInProgress_ = true;\n this_._onZoomAnimationStart(map.zoom);\n }\n\n // If draw() is not called each frame during a zoom animation,\n // simulate it.\n if (mapsVersion < DRAW_CALLED_DURING_ANIMATION_VERSION) {\n var TIMEOUT_ZOOM = 300;\n\n if (new Date().getTime() - _this.zoomControlClickTime_ < TIMEOUT_ZOOM) {\n // there is strange Google Map Api behavior in chrome when zoom animation of map\n // is started only on second raf call, if was click on zoom control\n // or +- keys pressed, so i wait for two rafs before change state\n\n // this does not fully prevent animation jump\n // but reduce it's occurence probability\n (0, _raf2.default)(function () {\n return (0, _raf2.default)(function () {\n this_.updateCounter_++;\n this_._onBoundsChanged(map, maps);\n });\n });\n } else {\n this_.updateCounter_++;\n this_._onBoundsChanged(map, maps);\n }\n }\n }\n });\n\n maps.event.addListener(map, 'idle', function () {\n if (_this.resetSizeOnIdle_) {\n _this._setViewSize();\n var currMinZoom = _this._computeMinZoom(_this.props.options.minZoom);\n\n if (currMinZoom !== _this.minZoom_) {\n _this.minZoom_ = currMinZoom;\n map.setOptions({ minZoom: currMinZoom });\n }\n\n _this.resetSizeOnIdle_ = false;\n }\n\n if (this_.zoomAnimationInProgress_) {\n this_.zoomAnimationInProgress_ = false;\n this_._onZoomAnimationEnd(map.zoom);\n }\n\n this_.updateCounter_++;\n this_._onBoundsChanged(map, maps);\n\n this_.dragTime_ = 0;\n\n if (this_.markersDispatcher_) {\n this_.markersDispatcher_.emit('kON_CHANGE');\n }\n });\n\n maps.event.addListener(map, 'mouseover', function () {\n // has advantage over div MouseLeave\n this_.mouseInMap_ = true;\n });\n\n // an alternative way to know the mouse is back within the map\n // This would not fire when clicking/interacting with google maps\n // own on-map countrols+markers. This handles an edge case for touch devices\n // + 'draggable:false' custom option. See #332 for more details.\n maps.event.addListener(map, 'click', function () {\n this_.mouseInMap_ = true;\n });\n\n maps.event.addListener(map, 'mouseout', function () {\n // has advantage over div MouseLeave\n this_.mouseInMap_ = false;\n this_.mouse_ = null;\n this_.markersDispatcher_.emit('kON_MOUSE_POSITION_CHANGE');\n });\n\n maps.event.addListener(map, 'drag', function () {\n this_.dragTime_ = new Date().getTime();\n this_._onDrag(map);\n });\n\n maps.event.addListener(map, 'dragend', function () {\n // 'dragend' fires on mouse release.\n // 'idle' listener waits until drag inertia ends before firing `onDragEnd`\n var idleListener = maps.event.addListener(map, 'idle', function () {\n maps.event.removeListener(idleListener);\n this_._onDragEnd(map);\n });\n });\n // user choosing satellite vs roads, etc\n maps.event.addListener(map, 'maptypeid_changed', function () {\n this_._onMapTypeIdChange(map.getMapTypeId());\n });\n }).catch(function (e) {\n // notify callback of load failure\n _this._onGoogleApiLoaded({\n map: null,\n maps: null,\n ref: _this.googleMapDom_\n });\n console.error(e); // eslint-disable-line no-console\n throw e;\n });\n };\n\n _this._onGoogleApiLoaded = function () {\n if (_this.props.onGoogleApiLoaded) {\n var _this$props;\n\n if (process.env.NODE_ENV !== 'production' && _this.props.yesIWantToUseGoogleMapApiInternals !== true) {\n console.warn('GoogleMap: ' + // eslint-disable-line\n 'Usage of internal api objects is dangerous ' + 'and can cause a lot of issues.\\n' + 'To hide this warning add yesIWantToUseGoogleMapApiInternals={true} ' + 'to K_RECALC_CLIENT_RECT_MS) {\n _this.boundingRect_ = e.currentTarget.getBoundingClientRect();\n }\n _this.mouseMoveTime_ = currTime;\n\n var mousePosX = e.clientX - _this.boundingRect_.left;\n var mousePosY = e.clientY - _this.boundingRect_.top;\n\n if (!_this.mouse_) {\n _this.mouse_ = { x: 0, y: 0, lat: 0, lng: 0 };\n }\n\n _this.mouse_.x = mousePosX;\n _this.mouse_.y = mousePosY;\n\n var latLng = _this.geoService_.fromContainerPixelToLatLng(_this.mouse_);\n _this.mouse_.lat = latLng.lat;\n _this.mouse_.lng = latLng.lng;\n\n _this._onChildMouseMove();\n\n if (currTime - _this.dragTime_ < K_IDLE_TIMEOUT) {\n _this.fireMouseEventOnIdle_ = true;\n } else {\n _this.markersDispatcher_.emit('kON_MOUSE_POSITION_CHANGE');\n _this.fireMouseEventOnIdle_ = false;\n }\n };\n\n _this._onClick = function () {\n var _this$props12;\n\n return _this.props.onClick && !_this.childMouseDownArgs_ && new Date().getTime() - _this.childMouseUpTime_ > K_IDLE_CLICK_TIMEOUT && _this.dragTime_ === 0 && (_this$props12 = _this.props).onClick.apply(_this$props12, arguments);\n };\n\n _this._onMapClick = function (event) {\n if (_this.markersDispatcher_) {\n // support touch events and recalculate mouse position on click\n _this._onMapMouseMove(event);\n var currTime = new Date().getTime();\n if (currTime - _this.dragTime_ > K_IDLE_TIMEOUT) {\n if (_this.mouse_) {\n _this._onClick(_extends({}, _this.mouse_, {\n event: event\n }));\n }\n\n _this.markersDispatcher_.emit('kON_CLICK', event);\n }\n }\n };\n\n _this._onMapMouseDownNative = function (event) {\n if (!_this.mouseInMap_) return;\n\n _this._onMapMouseDown(event);\n };\n\n _this._onMapMouseDown = function (event) {\n if (_this.markersDispatcher_) {\n var currTime = new Date().getTime();\n if (currTime - _this.dragTime_ > K_IDLE_TIMEOUT) {\n // Hovered marker detected at mouse move could be deleted at mouse down time\n // so it will be good to force hovered marker recalculation\n _this._onMapMouseMove(event);\n _this.markersDispatcher_.emit('kON_MDOWN', event);\n }\n }\n };\n\n _this._onMapMouseDownCapture = function () {\n if ((0, _detect2.default)().isChrome) {\n // to fix strange zoom in chrome\n _this.zoomControlClickTime_ = new Date().getTime();\n }\n };\n\n _this._onKeyDownCapture = function () {\n if ((0, _detect2.default)().isChrome) {\n _this.zoomControlClickTime_ = new Date().getTime();\n }\n };\n\n _this._isCenterDefined = function (center) {\n return center && ((0, _isPlainObject2.default)(center) && (0, _isNumber2.default)(center.lat) && (0, _isNumber2.default)(center.lng) || center.length === 2 && (0, _isNumber2.default)(center[0]) && (0, _isNumber2.default)(center[1]));\n };\n\n _this._onBoundsChanged = function (map, maps, callExtBoundsChange) {\n if (map) {\n var gmC = map.getCenter();\n _this.geoService_.setView([gmC.lat(), gmC.lng()], map.getZoom(), 0);\n }\n\n if ((_this.props.onChange || _this.props.onBoundsChange) && _this.geoService_.canProject()) {\n var zoom = _this.geoService_.getZoom();\n var bounds = _this.geoService_.getBounds();\n var centerLatLng = _this.geoService_.getCenter();\n\n if (!(0, _isArraysEqualEps2.default)(bounds, _this.prevBounds_, kEPS)) {\n if (callExtBoundsChange !== false) {\n var marginBounds = _this.geoService_.getBounds(_this.props.margin);\n if (_this.props.onBoundsChange) {\n _this.props.onBoundsChange(_this.centerIsObject_ ? _extends({}, centerLatLng) : [centerLatLng.lat, centerLatLng.lng], zoom, bounds, marginBounds);\n }\n\n if (_this.props.onChange) {\n _this.props.onChange({\n center: _extends({}, centerLatLng),\n zoom: zoom,\n bounds: {\n nw: {\n lat: bounds[0],\n lng: bounds[1]\n },\n se: {\n lat: bounds[2],\n lng: bounds[3]\n },\n sw: {\n lat: bounds[4],\n lng: bounds[5]\n },\n ne: {\n lat: bounds[6],\n lng: bounds[7]\n }\n },\n marginBounds: {\n nw: {\n lat: marginBounds[0],\n lng: marginBounds[1]\n },\n se: {\n lat: marginBounds[2],\n lng: marginBounds[3]\n },\n sw: {\n lat: marginBounds[4],\n lng: marginBounds[5]\n },\n ne: {\n lat: marginBounds[6],\n lng: marginBounds[7]\n }\n },\n\n size: _this.geoService_.hasSize() ? {\n width: _this.geoService_.getWidth(),\n height: _this.geoService_.getHeight()\n } : {\n width: 0,\n height: 0\n }\n });\n }\n\n _this.prevBounds_ = bounds;\n }\n }\n }\n };\n\n _this._registerChild = function (ref) {\n _this.googleMapDom_ = ref;\n };\n\n _this.mounted_ = false;\n _this.initialized_ = false;\n _this.googleApiLoadedCalled_ = false;\n\n _this.map_ = null;\n _this.maps_ = null;\n _this.prevBounds_ = null;\n _this.heatmap = null;\n\n _this.layers_ = {};\n\n _this.mouse_ = null;\n _this.mouseMoveTime_ = 0;\n _this.boundingRect_ = null;\n _this.mouseInMap_ = true;\n\n _this.dragTime_ = 0;\n _this.fireMouseEventOnIdle_ = false;\n _this.updateCounter_ = 0;\n\n _this.markersDispatcher_ = new _marker_dispatcher2.default(_this);\n _this.geoService_ = new _geo2.default(K_GOOGLE_TILE_SIZE);\n _this.centerIsObject_ = (0, _isPlainObject2.default)(_this.props.center);\n\n _this.minZoom_ = DEFAULT_MIN_ZOOM;\n _this.defaultDraggableOption_ = true;\n\n _this.zoomControlClickTime_ = 0;\n\n _this.childMouseDownArgs_ = null;\n _this.childMouseUpTime_ = 0;\n\n _this.googleMapDom_ = null;\n\n if (process.env.NODE_ENV !== 'production') {\n if (_this.props.apiKey) {\n console.warn('GoogleMap: ' + // eslint-disable-line no-console\n 'apiKey is deprecated, use ' + 'bootstrapURLKeys={{key: YOUR_API_KEY}} instead.');\n }\n\n if (_this.props.onBoundsChange) {\n console.warn('GoogleMap: ' + // eslint-disable-line no-console\n 'onBoundsChange is deprecated, use ' + 'onChange({center, zoom, bounds, ...other}) instead.');\n }\n\n if ((0, _isEmpty2.default)(_this.props.center) && (0, _isEmpty2.default)(_this.props.defaultCenter)) {\n console.warn('GoogleMap: center or defaultCenter property must be defined' // eslint-disable-line no-console\n );\n }\n\n if ((0, _isEmpty2.default)(_this.props.zoom) && (0, _isEmpty2.default)(_this.props.defaultZoom)) {\n console.warn('GoogleMap: zoom or defaultZoom property must be defined' // eslint-disable-line no-console\n );\n }\n }\n\n if (_this._isCenterDefined(_this.props.center || _this.props.defaultCenter)) {\n var propsCenter = latLng2Obj(_this.props.center || _this.props.defaultCenter);\n _this.geoService_.setView(propsCenter, _this.props.zoom || _this.props.defaultZoom, 0);\n }\n\n _this.zoomAnimationInProgress_ = false;\n\n _this.state = {\n overlay: null\n };\n return _this;\n }\n\n GoogleMap.prototype.componentDidMount = function componentDidMount() {\n var _this2 = this;\n\n this.mounted_ = true;\n (0, _passiveEvents2.default)(window, 'resize', this._onWindowResize, false);\n (0, _passiveEvents2.default)(window, 'keydown', this._onKeyDownCapture, true);\n var mapDom = _reactDom2.default.findDOMNode(this.googleMapDom_);\n // gmap can't prevent map drag if mousedown event already occured\n // the only workaround I find is prevent mousedown native browser event\n\n if (mapDom) {\n (0, _passiveEvents2.default)(mapDom, 'mousedown', this._onMapMouseDownNative, true);\n }\n\n (0, _passiveEvents2.default)(window, 'mouseup', this._onChildMouseUp, false);\n var bootstrapURLKeys = _extends({}, this.props.apiKey && { key: this.props.apiKey }, this.props.bootstrapURLKeys);\n\n this.props.googleMapLoader(bootstrapURLKeys, this.props.heatmapLibrary); // we can start load immediatly\n\n setTimeout(function () {\n // to detect size\n _this2._setViewSize();\n if (_this2._isCenterDefined(_this2.props.center || _this2.props.defaultCenter)) {\n _this2._initMap();\n }\n }, 0, this);\n if (this.props.resetBoundsOnResize) {\n var that = this;\n _detectElementResize2.default.addResizeListener(mapDom, that._mapDomResizeCallback);\n }\n };\n\n GoogleMap.prototype.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {\n var _this3 = this;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(0, _shallowEqual2.default)(this.props.defaultCenter, nextProps.defaultCenter)) {\n console.warn(\"GoogleMap: defaultCenter prop changed. You can't change default props.\");\n }\n\n if (!(0, _shallowEqual2.default)(this.props.defaultZoom, nextProps.defaultZoom)) {\n console.warn(\"GoogleMap: defaultZoom prop changed. You can't change default props.\");\n }\n }\n\n if (!this._isCenterDefined(this.props.center) && this._isCenterDefined(nextProps.center)) {\n setTimeout(function () {\n return _this3._initMap();\n }, 0);\n }\n\n if (this.map_) {\n var centerLatLng = this.geoService_.getCenter();\n if (this._isCenterDefined(nextProps.center)) {\n var nextPropsCenter = latLng2Obj(nextProps.center);\n var currCenter = this._isCenterDefined(this.props.center) ? latLng2Obj(this.props.center) : null;\n\n if (!currCenter || Math.abs(nextPropsCenter.lat - currCenter.lat) + Math.abs(nextPropsCenter.lng - currCenter.lng) > kEPS) {\n if (Math.abs(nextPropsCenter.lat - centerLatLng.lat) + Math.abs(nextPropsCenter.lng - centerLatLng.lng) > kEPS) {\n this.map_.panTo({\n lat: nextPropsCenter.lat,\n lng: nextPropsCenter.lng\n });\n }\n }\n }\n\n if (!(0, _isEmpty2.default)(nextProps.zoom)) {\n // if zoom chaged by user\n if (Math.abs(nextProps.zoom - this.props.zoom) > 0) {\n this.map_.setZoom(nextProps.zoom);\n }\n }\n\n if (!(0, _isEmpty2.default)(this.props.draggable) && (0, _isEmpty2.default)(nextProps.draggable)) {\n // reset to default\n this.map_.setOptions({ draggable: this.defaultDraggableOption_ });\n } else if (!(0, _shallowEqual2.default)(this.props.draggable, nextProps.draggable)) {\n // also prevent this on window 'mousedown' event to prevent map move\n this.map_.setOptions({ draggable: nextProps.draggable });\n }\n\n // use shallowEqual to try avoid calling map._setOptions if only the ref changes\n if (!(0, _isEmpty2.default)(nextProps.options) && !(0, _shallowEqual2.default)(this.props.options, nextProps.options)) {\n var mapPlainObjects = (0, _pick2.default)(this.maps_, _isPlainObject2.default);\n var options = typeof nextProps.options === 'function' ? nextProps.options(mapPlainObjects) : nextProps.options;\n // remove zoom, center and draggable options as these are managed by google-maps-react\n options = (0, _omit2.default)(options, ['zoom', 'center', 'draggable']);\n\n if ('minZoom' in options) {\n var minZoom = this._computeMinZoom(options.minZoom);\n options.minZoom = _checkMinZoom(options.minZoom, minZoom);\n }\n\n this.map_.setOptions(options);\n }\n\n if (!(0, _shallowEqual2.default)(nextProps.layerTypes, this.props.layerTypes)) {\n Object.keys(this.layers_).forEach(function (layerKey) {\n _this3.layers_[layerKey].setMap(null);\n delete _this3.layers_[layerKey];\n });\n this._setLayers(nextProps.layerTypes);\n }\n\n if (this.heatmap && !(0, _shallowEqual2.default)(nextProps.heatmap.positions, this.props.heatmap.positions)) {\n this.heatmap.setData(nextProps.heatmap.positions.map(function (p) {\n return {\n location: new _this3.maps_.LatLng(p.lat, p.lng),\n weight: p.weight\n };\n }));\n }\n }\n };\n\n GoogleMap.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {\n // draggable does not affect inner components\n return !(0, _shallowEqual2.default)((0, _omit2.default)(this.props, ['draggable']), (0, _omit2.default)(nextProps, ['draggable'])) || !(0, _shallowEqual2.default)(this.state, nextState);\n };\n\n GoogleMap.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {\n this.markersDispatcher_.emit('kON_CHANGE');\n\n if (!(0, _shallowEqual2.default)(this.props.hoverDistance, prevProps.hoverDistance)) {\n this.markersDispatcher_.emit('kON_MOUSE_POSITION_CHANGE');\n }\n };\n\n GoogleMap.prototype.componentWillUnmount = function componentWillUnmount() {\n this.mounted_ = false;\n var mapDom = _reactDom2.default.findDOMNode(this.googleMapDom_);\n if (mapDom) {\n mapDom.removeEventListener('mousedown', this._onMapMouseDownNative, true);\n }\n window.removeEventListener('resize', this._onWindowResize);\n window.removeEventListener('keydown', this._onKeyDownCapture);\n window.removeEventListener('mouseup', this._onChildMouseUp, false);\n if (this.props.resetBoundsOnResize) {\n _detectElementResize2.default.removeResizeListener(mapDom, this._mapDomResizeCallback);\n }\n\n if (this.overlay_) {\n // this triggers overlay_.onRemove(), which will unmount the \n this.overlay_.setMap(null);\n }\n\n if (this.maps_ && this.map_ && this.props.shouldUnregisterMapOnUnmount) {\n // fix google, as otherwise listeners works even without map\n this.map_.setOptions({ scrollwheel: false });\n this.maps_.event.clearInstanceListeners(this.map_);\n }\n\n if (this.props.shouldUnregisterMapOnUnmount) {\n this.map_ = null;\n this.maps_ = null;\n }\n this.markersDispatcher_.dispose();\n\n this.resetSizeOnIdle_ = false;\n\n if (this.props.shouldUnregisterMapOnUnmount) {\n delete this.map_;\n delete this.markersDispatcher_;\n }\n };\n // calc minZoom if map size available\n // it's better to not set minZoom less than this calculation gives\n // otherwise there is no homeomorphism between screen coordinates and map\n // (one map coordinate can have different screen coordinates)\n\n\n // this method works only if this.props.onChildMouseDown was called\n\n\n // this method works only if this.props.onChildMouseDown was called\n\n\n // K_IDLE_CLICK_TIMEOUT - looks like 300 is enough\n\n\n // gmap can't prevent map drag if mousedown event already occured\n // the only workaround I find is prevent mousedown native browser event\n\n\n GoogleMap.prototype.render = function render() {\n var overlay = this.state.overlay;\n var mapMarkerPrerender = !overlay ? _react2.default.createElement(_google_map_markers_prerender2.default, {\n experimental: this.props.experimental,\n onChildClick: this._onChildClick,\n onChildMouseDown: this._onChildMouseDown,\n onChildMouseEnter: this._onChildMouseEnter,\n onChildMouseLeave: this._onChildMouseLeave,\n geoService: this.geoService_,\n insideMapPanes: false,\n distanceToMouse: this.props.distanceToMouse,\n getHoverDistance: this._getHoverDistance,\n dispatcher: this.markersDispatcher_\n }) : null;\n\n return _react2.default.createElement(\n 'div',\n {\n style: this.props.style,\n onMouseMove: this._onMapMouseMove,\n onMouseDownCapture: this._onMapMouseDownCapture,\n onClick: this._onMapClick\n },\n _react2.default.createElement(_google_map_map2.default, { registerChild: this._registerChild }),\n IS_REACT_16 && overlay && createPortal(this._renderPortal(), overlay),\n mapMarkerPrerender\n );\n };\n\n return GoogleMap;\n}(_react.Component);\n\nGoogleMap.propTypes = {\n apiKey: _propTypes2.default.string,\n bootstrapURLKeys: _propTypes2.default.any,\n\n defaultCenter: _propTypes2.default.oneOfType([_propTypes2.default.array, _propTypes2.default.shape({\n lat: _propTypes2.default.number,\n lng: _propTypes2.default.number\n })]),\n center: _propTypes2.default.oneOfType([_propTypes2.default.array, _propTypes2.default.shape({\n lat: _propTypes2.default.number,\n lng: _propTypes2.default.number\n })]),\n defaultZoom: _propTypes2.default.number,\n zoom: _propTypes2.default.number,\n onBoundsChange: _propTypes2.default.func,\n onChange: _propTypes2.default.func,\n onClick: _propTypes2.default.func,\n onChildClick: _propTypes2.default.func,\n onChildMouseDown: _propTypes2.default.func,\n onChildMouseUp: _propTypes2.default.func,\n onChildMouseMove: _propTypes2.default.func,\n onChildMouseEnter: _propTypes2.default.func,\n onChildMouseLeave: _propTypes2.default.func,\n onZoomAnimationStart: _propTypes2.default.func,\n onZoomAnimationEnd: _propTypes2.default.func,\n onDrag: _propTypes2.default.func,\n onDragEnd: _propTypes2.default.func,\n onMapTypeIdChange: _propTypes2.default.func,\n onTilesLoaded: _propTypes2.default.func,\n options: _propTypes2.default.any,\n distanceToMouse: _propTypes2.default.func,\n hoverDistance: _propTypes2.default.number,\n debounced: _propTypes2.default.bool,\n margin: _propTypes2.default.array,\n googleMapLoader: _propTypes2.default.any,\n onGoogleApiLoaded: _propTypes2.default.func,\n yesIWantToUseGoogleMapApiInternals: _propTypes2.default.bool,\n draggable: _propTypes2.default.bool,\n style: _propTypes2.default.any,\n resetBoundsOnResize: _propTypes2.default.bool,\n layerTypes: _propTypes2.default.arrayOf(_propTypes2.default.string), // ['TransitLayer', 'TrafficLayer']\n shouldUnregisterMapOnUnmount: _propTypes2.default.bool\n};\nGoogleMap.defaultProps = {\n distanceToMouse: function distanceToMouse(pt, mousePos /* , markerProps */) {\n return Math.sqrt((pt.x - mousePos.x) * (pt.x - mousePos.x) + (pt.y - mousePos.y) * (pt.y - mousePos.y));\n },\n\n hoverDistance: 30,\n debounced: true,\n options: defaultOptions_,\n googleMapLoader: _google_map_loader2.default,\n yesIWantToUseGoogleMapApiInternals: false,\n style: {\n width: '100%',\n height: '100%',\n margin: 0,\n padding: 0,\n position: 'relative'\n },\n layerTypes: [],\n heatmap: {},\n heatmapLibrary: false,\n shouldUnregisterMapOnUnmount: true\n};\nGoogleMap.googleMapLoader = _google_map_loader2.default;\nexports.default = GoogleMap;","'use strict';\n\nexports.__esModule = true;\nexports.default = undefined;\n\nvar _google_map = require('./google_map');\n\nvar _google_map2 = _interopRequireDefault(_google_map);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _google_map2.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n// longitude/latitude to spherical mercator in [0..1] range\nvar lngX = exports.lngX = function lngX(lng) {\n return lng / 360 + 0.5;\n};\n\nvar latY = exports.latY = function latY(lat) {\n var sin = Math.sin(lat * Math.PI / 180);\n var y = 0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;\n\n return y < 0 ? 0 : y > 1 ? 1 : y;\n};\n\nvar TILE_SIZE = 256;\n\nvar screenDist2LatLngDist = exports.screenDist2LatLngDist = function screenDist2LatLngDist(dist, zoom) {\n var scale = Math.pow(2, zoom);\n var distW = dist / scale / TILE_SIZE;\n var distLatLng = distW * 360;\n return distLatLng;\n};\n\n/*\n// spherical mercator to longitude/latitude\nexport const xLng = (x) => (x - 0.5) * 360;\n\nexport const yLat = (y) =>\n 360 * Math.atan(Math.exp((180 - y * 360) * Math.PI / 180)) / Math.PI - 90;\n*/","/*\n (c) 2015, Vladimir Agafonkin\n RBush, a JavaScript library for high-performance 2D spatial indexing of points and rectangles.\n https://github.com/mourner/rbush\n*/\n\n(function () {\n'use strict';\n\nfunction rbush(maxEntries, format) {\n if (!(this instanceof rbush)) return new rbush(maxEntries, format);\n\n // max entries in a node is 9 by default; min node fill is 40% for best performance\n this._maxEntries = Math.max(4, maxEntries || 9);\n this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n\n if (format) {\n this._initFormat(format);\n }\n\n this.clear();\n}\n\nrbush.prototype = {\n\n all: function () {\n return this._all(this.data, []);\n },\n\n search: function (bbox) {\n\n var node = this.data,\n result = [],\n toBBox = this.toBBox;\n\n if (!intersects(bbox, node.bbox)) return result;\n\n var nodesToSearch = [],\n i, len, child, childBBox;\n\n while (node) {\n for (i = 0, len = node.children.length; i < len; i++) {\n\n child = node.children[i];\n childBBox = node.leaf ? toBBox(child) : child.bbox;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf) result.push(child);\n else if (contains(bbox, childBBox)) this._all(child, result);\n else nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return result;\n },\n\n collides: function (bbox) {\n\n var node = this.data,\n toBBox = this.toBBox;\n\n if (!intersects(bbox, node.bbox)) return false;\n\n var nodesToSearch = [],\n i, len, child, childBBox;\n\n while (node) {\n for (i = 0, len = node.children.length; i < len; i++) {\n\n child = node.children[i];\n childBBox = node.leaf ? toBBox(child) : child.bbox;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf || contains(bbox, childBBox)) return true;\n nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return false;\n },\n\n load: function (data) {\n if (!(data && data.length)) return this;\n\n if (data.length < this._minEntries) {\n for (var i = 0, len = data.length; i < len; i++) {\n this.insert(data[i]);\n }\n return this;\n }\n\n // recursively build the tree with the given data from stratch using OMT algorithm\n var node = this._build(data.slice(), 0, data.length - 1, 0);\n\n if (!this.data.children.length) {\n // save as is if tree is empty\n this.data = node;\n\n } else if (this.data.height === node.height) {\n // split root if trees have the same height\n this._splitRoot(this.data, node);\n\n } else {\n if (this.data.height < node.height) {\n // swap trees if inserted one is bigger\n var tmpNode = this.data;\n this.data = node;\n node = tmpNode;\n }\n\n // insert the small tree into the large tree at appropriate level\n this._insert(node, this.data.height - node.height - 1, true);\n }\n\n return this;\n },\n\n insert: function (item) {\n if (item) this._insert(item, this.data.height - 1);\n return this;\n },\n\n clear: function () {\n this.data = {\n children: [],\n height: 1,\n bbox: empty(),\n leaf: true\n };\n return this;\n },\n\n remove: function (item) {\n if (!item) return this;\n\n var node = this.data,\n bbox = this.toBBox(item),\n path = [],\n indexes = [],\n i, parent, index, goingUp;\n\n // depth-first iterative tree traversal\n while (node || path.length) {\n\n if (!node) { // go up\n node = path.pop();\n parent = path[path.length - 1];\n i = indexes.pop();\n goingUp = true;\n }\n\n if (node.leaf) { // check current node\n index = node.children.indexOf(item);\n\n if (index !== -1) {\n // item found, remove the item and condense tree upwards\n node.children.splice(index, 1);\n path.push(node);\n this._condense(path);\n return this;\n }\n }\n\n if (!goingUp && !node.leaf && contains(node.bbox, bbox)) { // go down\n path.push(node);\n indexes.push(i);\n i = 0;\n parent = node;\n node = node.children[0];\n\n } else if (parent) { // go right\n i++;\n node = parent.children[i];\n goingUp = false;\n\n } else node = null; // nothing found\n }\n\n return this;\n },\n\n toBBox: function (item) { return item; },\n\n compareMinX: function (a, b) { return a[0] - b[0]; },\n compareMinY: function (a, b) { return a[1] - b[1]; },\n\n toJSON: function () { return this.data; },\n\n fromJSON: function (data) {\n this.data = data;\n return this;\n },\n\n _all: function (node, result) {\n var nodesToSearch = [];\n while (node) {\n if (node.leaf) result.push.apply(result, node.children);\n else nodesToSearch.push.apply(nodesToSearch, node.children);\n\n node = nodesToSearch.pop();\n }\n return result;\n },\n\n _build: function (items, left, right, height) {\n\n var N = right - left + 1,\n M = this._maxEntries,\n node;\n\n if (N <= M) {\n // reached leaf level; return leaf\n node = {\n children: items.slice(left, right + 1),\n height: 1,\n bbox: null,\n leaf: true\n };\n calcBBox(node, this.toBBox);\n return node;\n }\n\n if (!height) {\n // target height of the bulk-loaded tree\n height = Math.ceil(Math.log(N) / Math.log(M));\n\n // target number of root entries to maximize storage utilization\n M = Math.ceil(N / Math.pow(M, height - 1));\n }\n\n node = {\n children: [],\n height: height,\n bbox: null,\n leaf: false\n };\n\n // split the items into M mostly square tiles\n\n var N2 = Math.ceil(N / M),\n N1 = N2 * Math.ceil(Math.sqrt(M)),\n i, j, right2, right3;\n\n multiSelect(items, left, right, N1, this.compareMinX);\n\n for (i = left; i <= right; i += N1) {\n\n right2 = Math.min(i + N1 - 1, right);\n\n multiSelect(items, i, right2, N2, this.compareMinY);\n\n for (j = i; j <= right2; j += N2) {\n\n right3 = Math.min(j + N2 - 1, right2);\n\n // pack each entry recursively\n node.children.push(this._build(items, j, right3, height - 1));\n }\n }\n\n calcBBox(node, this.toBBox);\n\n return node;\n },\n\n _chooseSubtree: function (bbox, node, level, path) {\n\n var i, len, child, targetNode, area, enlargement, minArea, minEnlargement;\n\n while (true) {\n path.push(node);\n\n if (node.leaf || path.length - 1 === level) break;\n\n minArea = minEnlargement = Infinity;\n\n for (i = 0, len = node.children.length; i < len; i++) {\n child = node.children[i];\n area = bboxArea(child.bbox);\n enlargement = enlargedArea(bbox, child.bbox) - area;\n\n // choose entry with the least area enlargement\n if (enlargement < minEnlargement) {\n minEnlargement = enlargement;\n minArea = area < minArea ? area : minArea;\n targetNode = child;\n\n } else if (enlargement === minEnlargement) {\n // otherwise choose one with the smallest area\n if (area < minArea) {\n minArea = area;\n targetNode = child;\n }\n }\n }\n\n node = targetNode || node.children[0];\n }\n\n return node;\n },\n\n _insert: function (item, level, isNode) {\n\n var toBBox = this.toBBox,\n bbox = isNode ? item.bbox : toBBox(item),\n insertPath = [];\n\n // find the best node for accommodating the item, saving all nodes along the path too\n var node = this._chooseSubtree(bbox, this.data, level, insertPath);\n\n // put the item into the node\n node.children.push(item);\n extend(node.bbox, bbox);\n\n // split on node overflow; propagate upwards if necessary\n while (level >= 0) {\n if (insertPath[level].children.length > this._maxEntries) {\n this._split(insertPath, level);\n level--;\n } else break;\n }\n\n // adjust bboxes along the insertion path\n this._adjustParentBBoxes(bbox, insertPath, level);\n },\n\n // split overflowed node into two\n _split: function (insertPath, level) {\n\n var node = insertPath[level],\n M = node.children.length,\n m = this._minEntries;\n\n this._chooseSplitAxis(node, m, M);\n\n var splitIndex = this._chooseSplitIndex(node, m, M);\n\n var newNode = {\n children: node.children.splice(splitIndex, node.children.length - splitIndex),\n height: node.height,\n bbox: null,\n leaf: false\n };\n\n if (node.leaf) newNode.leaf = true;\n\n calcBBox(node, this.toBBox);\n calcBBox(newNode, this.toBBox);\n\n if (level) insertPath[level - 1].children.push(newNode);\n else this._splitRoot(node, newNode);\n },\n\n _splitRoot: function (node, newNode) {\n // split root node\n this.data = {\n children: [node, newNode],\n height: node.height + 1,\n bbox: null,\n leaf: false\n };\n calcBBox(this.data, this.toBBox);\n },\n\n _chooseSplitIndex: function (node, m, M) {\n\n var i, bbox1, bbox2, overlap, area, minOverlap, minArea, index;\n\n minOverlap = minArea = Infinity;\n\n for (i = m; i <= M - m; i++) {\n bbox1 = distBBox(node, 0, i, this.toBBox);\n bbox2 = distBBox(node, i, M, this.toBBox);\n\n overlap = intersectionArea(bbox1, bbox2);\n area = bboxArea(bbox1) + bboxArea(bbox2);\n\n // choose distribution with minimum overlap\n if (overlap < minOverlap) {\n minOverlap = overlap;\n index = i;\n\n minArea = area < minArea ? area : minArea;\n\n } else if (overlap === minOverlap) {\n // otherwise choose distribution with minimum area\n if (area < minArea) {\n minArea = area;\n index = i;\n }\n }\n }\n\n return index;\n },\n\n // sorts node children by the best axis for split\n _chooseSplitAxis: function (node, m, M) {\n\n var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX,\n compareMinY = node.leaf ? this.compareMinY : compareNodeMinY,\n xMargin = this._allDistMargin(node, m, M, compareMinX),\n yMargin = this._allDistMargin(node, m, M, compareMinY);\n\n // if total distributions margin value is minimal for x, sort by minX,\n // otherwise it's already sorted by minY\n if (xMargin < yMargin) node.children.sort(compareMinX);\n },\n\n // total margin of all possible split distributions where each node is at least m full\n _allDistMargin: function (node, m, M, compare) {\n\n node.children.sort(compare);\n\n var toBBox = this.toBBox,\n leftBBox = distBBox(node, 0, m, toBBox),\n rightBBox = distBBox(node, M - m, M, toBBox),\n margin = bboxMargin(leftBBox) + bboxMargin(rightBBox),\n i, child;\n\n for (i = m; i < M - m; i++) {\n child = node.children[i];\n extend(leftBBox, node.leaf ? toBBox(child) : child.bbox);\n margin += bboxMargin(leftBBox);\n }\n\n for (i = M - m - 1; i >= m; i--) {\n child = node.children[i];\n extend(rightBBox, node.leaf ? toBBox(child) : child.bbox);\n margin += bboxMargin(rightBBox);\n }\n\n return margin;\n },\n\n _adjustParentBBoxes: function (bbox, path, level) {\n // adjust bboxes along the given tree path\n for (var i = level; i >= 0; i--) {\n extend(path[i].bbox, bbox);\n }\n },\n\n _condense: function (path) {\n // go through the path, removing empty nodes and updating bboxes\n for (var i = path.length - 1, siblings; i >= 0; i--) {\n if (path[i].children.length === 0) {\n if (i > 0) {\n siblings = path[i - 1].children;\n siblings.splice(siblings.indexOf(path[i]), 1);\n\n } else this.clear();\n\n } else calcBBox(path[i], this.toBBox);\n }\n },\n\n _initFormat: function (format) {\n // data format (minX, minY, maxX, maxY accessors)\n\n // uses eval-type function compilation instead of just accepting a toBBox function\n // because the algorithms are very sensitive to sorting functions performance,\n // so they should be dead simple and without inner calls\n\n var compareArr = ['return a', ' - b', ';'];\n\n this.compareMinX = new Function('a', 'b', compareArr.join(format[0]));\n this.compareMinY = new Function('a', 'b', compareArr.join(format[1]));\n\n this.toBBox = new Function('a', 'return [a' + format.join(', a') + '];');\n }\n};\n\n\n// calculate node's bbox from bboxes of its children\nfunction calcBBox(node, toBBox) {\n node.bbox = distBBox(node, 0, node.children.length, toBBox);\n}\n\n// min bounding rectangle of node children from k to p-1\nfunction distBBox(node, k, p, toBBox) {\n var bbox = empty();\n\n for (var i = k, child; i < p; i++) {\n child = node.children[i];\n extend(bbox, node.leaf ? toBBox(child) : child.bbox);\n }\n\n return bbox;\n}\n\nfunction empty() { return [Infinity, Infinity, -Infinity, -Infinity]; }\n\nfunction extend(a, b) {\n a[0] = Math.min(a[0], b[0]);\n a[1] = Math.min(a[1], b[1]);\n a[2] = Math.max(a[2], b[2]);\n a[3] = Math.max(a[3], b[3]);\n return a;\n}\n\nfunction compareNodeMinX(a, b) { return a.bbox[0] - b.bbox[0]; }\nfunction compareNodeMinY(a, b) { return a.bbox[1] - b.bbox[1]; }\n\nfunction bboxArea(a) { return (a[2] - a[0]) * (a[3] - a[1]); }\nfunction bboxMargin(a) { return (a[2] - a[0]) + (a[3] - a[1]); }\n\nfunction enlargedArea(a, b) {\n return (Math.max(b[2], a[2]) - Math.min(b[0], a[0])) *\n (Math.max(b[3], a[3]) - Math.min(b[1], a[1]));\n}\n\nfunction intersectionArea(a, b) {\n var minX = Math.max(a[0], b[0]),\n minY = Math.max(a[1], b[1]),\n maxX = Math.min(a[2], b[2]),\n maxY = Math.min(a[3], b[3]);\n\n return Math.max(0, maxX - minX) *\n Math.max(0, maxY - minY);\n}\n\nfunction contains(a, b) {\n return a[0] <= b[0] &&\n a[1] <= b[1] &&\n b[2] <= a[2] &&\n b[3] <= a[3];\n}\n\nfunction intersects(a, b) {\n return b[0] <= a[2] &&\n b[1] <= a[3] &&\n b[2] >= a[0] &&\n b[3] >= a[1];\n}\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nfunction multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n select(arr, left, right, mid, compare);\n\n stack.push(left, mid, mid, right);\n }\n}\n\n// Floyd-Rivest selection algorithm:\n// sort an array between left and right (inclusive) so that the smallest k elements come first (unordered)\nfunction select(arr, left, right, k, compare) {\n var n, i, z, s, sd, newLeft, newRight, t, j;\n\n while (right > left) {\n if (right - left > 600) {\n n = right - left + 1;\n i = k - left + 1;\n z = Math.log(n);\n s = 0.5 * Math.exp(2 * z / 3);\n sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (i - n / 2 < 0 ? -1 : 1);\n newLeft = Math.max(left, Math.floor(k - i * s / n + sd));\n newRight = Math.min(right, Math.floor(k + (n - i) * s / n + sd));\n select(arr, newLeft, newRight, k, compare);\n }\n\n t = arr[k];\n i = left;\n j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n\n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}\n\nfunction swap(arr, i, j) {\n var tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\n\n// export as AMD/CommonJS module or global variable\nif (typeof define === 'function' && define.amd) define('rbush', function () { return rbush; });\nelse if (typeof module !== 'undefined') module.exports = rbush;\nelse if (typeof self !== 'undefined') self.rbush = rbush;\nelse window.rbush = rbush;\n\n})();\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _rbush = require('rbush');\n\nvar _rbush2 = _interopRequireDefault(_rbush);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar toBBox = function toBBox(p) {\n return [p.x, p.y, p.x, p.y];\n};\nvar compareMinX = function compareMinX(a, b) {\n return a.x - b.x;\n};\nvar compareMinY = function compareMinY(a, b) {\n return a.y - b.y;\n};\n\nexports.default = function (nodeSize) {\n var tree = (0, _rbush2.default)(nodeSize);\n tree.toBBox = toBBox;\n tree.compareMinX = compareMinX;\n tree.compareMinY = compareMinY;\n return tree;\n};","'use strict';\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _invariant = require('invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nvar _latLng = require('./utils/latLng');\n\nvar _createTree = require('./utils/createTree');\n\nvar _createTree2 = _interopRequireDefault(_createTree);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nvar createCluster = function createCluster(x, y, points) {\n return {\n x: x, // cluster center\n y: y,\n wx: x, // weighted cluster center\n wy: y,\n zoom: Infinity, // the last zoom the cluster was processed at\n points: points,\n numPoints: points.length\n };\n};\n\n// squared distance between two points\nfunction distSq(a, b) {\n var dx = a.wx - b.wx;\n var dy = a.wy - b.wy;\n return dx * dx + dy * dy;\n}\n\nfunction SuperCluster(options) {\n this.options = _extends({}, this.options, options);\n\n this._initTrees();\n}\n\nSuperCluster.prototype = {\n options: {\n minZoom: 0, // min zoom to generate clusters on\n maxZoom: 16, // max zoom level to cluster the points on\n radius: 40, // cluster radius in pixels\n extent: 512, // tile extent (radius is calculated relative to it)\n nodeSize: 16 },\n\n // size of the R-tree leaf node, affects performance\n load: function load(points) {\n // generate a cluster object for each point\n var clusters = points.map(function (_ref) {\n var pt = _objectWithoutProperties(_ref, []);\n\n var lat = _ref.lat;\n var lng = _ref.lng;\n return createCluster(lng, lat, [pt]);\n });\n\n // cluster points on max zoom, then cluster the results on previous zoom, etc.;\n // results in a cluster hierarchy across zoom levels\n for (var z = this.options.maxZoom; z >= this.options.minZoom; z--) {\n this.trees[z + 1].load(clusters); // index input points into an R-tree\n clusters = this._cluster(clusters, z); // create a new set of clusters for the zoom\n }\n this.trees[this.options.minZoom].load(clusters); // index top-level clusters\n\n return this;\n },\n getClusters: function getClusters(bbox, zoom) {\n var _this = this;\n\n var _bbox = _slicedToArray(bbox, 4);\n\n var nwLng = _bbox[0];\n var seLat = _bbox[1];\n var seLng = _bbox[2];\n var nwLat = _bbox[3];\n\n var z = Math.max(this.options.minZoom, Math.min(zoom, this.options.maxZoom + 1));\n var bBoxes = nwLng < seLng ? [bbox] : [[nwLng, seLat, 180, nwLat], [-180, seLat, seLng, nwLat]];\n\n var clusters = bBoxes.map(function (bBox) {\n return _this.trees[z].search(bBox);\n }).reduce(function (r, lst) {\n return [].concat(_toConsumableArray(r), _toConsumableArray(lst));\n }, []);\n\n return clusters;\n },\n _initTrees: function _initTrees() {\n this.trees = [];\n // make an R-Tree index for each zoom level\n for (var z = 0; z <= this.options.maxZoom + 1; z++) {\n this.trees[z] = (0, _createTree2.default)(this.options.nodeSize);\n }\n },\n _cluster: function _cluster(points, zoom) {\n var clusters = [];\n var r = (0, _latLng.screenDist2LatLngDist)(this.options.radius, zoom);\n var bbox = [0, 0, 0, 0];\n\n // loop through each point\n for (var i = 0; i < points.length; i++) {\n var p = points[i];\n var clusterPoints = p.points;\n // if we've already visited the point at this zoom level, skip it\n if (p.zoom <= zoom) continue;\n p.zoom = zoom;\n\n // find all nearby points with a bbox search\n bbox[0] = p.wx - r;\n bbox[1] = p.wy - r;\n bbox[2] = p.wx + r;\n bbox[3] = p.wy + r;\n var bboxNeighbors = this.trees[zoom + 1].search(bbox);\n\n var foundNeighbors = false;\n var numPoints = p.numPoints;\n var wx = p.wx * numPoints;\n var wy = p.wy * numPoints;\n\n for (var j = 0; j < bboxNeighbors.length; j++) {\n var b = bboxNeighbors[j];\n // filter out neighbors that are too far or already processed\n if (zoom < b.zoom && distSq(p, b) <= r * r) {\n foundNeighbors = true;\n b.zoom = zoom; // save the zoom (so it doesn't get processed twice)\n wx += b.wx * b.numPoints; // accumulate coordinates for calculating weighted center\n wy += b.wy * b.numPoints;\n numPoints += b.numPoints;\n clusterPoints = [].concat(_toConsumableArray(clusterPoints), _toConsumableArray(b.points));\n }\n }\n\n if (!foundNeighbors) {\n clusters.push(p); // no neighbors, add a single point as cluster\n continue;\n }\n\n // form a cluster with neighbors\n var cluster = createCluster(p.x, p.y, clusterPoints);\n (0, _invariant2.default)(clusterPoints.length === numPoints, 'clusterPoints.length === numPoints');\n\n // save weighted cluster center for display\n cluster.wx = wx / numPoints;\n cluster.wy = wy / numPoints;\n\n clusters.push(cluster);\n }\n\n return clusters;\n }\n};\n\nvar supercluster = function supercluster(points, options) {\n var cl = new SuperCluster(options);\n cl.load(points);\n\n return function (_ref2) {\n var _ref2$bounds = _ref2.bounds;\n var nw = _ref2$bounds.nw;\n var se = _ref2$bounds.se;\n var zoom = _ref2.zoom;\n return cl.getClusters([nw.lng, se.lat, se.lng, nw.lat], zoom);\n };\n};\n\nexports.default = supercluster;\n\n/*\nconst cl = supercluster([\n { lat: 10, lng: 10 },\n { lat: 10.1, lng: 10.1 },\n { lat: 12, lng: 12 },\n { lat: 84, lng: 179 },\n]);\n\nconst r = cl({ bounds: { nw: { lat: 85, lng: -180 }, se: { lat: -85, lng: 180 } }, zoom: 2 });\n\nconsole.log(JSON.stringify(r));\n*/","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate){\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n };\n\n var debounced = function(){\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n \n debounced.flush = function() {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n \n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n};\n\n// Adds compatibility for ES modules\ndebounce.debounce = debounce;\n\nmodule.exports = debounce;\n","import React from 'react';\nimport classNames from 'classnames';\n\nclass Marker extends React.PureComponent {\n handleClick = e => {\n if(e){\n //mouse click\n this.props.onClick(e.currentTarget.dataset.id);\n }else {\n //enter key\n this.props.onClick(document.activeElement.dataset.id);\n }\n\n };\n\n pressFunction = event => {\n //on enter key\n if(event.keyCode === 13) {\n this.handleClick();\n }\n }\n componentDidMount(){\n document.addEventListener(\"keydown\", this.pressFunction, false);\n }\n componentWillUnmount(){\n document.removeEventListener(\"keydown\", this.pressFunction, false);\n }\n\n render() {\n const size = 42;\n const markerStyle = {\n position: 'absolute',\n width: size,\n height: size,\n left: -size / 2,\n top: -size / 2\n };\n\n const { item } = this.props;\n\n const classes = classNames('Marker', {\n [`Marker--Closed`]: !item.is_open,\n });\n\n return (\n \n );\n }\n}\n\nMarker.defaultProps = {};\n\nexport default Marker;\n","/**\n * ClusterMarker\n */\n\nimport React from 'react';\nimport classNames from 'classnames';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { fitBounds } from 'google-map-react/utils';\nimport * as actionCreators from '../../actions/actionCreators';\n\nclass ClusterMarker extends React.Component {\n constructor(props) {\n super(props);\n }\n\n pressFunction = event => {\n //on enter key\n if(event.keyCode === 13) {\n this.handleClick();\n }\n }\n componentDidMount(){\n document.addEventListener(\"keydown\", this.pressFunction, false);\n }\n componentWillUnmount(){\n document.removeEventListener(\"keydown\", this.pressFunction, false);\n }\n\n handleClick = () => {\n const lats = this.props.item.points.map(point => {\n return point.lat;\n });\n const lngs = this.props.item.points.map(point => {\n return point.lng;\n });\n const maxLat = Math.max.apply(Math, lats);\n const minLat = Math.min.apply(Math, lats);\n const maxLng = Math.max.apply(Math, lngs);\n const minLng = Math.min.apply(Math, lngs);\n const bounds = {\n ne: {\n lat: maxLat,\n lng: maxLng\n },\n sw: {\n lat: minLat,\n lng: minLng\n }\n };\n\n const { center, zoom } = fitBounds(bounds, this.props.mapContainerDimensions);\n\n this.props.setCenter(center);\n this.props.setZoom(zoom);\n };\n\n render() {\n const size = 42;\n const markerStyle = {\n position: 'absolute',\n width: size,\n height: size,\n left: -size / 2,\n top: -size / 2\n };\n\n const classesMarker = classNames('ClusterMarker', {\n [`ClusterMarker--Active`]: this.props.activeMarker\n });\n\n return (\n \n {this.props.item.numPoints}\n \n );\n }\n}\n\nClusterMarker.defaultProps = {\n item: {}\n};\n\nfunction mapStateToProps(state) {\n return {\n mapContainerDimensions: state.map.mapContainerDimensions\n }\n}\n\nfunction mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ClusterMarker);\n","/**\n * UserPosMarker\n */\n\nimport React from 'react';\n\nclass UserPosMarker extends React.Component {\n constructor(props) {\n super(props);\n }\n\n render() {\n\n const size = 17;\n const markerStyle = {\n position: 'absolute',\n width: size,\n height: size,\n left: -size / 2,\n top: -size / 2\n }\n\n return (\n \n );\n }\n}\n\nUserPosMarker.defaultProps = {\n};\n\nexport default UserPosMarker;\n","export const fullscreenSupported = () => {\n if (\n document.fullscreenEnabled ||\n document.webkitFullscreenEnabled ||\n document.mozFullScreenEnabled ||\n document.msFullscreenEnabled\n ) {\n return true;\n } else {\n return false;\n }\n};\n\nexport const fullscreenActive = () => {\n if (\n document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement ||\n document.msFullscreenElement\n ) {\n return true;\n } else {\n return false;\n }\n};\n\nexport const fullscreenEnter = element => {\n if (element.requestFullScreen) {\n element.requestFullScreen();\n } else if (element.webkitRequestFullScreen) {\n element.webkitRequestFullScreen();\n } else if (element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if (element.msRequestFullScreen) {\n element.msRequestFullScreen();\n }\n};\n\nexport const fullscreenExit = () => {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n }\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { bindActionCreators } from 'redux';\nimport { connect } from 'react-redux';\nimport GoogleMapReact from 'google-map-react';\nimport supercluster from 'points-cluster';\nimport debounce from 'debounce';\n\nimport * as actionCreators from '../../actions/actionCreators';\n\nimport Marker from '../Marker/Marker';\nimport ClusterMarker from '../ClusterMarker/ClusterMarker';\nimport UserPosMarker from '../UserPosMarker/UserPosMarker';\nimport { MAX_ZOOM, MIN_ZOOM } from '../../constants/map';\n\nimport {\n fullscreenSupported,\n fullscreenActive,\n fullscreenEnter,\n fullscreenExit\n} from '../../utils/fullScreen';\n\nimport { trackMapZoomChange } from '../../utils/analytics';\n\nimport { sortByDistance } from '../../utils/sortByDistance';\n\nclass Map extends React.Component {\n state = {\n clusters: [],\n mapProps: false,\n fullscreenActive: false\n };\n\n componentDidMount() {\n const ua = window.navigator.userAgent;\n const trident = ua.indexOf('Trident/');\n\n if (!fullscreenSupported() || trident > 0) {\n document.getElementById('fullScreenControl').style.display = 'none';\n }\n\n document.addEventListener(\n 'fullscreenchange',\n this.toggleFullscreenState\n );\n document.addEventListener(\n 'webkitfullscreenchange',\n this.toggleFullscreenState\n );\n document.addEventListener(\n 'mozfullscreenchange',\n this.toggleFullscreenState\n );\n document.addEventListener(\n 'msfullscreenchange',\n this.toggleFullscreenState\n );\n\n window.addEventListener('resize', this.handleWindowResize);\n\n const mapContainerDims = this.getMapContainerDimensions();\n this.props.setMapContainerDimensions(mapContainerDims);\n }\n\n // Notify parent about the markers currently in display\n componentDidUpdate() {\n if (!this.state.mapProps) {\n return;\n }\n\n const { setListMarkers, center, searchValue } = this.props;\n\n if (searchValue !== '') {\n const markersInSearchResult = this.props.items.filter((item) => {\n let words = searchValue.split(' ');\n words = words.map((word) => {\n word = word.replace(/[!&/\\\\#,+()$~%.'\":*?<>{}]/g, '');\n return word.toLowerCase();\n });\n return words.every(\n (word) =>\n item.address1.toLowerCase().includes(word) ||\n item.city.toLowerCase().includes(word) ||\n item.machines.some((machine) =>\n new RegExp(`^${word}`, 'g').test(machine.machine_id)\n )\n );\n });\n setListMarkers(markersInSearchResult);\n return;\n }\n\n const filteredItems = this.filterItems(\n this.props.items,\n this.props.filter\n );\n\n let clusters = this.createClusters({\n zoom: this.state.mapProps.zoom,\n bounds: this.state.mapProps.bounds,\n items: filteredItems\n });\n\n let markersInbounds = [];\n clusters.forEach((cluster) => {\n cluster.points.forEach((point) => {\n markersInbounds.push(point.item);\n });\n });\n\n if (markersInbounds.length > 0) {\n markersInbounds = markersInbounds.map((item) => {\n item['y'] = item.point.coordinates[1];\n item['x'] = item.point.coordinates[0];\n return item;\n });\n }\n\n if (center.lat && center.lng) {\n const origin = { x: center.lng, y: center.lat };\n markersInbounds = sortByDistance(origin, markersInbounds);\n\n if (markersInbounds.length < 10) {\n let items = this.filterItems(\n this.props.items,\n this.props.filter\n );\n items = items.map((item) => {\n const { coordinates = [] } = item.point || {};\n const [x = null, y = null] = coordinates;\n\n return {\n ...item,\n x,\n y\n };\n });\n markersInbounds = sortByDistance(origin, items).slice(0, 10);\n }\n }\n\n setListMarkers(markersInbounds);\n\n const mapContainerDims = this.getMapContainerDimensions();\n this.props.setMapContainerDimensions(mapContainerDims);\n }\n\n componentWillUnmount() {\n let doc = document;\n\n doc.removeEventListener('fullscreenchange', this.toggleFullscreenState);\n doc.removeEventListener(\n 'webkitfullscreenchange',\n this.toggleFullscreenState\n );\n doc.removeEventListener(\n 'mozfullscreenchange',\n this.toggleFullscreenState\n );\n doc.removeEventListener(\n 'msfullscreenchange',\n this.toggleFullscreenState\n );\n\n window.removeEventListener('resize', this.handleWindowResize);\n }\n\n handleMapChange = ({ bounds, center, marginBounds, size, zoom }) => {\n trackMapZoomChange(this.state.mapProps.zoom, zoom);\n\n this.setState({\n mapProps: { bounds, center, marginBounds, size, zoom }\n });\n\n this.props.setCenter(center);\n this.props.setZoom(zoom);\n };\n\n handleMapApiLoaded = ({ maps, map }) => {\n this.setState({ apiLoaded: true }, () => {\n this.maps = maps;\n this.map = map;\n\n this.props.setMap(map);\n this.props.setInfoWindow(\n new this.maps.InfoWindow({\n pixelOffset: new this.maps.Size(0, -20)\n })\n );\n this.map.controls[this.maps.ControlPosition.RIGHT_BOTTOM].push(\n document.getElementById('controls')\n );\n this.map.controls[this.maps.ControlPosition.TOP_RIGHT].push(\n document.getElementById('filters')\n );\n });\n };\n\n handleZoomIn = () => {\n const zoom = Math.min(this.props.zoom + 1, MAX_ZOOM);\n this.props.setCenter(this.props.center);\n this.props.setZoom(zoom);\n };\n\n handleZoomOut = () => {\n const zoom = Math.max(this.props.zoom - 1, MIN_ZOOM);\n this.props.setCenter(this.props.center);\n this.props.setZoom(zoom);\n };\n\n handleWindowResize = debounce(() => {\n const mapContainerDims = this.getMapContainerDimensions();\n this.props.setMapContainerDimensions(mapContainerDims);\n }, 300);\n\n fullscreenToggle = () => {\n if (fullscreenActive()) {\n fullscreenExit();\n } else {\n const map = document.querySelector('.gm-style');\n fullscreenEnter(map);\n }\n };\n\n toggleFullscreenState = () => {\n this.setState((prevState) => ({\n fullscreenActive: !prevState.fullscreenActive\n }));\n };\n\n getFormattedServices(language) {\n return [\n {\n value: '',\n label: this.props.labels.showAll,\n className: 'Select-option--all'\n },\n ...this.props.services.map((item) => {\n return {\n value: item.value,\n label: item[`name_${language}`],\n className: `Select-option--${item.identifier}`,\n link: item.link\n };\n })\n ];\n }\n\n handleMarkerClick = (id) => {\n const marker = this.props.items.find((item) => item.identifier === id);\n if (!marker) {\n return;\n }\n this.props.setCenter({ lat: marker.y, lng: marker.x });\n this.props.onMarkerClick(marker);\n };\n\n createClusters = ({ bounds, zoom, items }) => {\n if (!bounds) {\n return;\n }\n\n const index = supercluster(\n items.map((item) => {\n const { coordinates = [] } = item.point || {};\n const [lng = null, lat = null] = coordinates;\n\n return {\n lat,\n lng,\n item\n };\n })\n );\n\n return index({\n bounds: {\n nw: { lat: bounds.nw.lat, lng: bounds.nw.lng },\n se: { lat: bounds.se.lat, lng: bounds.se.lng }\n },\n zoom: zoom\n });\n };\n\n filterItems = (items, filters) => {\n const filterDict = {};\n let anyActiveFilters = false; // Flag to check if any filters other than 'deposit' are active\n\n filters.forEach((filter) => {\n const currency = filter.value.toLowerCase(); // normalize currency to lowercase\n const activeDenominations = new Set();\n\n filter.options.forEach((option) => {\n if (option.active) {\n activeDenominations.add(parseInt(option.value));\n anyActiveFilters = true;\n }\n });\n\n if (activeDenominations.size > 0) {\n filterDict[currency] = activeDenominations;\n }\n\n if (currency === 'deposit' && activeDenominations.size > 0) {\n filterDict.deposit = true;\n }\n });\n\n if (!anyActiveFilters) {\n return items;\n }\n\n if (Object.keys(filterDict).length === 1 && filterDict.deposit) {\n return items.filter((item) =>\n item.services.some(\n (service) =>\n service.identifier === 'deposit' && service.available\n )\n );\n }\n\n return items.filter((item) => {\n const currencyMatch = Object.keys(filterDict).some((key) => {\n if (key !== 'deposit') {\n const denominations = new Set(\n item.currencies.find(\n (currencyInfo) =>\n currencyInfo.currency.toLowerCase() === key\n )?.denomination || []\n );\n return (\n filterDict[key] &&\n [...denominations].some((den) =>\n filterDict[key].has(den)\n )\n );\n }\n return false;\n });\n\n const depositServiceAvailable = filterDict.deposit\n ? item.services.some(\n (service) =>\n service.identifier === 'deposit' && service.available\n )\n : true;\n\n return currencyMatch && depositServiceAvailable;\n });\n };\n\n // filterItems = (items, filter) => {\n // console.log(items);\n // console.log(filter);\n // // TODO: fix with new filter\n // return items;\n // if (!Array.isArray(items) || items.length < 1) {return [];}\n //\n // if (!filter) {\n // return items.filter(i => Array.isArray(i.point.coordinates));\n // }\n //\n // let filtered = items.filter(item => {\n // let groups = item.groups\n // ? item.groups\n // : [];\n //\n // const identifiers = [\n // ...item.services.map(service => service.identifier),\n // ...groups\n // ];\n //\n // return identifiers.includes(filter) && Array.isArray(item.point.coordinates);\n // });\n //\n // return filtered;\n // };\n\n getMapContainerDimensions = () => {\n const mapRef = this.refs.map;\n const mapWidth = mapRef.clientWidth;\n const mapHeight = mapRef.clientHeight;\n\n const mapContainerDims = {\n width: mapWidth,\n height: fullscreenActive() ? screen.height : mapHeight\n };\n\n return mapContainerDims;\n };\n\n render() {\n const {\n items,\n center,\n googleMapKey,\n showFilters,\n labels,\n zoom,\n language,\n userPos,\n fetchedMachines,\n fetchedUserPosition\n } = this.props;\n\n const { fullscreenActive, mapProps } = this.state;\n\n // const options = this.getFormattedServices(language);\n const mapClasses = classNames('Map', {\n [`Map--Active`]:\n items.length > 0 && fetchedMachines && fetchedUserPosition\n });\n const loaderClasses = classNames('Map__Loader', {\n [`Map__Loader--Active`]: !fetchedMachines || !fetchedUserPosition\n });\n\n const filteredItems = this.filterItems(\n this.props.items,\n this.props.filter\n );\n\n let clusters = this.createClusters({\n zoom: mapProps.zoom,\n bounds: mapProps.bounds,\n items: filteredItems\n });\n\n clusters = clusters || [];\n\n return (\n
\n
\n
\n
\n \n \n {labels.toggleFullscreen}\n \n \n {labels.zoomIn}\n \n \n {labels.zoomOut}\n \n
\n \n {userPos && (\n \n )}\n {clusters.map((item, index) =>\n item.numPoints === 1 ? (\n \n ) : (\n \n )\n )}\n \n
\n );\n }\n}\n\nMap.defaultProps = {\n googleMapKey: '',\n items: [],\n labels: {},\n services: []\n};\n\nconst MAP_OPTIONS = {\n scrollwheel: true,\n zoomControl: false,\n disableDefaultUI: true,\n minZoom: MIN_ZOOM,\n maxZoom: MAX_ZOOM,\n rotateControl: false,\n clickableIcons: false,\n styles: [\n {\n featureType: 'water',\n stylers: [{ visibility: 'simplified' }, { color: '#B6DFE1' }]\n },\n {\n featureType: 'road',\n stylers: [{ saturation: -100 }, { gamma: 0.7 }]\n },\n {\n featureType: 'poi.park',\n stylers: [{ saturation: -100 }, { gamma: 2.6 }]\n },\n {\n featureType: 'landscape',\n stylers: [\n { saturation: -50 },\n { gamma: 1.2 },\n { visibility: 'simplified' }\n ]\n },\n {\n featureType: 'poi'\n },\n {\n featureType: 'transit'\n }\n ]\n};\n\nfunction mapStateToProps(state) {\n return {\n items: state.map.items || [],\n center: state.map.center,\n zoom: state.map.zoom,\n searchValueClicked: state.map.searchValueClicked,\n userPos: state.map.userPos,\n fetchedUserPosition: state.map.fetchedUserPosition,\n fetchedMachines: state.map.fetchedMachines,\n infowindow: state.map.infowindow,\n activeMarker: state.map.activeMarker,\n filter: state.map.filter,\n searchValue: state.map.searchValue\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Map);","/**\n * MapSearch\n */\n\n/* global google */\nimport React from 'react';\nimport { bindActionCreators } from 'redux';\nimport { connect } from 'react-redux';\nimport * as actionCreators from '../../actions/actionCreators';\nimport { trackMapSearch } from '../../utils/analytics';\n\nclass MapSearch extends React.Component {\n constructor(props) {\n super(props);\n }\n\n escFunction = event => {\n if(event.keyCode === 27) {\n this.props.setListActive(false);\n }\n }\n componentDidMount(){\n document.addEventListener(\"keydown\", this.escFunction, false);\n }\n componentWillUnmount(){\n document.removeEventListener(\"keydown\", this.escFunction, false);\n }\n\n onChange = e => {\n this.props.setListActive(true);\n this.props.setSearchvalue(e.target.value);\n };\n\n submitSearch = e => {\n e.preventDefault();\n const { items, searchValue } = this.props;\n\n trackMapSearch(searchValue);\n\n this.props.setListActive(false);\n\n if (/^\\d{4}$/.test(searchValue) || /^\\d{6}$/.test(searchValue)) {\n const marker = items.filter(item => {\n return item.machines.some(machine =>\n new RegExp(`^${searchValue}`, 'g').test(machine.machine_id)\n );\n })[0];\n\n if (!marker) {\n return false;\n }\n\n const center = {\n lat: marker.point.coordinates[1],\n lng: marker.point.coordinates[0]\n };\n this.props.setCenter(center);\n this.props.setZoom(this.props.zoom);\n } else {\n return fetch(\n `/proxy-google.php?service=geocode&address=${encodeURI(\n searchValue\n )}&language=sv®ion=sv&key=${this.props.googleMapKey}`,\n {\n method: 'get'\n }\n )\n .then(response => {\n return response.json();\n })\n .then(json => {\n if (json.status.toLowerCase() === 'ok') {\n const bounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(\n json.results[0].geometry.viewport.southwest.lat,\n json.results[0].geometry.viewport.southwest.lng\n ),\n new google.maps.LatLng(\n json.results[0].geometry.viewport.northeast.lat,\n json.results[0].geometry.viewport.northeast.lng\n )\n );\n this.props.map.fitBounds(bounds);\n }\n })\n .catch(function(error) {\n console.log(error);\n });\n }\n };\n\n render() {\n const { labels, showList, searchValue } = this.props;\n\n return (\n
\n \n \n );\n }\n}\n\nMapSearch.defaultProps = {\n googleMapKey: '',\n labels: {}\n};\n\nfunction mapStateToProps(state) {\n return {\n map: state.map.map,\n items: state.map.items,\n zoom: state.map.zoom,\n searchValue: state.map.searchValue\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MapSearch);\n","const getAvailableServices = (marker, services, language, labelType = '') => {\n\n labelType = labelType !== '' ? `_${labelType}` : '';\n\n // Use service list as template because order is important\n let availableServices = services.filter(service => {\n return marker.services\n .map(service => service.identifier)\n .includes(service.identifier);\n });\n\n // Check if service is available and add strikethrough if not available\n let withdrawalServices = [];\n let depositServices = [];\n let otherServices = [];\n\n availableServices.map(service => {\n const available = marker.services.find(\n x => x.identifier === service.identifier\n ).available;\n\n const labelKey = `name${labelType}_${language}`;\n const defaultLabelKey = `name_${language}`;\n\n let label =\n // labelKey in service ? service[labelKey] : service[defaultLabelKey];\n labelKey in service ? `${service[labelKey]}` : `${service[defaultLabelKey]}`;\n\n if (available === false) {\n label = `${label}`;\n }\n\n if (service.group_as === 'withdrawal') {\n withdrawalServices.push(label);\n } else if (service.group_as === 'deposit') {\n depositServices.push(label);\n } else {\n otherServices.push(label);\n }\n });\n\n return {\n withdrawalServices: withdrawalServices,\n depositServices: depositServices,\n otherServices: otherServices\n };\n};\n\nexport default getAvailableServices;\n","import React from 'react';\nimport getAvailableServices from '../../utils/getAvailableServices';\n\nclass MapListItem extends React.Component {\n clickHandler = e => {\n e.stopPropagation();\n\n this.props.onClick(this.props.item);\n };\n\n noopClickHandler = e => {\n e.preventDefault();\n };\n\n render() {\n const { item, labels, services, language } = this.props;\n const availableServices = getAvailableServices(\n item,\n services,\n language,\n 'popup'\n );\n\n let openingHours = '';\n\n // TODO: Remove below logic when realtime api is in production\n if (item.machines && item.machines.length) {\n const machineWithOpeningHours = item.machines\n .filter(machine => machine.opening_hours !== '')\n .slice(-1)[0];\n\n if (machineWithOpeningHours) {\n openingHours = machineWithOpeningHours.opening_hours;\n }\n }\n\n if (item.opening_info) {\n openingHours = item.opening_info;\n }\n\n let screenReaderLabel = `${item.address1} ${item.address2 ? item.address2 : ''} ${item.city}`;\n if (availableServices.withdrawalServices) {\n screenReaderLabel += `, ${labels.withdrawal} ${availableServices.withdrawalServices}`;\n }\n if (availableServices.depositServices) {\n screenReaderLabel += `, ${labels.deposit} ${availableServices.depositServices}`;\n }\n if (openingHours !== '') {\n screenReaderLabel += `, ${labels.businessHours} ${openingHours}`;\n }\n\n return (\n \n \n ${item.address2}, ${\n item.city\n }`\n : `${item.address1}, ${item.city}`\n }}\n />\n {availableServices.withdrawalServices !== '' && (\n ${labels.withdrawal}: ${\n availableServices.withdrawalServices.join('')\n }`\n }}\n />\n )}\n {availableServices.depositServices.length !== 0 && (\n ${labels.deposit}: ${\n availableServices.depositServices.join('')\n }`\n }}\n />\n )}\n {openingHours !== '' && (\n ${labels.businessHours}: ${\n openingHours\n }`\n }}\n />\n )}\n {!item.is_open && (\n

{labels.isClosed}

\n )}\n \n \n );\n }\n}\n\nMapListItem.defaultProps = {};\n\nexport default MapListItem;\n","function mediaCheck(query) {\n if (window.matchMedia) {\n let mq = window.matchMedia('(' + query + ')');\n return mq.matches;\n } else {\n return false;\n }\n}\n\nexport default mediaCheck;\n","\nimport React from 'react';\nimport { bindActionCreators } from 'redux';\nimport { connect } from 'react-redux';\nimport classNames from 'classnames';\nimport { CENTER_ZOOM, BREAKPOINT } from '../../constants/map';\nimport * as actionCreators from '../../actions/actionCreators';\nimport MapListItem from '../MapListItem/MapListItem';\nimport mediaCheck from '../../utils/mediaCheck';\n\nconst isMobile = () => !mediaCheck(`min-width: ${BREAKPOINT}px`);\n\nclass MapList extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n listLength: 0\n };\n this.scrollContainer = React.createRef();\n }\n\n loadMore = e => {\n if (\n e.target.scrollHeight - e.target.scrollTop ===\n e.target.clientHeight\n ) {\n if (this.state.listLength < this.props.listMarkers.length) {\n this.setState(prevState => ({\n listLength: Math.min(\n prevState.listLength + 50,\n this.props.listMarkers.length\n )\n }));\n }\n }\n };\n\n componentDidMount() {\n this.state = {\n listLength: Math.min(this.props.listMarkers.length, 50)\n };\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (prevProps.listMarkers.length !== this.props.listMarkers.length) {\n this.setState({\n listLength: Math.min(this.props.listMarkers.length, 50)\n });\n this.scrollContainer.current.scrollTop = 0;\n }\n if (prevProps.listActive !== this.props.listActive) {\n setTimeout(() => {\n this.scrollContainer.current.scrollTop = 0;\n }, 500);\n }\n }\n\n handleItemClick = marker => {\n const center = {\n lat: marker.point.coordinates[1],\n lng: marker.point.coordinates[0]\n };\n const zoom = Math.max(CENTER_ZOOM, this.props.zoom);\n\n this.props.setCenter(center);\n this.props.setZoom(zoom);\n this.props.setListMarkers([]);\n this.props.setSearchvalue('');\n this.props.setListActive(false);\n\n if (!isMobile()) {\n this.props.onMarkerClick(marker);\n }\n };\n\n render() {\n const {\n listActive,\n labels,\n services,\n listMarkers,\n language,\n } = this.props;\n\n const { listLength } = this.state;\n const classes = classNames('MapList', {\n [`MapList--Active`]: listActive\n });\n\n return (\n
\n
\n \n {listMarkers.length > 0 ? (\n
    \n {listMarkers\n .slice(0, listLength)\n .map((item, index) => (\n \n ))}\n
\n ) : (\n Din sökning gav inget resultat\n )}\n
\n
\n \n );\n }\n}\n\nMapList.defaultProps = {\n listMarkers: []\n};\n\nfunction mapStateToProps(state) {\n return {\n listMarkers: state.map.listMarkers,\n zoom: state.map.zoom,\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MapList);\n","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : String(i);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nexport default function _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n 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}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\nimport _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';\nimport _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';\nimport { useState, useCallback } from 'react';\n\nvar _excluded = [\"defaultInputValue\", \"defaultMenuIsOpen\", \"defaultValue\", \"inputValue\", \"menuIsOpen\", \"onChange\", \"onInputChange\", \"onMenuClose\", \"onMenuOpen\", \"value\"];\nfunction useStateManager(_ref) {\n var _ref$defaultInputValu = _ref.defaultInputValue,\n defaultInputValue = _ref$defaultInputValu === void 0 ? '' : _ref$defaultInputValu,\n _ref$defaultMenuIsOpe = _ref.defaultMenuIsOpen,\n defaultMenuIsOpen = _ref$defaultMenuIsOpe === void 0 ? false : _ref$defaultMenuIsOpe,\n _ref$defaultValue = _ref.defaultValue,\n defaultValue = _ref$defaultValue === void 0 ? null : _ref$defaultValue,\n propsInputValue = _ref.inputValue,\n propsMenuIsOpen = _ref.menuIsOpen,\n propsOnChange = _ref.onChange,\n propsOnInputChange = _ref.onInputChange,\n propsOnMenuClose = _ref.onMenuClose,\n propsOnMenuOpen = _ref.onMenuOpen,\n propsValue = _ref.value,\n restSelectProps = _objectWithoutProperties(_ref, _excluded);\n var _useState = useState(propsInputValue !== undefined ? propsInputValue : defaultInputValue),\n _useState2 = _slicedToArray(_useState, 2),\n stateInputValue = _useState2[0],\n setStateInputValue = _useState2[1];\n var _useState3 = useState(propsMenuIsOpen !== undefined ? propsMenuIsOpen : defaultMenuIsOpen),\n _useState4 = _slicedToArray(_useState3, 2),\n stateMenuIsOpen = _useState4[0],\n setStateMenuIsOpen = _useState4[1];\n var _useState5 = useState(propsValue !== undefined ? propsValue : defaultValue),\n _useState6 = _slicedToArray(_useState5, 2),\n stateValue = _useState6[0],\n setStateValue = _useState6[1];\n var onChange = useCallback(function (value, actionMeta) {\n if (typeof propsOnChange === 'function') {\n propsOnChange(value, actionMeta);\n }\n setStateValue(value);\n }, [propsOnChange]);\n var onInputChange = useCallback(function (value, actionMeta) {\n var newValue;\n if (typeof propsOnInputChange === 'function') {\n newValue = propsOnInputChange(value, actionMeta);\n }\n setStateInputValue(newValue !== undefined ? newValue : value);\n }, [propsOnInputChange]);\n var onMenuOpen = useCallback(function () {\n if (typeof propsOnMenuOpen === 'function') {\n propsOnMenuOpen();\n }\n setStateMenuIsOpen(true);\n }, [propsOnMenuOpen]);\n var onMenuClose = useCallback(function () {\n if (typeof propsOnMenuClose === 'function') {\n propsOnMenuClose();\n }\n setStateMenuIsOpen(false);\n }, [propsOnMenuClose]);\n var inputValue = propsInputValue !== undefined ? propsInputValue : stateInputValue;\n var menuIsOpen = propsMenuIsOpen !== undefined ? propsMenuIsOpen : stateMenuIsOpen;\n var value = propsValue !== undefined ? propsValue : stateValue;\n return _objectSpread(_objectSpread({}, restSelectProps), {}, {\n inputValue: inputValue,\n menuIsOpen: menuIsOpen,\n onChange: onChange,\n onInputChange: onInputChange,\n onMenuClose: onMenuClose,\n onMenuOpen: onMenuOpen,\n value: value\n });\n}\n\nexport { useStateManager as u };\n","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {\n return !!t;\n })();\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.js\";\nexport default function _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived),\n result;\n if (hasNativeReflectConstruct) {\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return possibleConstructorReturn(this, result);\n };\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (process.env.NODE_ENV !== 'production') {\n var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;\n\n if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {\n // this would only cause problem in speedy mode\n // but we don't want enabling speedy to affect the observable behavior\n // so we report this error at all times\n console.error(\"You're attempting to insert the following rule:\\n\" + rule + '\\n\\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');\n }\n this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;\n }\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {\n console.error(\"There was a problem inserting the following rule: \\\"\" + rule + \"\\\"\", e);\n }\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode && tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n\n if (process.env.NODE_ENV !== 'production') {\n this._alreadyInsertedOrderInsensitiveRule = false;\n }\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, COMMENT, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\nvar ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n\nvar isIgnoringComment = function isIgnoringComment(element) {\n return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;\n};\n\nvar createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {\n return function (element, index, children) {\n if (element.type !== 'rule' || cache.compat) return;\n var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses) {\n var isNested = !!element.parent; // in nested rules comments become children of the \"auto-inserted\" rule and that's always the `element.parent`\n //\n // considering this input:\n // .a {\n // .b /* comm */ {}\n // color: hotpink;\n // }\n // we get output corresponding to this:\n // .a {\n // & {\n // /* comm */\n // color: hotpink;\n // }\n // .b {}\n // }\n\n var commentContainer = isNested ? element.parent.children : // global rule at the root level\n children;\n\n for (var i = commentContainer.length - 1; i >= 0; i--) {\n var node = commentContainer[i];\n\n if (node.line < element.line) {\n break;\n } // it is quite weird but comments are *usually* put at `column: element.column - 1`\n // so we seek *from the end* for the node that is earlier than the rule's `element` and check that\n // this will also match inputs like this:\n // .a {\n // /* comm */\n // .b {}\n // }\n //\n // but that is fine\n //\n // it would be the easiest to change the placement of the comment to be the first child of the rule:\n // .a {\n // .b { /* comm */ }\n // }\n // with such inputs we wouldn't have to search for the comment at all\n // TODO: consider changing this comment placement in the next major version\n\n\n if (node.column < element.column) {\n if (isIgnoringComment(node)) {\n return;\n }\n\n break;\n }\n }\n\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n });\n }\n };\n};\n\nvar isImportRule = function isImportRule(element) {\n return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;\n};\n\nvar isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {\n for (var i = index - 1; i >= 0; i--) {\n if (!isImportRule(children[i])) {\n return true;\n }\n }\n\n return false;\n}; // use this to remove incorrect elements from further processing\n// so they don't get handed to the `sheet` (or anything else)\n// as that could potentially lead to additional logs which in turn could be overhelming to the user\n\n\nvar nullifyElement = function nullifyElement(element) {\n element.type = '';\n element.value = '';\n element[\"return\"] = '';\n element.children = '';\n element.props = '';\n};\n\nvar incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {\n if (!isImportRule(element)) {\n return;\n }\n\n if (element.parent) {\n console.error(\"`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.\");\n nullifyElement(element);\n } else if (isPrependedWithRegularRules(index, children)) {\n console.error(\"`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.\");\n nullifyElement(element);\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (process.env.NODE_ENV !== 'production' && !key) {\n throw new Error(\"You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\\n\" + \"If multiple caches share the same key they might \\\"fight\\\" for each other's style elements.\");\n }\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' '); // $FlowFixMe\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (process.env.NODE_ENV !== 'production') {\n omnipresentPlugins.push(createUnsafeSelectorsAlarm({\n get compat() {\n return cache.compat;\n }\n\n }), incorrectImportAlarm);\n }\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {\n if (!element.root) {\n if (element[\"return\"]) {\n currentSheet.insert(element[\"return\"]);\n } else if (element.value && element.type !== COMMENT) {\n // insert empty rule in non-production environments\n // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet\n currentSheet.insert(element.value + \"{}\");\n }\n }\n } : rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n currentSheet = {\n insert: function insert(rule) {\n sheet.insert(rule + serialized.map);\n }\n };\n }\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n","var isBrowser = \"object\" !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\\(|(no-)?(open|close)-quote/;\n var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n throw new Error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error(noComponentSelectorMessage);\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n return cached !== undefined ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*(;|$)/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","import * as React from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n","import * as React from 'react';\nimport { useContext, forwardRef } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar isBrowser = \"object\" !== 'undefined';\nvar hasOwn = {}.hasOwnProperty;\n\nvar EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nif (process.env.NODE_ENV !== 'production') {\n EmotionCacheContext.displayName = 'EmotionCacheContext';\n}\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n // $FlowFixMe\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nif (!isBrowser) {\n withEmotionCache = function withEmotionCache(func) {\n return function (props) {\n var cache = useContext(EmotionCacheContext);\n\n if (cache === null) {\n // yes, we're potentially creating this on every render\n // it doesn't actually matter though since it's only on the server\n // so there will only every be a single render\n // that could change in the future because of suspense and etc. but for now,\n // this works and i don't want to optimise for a future thing that we aren't sure about\n cache = createCache({\n key: 'css'\n });\n return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {\n value: cache\n }, func(props, cache));\n } else {\n return func(props, cache);\n }\n };\n };\n}\n\nvar ThemeContext = /* #__PURE__ */React.createContext({});\n\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'EmotionThemeContext';\n}\n\nvar useTheme = function useTheme() {\n return React.useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {\n throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');\n }\n\n return mergedTheme;\n }\n\n if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {\n throw new Error('[ThemeProvider] Please make your theme prop a plain object');\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = React.useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n\n var render = function render(props, ref) {\n var theme = React.useContext(ThemeContext);\n return /*#__PURE__*/React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n }; // $FlowFixMe\n\n\n var WithTheme = /*#__PURE__*/React.forwardRef(render);\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar getLastPart = function getLastPart(functionName) {\n // The match may be something like 'Object.createEmotionProps' or\n // 'Loader.prototype.render'\n var parts = functionName.split('.');\n return parts[parts.length - 1];\n};\n\nvar getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {\n // V8\n var match = /^\\s+at\\s+([A-Za-z0-9$.]+)\\s/.exec(line);\n if (match) return getLastPart(match[1]); // Safari / Firefox\n\n match = /^([A-Za-z0-9$.]+)@/.exec(line);\n if (match) return getLastPart(match[1]);\n return undefined;\n};\n\nvar internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS\n// identifiers, thus we only need to replace what is a valid character for JS,\n// but not for CSS.\n\nvar sanitizeIdentifier = function sanitizeIdentifier(identifier) {\n return identifier.replace(/\\$/g, '-');\n};\n\nvar getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {\n if (!stackTrace) return undefined;\n var lines = stackTrace.split('\\n');\n\n for (var i = 0; i < lines.length; i++) {\n var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just \"Error\"\n\n if (!functionName) continue; // If we reach one of these, we have gone too far and should quit\n\n if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an\n // uppercase letter\n\n if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);\n }\n\n return undefined;\n};\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' && // check if there is a css declaration\n props.css.indexOf(':') !== -1) {\n throw new Error(\"Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`\" + props.css + \"`\");\n }\n\n var newProps = {};\n\n for (var key in props) {\n if (hasOwn.call(props, key)) {\n newProps[key] = props[key];\n }\n }\n\n newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when\n // the label hasn't already been computed\n\n if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {\n var label = getLabelFromStackTrace(new Error().stack);\n if (label) newProps[labelPropName] = label;\n }\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));\n\n if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {\n var labelFromStack = props[labelPropName];\n\n if (labelFromStack) {\n serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);\n }\n }\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var key in props) {\n if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {\n newProps[key] = props[key];\n }\n }\n\n newProps.ref = ref;\n newProps.className = className;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Emotion.displayName = 'EmotionCssPropInternal';\n}\n\nvar Emotion$1 = Emotion;\n\nexport { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwn as h, isBrowser as i, useTheme as u, withEmotionCache as w };\n","import { h as hasOwn, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isBrowser$1 } from './emotion-element-43c6fea0.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-43c6fea0.browser.esm.js';\nimport * as React from 'react';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { serializeStyles } from '@emotion/serialize';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport 'hoist-non-react-statics';\n\nvar pkg = {\n\tname: \"@emotion/react\",\n\tversion: \"11.11.4\",\n\tmain: \"dist/emotion-react.cjs.js\",\n\tmodule: \"dist/emotion-react.esm.js\",\n\tbrowser: {\n\t\t\"./dist/emotion-react.esm.js\": \"./dist/emotion-react.browser.esm.js\"\n\t},\n\texports: {\n\t\t\".\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./dist/emotion-react.worker.esm.js\",\n\t\t\t\tbrowser: \"./dist/emotion-react.browser.esm.js\",\n\t\t\t\t\"default\": \"./dist/emotion-react.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/emotion-react.cjs.mjs\",\n\t\t\t\"default\": \"./dist/emotion-react.cjs.js\"\n\t\t},\n\t\t\"./jsx-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs\",\n\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js\"\n\t\t},\n\t\t\"./_isolated-hnrs\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js\",\n\t\t\t\tbrowser: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js\",\n\t\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs\",\n\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js\"\n\t\t},\n\t\t\"./jsx-dev-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs\",\n\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\",\n\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\"./macro\": {\n\t\t\ttypes: {\n\t\t\t\t\"import\": \"./macro.d.mts\",\n\t\t\t\t\"default\": \"./macro.d.ts\"\n\t\t\t},\n\t\t\t\"default\": \"./macro.js\"\n\t\t}\n\t},\n\ttypes: \"types/index.d.ts\",\n\tfiles: [\n\t\t\"src\",\n\t\t\"dist\",\n\t\t\"jsx-runtime\",\n\t\t\"jsx-dev-runtime\",\n\t\t\"_isolated-hnrs\",\n\t\t\"types/*.d.ts\",\n\t\t\"macro.*\"\n\t],\n\tsideEffects: false,\n\tauthor: \"Emotion Contributors\",\n\tlicense: \"MIT\",\n\tscripts: {\n\t\t\"test:typescript\": \"dtslint types\"\n\t},\n\tdependencies: {\n\t\t\"@babel/runtime\": \"^7.18.3\",\n\t\t\"@emotion/babel-plugin\": \"^11.11.0\",\n\t\t\"@emotion/cache\": \"^11.11.0\",\n\t\t\"@emotion/serialize\": \"^1.1.3\",\n\t\t\"@emotion/use-insertion-effect-with-fallbacks\": \"^1.0.1\",\n\t\t\"@emotion/utils\": \"^1.2.1\",\n\t\t\"@emotion/weak-memoize\": \"^0.3.1\",\n\t\t\"hoist-non-react-statics\": \"^3.3.1\"\n\t},\n\tpeerDependencies: {\n\t\treact: \">=16.8.0\"\n\t},\n\tpeerDependenciesMeta: {\n\t\t\"@types/react\": {\n\t\t\toptional: true\n\t\t}\n\t},\n\tdevDependencies: {\n\t\t\"@definitelytyped/dtslint\": \"0.0.112\",\n\t\t\"@emotion/css\": \"11.11.2\",\n\t\t\"@emotion/css-prettifier\": \"1.1.3\",\n\t\t\"@emotion/server\": \"11.11.0\",\n\t\t\"@emotion/styled\": \"11.11.0\",\n\t\t\"html-tag-names\": \"^1.1.2\",\n\t\treact: \"16.14.0\",\n\t\t\"svg-tag-names\": \"^1.1.1\",\n\t\ttypescript: \"^4.5.5\"\n\t},\n\trepository: \"https://github.com/emotion-js/emotion/tree/main/packages/react\",\n\tpublishConfig: {\n\t\taccess: \"public\"\n\t},\n\t\"umd:main\": \"dist/emotion-react.umd.min.js\",\n\tpreconstruct: {\n\t\tentrypoints: [\n\t\t\t\"./index.js\",\n\t\t\t\"./jsx-runtime.js\",\n\t\t\t\"./jsx-dev-runtime.js\",\n\t\t\t\"./_isolated-hnrs.js\"\n\t\t],\n\t\tumdName: \"emotionReact\",\n\t\texports: {\n\t\t\tenvConditions: [\n\t\t\t\t\"browser\",\n\t\t\t\t\"worker\"\n\t\t\t],\n\t\t\textra: {\n\t\t\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\t\t\"./macro\": {\n\t\t\t\t\ttypes: {\n\t\t\t\t\t\t\"import\": \"./macro.d.mts\",\n\t\t\t\t\t\t\"default\": \"./macro.d.ts\"\n\t\t\t\t\t},\n\t\t\t\t\t\"default\": \"./macro.js\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar jsx = function jsx(type, props) {\n var args = arguments;\n\n if (props == null || !hasOwn.call(props, 'css')) {\n // $FlowFixMe\n return React.createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n } // $FlowFixMe\n\n\n return React.createElement.apply(null, createElementArgArray);\n};\n\nvar warnedAboutCssPropForGlobal = false; // maintain place over rerenders.\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is\n // probably using the custom createElement which\n // means it will be turned into a className prop\n // $FlowFixMe I don't really want to add it to the type since it shouldn't be used\n props.className || props.css)) {\n console.error(\"It looks like you're using the css prop on Global, did you mean to use the styles prop instead?\");\n warnedAboutCssPropForGlobal = true;\n }\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\n\n if (!isBrowser$1) {\n var _ref;\n\n var serializedNames = serialized.name;\n var serializedStyles = serialized.styles;\n var next = serialized.next;\n\n while (next !== undefined) {\n serializedNames += ' ' + next.name;\n serializedStyles += next.styles;\n next = next.next;\n }\n\n var shouldCache = cache.compat === true;\n var rules = cache.insert(\"\", {\n name: serializedNames,\n styles: serializedStyles\n }, cache.sheet, shouldCache);\n\n if (shouldCache) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"style\", (_ref = {}, _ref[\"data-emotion\"] = cache.key + \"-global \" + serializedNames, _ref.dangerouslySetInnerHTML = {\n __html: rules\n }, _ref.nonce = cache.sheet.nonce, _ref));\n } // yes, i know these hooks are used conditionally\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = React.useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false; // $FlowFixMe\n\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Global.displayName = 'EmotionGlobal';\n}\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nvar keyframes = function keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name; // $FlowFixMe\n\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n};\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {\n console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.');\n }\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: React.useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nif (process.env.NODE_ENV !== 'production') {\n ClassNames.displayName = 'EmotionClassNames';\n}\n\nif (process.env.NODE_ENV !== 'production') {\n var isBrowser = \"object\" !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked\n\n var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';\n\n if (isBrowser && !isTestEnv) {\n // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later\n var globalContext = // $FlowIgnore\n typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef\n : isBrowser ? window : global;\n var globalKey = \"__EMOTION_REACT_\" + pkg.version.split('.')[0] + \"__\";\n\n if (globalContext[globalKey]) {\n console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');\n }\n\n globalContext[globalKey] = true;\n }\n}\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","export default function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n return {\n ...rect,\n top: rect.y,\n left: rect.x,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","function getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n // Browsers without `ShadowRoot` support.\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isContainingBlock(element) {\n const webkit = isWebKit();\n const css = getComputedStyle(element);\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else {\n currentNode = getParentNode(currentNode);\n }\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.pageXOffset,\n scrollTop: element.pageYOffset\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isWebKit };\n","import { rectToClientRect, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nexport { detectOverflow, offset } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getDocumentElement, getNodeName, isOverflowElement, getNodeScroll, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = currentWin.frameElement;\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = currentWin.frameElement;\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\nconst topLayerSelectors = [':popover-open', ':modal'];\nfunction isTopLayer(floating) {\n return topLayerSelectors.some(selector => {\n try {\n return floating.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\nfunction getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n ...clippingAncestor,\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const x = rect.left + scroll.scrollLeft - offsets.x;\n const y = rect.top + scroll.scrollTop - offsets.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n return element.offsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const window = getWindow(element);\n if (!isHTMLElement(element) || isTopLayer(element)) {\n return window;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {\n return window;\n }\n return offsetParent || getContainingBlock(element) || window;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n ...(await getDimensionsFn(data.floating))\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const {\n left,\n top,\n width,\n height\n } = element.getBoundingClientRect();\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 100);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle