@wemap/positioning 2.7.13 → 14.0.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +51 -0
  2. package/dist/index.d.ts +19 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +16582 -0
  5. package/dist/qr-scanner-worker.min-CdBZO1_x.js +2 -0
  6. package/dist/src/ILocationSource.d.ts +104 -0
  7. package/dist/src/ILocationSource.d.ts.map +1 -0
  8. package/dist/src/MapMatching.d.ts +83 -0
  9. package/dist/src/MapMatching.d.ts.map +1 -0
  10. package/dist/src/location-sources/GnssWifiLocationSource.d.ts +79 -0
  11. package/dist/src/location-sources/GnssWifiLocationSource.d.ts.map +1 -0
  12. package/dist/src/location-sources/LocationSource.d.ts +102 -0
  13. package/dist/src/location-sources/LocationSource.d.ts.map +1 -0
  14. package/dist/src/location-sources/VPSLocationSource.d.ts +107 -0
  15. package/dist/src/location-sources/VPSLocationSource.d.ts.map +1 -0
  16. package/dist/src/types.d.ts +65 -0
  17. package/dist/src/types.d.ts.map +1 -0
  18. package/dist/src/utils/permissions.d.ts +29 -0
  19. package/dist/src/utils/permissions.d.ts.map +1 -0
  20. package/dist/vitest.config.d.ts +3 -0
  21. package/dist/vitest.config.d.ts.map +1 -0
  22. package/package.json +23 -59
  23. package/babel.config.js +0 -11
  24. package/config.json +0 -4
  25. package/debug/absolute-attitude.html +0 -16
  26. package/debug/arcore-absolute.html +0 -16
  27. package/debug/arcore.html +0 -16
  28. package/debug/components/AbsoluteAttitudeComponent.jsx +0 -100
  29. package/debug/components/ArCoreAbsoluteComponent.jsx +0 -104
  30. package/debug/components/ArCoreComponent.jsx +0 -69
  31. package/debug/components/GnssWifiComponent.jsx +0 -56
  32. package/debug/components/GnssWifiPdrComponent.jsx +0 -76
  33. package/debug/components/ImuComponent.jsx +0 -95
  34. package/debug/components/InclinationComponent.jsx +0 -52
  35. package/debug/components/MapComponent.jsx +0 -228
  36. package/debug/components/NavigationConfig.js +0 -92
  37. package/debug/components/PdrComponent.jsx +0 -75
  38. package/debug/components/PoseComponent.jsx +0 -77
  39. package/debug/components/PositioningComponent.jsx +0 -29
  40. package/debug/components/PositioningInclinationComponent.jsx +0 -82
  41. package/debug/components/PositioningPoseComponent.jsx +0 -117
  42. package/debug/components/RelativeAttitudeComponent.jsx +0 -82
  43. package/debug/components/StartStopComponent.jsx +0 -50
  44. package/debug/components/Utils.js +0 -128
  45. package/debug/components/index.js +0 -34
  46. package/debug/gnss-wifi-pdr.html +0 -16
  47. package/debug/gnss-wifi.html +0 -16
  48. package/debug/imu.html +0 -16
  49. package/debug/inclination.html +0 -16
  50. package/debug/pdr.html +0 -16
  51. package/debug/pose.html +0 -16
  52. package/debug/positioning.html +0 -16
  53. package/debug/relative-attitude.html +0 -16
  54. package/dist/wemap-positioning.min.js +0 -1
  55. package/index.js +0 -8
  56. package/src/PositioningHandler.js +0 -237
  57. package/src/PositioningHandler.spec.js +0 -294
  58. package/src/PositioningOptions.js +0 -34
  59. package/src/errors/AskImuOnDesktopError.js +0 -9
  60. package/src/errors/ContainsIgnoredProviderError.js +0 -9
  61. package/src/errors/GeolocationApiMissingError.js +0 -9
  62. package/src/errors/GeolocationPermissionDeniedError.js +0 -9
  63. package/src/errors/GeolocationPositionUnavailableError.js +0 -9
  64. package/src/errors/IpResolveServerError.js +0 -9
  65. package/src/errors/MissingAccelerometerError.js +0 -11
  66. package/src/errors/MissingArCoreError.js +0 -9
  67. package/src/errors/MissingGyroscopeError.js +0 -11
  68. package/src/errors/MissingMagnetometerError.js +0 -9
  69. package/src/errors/MissingNativeInterfaceError.js +0 -9
  70. package/src/errors/MissingSensorError.js +0 -14
  71. package/src/errors/NoProviderFoundError.js +0 -9
  72. package/src/events/Availability.js +0 -30
  73. package/src/events/EventType.js +0 -22
  74. package/src/events/ProviderEvent.js +0 -35
  75. package/src/providers/Constants.js +0 -5
  76. package/src/providers/Provider.js +0 -247
  77. package/src/providers/ProvidersList.js +0 -44
  78. package/src/providers/ProvidersLogger.js +0 -75
  79. package/src/providers/attitude/AbsoluteAttitudeProvider.js +0 -199
  80. package/src/providers/attitude/EkfAttitude.js +0 -238
  81. package/src/providers/attitude/EkfAttitude.spec.js +0 -116
  82. package/src/providers/attitude/RelativeAttitudeProvider.js +0 -121
  83. package/src/providers/others/ImuProvider.js +0 -179
  84. package/src/providers/others/InclinationProvider.js +0 -99
  85. package/src/providers/others/MapMatchingProvider.js +0 -65
  86. package/src/providers/pose/ArCoreAbsoluteProvider.js +0 -235
  87. package/src/providers/pose/ArCoreProvider.js +0 -191
  88. package/src/providers/pose/GnssWifiPdrProvider.js +0 -219
  89. package/src/providers/pose/PoseProvider.js +0 -71
  90. package/src/providers/pose/pdr/PdrProvider.js +0 -364
  91. package/src/providers/pose/pdr/helpers/HeadingUnlocker.js +0 -41
  92. package/src/providers/pose/pdr/helpers/HeadingUnlocker.spec.js +0 -26
  93. package/src/providers/pose/pdr/helpers/Smoother.js +0 -92
  94. package/src/providers/pose/pdr/helpers/Smoother.spec.js +0 -426
  95. package/src/providers/pose/pdr/helpers/ThugDetector.js +0 -37
  96. package/src/providers/pose/pdr/steps/StepDetection.js +0 -7
  97. package/src/providers/pose/pdr/steps/StepDetectionLadetto.js +0 -67
  98. package/src/providers/pose/pdr/steps/StepDetectionMinMaxPeaks.js +0 -80
  99. package/src/providers/pose/pdr/steps/StepDetectionMinMaxPeaks2.js +0 -108
  100. package/src/providers/position/GnssWifiProvider.js +0 -130
  101. package/src/providers/position/IpProvider.js +0 -74
  102. package/webpack/webpack.common.js +0 -20
  103. package/webpack/webpack.dev.js +0 -24
  104. package/webpack/webpack.prod.js +0 -15
@@ -1 +0,0 @@
1
- module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=27)}([function(t,e,n){"use strict";e.a={Unknown:"UNKNOWN",MagneticField:"MAGNETIC_FIELD",AngularRate:"ANGULAR_RATE",Acceleration:"ACCELERATION",Inclination:"INCLINATION",RelativeAttitude:"RELATIVE_ATTITUDE",AbsoluteAttitude:"ABSOLUTE_ATTITUDE",RelativePosition:"RELATIVE_POSITION",AbsolutePosition:"ABSOLUTE_POSITION",Pressure:"PRESSURE",BluetoothSignals:"BLUETOOTH_SIGNALS",WifiSignals:"WIFI_SIGNALS",ScanId:"SCAN_ID",Itinerary:"ITINERARY",Network:"NETWORK"}},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),o(this,"isSupported",!1),o(this,"reason",null)}var e,n,i;return e=t,i=[{key:"no",value:function(e){var n=new t;return n.reason=e,n.isSupported=!1,n}},{key:"yes",value:function(){var e=new t;return e.isSupported=!0,e}},{key:"merge",value:function(){for(var e=0;e<arguments.length;e++){var n=e<0||arguments.length<=e?void 0:arguments[e];if(!n.isSupported)return n}return t.yes()}}],(n=null)&&r(e.prototype,n),i&&r(e,i),t}();e.a=i},function(t,e,n){"use strict";var r=n(13);e.a=r.a},function(t,e,n){"use strict";(function(t){var r=n(6),o=n.n(r),i=(n(0),n(12)),a=n(2),u=n(8),c=n(1),s=n(5),l=n(14);function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var h=1,y=function(){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),p(this,"state",e.State.STOPPPED),this.onEvent=t||o.a,this.onError=n||o.a,this.options=Object.assign({},e.DEFAULT_OPTIONS,s.a,r),this.id=h++,u.a.addEvent(this,"constructor")}var n,r,y;return n=e,y=[{key:"checkAvailability",value:function(t){return this.containsIgnoredProviders(t)?c.a.no(new l.a):this.getRequiredProviders(t).reduce((function(e,n){return c.a.merge(e,n.checkAvailability(t))}),c.a.yes())}},{key:"getRequiredProviders",value:function(){return[]}},{key:"containsIgnoredProviders",value:function(t){return this.getRequiredProvidersRecursively(t).some((function(e){return t.ignoreProviders.includes(e.name)}))}},{key:"getRequiredProvidersRecursively",value:function(t){return 0===this.getRequiredProviders(t).length?[this]:this.getRequiredProviders().reduce((function(e,n){return e.concat(n.getRequiredProvidersRecursively(t))}),[this])}},{key:"createEvent",value:function(t,e,n){var r=new i.a(this.constructor.name,t,e);return n&&(r.timestamp=n),r}},{key:"hasNativeInterface",value:function(){return Boolean(e.nativeInterface)}},{key:"name",get:function(){return this.DEFAULT_NAME}},{key:"displayName",get:function(){return this.constructor.DEFAULT_NAME}},{key:"eventsType",get:function(){return[]}},{key:"nativeInterface",get:function(){return t.WemapProvidersAndroid}},{key:"useCameraNatively",get:function(){return!1}}],(r=[{key:"start",value:function(){if(this.state!==e.State.STARTING&&this.state!==e.State.STARTED){if(this.state=e.State.STARTING,this.options.checkAvailabilityOnStart){var t=this.constructor.checkAvailability(this.options);if(!t.isSupported)return void this.notifyError(t.reason)}u.a.addEvent(this,"start"),this.state=e.State.STARTED,this.startInternal()}else a.a.warn(e.Warnings.ALREADY_STARTED)}},{key:"startInternal",value:function(){throw new Error('Provider "'+this.constructor.name+'" does not @override startInternal()')}},{key:"stop",value:function(){this.state!==e.State.STOPPPED?(u.a.addEvent(this,"stop"),this.state=e.State.STOPPPED,this.stopInternal()):a.a.warn(e.Warnings.ALREADY_STOPPED)}},{key:"stopInternal",value:function(){throw new Error('Provider "'+this.constructor.name+'" does not @override stopInternal()')}},{key:"notify",value:function(){u.a.incrementNotifications(this);for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.onEvent(e)}},{key:"notifyError",value:function(t){this.onError(t),this.options.stopOnError&&this.state===e.State.STARTED&&this.stop()}},{key:"createEvent",value:function(t,e,n){return this.constructor.createEvent(t,e,n)}},{key:"useCameraNatively",get:function(){return this.constructor.useCameraNatively}}])&&f(n.prototype,r),y&&f(n,y),e}();p(y,"DEFAULT_NAME","Unknown"),p(y,"DEFAULT_OPTIONS",Object.assign({},s.a,{stopOnError:!0,checkAvailabilityOnStart:!0})),p(y,"State",{STARTING:0,STARTED:1,STOPPPED:2}),p(y,"Warnings",{ALREADY_STARTED:"Provider already started",ALREADY_STOPPED:"Provider already stopped"}),e.a=y}).call(this,n(9))},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r="[object Number]",o=Object.prototype.toString;t.exports=function(t){return"number"==typeof t||function(t){return!!t&&"object"==n(t)}(t)&&o.call(t)==r}},function(t,e,n){"use strict";e.a={waitInputPosition:!1,waitInputHeading:!1,useMapMatching:!1,ignoreProviders:[],optionalEvents:[]}},function(t,e){t.exports=function(){}},function(t,e,n){(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r="object"==(void 0===e?"undefined":n(e))&&e&&e.Object===Object&&e,o="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,i=(r||o||Function("return this")()).isFinite;t.exports=function(t){return"number"==typeof t&&i(t)}}).call(this,n(9))},function(t,e,n){"use strict";var r=n(2);function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a,u,c=0,s=new WeakMap,l={},f={},p=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,p;return e=t,p=[{key:"initializeInterval",value:function(){a||(a=setInterval((function(){for(var t=0,e=Object.entries(l);t<e.length;t++){var n=o(e[t],2),i=n[0],a=n[1];r.a.debug("Received "+a+" notifications from "+f[i].constructor.name+" last second")}l={},f={}}),1e3))}},{key:"getObjectId",value:function(t){return s.has(t)||s.set(t,++c),s.get(t)}},{key:"addEvent",value:function(e,n){if(t.enabled){u||(u=Date.now()),t.initializeInterval();var o=t.getObjectId(e),i=e.constructor.name;r.a.debug(i+"["+o+"]."+n)}}},{key:"incrementNotifications",value:function(e){if(t.enabled){var n=t.getObjectId(e),r=l[n];r||(r=0,f[n]=e),l[n]=r+1}}},{key:"enabled",get:function(){return r.a.ENABLED&&r.a.LOG_LEVEL===r.a.DEBUG}}],(n=null)&&i(e.prototype,n),p&&i(e,p),t}();e.a=p},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r},function(t,e,n){var r=n(20),o=n(11);function i(t){this.options=t,this.lambda=t.lambda||t.lon,this.phi=t.phi||t.lat,this.height_above_ellipsoid=t.height_above_ellipsoid||0,this.ellipsoid=t.ellipsoid||new o}t.exports=i,i.prototype.toSpherical=function(){var t=this.ellipsoid,e=Math.cos(this.phi*Math.PI/180),n=Math.sin(this.phi*Math.PI/180),o=t.a/Math.sqrt(1-t.epssq*n*n),i=(o+this.height_above_ellipsoid)*e,a=(o*(1-t.epssq)+this.height_above_ellipsoid)*n,u=Math.sqrt(i*i+a*a);return new r({r:u,phig:180/Math.PI*Math.asin(a/u),lambda:this.lambda})},i.prototype.clone=function(){return new i(this.options)}},function(t,e){t.exports=function(t){t=t||{a:6378.137,b:6356.7523142,fla:1/298.257223563,re:6371.2},this.a=t.a,this.b=t.b,this.fla=t.fla,this.re=t.re,this.eps=Math.sqrt(1-this.b*this.b/(this.a*this.a)),this.epssq=this.eps*this.eps}},function(t,e,n){"use strict";var r=n(0);function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=function(){function t(e,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,"timestamp",-1),i(this,"dataType",r.a.Unknown),i(this,"providerName",""),i(this,"isFromNative",!1),i(this,"data",null),this.providerName=e,this.dataType=n,this.data=o}var e,n,a;return e=t,(n=[{key:"clone",value:function(){var e=new t(this.providerName,this.dataType,this.data);return e.timestamp=this.timestamp,e.isFromNative=this.isFromNative,e}}])&&o(e.prototype,n),a&&o(e,a),t}();e.a=a},function(t,e,n){"use strict";(function(t){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o=["error","ok","warn","flux","deprecated","info","log","debug"],i=function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}var r,i,a;return r=e,a=[{key:"enable",value:function(t){e.ENABLED=Boolean(t)}},{key:"level",value:function(t){return arguments.length&&(e.LOG_LEVEL=t),e.LOG_LEVEL}},{key:"_canUseLog",value:function(t){var n=o.indexOf(t),r=o.indexOf(e.LOG_LEVEL);return-1!==r&&n<=r}},{key:"_getColorByType",value:function(t){var n=null;switch(t){case e.FLUX:n="background: #0083E0; color: #FFFFFF;";break;case e.OK:n="background: #00FF22; color: #272727;";break;case e.DEPRECATED:n="background: #CA0AFA; color: #FFFFFF;";break;case e.ERROR:n="background: #CC0000; color: #FFFFFF;";break;case e.WARN:n="background: #DD7908; color: #FFFFFF;";break;case e.DEBUG:n="background: #999999; color: #FFFFFF;";break;case e.INFO:n="background: #DCFF4E; color: #000000;";break;default:n="background: #F4F4F4; color: #999999;"}return n}},{key:"_getOriginByType",value:function(t,e){var n=null,r=null,o=e;if(arguments.length<2)return"";try{for(n="",r=t.stack&&t.stack.length?t.stack.split("\n").splice(3):[],o<0?o=r.length:o>=r.length&&(o=r.length);o;)n+="\r\n\t"+r[0].trim(),r=r.splice(1),o--;return n}catch(t){return""}}},{key:"_log",value:function(n,r,i){var a="color: #000;",u="color: #6A6A6A;",c=null,s=null,l=null,f=null,p=null,h="",y=!1;if(!this._canUseLog(n)||arguments.length<2||!e.ENABLED)return!1;if(s=n,p=new Error(r),l=e._getColorByType(n),f=e._getOriginByType(p,i),s===e.DEPRECATED&&(s=e.WARN,y=e.DEPRECATED),f=e._COLOR_TOKEN+f,c=e._COLOR_TOKEN+" "+p.message,h=e._COLOR_TOKEN,h+=e._TYPE_PREFIX,h+=y||n,h+=e._TYPE_SUFFIX,t.wemap&&t.wemap.startTime){var v=performance&&performance.now?performance.now():(new Date).getTime();h+="["+Math.round(v-t.wemap.startTime)+"ms]"}return c=h+c+f,console&&console[n]&&o.indexOf(n)<=e.INFO?console[n](c,l,a,u):console.log(c,l,a,u),!0}},{key:"external",value:function(t){return console.log("LIVEMAP :: "+t)}},{key:"flux",value:function(t){var n=e.FLUX;return e._log(n,t,0)}},{key:"ok",value:function(t){var n=e.OK;return e._log(n,t,1)}},{key:"error",value:function(t,n){var r=n||-1,o=e.ERROR;return e._log(o,t,r)}},{key:"warn",value:function(t,n){var r=n||2,o=e.WARN;return e._log(o,t,r)}},{key:"deprecated",value:function(t,n){var r=n||2,o=e.DEPRECATED;return e._log(o,t,r)}},{key:"debug",value:function(t,n){var r=n||-1,o=e.DEBUG;return e._log(o,t,r)}},{key:"info",value:function(t,n){var r=n||0,o=e.INFO;return e._log(o,t,r)}},{key:"log",value:function(t,n){var r=n||1,o=e.LOG;return e._log(o,t,r)}}],(i=null)&&n(r.prototype,i),a&&n(r,a),e}();r(i,"LOG_LEVEL","debug"),r(i,"ENABLED",!0),r(i,"_COLOR_TOKEN","%c"),r(i,"_TYPE_PREFIX","<<<< "),r(i,"_TYPE_SUFFIX"," >>>>"),r(i,"ERROR",o[0]),r(i,"OK",o[1]),r(i,"WARN",o[2]),r(i,"FLUX",o[3]),r(i,"DEPRECATED",o[4]),r(i,"INFO",o[5]),r(i,"LOG",o[6]),r(i,"DEBUG",o[7]),e.a=i}).call(this,n(9))},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function i(t){var e="function"==typeof Map?new Map:void 0;return(i=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return a(t,arguments,c(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,t)})(t)}function a(t,e,n){return(a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&u(o,n.prototype),o}).apply(null,arguments)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var s="Contains ignored provider",l=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,c(e).call(this,t||s))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(e,t),e}(i(Error));e.a=l},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r="[object String]",o=Object.prototype.toString,i=Array.isArray;t.exports=function(t){return"string"==typeof t||!i(t)&&function(t){return!!t&&"object"==n(t)}(t)&&o.call(t)==r}},function(t,e,n){var r=n(17),o=t.exports={},i=null,a=[n(25),n(26)];o.model=function(t){t=t||new Date,i||(i=a.map((function(t){return new r(t)})));for(var e,n=t.getTime(),o=0,u=i.length;o<u;++o)if(!(i[o].start_date.getTime()>n||i[o].end_date.getTime()<n)){e=i[o];break}return e||(e=i[0]),e.getTimedModel(t)}},function(t,e,n){n(18);var r=n(10),o=(n(11),n(23)),i=n(24);function a(t){this.epoch=t.epoch,this.start_date=new Date(t.start_date),this.end_date=new Date(t.end_date),this.name=t.name||"",this.main_field_coeff_g=t.main_field_coeff_g||[0],this.main_field_coeff_h=t.main_field_coeff_h||[0],this.secular_var_coeff_g=t.secular_var_coeff_g||[0],this.secular_var_coeff_h=t.secular_var_coeff_h||[0],this.n_max=t.n_max||0,this.n_max_sec_var=t.n_max_sec_var||0,this.num_terms=this.n_max*(this.n_max+1)/2+this.n_max}t.exports=a,a.prototype.getTimedModel=function(t){var e=t.getFullYear(),n=new Date(e,0,1),r=e+(t.valueOf()-n.valueOf())/31536e6-this.epoch;if(t<this.start_date||t>this.end_date)throw new RangeError("Model is only valid from "+this.start_date.toDateString()+" to "+this.end_date.toDateString());for(var o=new a({epoch:this.epoch,n_max:this.n_max,n_max_sec_var:this.n_max_sec_var,name:this.name}),i=o.n_max_sec_var,u=i*(i+1)/2+i,c=1;c<=this.n_max;c++)for(var s=0;s<=c;s++){var l=c*(c+1)/2+s,f=this.main_field_coeff_h[l],p=this.main_field_coeff_g[l],h=this.secular_var_coeff_h[l],y=this.secular_var_coeff_g[l];l<=u?(o.main_field_coeff_h[l]=f+r*h,o.main_field_coeff_g[l]=p+r*y,o.secular_var_coeff_h[l]=h,o.secular_var_coeff_g[l]=y):(o.main_field_coeff_h[l]=f,o.main_field_coeff_g[l]=p)}return o},a.prototype.getSummation=function(t,e,n){var r,o,a,u,c=0,s=0,l=0,f=e.relative_radius_power,p=e.cos_mlambda,h=e.sin_mlambda,y=this.main_field_coeff_g,v=this.main_field_coeff_h;for(r=1;r<=this.n_max;r++)for(o=0;o<=r;o++)a=r*(r+1)/2+o,l-=f[r]*(y[a]*p[o]+v[a]*h[o])*(r+1)*t.pcup[a],s+=f[r]*(y[a]*h[o]-v[a]*p[o])*o*t.pcup[a],c-=f[r]*(y[a]*p[o]+v[a]*h[o])*t.dpcup[a];var d=Math.cos(Math.PI/180*n.phig);if(Math.abs(d)>1e-10)s/=d;else{s=0;var b,g,m=1,w=[1],_=Math.sin(Math.PI/180*n.phig);for(r=1;r<=this.n_max;r++)a=r*(r+1)/2+1,g=(b=m*(2*r-1)/r)*Math.sqrt(2*r/(r+1)),m=b,1==r?w[r]=w[r-1]:(u=((r-1)*(r-1)-1)/((2*r-1)*(2*r-3)),w[r]=_*w[r-1]-u*w[r-2]),s+=f[r]*(y[a]*h[1]-v[a]*p[1])*w[r]*g}return new i({bx:c,by:s,bz:l})},a.prototype.point=function(t){var e=new r({lat:t[0],lon:t[1]}),n=e.toSpherical(),i=n.getLegendreFunction(this.n_max),a=n.getHarmonicVariables(e.ellipsoid,this.n_max),u=this.getSummation(i,a,n).rotate(n,e);return o.fromGeoMagneticVector(u)}},function(t,e,n){(function(t){function n(t,e){for(var n=0,r=t.length-1;r>=0;r--){var o=t[r];"."===o?t.splice(r,1):".."===o?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}e.resolve=function(){for(var e="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a=i>=0?arguments[i]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,o="/"===a.charAt(0))}return(o?"/":"")+(e=n(r(e.split("/"),(function(t){return!!t})),!o).join("/"))||"."},e.normalize=function(t){var i=e.isAbsolute(t),a="/"===o(t,-1);return(t=n(r(t.split("/"),(function(t){return!!t})),!i).join("/"))||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(r(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var o=r(t.split("/")),i=r(n.split("/")),a=Math.min(o.length,i.length),u=a,c=0;c<a;c++)if(o[c]!==i[c]){u=c;break}var s=[];for(c=u;c<o.length;c++)s.push("..");return(s=s.concat(i.slice(u))).join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){if("string"!=typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,r=-1,o=!0,i=t.length-1;i>=1;--i)if(47===(e=t.charCodeAt(i))){if(!o){r=i;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"/":t.slice(0,r)},e.basename=function(t,e){var n=function(t){"string"!=typeof t&&(t+="");var e,n=0,r=-1,o=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!o){n=e+1;break}}else-1===r&&(o=!1,r=e+1);return-1===r?"":t.slice(n,r)}(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,n=0,r=-1,o=!0,i=0,a=t.length-1;a>=0;--a){var u=t.charCodeAt(a);if(47!==u)-1===r&&(o=!1,r=a+1),46===u?-1===e?e=a:1!==i&&(i=1):-1!==e&&(i=-1);else if(!o){n=a+1;break}}return-1===e||-1===r||0===i||1===i&&e===r-1&&e===n+1?"":t.slice(e,r)};var o="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n(19))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,s=[],l=!1,f=-1;function p(){l&&c&&(l=!1,c.length?s=c.concat(s):f=-1,s.length&&h())}function h(){if(!l){var t=u(p);l=!0;for(var e=s.length;e;){for(c=s,s=[];++f<e;)c&&c[f].run();f=-1,e=s.length}c=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new y(t,e)),1!==s.length||l||u(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){var r=n(21),o=n(22);function i(t){this.lambda=t.lambda,this.phig=t.phig,this.r=t.r}t.exports=i,i.prototype.toCartesian=function(){var t=this.phig*Math.PI/180,e=this.lambda*Math.PI/180;return new r({x:this.r*cos(t)*cos(e),y:this.r*cos(t)*sin(e),z:this.r*sin(t)})},i.prototype.toGeodetic=function(t){return this.toCartesian().toGeodetic(t)},i.prototype.getHarmonicVariables=function(t,e){var n,r,o=Math.cos(Math.PI/180*this.lambda),i=Math.sin(Math.PI/180*this.lambda),a=[1,o],u=[0,i],c=[t.re/this.r*(t.re/this.r)];for(r=1;r<=e;r++)c[r]=c[r-1]*(t.re/this.r);for(n=2;n<=e;n++)a[n]=a[n-1]*o-u[n-1]*i,u[n]=a[n-1]*i+u[n-1]*o;return{relative_radius_power:c,cos_mlambda:a,sin_mlambda:u}},i.prototype.getLegendreFunction=function(t){return new o(this,t)}},function(t,e,n){var r=n(10);function o(t){this.x=t.x,this.y=t.y,this.z=t.z}t.exports=o,o.prototype.toGeodetic=function(t){var e,n=this.z<0?-t.b:t.b,o=this.x,i=this.y,a=this.z,u=Math.sqr(o*o+i*i),c=(n*a-(t.a*t.a-n*n))/(t.a*u),s=(n*a+(t.a*t.a-n*n))/(t.a*u),l=4/3*(c*s+1),f=2*(c*c+s*s),p=l*l*l+f*f;(e=p>0?Math.pow(Math.sqrt(p)-f,1/3)-Math.pow(Math.sqrt(p)+f,1/3):2*Math.sqrt(-l)*Math.cos(Math.acos(f/(l*Math.sqrt(-l)))/3))*e<Math.abs(l)&&(e=-(e*e*e+2*f)/3*l);var h=(Math.sqrt(c*c+e)+c)/2,y=Math.sqrt(h*h+(s-e*h)/(2*h-c))-h,v=Math.atan(t.a*(1-y*y)/(2*n*y)),d=Math.atan2(i,o);d<0&&(d+=2*Math.PI);var b=(u-t.a*y)*Math.cos(v)+(a-n)*Math.sin(v),g=d*Math.PI/180;return g>180&&(g-=360),new r({lambda:g,phi:v*Math.PI/180,height_above_ellipsoid:b,ellipsoid:t})}},function(t,e){t.exports=function(t,e){var n,r=Math.sin(Math.PI/180*t.phig);n=e<=16||1-Math.abs(r)<1e-10?function(t,e){var n,r,o,i,a,u,c,s=[1],l=[1],f=[0];for(r=Math.sqrt((1-t)*(1+t)),(e+1)*(e+2)/2,o=1;o<=e;o++)for(i=0;i<=o;i++)a=o*(o+1)/2+i,o==i?(u=(o-1)*o/2+i-1,l[a]=r*l[u],f[a]=r*f[u]+t*l[u]):1==o&&0==i?(u=(o-1)*o/2+i,l[a]=t*l[u],f[a]=t*f[u]-r*l[u]):o>1&&o!=i&&(u=(o-2)*(o-1)/2+i,c=(o-1)*o/2+i,i>o-2?(l[a]=t*l[c],f[a]=t*f[c]-r*l[c]):(n=((o-1)*(o-1)-i*i)/((2*o-1)*(2*o-3)),l[a]=t*l[c]-n*l[u],f[a]=t*f[c]-r*l[c]-n*f[u]));for(o=1;o<=e;o++)for(u=(o-1)*o/2,s[a=o*(o+1)/2]=s[u]*(2*o-1)/o,i=1;i<=o;i++)u=o*(o+1)/2+i-1,s[a=o*(o+1)/2+i]=s[u]*Math.sqrt((o-i+1)*(1==i?2:1)/(o+i));for(o=1;o<=e;o++)for(i=0;i<=o;i++)l[a=o*(o+1)/2+i]*=s[a],f[a]*=-s[a];return{pcup:l,dpcup:f}}(r,e):function(t,e){if(1==Math.abs(t))throw new Error("Error in PcupHigh: derivative cannot be calculated at poles");var n,r,o=[],i=[],a=[];for(n=0;n<=2*e+1;++n)a[n]=Math.sqrt(n);for(r=2,n=0;n<=e;n++){for(o[++r]=(2*n-1)/n,i[r]=(n-1)/n,d=1;d<=n-2;d++)o[++r]=(2*n-1)/a[n+d]/a[n-d],i[r]=a[n-d-1]*a[n+d-1]/a[n+d]/a[n-d];r+=2}var u,c=Math.sqrt((1-t)*(1+t)),s=t,l=1,f=[1,s],p=[0,c];if(0==e)throw new Error("Error in PcupHigh: n_max must be greater than 0");for(r=1,n=2;n<=e;n++)u=o[r+=n]*t*s-i[r]*l,f[r]=u,p[r]=n*(s-t*u)/c,l=s,s=u;for(var h=1e-280*a[2],y=1e280,v=0,d=1;d<=e-1;++d)for(y*=c,v=v+d+1,h=h*a[2*d+1]/a[2*d],f[v]=h*y/a[2*d+1],p[v]=-d*t*f[v]/c,l=h/a[2*d+1],r=v+d+1,s=t*a[2*d+1]*l,f[r]=s*y,p[r]=(l*y*a[2*d+1]-t*(d+1)*f[r])/c,n=d+2;n<=e;++n)u=t*o[r+=n]*s-i[r]*l,f[r]=u*y,p[r]=(a[n+d]*a[n-d]*s*y-n*t*f[r])/c,l=s,s=u;return y*=c,v=v+d+1,h/=a[2*e],f[v]=h*y,p[v]=-e*t*f[v]/c,{pcup:f,dpcup:p}}(r,e);this.pcup=n.pcup,this.dpcup=n.dpcup}},function(t,e){function n(t){this.x=t.x,this.y=t.y,this.z=t.z,this.h=t.h,this.f=t.f,this.incl=t.incl,this.decl=t.decl,this.gv=t.gv,this.xdot=t.xdot,this.ydot=t.ydot,this.zdot=t.zdot,this.hdot=t.hdot,this.fdot=t.fdot,this.incldot=t.incldot,this.decldot=t.decldot,this.gvdot=t.gvdot}t.exports=n,n.prototype.clone=function(){return new n(this)},n.prototype.scale=function(t){return new n({x:this.x*t,y:this.y*t,z:this.z*t,h:this.h*t,f:this.f*t,incl:this.incl*t,decl:this.decl*t,gv:this.gv*t,xdot:this.xdot*t,ydot:this.ydot*t,zdot:this.zdot*t,hdot:this.hdot*t,fdot:this.fdot*t,incldot:this.incldot*t,decldot:this.decldot*t,gvdot:this.gvdot*t})},n.prototype.subtract=function(t){return new n({x:this.x-t.x,y:this.y-t.y,z:this.z-t.z,h:this.h-t.h,f:this.f-t.f,incl:this.incl-t.incl,decl:this.decl-t.decl,gv:this.gv-t.gv,xdot:this.xdot-t.xdot,ydot:this.ydot-t.ydot,zdot:this.zdot-t.zdot,hdot:this.hdot-t.hdot,fdot:this.fdot-t.fdot,incldot:this.incldot-t.incldot,decldot:this.decldot-t.decldot,gvdot:this.gvdot-t.gvdot})},n.fromGeoMagneticVector=function(t){var e=t.bx,r=t.by,o=t.bz,i=Math.sqrt(e*e+r*r);return new n({x:e,y:r,z:o,h:i,f:Math.sqrt(i*i+o*o),decl:180/Math.PI*Math.atan2(r,e),incl:180/Math.PI*Math.atan2(o,i)})},n.fromSecularVariationVector=function(t){var e=t.bx,r=t.by,o=t.bz;return new n({xdot:e,ydot:r,zdot:o,hdot:(this.x*e+this.y*r)/this.h,fdot:(this.x*e+this.y*r+this.z*o)/this.f,decldot:180/Math.PI*(this.x*this.ydot-this.y*this.xdot)/(this.h*this.h),incldot:180/Math.PI*(this.h*this.zdot-this.z*this.hdot)/(this.f*this.f),gvdot:this.decldot})}},function(t,e){function n(t){this.bx=t.bx,this.by=t.by,this.bz=t.bz}t.exports=n,n.prototype.rotate=function(t,e){var r=Math.PI/180*(t.phig-e.phi);return new n({bz:this.bx*Math.sin(r)+this.bz*Math.cos(r),bx:this.bx*Math.cos(r)-this.bz*Math.sin(r),by:this.by})}},function(t){t.exports=JSON.parse('{"main_field_coeff_g":[0,-29438.2,-1493.5,-2444.5,3014.7,1679,1351.8,-2351.6,1223.6,582.3,907.5,814.8,117.8,-335.6,69.7,-232.9,360.1,191.7,-141.3,-157.2,7.7,69.4,67.7,72.3,-129.1,-28.4,13.6,-70.3,81.7,-75.9,-7.1,52.2,15,9.1,-3,5.9,24.2,8.9,-16.9,-3.1,-20.7,13.3,11.6,-16.3,-2.1,5.5,8.8,3,-3.2,0.6,-13.2,-0.1,8.7,-9.1,-10.4,-2,-6.1,0.2,0.6,-0.5,1.8,-0.7,2.2,2.4,-1.8,-3.6,3,-1.4,-2.3,2.1,-0.8,0.6,-0.7,0.1,1.7,-0.2,0.4,3.5,-2,-0.1,0.5,1.2,-0.9,0.9,0.1,0.6,-0.4,-0.5,0.2,-0.9,0],"main_field_coeff_h":[0,0,4796.3,0,-2842.4,-638.8,0,-113.7,246.5,-537.4,0,283.3,-188.6,180.7,-330,0,46.9,196.5,-119.9,16,100.6,0,-20.1,32.8,59.1,-67.1,8.1,61.9,0,-54.3,-19.5,6,24.5,3.5,-27.7,-2.9,0,10.1,-18.3,13.3,-14.5,16.2,6,-9.2,2.4,0,-21.8,10.7,11.8,-6.8,-6.9,7.9,1,-3.9,8.5,0,3.3,-0.4,4.6,4.4,-7.9,-0.6,-4.2,-2.9,-1.1,-8.8,0,0,2.1,-0.6,-1.1,0.7,-0.2,-2.1,-1.5,-2.6,-2,-2.3,0,-1,0.3,1.8,-2.2,0.3,0.7,-0.1,0.3,0.2,-0.9,-0.2,0.8],"secular_var_coeff_g":[0,7,9,-11,-6.2,0.3,2.4,-5.7,2,-11,-0.8,-0.9,-6.5,5.2,-4,-0.3,0.6,-0.8,0.1,1.2,1.4,-0.8,-0.5,-0.1,1.6,-1.6,0,1.2,-0.3,-0.2,-0.3,0.9,0.1,-0.6,-0.9,0.7,-0.1,0.2,-0.2,0.5,-0.1,0.4,0.4,-0.1,0.4,-0.1,-0.1,0,0.4,-0.4,0,0.3,0,0,-0.3,0,0,-0.1,0.2,-0.1,-0.2,0,-0.1,-0.2,-0.1,0,0,0,0,0,0,-0.1,0,0,0,-0.1,0,-0.1,0,0,0,0,-0.1,0,0,0,0,0,0,0,-0.1],"secular_var_coeff_h":[0,0,-30.2,0,-29.6,-17.3,0,6.5,-0.8,-2,0,-0.4,5.8,3.8,-3.5,0,0.2,2.3,0,3.3,-0.6,0,0.3,-1.5,-1.2,0.4,0.2,1.3,0,0.6,0.5,-0.8,-0.2,-1.1,0.1,0.2,0,-0.4,0.6,-0.1,0.6,-0.2,-0.5,0.5,0.1,0,-0.3,0.1,-0.4,0.3,0.1,0,-0.1,0.5,0.2,0,0,0.1,-0.2,0.1,-0.1,0.1,0,-0.1,0.2,0,0,0,0.1,0,0.1,0,0,0.1,0,-0.1,0,-0.1,0,0,0,-0.1,0.1,0,0,0,0,0,0,0,-0.1],"n_max":12,"n_max_sec_var":12,"epoch":2015,"name":"WMM-2015v2","start_date":"2018-09-18T06:00:00.000Z","end_date":"2023-09-18T06:00:00.000Z"}')},function(t){t.exports=JSON.parse('{"main_field_coeff_g":[0,-29438.5,-1501.1,-2445.3,3012.5,1676.6,1351.1,-2352.3,1225.6,581.9,907.2,813.7,120.3,-335,70.3,-232.6,360.1,192.4,-141,-157.4,4.3,69.5,67.4,72.8,-129.8,-29,13.2,-70.9,81.6,-76.1,-6.8,51.9,15,9.3,-2.8,6.7,24,8.6,-16.9,-3.2,-20.6,13.3,11.7,-16,-2,5.4,8.8,3.1,-3.1,0.6,-13.3,-0.1,8.7,-9.1,-10.5,-1.9,-6.5,0.2,0.6,-0.6,1.7,-0.7,2.1,2.3,-1.8,-3.6,3.1,-1.5,-2.3,2.1,-0.9,0.6,-0.7,0.2,1.7,-0.2,0.4,3.5,-2,-0.3,0.4,1.3,-0.9,0.9,0.1,0.5,-0.4,-0.4,0.2,-0.9,0],"main_field_coeff_h":[0,0,4796.2,0,-2845.6,-642,0,-115.3,245,-538.3,0,283.4,-188.6,180.9,-329.5,0,47.4,196.9,-119.4,16.1,100.1,0,-20.7,33.2,58.8,-66.5,7.3,62.5,0,-54.1,-19.4,5.6,24.4,3.3,-27.5,-2.3,0,10.2,-18.1,13.2,-14.6,16.2,5.7,-9.1,2.2,0,-21.6,10.8,11.7,-6.8,-6.9,7.8,1,-3.9,8.5,0,3.3,-0.3,4.6,4.4,-7.9,-0.6,-4.1,-2.8,-1.1,-8.7,0,-0.1,2.1,-0.7,-1.1,0.7,-0.2,-2.1,-1.5,-2.5,-2,-2.3,0,-1,0.5,1.8,-2.2,0.3,0.7,-0.1,0.3,0.2,-0.9,-0.2,0.7],"secular_var_coeff_g":[0,10.7,17.9,-8.6,-3.3,2.4,3.1,-6.2,-0.4,-10.4,-0.4,0.8,-9.2,4,-4.2,-0.2,0.1,-1.4,0,1.3,3.8,-0.5,-0.2,-0.6,2.4,-1.1,0.3,1.5,0.2,-0.2,-0.4,1.3,0.2,-0.4,-0.9,0.3,0,0.1,-0.5,0.5,-0.2,0.4,0.2,-0.4,0.3,0,-0.1,-0.1,0.4,-0.5,-0.2,0.1,0,-0.2,-0.1,0,0,-0.1,0.3,-0.1,-0.1,-0.1,0,-0.2,-0.1,-0.2,0,0,-0.1,0.1,0,0,0,0,0,0,-0.1,-0.1,0.1,0,0,0.1,-0.1,0,0.1,0,0,0,0,0,0],"secular_var_coeff_h":[0,0,-26.8,0,-27.1,-13.3,0,8.4,-0.4,2.3,0,-0.6,5.3,3,-5.3,0,0.4,1.6,-1.1,3.3,0.1,0,0,-2.2,-0.7,0.1,1,1.3,0,0.7,0.5,-0.2,-0.1,-0.7,0.1,0.1,0,-0.3,0.3,0.3,0.6,-0.1,-0.2,0.3,0,0,-0.2,-0.1,-0.2,0.1,0.1,0,-0.2,0.4,0.3,0,0.1,-0.1,0,0,-0.2,0.1,-0.1,-0.2,0.1,-0.1,0,0,0.1,0,0.1,0,0,0.1,0,-0.1,0,-0.1,0,0,0,-0.1,0,0,0,0,0,0,0,0,0],"n_max":12,"n_max_sec_var":12,"epoch":2015,"name":"WMM-2015","start_date":"2014-12-15T07:00:00.000Z","end_date":"2019-12-15T07:00:00.000Z"}')},function(t,e,n){"use strict";n.r(e);var r=n(3),o=n(0);function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"identity4",value:function(){return[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]}},{key:"add",value:function(t,e){for(var n=t.length,r=t[0].length,o=new Array(n),i=0;i<n;++i){o[i]=new Array(r);for(var a=0;a<r;++a)o[i][a]=t[i][a]+e[i][a]}return o}},{key:"concatRow",value:function(t,e){for(var n=t.length,r=e.length,o=new Array(n+r),i=0;i<n;++i)o[i]=t[i].slice();for(var a=0;a<r;++a)o[n+a]=e[a].slice();return o}},{key:"concatLine",value:function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;++o)r[o]=t[o].concat(e[o]);return r}},{key:"diag",value:function(t){for(var e=Array(t.length),n=0;n<t.length;n++){e[n]=Array(t.length);for(var r=0;r<t.length;r++)e[n][r]=n===r?t[n]:0}return e}},{key:"transpose",value:function(t){for(var e=t.length,n=t[0].length,r=Array(n),o=0;o<n;o++){r[o]=Array(e);for(var i=0;i<e;i++)r[o][i]=t[i][o]}return r}},{key:"multiply",value:function(t,e){for(var n=t.length,r=t[0].length,o=e[0].length,i=new Array(n),a=0;a<n;++a){i[a]=new Array(o);for(var u=0;u<o;++u){i[a][u]=0;for(var c=0;c<r;++c)i[a][u]+=t[a][c]*e[c][u]}}return i}},{key:"multiplyScalar",value:function(t,e){for(var n=t.length,r=t[0].length,o=new Array(n),i=0;i<n;++i){o[i]=new Array(r);for(var a=0;a<r;++a)o[i][a]=t[i][a]*e}return o}},{key:"multiplyVector",value:function(t,e){for(var n=t.length,r=t[0].length,o=new Array(n),i=0;i<n;++i){o[i]=0;for(var a=0;a<r;++a)o[i]+=t[i][a]*e[a]}return o}},{key:"inverse",value:function(t){if(t.length!==t[0].length)return null;var e=0,n=0,r=0,o=t.length,i=0,a=[],u=[];for(e=0;e<o;e+=1)for(a[a.length]=[],u[u.length]=[],r=0;r<o;r+=1)a[e][r]=e===r?1:0,u[e][r]=t[e][r];for(e=0;e<o;e+=1){if(0===(i=u[e][e])){for(n=e+1;n<o;n+=1)if(0!==u[n][e]){for(r=0;r<o;r++)i=u[e][r],u[e][r]=u[n][r],u[n][r]=i,i=a[e][r],a[e][r]=a[n][r],a[n][r]=i;break}if(0===(i=u[e][e]))return null}for(r=0;r<o;r++)u[e][r]=u[e][r]/i,a[e][r]=a[e][r]/i;for(n=0;n<o;n++)if(n!==e)for(i=u[n][e],r=0;r<o;r++)u[n][r]-=i*u[e][r],a[n][r]-=i*a[e][r]}return a}}],(n=null)&&i(e.prototype,n),r&&i(e,r),t}();function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return!e||"object"!==u(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var p=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,l(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(e,t),n=e,o=[{key:"add",value:function(t,e){return[[t[0][0]+e[0][0],t[0][1]+e[0][1],t[0][2]+e[0][2]],[t[1][0]+e[1][0],t[1][1]+e[1][1],t[1][2]+e[1][2]],[t[2][0]+e[2][0],t[2][1]+e[2][1],t[2][2]+e[2][2]]]}},{key:"transpose",value:function(t){return[[t[0][0],t[1][0],t[2][0]],[t[0][1],t[1][1],t[2][1]],[t[0][2],t[1][2],t[2][2]]]}},{key:"zeros",value:function(){return[[0,0,0],[0,0,0],[0,0,0]]}},{key:"multiplyScalar",value:function(t,e){return[[t[0][0]*e,t[0][1]*e,t[0][2]*e],[t[1][0]*e,t[1][1]*e,t[1][2]*e],[t[2][0]*e,t[2][1]*e,t[2][2]*e]]}},{key:"multiplyVector",value:function(t,e){for(var n=new Array(3),r=0;r<3;++r){n[r]=0;for(var o=0;o<3;++o)n[r]+=t[r][o]*e[o]}return n}},{key:"multiply",value:function(t,e){for(var n=new Array(3),r=0;r<3;++r){n[r]=new Array(3);for(var o=0;o<3;++o){n[r][o]=0;for(var i=0;i<3;++i)n[r][o]+=t[r][i]*e[i][o]}}return n}},{key:"skew",value:function(t){return[[0,-t[2],t[1]],[t[2],0,-t[0]],[-t[1],t[0],0]]}},{key:"inverse",value:function(t){var e=new Array(3),n=t[0][0],r=t[0][1],o=t[0][2],i=t[1][0],a=t[1][1],u=t[1][2],c=t[2][0],s=t[2][1],l=t[2][2],f=l*a-u*s,p=u*c-l*i,h=s*i-a*c,y=n*f+r*p+o*h;if(0===y)return null;e[0]=new Array(3),e[1]=new Array(3),e[2]=new Array(3);var v=1/y;return e[0][0]=f*v,e[0][1]=(o*s-l*r)*v,e[0][2]=(u*r-o*a)*v,e[1][0]=p*v,e[1][1]=(l*n-o*c)*v,e[1][2]=(o*i-u*n)*v,e[2][0]=h*v,e[2][1]=(r*c-s*n)*v,e[2][2]=(a*n-r*i)*v,e}}],(r=null)&&c(n.prototype,r),o&&c(n,o),e}(a);function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t,e){return!e||"object"!==h(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var g=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),v(this,d(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}(e,t),n=e,o=[{key:"add",value:function(t,e){return[[t[0][0]+e[0][0],t[0][1]+e[0][1],t[0][2]+e[0][2],t[0][3]+e[0][3]],[t[1][0]+e[1][0],t[1][1]+e[1][1],t[1][2]+e[1][2],t[1][3]+e[1][3]],[t[2][0]+e[2][0],t[2][1]+e[2][1],t[2][2]+e[2][2],t[2][3]+e[2][3]],[t[3][0]+e[3][0],t[3][1]+e[3][1],t[3][2]+e[3][2],t[3][3]+e[3][3]]]}},{key:"subtract",value:function(t,e){return[[t[0][0]-e[0][0],t[0][1]-e[0][1],t[0][2]-e[0][2],t[0][3]-e[0][3]],[t[1][0]-e[1][0],t[1][1]-e[1][1],t[1][2]-e[1][2],t[1][3]-e[1][3]],[t[2][0]-e[2][0],t[2][1]-e[2][1],t[2][2]-e[2][2],t[2][3]-e[2][3]],[t[3][0]-e[3][0],t[3][1]-e[3][1],t[3][2]-e[3][2],t[3][3]-e[3][3]]]}}],(r=null)&&y(n.prototype,r),o&&y(n,o),e}(a);function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var _=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"add",value:function(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2],t[3]+e[3]]}},{key:"rotate",value:function(t,e){var n=m(t,4),r=n[0],o=n[1],i=n[2],a=n[3],u=m(e,3),c=u[0],s=u[1],l=u[2];return[r*(r*c-i*l+a*s)-i*(r*l-o*s+i*c)+o*(o*c+i*s+a*l)+a*(r*s+o*l-a*c),r*(r*s+o*l-a*c)+o*(r*l-o*s+i*c)+i*(o*c+i*s+a*l)-a*(r*c-i*l+a*s),r*(r*l-o*s+i*c)-o*(r*s+o*l-a*c)+i*(r*c-i*l+a*s)+a*(o*c+i*s+a*l)]}},{key:"inverse",value:function(t){return[-t[0],t[1],t[2],t[3]]}},{key:"multiply",value:function(t,e){var n=m(t,4),r=n[0],o=n[1],i=n[2],a=n[3],u=m(e,4),c=u[0],s=u[1],l=u[2],f=u[3];return[r*c-o*s-i*l-a*f,r*s+c*o+i*f-a*l,r*l+c*i+a*s-o*f,r*f+c*a+o*l-i*s]}},{key:"fromAxisAngle",value:function(t,e){var n=Math.sin(e/2);return[Math.cos(e/2),t[0]*n,t[1]*n,t[2]*n]}},{key:"fromMatrix3",value:function(t){var e=Math.sqrt(1+t[0][0]+t[1][1]+t[2][2])/2;return[e,(t[1][2]-t[2][1])/(4*e),(t[2][0]-t[0][2])/(4*e),(t[0][1]-t[1][0])/(4*e)]}},{key:"wxyz2xyzw",value:function(t){return[t[1],t[2],t[3],t[0]]}},{key:"xyzw2wxyz",value:function(t){return[t[3],t[0],t[1],t[2]]}},{key:"distance",value:function(e,n){return Math.acos(Math.min(2*Math.pow(t.dot(e,n),2)-1,1))}},{key:"normalize",value:function(t){for(var e=this.norm(t),n=new Array(4),r=0;r<4;r++)n[r]=t[r]/e;return n}},{key:"norm",value:function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))}},{key:"dot",value:function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}}],(n=null)&&w(e.prototype,n),r&&w(e,r),t}();function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var P=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"deg2rad",value:function(t){return t*(Math.PI/180)}},{key:"rad2deg",value:function(t){return 180*t/Math.PI}},{key:"diffAngle",value:function(t,e){return Math.atan2(Math.sin(t-e),Math.cos(t-e))}},{key:"positiveMod",value:function(t,e){return(t%e+e)%e}}],(n=null)&&O(e.prototype,n),r&&O(e,r),t}();function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var k=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"concat",value:function(t,e){return t.concat(e)}}],(n=null)&&E(e.prototype,n),r&&E(e,r),t}();function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function A(t,e){return!e||"object"!==S(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function j(t){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function T(t,e){return(T=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var R=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),A(this,j(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&T(t,e)}(e,t),n=e,o=[{key:"norm",value:function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}},{key:"normalize",value:function(t){for(var e=this.norm(t),n=new Array(3),r=0;r<3;r++)n[r]=t[r]/e;return n}},{key:"add",value:function(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}},{key:"subtract",value:function(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}},{key:"distance",value:function(t,n){return e.norm(e.subtract(t,n))}},{key:"cross",value:function(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}},{key:"dot",value:function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{key:"multiplyScalar",value:function(t,e){for(var n=new Array(3),r=0;r<3;r++)n[r]=t[r]*e;return n}}],(r=null)&&M(n.prototype,r),o&&M(n,o),e}(k);function I(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function x(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var N=Math.sqrt(2)/2,D=-Math.sqrt(2)/2,C=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"eulerToQuaternionZXYDegrees",value:function(e){var n=e.slice(0).map((function(t){return P.deg2rad(t)}));return t.eulerToQuaternionZXY(n)}},{key:"eulerToQuaternionZXY",value:function(t){var e=t[0],n=t[1],r=t[2],o=Math.cos(e/2),i=Math.cos(n/2),a=Math.cos(r/2),u=Math.sin(e/2),c=Math.sin(n/2),s=Math.sin(r/2),l=o*i*a-u*c*s,f=o*c*a-u*i*s,p=u*c*a+o*i*s,h=u*i*a+o*c*s;return l<0&&(l=-l,f=-f,p=-p,h=-h),[l,f,p,h]}},{key:"quaternionToEulerZXYDegrees",value:function(e){return t.quaternionToEulerZXY(e).map((function(t){return P.rad2deg(t)}))}},{key:"quaternionToEulerZXY",value:function(t){var e,n,r=t[0],o=t[1],i=t[2],a=t[3];return i*a+o*r==.5?(e=2*Math.atan2(i,r),n=0):i*a+o*r==-.5?(e=-2*Math.atan2(i,r),n=0):(e=Math.atan2(2*a*r-2*i*o,1-2*Math.pow(a,2)-2*Math.pow(o,2)),n=Math.atan2(2*i*r-2*a*o,1-2*Math.pow(i,2)-2*Math.pow(o,2))),[e,Math.asin(2*i*a+2*o*r),n]}},{key:"getHeadingFromQuaternion",value:function(t){var e=I(t,4),n=e[0],r=e[1],o=e[2],i=e[3];if(Math.asin(2*o*i+2*r*n)<Math.PI/4)return-Math.atan2(2*i*n-2*o*r,1-2*i*i-2*r*r);var a=n*N-r*D,u=n*D+N*r,c=N*o+i*D,s=N*i-o*D;return-Math.atan2(2*s*a-2*c*u,1-2*s*s-2*u*u)}},{key:"getRotationBetweenTwoVectors",value:function(t,e){var n,r=R.normalize(t),o=R.normalize(e),i=R.dot(r,o);if(i<-.999999)return n=R.cross([1,0,0],r),R.norm(n)<1e-6&&(n=R.cross([0,1,0],r)),R.normalize(n,n),_.fromAxisAngle(n,Math.PI);if(i>.999999)return _.identity();var a=[1+i,(n=R.cross(r,o))[0],n[1],n[2]];return _.normalize(a)}}],(n=null)&&x(e.prototype,n),r&&x(e,r),t}(),F=P.deg2rad,q=P.diffAngle,L=(P.positiveMod,P.rad2deg),z={UNKNOWN:"Unknown",SAFARI:"Safari",FIREFOX:"Firefox",OPERA:"Opera",CHROME:"Chrome"};function W(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var U=/(mobi|tablet)/i,G=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"name",get:function(){var t=navigator.userAgent;return t.match(/Firefox/i)?z.FIREFOX:t.match(/(Opera|OPR)/i)?z.OPERA:t.match(/Chrome/i)?z.CHROME:t.match(/Safari/i)?z.SAFARI:z.UNKNOWN}},{key:"isMobile",get:function(){return U.test(navigator.userAgent)}}],(n=null)&&W(e.prototype,n),r&&W(e,r),t}();function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var V=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"unixTimestampToPerformanceNow",value:function(t){if(!window||!window.performance)throw new Error("window.performance does not exist");return window.performance.now()+t-(new Date).getTime()}}],(n=null)&&B(e.prototype,n),r&&B(e,r),t}(),Y=n(4),H=n.n(Y);function Q(t){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function X(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function J(t,e){return!e||"object"!==Q(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Z(t){var e="function"==typeof Map?new Map:void 0;return(Z=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return K(t,arguments,tt(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),$(r,t)})(t)}function K(t,e,n){return(K=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&$(o,n.prototype),o}).apply(null,arguments)}function $(t,e){return($=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function tt(t){return(tt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var et="Impossible to retrieve events, a sensor is missing",nt=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),J(this,tt(e).call(this,t||et))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$(t,e)}(e,t),n=e,(r=[{key:"from",value:function(t){return this.message+=" from "+t,this}}])&&X(n.prototype,r),o&&X(n,o),e}(Z(Error));function rt(t){return(rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ot(t,e){return!e||"object"!==rt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function it(t){return(it=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function at(t,e){return(at=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ut="Impossible to retrieve Acceleration data",ct=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),ot(this,it(e).call(this,t||ut))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&at(t,e)}(e,t),e}(nt);function st(t){return(st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lt(t,e){return!e||"object"!==st(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ft(t){return(ft=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function pt(t,e){return(pt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ht="Impossible to retrieve Angular Rate data",yt=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),lt(this,ft(e).call(this,t||ht))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&pt(t,e)}(e,t),e}(nt);function vt(t){return(vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dt(t,e){return!e||"object"!==vt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function bt(t){var e="function"==typeof Map?new Map:void 0;return(bt=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return gt(t,arguments,wt(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),mt(r,t)})(t)}function gt(t,e,n){return(gt=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&mt(o,n.prototype),o}).apply(null,arguments)}function mt(t,e){return(mt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wt(t){return(wt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var _t="It seems that you ask for IMU events on a desktop browser",Ot=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),dt(this,wt(e).call(this,t||_t))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mt(t,e)}(e,t),e}(bt(Error)),Pt=n(1);function Et(t){return(Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function St(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mt(t,e,n){return(Mt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=At(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function At(t){return(At=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jt(t,e){return(jt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Tt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Rt=function(t){function e(t,n,r){var i;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i=function(t,e){return!e||"object"!==Et(e)&&"function"!=typeof e?St(t):e}(this,At(e).call(this,t,n,r)),Tt(St(i),"requiredSensors",[]),Tt(St(i),"parseDeviceMotionEvent",(function(t){var e,n=[],r=t.timeStamp/1e3;if(i.requiredSensors.includes(o.a.Acceleration)){var a;if(t.accelerationIncludingGravity){var u=t.accelerationIncludingGravity,c=u.x,s=u.y,l=u.z;H()(c)&&H()(s)&&H()(l)&&(a=[c,s,l],G.name===z.SAFARI&&(a[0]*=-1,a[1]*=-1,a[2]*=-1))}if(!a)return void i.notifyError((new ct).from("devicemotion"));n.push(i.createEvent(o.a.Acceleration,a,r))}if(i.requiredSensors.includes(o.a.AngularRate)){var f;if(t.rotationRate){var p=t.rotationRate,h=p.alpha,y=p.beta,v=p.gamma;H()(h)&&H()(y)&&H()(v)&&(f=[F(h),F(y),F(v)])}if(!f)return void i.notifyError((new yt).from("devicemotion"));n.push(i.createEvent(o.a.AngularRate,f,r))}0!==n.length&&(e=i).notify.apply(e,n)})),!r.hasOwnProperty("require"))throw new Error("options.require is missing in ImuProvider constructor");if(0===r.require.length)throw new Error("option.require is empty");return r.require.forEach((function(t){if(!e.eventsType.includes(t))throw new Error(t+" is not recognised in options.require")})),i.requiredSensors=r.require,i}var n,r,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jt(t,e)}(e,t),n=e,i=[{key:"checkAvailability",value:function(t){return Pt.a.merge(Mt(At(e),"checkAvailability",this).call(this,t),G.isMobile?Pt.a.yes():Pt.a.no(new Ot))}},{key:"name",get:function(){return"Imu"}},{key:"displayName",get:function(){return"Inertial Measurement Unit"}},{key:"eventsType",get:function(){return[o.a.AngularRate,o.a.Acceleration]}}],(r=[{key:"startInternal",value:function(){window.addEventListener("devicemotion",this.parseDeviceMotionEvent,!0)}},{key:"stopInternal",value:function(){window.removeEventListener("devicemotion",this.parseDeviceMotionEvent,!0)}}])&&kt(n.prototype,r),i&&kt(n,i),e}(r.a);function It(t){return(It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Nt(t){return(Nt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Dt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ct(t,e){return(Ct=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ft=function(t){function e(t,n,r){var i,a,u,c;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i=function(t,e){return!e||"object"!==It(e)&&"function"!=typeof e?Dt(t):e}(this,Nt(e).call(this,t,n,r)),a=Dt(i),c=function(t){var e,n=t[0].data,r=window.orientation||0,a=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]),u=[n[0]/a,n[1]/a,n[2]/a],c=[u[2]+1,u[1],-u[0],0],s=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]),l=[c[0]/s,c[1]/s,c[2]/s,0];0===r?e=Math.asin(2*l[1]*l[0]):90===r?e=-Math.asin(2*l[2]*l[0]):-90===r?e=Math.asin(2*l[2]*l[0]):180===r&&(e=-Math.asin(2*l[1]*l[0])),i.notify(i.createEvent(o.a.Inclination,e))},(u="onImuEvent")in a?Object.defineProperty(a,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[u]=c,i.imuProvider=new Rt(i.onImuEvent,n,{require:[o.a.Acceleration]}),i}var n,r,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ct(t,e)}(e,t),n=e,i=[{key:"getRequiredProviders",value:function(){return[Rt]}},{key:"name",get:function(){return"Inclination"}},{key:"displayName",get:function(){return"Inertial Measurement Unit"}},{key:"eventsType",get:function(){return[o.a.Inclination]}}],(r=[{key:"startInternal",value:function(){return this.imuProvider.start()}},{key:"stopInternal",value:function(){return this.imuProvider.stop()}}])&&xt(n.prototype,r),i&&xt(n,i),e}(r.a),qt=n(6),Lt=n.n(qt),zt={R_MAJOR:6378137,R_MINOR:6356752.3142,EARTH_GRAVITY:9.80665,EARTH_RADIUS_KM:6371};zt.ELLIPSOID_FLATNESS=(zt.R_MAJOR-zt.R_MINOR)/zt.R_MAJOR,zt.ECCENTRICITY=Math.sqrt(zt.ELLIPSOID_FLATNESS*(2-zt.ELLIPSOID_FLATNESS)),zt.R_MAJOR_2=zt.R_MAJOR*zt.R_MAJOR,zt.R_MAJOR_4=zt.R_MAJOR_2*zt.R_MAJOR_2,zt.R_MINOR_2=zt.R_MINOR*zt.R_MINOR,zt.R_MINOR_4=zt.R_MINOR_2*zt.R_MINOR_2,zt.ECCENTRICITY_2=zt.ECCENTRICITY*zt.ECCENTRICITY;var Wt=zt;function Ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Bt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"add",value:function(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2],t[3]+e[3]]}},{key:"rotate",value:function(t,e){var n=Ut(t,4),r=n[0],o=n[1],i=n[2],a=n[3],u=Ut(e,3),c=u[0],s=u[1],l=u[2];return[r*(r*c-i*l+a*s)-i*(r*l-o*s+i*c)+o*(o*c+i*s+a*l)+a*(r*s+o*l-a*c),r*(r*s+o*l-a*c)+o*(r*l-o*s+i*c)+i*(o*c+i*s+a*l)-a*(r*c-i*l+a*s),r*(r*l-o*s+i*c)-o*(r*s+o*l-a*c)+i*(r*c-i*l+a*s)+a*(o*c+i*s+a*l)]}},{key:"inverse",value:function(t){return[-t[0],t[1],t[2],t[3]]}},{key:"multiply",value:function(t,e){var n=Ut(t,4),r=n[0],o=n[1],i=n[2],a=n[3],u=Ut(e,4),c=u[0],s=u[1],l=u[2],f=u[3];return[r*c-o*s-i*l-a*f,r*s+c*o+i*f-a*l,r*l+c*i+a*s-o*f,r*f+c*a+o*l-i*s]}},{key:"fromAxisAngle",value:function(t,e){var n=Math.sin(e/2);return[Math.cos(e/2),t[0]*n,t[1]*n,t[2]*n]}},{key:"fromMatrix3",value:function(t){var e=Math.sqrt(1+t[0][0]+t[1][1]+t[2][2])/2;return[e,(t[1][2]-t[2][1])/(4*e),(t[2][0]-t[0][2])/(4*e),(t[0][1]-t[1][0])/(4*e)]}},{key:"wxyz2xyzw",value:function(t){return[t[1],t[2],t[3],t[0]]}},{key:"xyzw2wxyz",value:function(t){return[t[3],t[0],t[1],t[2]]}},{key:"distance",value:function(e,n){return Math.acos(Math.min(2*Math.pow(t.dot(e,n),2)-1,1))}},{key:"normalize",value:function(t){for(var e=this.norm(t),n=new Array(4),r=0;r<4;r++)n[r]=t[r]/e;return n}},{key:"norm",value:function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))}},{key:"dot",value:function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}}],(n=null)&&Gt(e.prototype,n),r&&Gt(e,r),t}();function Vt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Yt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"deg2rad",value:function(t){return t*(Math.PI/180)}},{key:"rad2deg",value:function(t){return 180*t/Math.PI}},{key:"diffAngle",value:function(t,e){return Math.atan2(Math.sin(t-e),Math.cos(t-e))}},{key:"positiveMod",value:function(t,e){return(t%e+e)%e}}],(n=null)&&Vt(e.prototype,n),r&&Vt(e,r),t}();function Ht(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qt(t){return(Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Jt(t,e){return!e||"object"!==Qt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Zt(t){return(Zt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Kt(t,e){return(Kt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var $t=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Jt(this,Zt(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Kt(t,e)}(e,t),n=e,o=[{key:"norm",value:function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}},{key:"normalize",value:function(t){for(var e=this.norm(t),n=new Array(3),r=0;r<3;r++)n[r]=t[r]/e;return n}},{key:"add",value:function(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}},{key:"subtract",value:function(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}},{key:"distance",value:function(t,n){return e.norm(e.subtract(t,n))}},{key:"cross",value:function(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}},{key:"dot",value:function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{key:"multiplyScalar",value:function(t,e){for(var n=new Array(3),r=0;r<3;r++)n[r]=t[r]*e;return n}}],(r=null)&&Xt(n.prototype,r),o&&Xt(n,o),e}(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"concat",value:function(t,e){return t.concat(e)}}],(n=null)&&Ht(e.prototype,n),r&&Ht(e,r),t}());function te(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ne=Math.sqrt(2)/2,re=-Math.sqrt(2)/2,oe=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"eulerToQuaternionZXYDegrees",value:function(e){var n=e.slice(0).map((function(t){return Yt.deg2rad(t)}));return t.eulerToQuaternionZXY(n)}},{key:"eulerToQuaternionZXY",value:function(t){var e=t[0],n=t[1],r=t[2],o=Math.cos(e/2),i=Math.cos(n/2),a=Math.cos(r/2),u=Math.sin(e/2),c=Math.sin(n/2),s=Math.sin(r/2),l=o*i*a-u*c*s,f=o*c*a-u*i*s,p=u*c*a+o*i*s,h=u*i*a+o*c*s;return l<0&&(l=-l,f=-f,p=-p,h=-h),[l,f,p,h]}},{key:"quaternionToEulerZXYDegrees",value:function(e){return t.quaternionToEulerZXY(e).map((function(t){return Yt.rad2deg(t)}))}},{key:"quaternionToEulerZXY",value:function(t){var e,n,r=t[0],o=t[1],i=t[2],a=t[3];return i*a+o*r==.5?(e=2*Math.atan2(i,r),n=0):i*a+o*r==-.5?(e=-2*Math.atan2(i,r),n=0):(e=Math.atan2(2*a*r-2*i*o,1-2*Math.pow(a,2)-2*Math.pow(o,2)),n=Math.atan2(2*i*r-2*a*o,1-2*Math.pow(i,2)-2*Math.pow(o,2))),[e,Math.asin(2*i*a+2*o*r),n]}},{key:"getHeadingFromQuaternion",value:function(t){var e=te(t,4),n=e[0],r=e[1],o=e[2],i=e[3];if(Math.asin(2*o*i+2*r*n)<Math.PI/4)return-Math.atan2(2*i*n-2*o*r,1-2*i*i-2*r*r);var a=n*ne-r*re,u=n*re+ne*r,c=ne*o+i*re,s=ne*i-o*re;return-Math.atan2(2*s*a-2*c*u,1-2*s*s-2*u*u)}},{key:"getRotationBetweenTwoVectors",value:function(t,e){var n,r=$t.normalize(t),o=$t.normalize(e),i=$t.dot(r,o);if(i<-.999999)return n=$t.cross([1,0,0],r),$t.norm(n)<1e-6&&(n=$t.cross([0,1,0],r)),$t.normalize(n,n),Bt.fromAxisAngle(n,Math.PI);if(i>.999999)return Bt.identity();var a=[1+i,(n=$t.cross(r,o))[0],n[1],n[2]];return Bt.normalize(a)}}],(n=null)&&ee(e.prototype,n),r&&ee(e,r),t}();Yt.deg2rad,Yt.diffAngle,Yt.positiveMod,Yt.rad2deg;function ie(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ae(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ue=Bt.fromAxisAngle([1,0,0],-Math.PI/2),ce=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ae(this,"quaternion",[1,0,0,0]),ae(this,"quaternionThreeJsV",null),ae(this,"headingV",null),ae(this,"headingDegreesV",null),ae(this,"eulerAnglesV",null),ae(this,"eulerAnglesDegreesV",null),this.quaternion=e}var e,n,r;return e=t,r=[{key:"fromMessage",value:function(e){return new t(e)}}],(n=[{key:"toMessage",value:function(){return this.quaternion}},{key:"eulerAngles",get:function(){return this.eulerAnglesV||(this.eulerAnglesV=oe.quaternionToEulerZXY(this.quaternion)),this.eulerAnglesV}},{key:"eulerAnglesDegrees",get:function(){return this.eulerAnglesDegreesV||(this.eulerAnglesDegreesV=oe.quaternionToEulerZXYDegrees(this.quaternion)),this.eulerAnglesDegreesV}},{key:"heading",get:function(){return this.headingV||(this.headingV=oe.getHeadingFromQuaternion(this.quaternion)+Yt.deg2rad(window.orientation||0)),this.headingV}},{key:"headingDegrees",get:function(){return this.headingDegreesV||(this.headingDegreesV=Yt.rad2deg(oe.getHeadingFromQuaternion(this.quaternion))+(window.orientation||0)),this.headingDegreesV}},{key:"quaternionThreeJs",get:function(){return this.quaternionThreeJsV||(this.quaternionThreeJsV=Bt.wxyz2xyzw(Bt.multiply(ue,this.quaternion))),this.quaternionThreeJsV}}])&&ie(e.prototype,n),r&&ie(e,r),t}(),se=n(2),le=n(7),fe=n.n(le),pe=n(15),he=n.n(pe);function ye(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ve=function(){function t(e,n){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!fe()(e))throw new Error("first argument is mandatory");if(fe()(n))e===n?(this.isRange=!1,this.val=e):(this.isRange=!0,this.low=Math.min(e,n),this.up=Math.max(e,n));else{if(void 0!==n)throw new Error("second argument is not a number");this.isRange=!1,this.val=e}}var e,n,r;return e=t,r=[{key:"fromString",value:function(e){if(!he()(e))return null;if(!isNaN(Number(e)))return new t(Number(e));var n=e.split(";");if(2===n.length){var r=Number(n[0]),o=Number(n[1]);if(!isNaN(r)&&!isNaN(o))return new t(r,o)}return se.a.warn("Cannot parse following level: "+e),null}},{key:"intersect",value:function(e,n){if(e===n)return e;if(!n)return null;if(!e)return null;if(e.isRange&&!n.isRange)return e.isInside(n.val)?n:null;if(!e.isRange&&n.isRange)return n.isInside(e.val)?e:null;if(e.isRange&&n.isRange){var r=Math.min(e.up,n.up),o=Math.max(e.low,n.low);return r<o?null:new t(o,r)}return e.val===n.val?e:null}},{key:"union",value:function(e,n){return e===n?e:n?e?(e.isRange||n.isRange?e.isRange&&!n.isRange?(r=Math.min(e.low,n.val),o=Math.max(e.up,n.val)):!e.isRange&&n.isRange?(r=Math.min(n.low,e.val),o=Math.max(n.up,e.val)):(r=Math.min(n.low,e.low),o=Math.max(n.up,e.up)):(r=Math.min(e.val,n.val),o=Math.max(e.val,n.val)),r===o?new t(r):new t(r,o)):n:e;var r,o}},{key:"equalsTo",value:function(t,e){return!(t!==e&&(t||e)&&(!t&&e||t&&!e||!t.isRange&&e.isRange||t.isRange&&!e.isRange||(t.isRange&&e.isRange?t.low!==e.low||t.up!==e.up:t.val!==e.val)))}}],(n=[{key:"clone",value:function(){return this.isRange?new t(this.low,this.up):new t(this.val)}},{key:"isInside",value:function(t){return this.isRange?t>=this.low&&t<=this.up:t===this.val}},{key:"intersect",value:function(e){return t.intersect(this,e)}},{key:"union",value:function(e){return t.union(this,e)}},{key:"multiplyBy",value:function(t){this.isRange?(this.low*=t,this.up*=t):this.val*=t}},{key:"toString",value:function(){return this.isRange?this.low+";"+this.up:String(this.val)}}])&&ye(e.prototype,n),r&&ye(e,r),t}();function de(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var be=function(){function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._lat=e,this._lng=n,this._alt=r,this._level=o,this._ecef=null}var e,n,r;return e=t,r=[{key:"equalsTo",value:function(e,n){return e instanceof t&&n instanceof t&&n.lat===e.lat&&n.lng===e.lng&&ve.equalsTo(n.level,e.level)}},{key:"distanceBetween",value:function(t,e){return t.distanceTo(e)}},{key:"fromECEF",value:function(e){var n=e[0],r=e[1],o=e[2],i=Math.sqrt(Wt.R_MAJOR_2*(1-Wt.ECCENTRICITY_2)),a=Math.pow(i,2),u=Math.sqrt((Wt.R_MAJOR_2-a)/a),c=Math.sqrt(Math.pow(n,2)+Math.pow(r,2)),s=Math.atan2(Wt.R_MAJOR*o,i*c),l=Math.atan2(r,n),f=Math.atan2(o+Math.pow(u,2)*i*Math.pow(Math.sin(s),3),c-Wt.ECCENTRICITY_2*Wt.R_MAJOR*Math.pow(Math.cos(s),3)),p=Wt.R_MAJOR/Math.sqrt(1-Wt.ECCENTRICITY_2*Math.pow(Math.sin(f),2)),h=c/Math.cos(f)-p;l%=2*Math.PI;var y=new t(Yt.rad2deg(f),Yt.rad2deg(l),Yt.rad2deg(h));return y._ecef=e,y}},{key:"fromMessage",value:function(e){return new t(e.lat,e.lng,e.alt,ve.fromString(e.level))}},{key:"sampleRoute",value:function(t){for(var e,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.7,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_VALUE,a=null,u=[],c=0,s=0,l=0;l<t.length-1;l++)if(e=t[l],a=t[l+1],n=e.bearingTo(a),(r=e.distanceTo(a))>0){for(var f=c/r;f<1&&s<=i;){var p=e.destinationPoint(f*r,n);p.bearing=n,u.push(p),f+=o/r,s+=o}c=(f-1)*r}return a&&u.push(a),u}}],(n=[{key:"clone",value:function(){var e=new t(this.lat,this.lng,this.alt);return this.level&&(e.level=this.level.clone()),e}},{key:"equalsTo",value:function(e){return t.equalsTo(this,e)}},{key:"toString",value:function(){var t="["+this._lat.toFixed(7)+", "+this._lng.toFixed(7);return this._alt&&(t+=", "+this._alt.toFixed(2)),this._level&&(t+=", ["+this._level.toString()+"]"),t+="]"}},{key:"destinationPoint",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.clone();return r.move(t,e,n),r}},{key:"move",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t,o=Wt.R_MAJOR,i=Yt.deg2rad(this.lat),a=Yt.deg2rad(this.lng),u=Math.asin(Math.sin(i)*Math.cos(r/o)+Math.cos(i)*Math.sin(r/o)*Math.cos(e)),c=a+Math.atan2(Math.sin(e)*Math.sin(r/o)*Math.cos(i),Math.cos(r/o)-Math.sin(i)*Math.sin(u)),s=(this.alt||0)+n;return this.lat=Yt.rad2deg(u),this.lng=Yt.rad2deg(c),this.alt=s,this}},{key:"distanceTo",value:function(t){var e,n,r,o,i,a,u,c,s,l,f,p=this.lat,h=this.lng,y=t.lat,v=t.lng;return n=Yt.deg2rad(y-p),r=Yt.deg2rad(v-h),c=Math.sin(r/2),u=Math.sin(n/2),f=Yt.deg2rad(p),s=Math.cos(f),l=Yt.deg2rad(y),o=u*u+s*Math.cos(l)*c*c,i=Math.sqrt(o),a=Math.sqrt(1-o),e=2*Math.atan2(i,a),1e3*Wt.EARTH_RADIUS_KM*e}},{key:"bearingTo",value:function(t){var e=Yt.deg2rad(this.lat),n=Yt.deg2rad(t.lat),r=Yt.deg2rad(t.lng-this.lng);return Math.atan2(Math.sin(r)*Math.cos(n),Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(r))}},{key:"getEnuToEcefRotation",value:function(){var t=Bt.fromAxisAngle([0,0,1],Math.PI/2+Yt.deg2rad(this.lng)),e=Bt.fromAxisAngle([1,0,0],Math.PI/2-Yt.deg2rad(this.lat));return Bt.multiply(t,e)}},{key:"getEcefToEnuRotation",value:function(){var t=Bt.fromAxisAngle([1,0,0],Yt.deg2rad(this.lat)-Math.PI/2),e=Bt.fromAxisAngle([0,0,1],-Yt.deg2rad(this.lng)-Math.PI/2);return Bt.multiply(t,e)}},{key:"getUpVector",value:function(){return $t.normalize(this.ecef)}},{key:"getProjection",value:function(e){var n,r=e.node1.coords,o=e.node2.coords,i=$t.normalize(r.ecef),a=$t.normalize(o.ecef),u=$t.normalize(this.ecef),c=$t.cross(i,a),s=$t.cross(u,c),l=$t.normalize($t.cross(c,s)),f=$t.multiplyScalar(l,this.getEarthRadiusAtPosition()),p=t.fromECEF(f);H()(r.alt)&&H()(o.alt)&&(n=(r.alt+o.alt)/2);var h=new t(p.lat,p.lng,n);return Math.abs(r.distanceTo(o)-r.distanceTo(h)-o.distanceTo(h))>1e-6?null:h}},{key:"getEarthRadiusAtPosition",value:function(){var t=Yt.deg2rad(this.lat),e=Math.cos(t)*Math.cos(t),n=Math.sin(t)*Math.sin(t);return Math.sqrt((Wt.R_MAJOR_4*e+Wt.R_MINOR_4*n)/(Wt.R_MAJOR_2*e+Wt.R_MINOR_2*n))}},{key:"toMessage",value:function(){var t={lat:this.lat,lng:this.lng};return H()(this.alt)&&(t.alt=this.alt),this.level&&(t.level=this.level),t}},{key:"lat",get:function(){return this._lat},set:function(t){this._ecef=null,this._lat=t}},{key:"lng",get:function(){return this._lng},set:function(t){this._ecef=null,this._lng=t}},{key:"alt",get:function(){return this._alt},set:function(t){this._ecef=null,this._alt=t}},{key:"level",get:function(){return this._level},set:function(t){this._level=t}},{key:"ecef",get:function(){if(!this._ecef){var t=Yt.deg2rad(this.lat),e=Yt.deg2rad(this.lng),n=this.alt||0,r=Wt.R_MAJOR/Math.sqrt(1-Wt.ECCENTRICITY_2*Math.pow(Math.sin(t),2)),o=(r+n)*Math.cos(t)*Math.cos(e),i=(r+n)*Math.cos(t)*Math.sin(e),a=((1-Wt.ECCENTRICITY_2)*r+n)*Math.sin(t);this._ecef=[o,i,a]}return this._ecef}}])&&de(e.prototype,n),r&&de(e,r),t}();function ge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function me(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var we=function(){function t(e,n){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),me(this,"northEast",void 0),me(this,"southWest",void 0),this.southWest=n||null,this.northEast=e||null,this.southWest&&this.northEast&&(this.southWest.lat>this.northEast.lat||this.southWest.lng>this.northEast.lng))throw new Error("Incorrect bounding box")}var e,n,r;return e=t,r=[{key:"equalsTo",value:function(t,e){return be.equalsTo(t.northEast,e.northEast)&&be.equalsTo(t.southWest,e.southWest)}}],(n=[{key:"contains",value:function(t){return t.lat<=this.northEast.lat&&t.lat>=this.southWest.lat&&t.lng<=this.northEast.lng&&t.lng>=this.southWest.lng}},{key:"extend",value:function(e){var n,r,o=this.southWest,i=this.northEast;if(e instanceof be)n=e,r=e;else{if(!(e instanceof t))throw new Error("Unknown parameter");if(n=e.southWest,r=e.northEast,!n||!r)return this}return o||i?(this.southWest=new be(Math.min(n.lat,o.lat),Math.min(n.lng,o.lng)),this.northEast=new be(Math.max(r.lat,i.lat),Math.max(r.lng,i.lng))):(this.southWest=new be(n.lat,n.lng),this.northEast=new be(r.lat,r.lng)),this}},{key:"extendsWithMeasure",value:function(t){if(!H()(t)||!fe()(t))throw new Error("measure is not a number");return this.northEast=this.northEast.destinationPoint(t,0).move(t,Math.PI/2),this.southWest=this.southWest.clone().destinationPoint(t,-Math.PI/2).destinationPoint(t,Math.PI),this}},{key:"getSouthWest",value:function(){return this.southWest}},{key:"getNorthEast",value:function(){return this.northEast}},{key:"getNorthWest",value:function(){return new be(this.getNorth(),this.getWest())}},{key:"getSouthEast",value:function(){return new be(this.getSouth(),this.getEast())}},{key:"getWest",value:function(){return this.southWest.lng}},{key:"getSouth",value:function(){return this.southWest.lat}},{key:"getEast",value:function(){return this.northEast.lng}},{key:"getNorth",value:function(){return this.northEast.lat}},{key:"equalsTo",value:function(e){return t.equalsTo(this,e)}},{key:"center",get:function(){var t=(this.southWest.lat+this.northEast.lat)/2,e=(this.northEast.lng+this.southWest.lng)/2;return new be(t,e)}}])&&ge(e.prototype,n),r&&ge(e,r),t}();function _e(t){return(_e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Oe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Pe(t,e){return!e||"object"!==_e(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ee(t,e,n){return(Ee="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ke(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ke(t){return(ke=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Se(t,e){return(Se=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Me=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Pe(this,ke(e).call(this,t,n,o,i))).bearing=c,r.provider=s,r.time=a,r.accuracy=u,r}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Se(t,e)}(e,t),n=e,o=[{key:"fromWGS84",value:function(t){return new e(t.lat,t.lng,t.alt,t.level)}},{key:"fromMessage",value:function(t){return new e(t.lat,t.lng,t.alt,ve.fromString(t.level),t.time,t.accuracy,t.bearing,t.provider)}},{key:"MESSAGE_TYPE",get:function(){return"WGS84UserPosition"}}],(r=[{key:"clone",value:function(){return new e(this.lat,this.lng,this.alt,this.level,this.time,this.accuracy,this.bearing,this.provider)}},{key:"toMessage",value:function(){var t=Ee(ke(e.prototype),"toMessage",this).call(this);return t.type="WGS84UserPosition",t.time=this.time,t.bearing=this.bearing,t.provider=this.provider,t.accuracy=this.accuracy,t}}])&&Oe(n.prototype,r),o&&Oe(n,o),e}(be);function Ae(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var je=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.coords=e,this.data=n,this.edges=[]}var e,n,r;return e=t,(n=[{key:"distanceTo",value:function(t){return this.coords.distanceTo(t.coords)}},{key:"bearingTo",value:function(t){return this.coords.bearingTo(t.coords)}},{key:"equalsTo",value:function(t){return this.coords.equalsTo(t.coords)}},{key:"clone",value:function(){return new t(this.coords,this.data)}},{key:"generateLevelFromEdges",value:function(){var t,e=this;this.edges.forEach((function(n){n.level&&(t?(t=t.intersect(n.level))||se.a.error("Error: Something bad happend during parsing: We cannot retrieve node level from adjacent ways: "+e.coords):t=n.level.clone())})),this.coords.level=t}}])&&Ae(e.prototype,n),r&&Ae(e,r),t}();function Te(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Re=function(){function t(e,n,r,o){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!(e instanceof je))throw new TypeError("node1 is not an instance of Node");if(!(n instanceof je))throw new TypeError("node2 is not an instance of Node");this.node1=e,this.node2=n,this.data=r,this.level=o,this.node1.edges.push(this),this.node2.edges.push(this),this.computedSizeAndBearing=!1}var e,n,r;return e=t,(n=[{key:"computeSizeAndBearing",value:function(){this._length=this.node1.distanceTo(this.node2),this._bearing=this.node1.bearingTo(this.node2),this.computedSizedAndBearing=!0}},{key:"equalsTo",value:function(e){return e instanceof t&&e.node1.equalsTo(this.node1)&&e.node2.equalsTo(this.node2)}},{key:"clone",value:function(e,n){var r=new t(e,n,this.data);return r.level=this.level,r}},{key:"bearing",get:function(){return this.computedSizeAndBearing||this.computeSizeAndBearing(),this._bearing}},{key:"length",get:function(){return this.computedSizeAndBearing||this.computeSizeAndBearing(),this._length}}])&&Te(e.prototype,n),r&&Te(e,r),t}();function Ie(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var xe=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"deg2rad",value:function(t){return t*(Math.PI/180)}},{key:"rad2deg",value:function(t){return 180*t/Math.PI}},{key:"diffAngle",value:function(t,e){return Math.atan2(Math.sin(t-e),Math.cos(t-e))}},{key:"positiveMod",value:function(t,e){return(t%e+e)%e}}],(n=null)&&Ie(e.prototype,n),r&&Ie(e,r),t}();Math.sqrt(2),Math.sqrt(2);var Ne=xe.deg2rad,De=xe.diffAngle,Ce=(xe.positiveMod,xe.rad2deg);function Fe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var qe=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.nodes=Array.isArray(e)?e:[],this.edges=Array.isArray(n)?n:[]}var e,n,r;return e=t,r=[{key:"getEdgeByNodes",value:function(t,e,n){return t.find((function(t){return e===t.node1&&n===t.node2||n===t.node1&&e===t.node2}))}}],(n=[{key:"getNodeByCoords",value:function(t){return this.nodes.find((function(e){return e.coords.equalsTo(t)}))}},{key:"getEdgeByNodes",value:function(e,n){return t.getEdgeByNodes(this.edges,e,n)}},{key:"getBoundingBox",value:function(t){var e=this.nodes.reduce((function(t,e){return t.extend(e.coords)}),new we);return t&&e.extendsWithMeasure(t),e}},{key:"toDetailedString",value:function(t,e){var n=t;n||(n=function(t){return"".concat(t.data)});var r=e;e||(r=function(t){return"".concat(t.data)});var o="--- Network ---\n"+"Nodes: ".concat(this.nodes.length,"\n")+"Edges: ".concat(this.edges.length,"\n")+"---\nNodes\n";return this.nodes.forEach((function(t){o+="".concat(n(t)," [edges: ").concat(t.edges.length,"]\n")})),o+="---\nEdges\n",this.edges.forEach((function(t){o+="".concat(r(t)," "),o+="[".concat(n(t.node1)," -- ").concat(n(t.node2),"]\n")})),o+="---"}}])&&Fe(e.prototype,n),r&&Fe(e,r),t}();function Le(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ze(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function We(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ue=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),We(this,"_maxDistance",Number.MAX_VALUE),e&&this.setNetwork(e)}var e,n,r;return e=t,r=[{key:"diffAngle90",value:function(t,e){var n=Math.abs(t-e);return n>180&&(n=360-n),n>90&&(n=180-n),n}}],(n=[{key:"setNetwork",value:function(t){if(!(t instanceof qe))throw new Error(t+" is not an instance of Network");this.network=t}},{key:"_shouldProjectOnEdgeAndNodes",value:function(e,n,r,o,i){if(!i(e))return[!1,!1,!1];var a=!0,u=!0,c=!0;if((n.level||e.level)&&(!ve.intersect(n.level,e.level)||!o&&e.level&&e.level.isRange)&&(c=!1),ve.equalsTo(n.level,e.node1.coords.level)||(a=!1),ve.equalsTo(n.level,e.node2.coords.level)||(u=!1),r){if(c){var s=Ce(e.bearing);t.diffAngle90(s,n.bearing)>this._maxAngleBearing&&(c=!1)}a=!1,u=!1}return[c,a,u]}},{key:"getProjection",value:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!0};if(!this.network)return null;if(o&&(!e.bearing||!this._maxAngleBearing))return null;if(r&&!this._maxDistance)return null;var u={};u.origin=e,u.distanceFromNearestElement=Number.MAX_VALUE;for(var c=function(t){return t<u.distanceFromNearestElement&&(!r||t<=n._maxDistance)},s=0;s<this.network.edges.length;s++){var l=this.network.edges[s],f=this._shouldProjectOnEdgeAndNodes(l,e,o,i,a),p=Le(f,3),h=p[0],y=p[1],v=p[2];if(y){var d=e.distanceTo(l.node1.coords);c(d)&&(u.distanceFromNearestElement=d,u.nearestElement=l.node1,u.projection=l.node1.coords.clone(),t._updateProjectionLevelFromEdge(l,u.projection))}if(v){var b=e.distanceTo(l.node2.coords);c(b)&&(u.distanceFromNearestElement=b,u.nearestElement=l.node2,u.projection=l.node2.coords.clone(),t._updateProjectionLevelFromEdge(l,u.projection))}if(h){var g=e.getProjection(l);if(g){var m=e.distanceTo(g);c(m)&&(u.distanceFromNearestElement=m,u.nearestElement=l,u.projection=g.clone(),t._updateProjectionLevelFromEdge(l,u.projection))}}}return u.projection?(H()(u.projection.alt)||(u.projection.alt=e.alt),u):null}},{key:"maxAngleBearing",set:function(t){this._maxAngleBearing=t}},{key:"maxDistance",set:function(t){this._maxDistance=t}}])&&ze(e.prototype,n),r&&ze(e,r),t}();We(Ue,"_updateProjectionLevelFromEdge",(function(t,e){t.level&&(e.level=t.level.clone())}));var Ge=Ue;function Be(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Ve=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"getDurationFromLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return t/(1e3*e/3600)}}],(n=null)&&Be(e.prototype,n),r&&Be(e,r),t}();function Ye(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function He(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qe=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),He(this,"number",void 0),He(this,"nodes",[]),He(this,"edges",[]),He(this,"angle",void 0),He(this,"_length",0),He(this,"previousBearing",void 0),He(this,"nextBearing",void 0),He(this,"firstStep",!1),He(this,"lastStep",!1),He(this,"name",void 0)}var e,n,r;return e=t,(n=[{key:"getDuration",value:function(t){return Ve.getDurationFromLength(this.length,t)}},{key:"node",get:function(){return this.nodes[0]}},{key:"nodeData",get:function(){return this.nodes[0].data}},{key:"nextEdgeData",get:function(){return 0===this.edges.length?null:this.edges[0].data}},{key:"length",get:function(){return this._length||(this._length=this.edges.reduce((function(t,e){return t+e.length}),0)),this._length}},{key:"duration",get:function(){return this.getDuration()}},{key:"location",get:function(){return this.nodes[0].coords}}])&&Ye(e.prototype,n),r&&Ye(e,r),t}();function Xe(t){return(Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Je(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ze(t){return(Ze=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ke(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $e(t,e){return($e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var tn=Ne(20),en=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e){return!e||"object"!==Xe(e)&&"function"!=typeof e?Ke(t):e}(this,Ze(e).call(this))).start=null,t.end=null,t._steps=null,t._length=0,t._edgesDirectionReversed=[],t._nextStepsIndexes=null,t.mapMatching=new Ge(Ke(t)),t}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$e(t,e)}(e,t),n=e,o=[{key:"fromNetworkNodes",value:function(t,n,r){var o=new e;o._length=0,o.start=n,o.end=r;for(var i=0;i<t.length;i++){var a=t[i];if(o.nodes.push(a),i===t.length-1)break;var u=t[i+1],c=qe.getEdgeByNodes(a.edges,a,u);o._edgesDirectionReversed.push(a!==c.node1),o.edges.push(c),o._length+=c.length}return o}},{key:"fromOrderedPointsArray",value:function(t,n,r,o){var i=new e;i._length=0,i.start=new be(n[o?1:0],n[o?0:1],null,n[2]),i.end=new be(r[o?1:0],r[o?0:1],null,r[2]);for(var a=null,u=0;u<t.length;u++){var c=new je(new be(t[u][o?1:0],t[u][o?0:1],null,t[u][2]));if(a){var s=new Re(a,c,null,ve.union(a.coords.level,c.coords.level));i._edgesDirectionReversed.push(!1),i.edges.push(s),i._length+=s.length}i.nodes.push(c),a=c}return i}}],(r=[{key:"getDuration",value:function(t){return Ve.getDurationFromLength(this.length,t)}},{key:"getEdgeAt",value:function(t){if(0===t&&this.edges.length>0)return this.edges[0];for(var e=0,n=0;n<=this.edges.length;n++)if(t<=(e+=this.edges[n].length))return this.edges[n];return null}},{key:"getNextNode",value:function(t){if(t instanceof Re){var e=this.edges.indexOf(t);if(-1!==e)return this.nodes[e+1]}if(t instanceof je){var n=this.nodes.indexOf(t);if(-1!==n&&n!==this.nodes.length-1)return this.nodes[n+1]}return null}},{key:"getNextEdge",value:function(t){if(t instanceof Re){var e=this.edges.indexOf(t);if(-1!==e&&e!==this.edges.length-1)return this.edges[e+1]}if(t instanceof je){var n=this.nodes.indexOf(t);if(-1!==n&&n!==this.edges.length)return this.edges[n]}return null}},{key:"getNextStep",value:function(t){if(t instanceof Re){var e=this.edges.indexOf(t);if(-1!==e)return this.getNextStepFromEdgeId(e)}else if(t instanceof je){var n=this.nodes.indexOf(t);if(-1!==n)return this.getNextStepFromNodeId(n)}return null}},{key:"getNextStepFromEdgeId",value:function(t){return this.steps[this._nextStepsIndexes[t+1]]}},{key:"getNextStepFromNodeId",value:function(t){return this.steps[this._nextStepsIndexes[t]]}},{key:"getPreviousStep",value:function(t){if(t instanceof Re){var e=this.edges.indexOf(t);if(-1!==e)return this.getPreviousStepFromEdgeId(e)}else if(t instanceof je){var n=this.nodes.indexOf(t);if(-1!==n)return this.getPreviousStepFromNodeId(n)}return null}},{key:"getPreviousStepFromEdgeId",value:function(t){var e=this._nextStepsIndexes[t+1]-1;return-1!==e?this.steps[e]:null}},{key:"getPreviousStepFromNodeId",value:function(t){var e=this._nextStepsIndexes[t]-1;return-1!==e?this.steps[e]:null}},{key:"getInfo",value:function(t){if(!t instanceof be)return null;var e=this.mapMatching.getProjection(t);if(!e)return null;var n,r,o=this.length,i=0;if(e.nearestElement instanceof je){for(var a=0;this.nodes[a]!==e.nearestElement;)i+=this.edges[a].length,a++;n=this.getNextStepFromNodeId(a),r=this.getPreviousStepFromNodeId(a)}else{if(!(e.nearestElement instanceof Re))throw new Error("No projection found");for(var u=0;this.edges[u]!==e.nearestElement;)i+=this.edges[u].length,u++;i+=this.nodes[u].coords.distanceTo(e.projection),n=this.getNextStepFromEdgeId(u),r=this.getPreviousStepFromEdgeId(u)}return{nextStep:n,previousStep:r,projection:e,traveledDistance:i,traveledPercentage:i/o,remainingDistance:o-i,remainingPercentage:1-i/o}}},{key:"generateSteps",value:function(){var t,e;this._steps=[],this._nextStepsIndexes=[];for(var n=this.start.bearingTo(this.nodes[0].coords),r=0;r<this.nodes.length-1;r++){var o=this.nodes[r],i=this.nodes[r+1],a=this.edges[r],u=a.length,c=a.bearing+(a.node1!==o?Math.PI:0),s=De(n,c+Math.PI);if(t&&t.nodes.push(o),!t||Math.abs(De(Math.PI,s))>=tn){e=t,(t=new Qe).number=this._steps.length+1,t.angle=s,t.previousBearing=n,t.nextBearing=c,t.nodes.push(o),this._steps.push(t),e||(t.firstStep=!0);for(var l=this._steps.length-1,f=e?e.nodes.length-1:1,p=0;p<f;p++)this._nextStepsIndexes.push(l)}t.edges.push(a),t._length+=u,r===this.nodes.length-2&&t.nodes.push(i),n=c}var h=this.nodes[this.nodes.length-1];if(h.coords!==this.end){var y=new Qe;y.number=this._steps.length+1,y._length=0,y.nextBearing=h.coords.bearingTo(this.end),y.previousBearing=n,y.lastStep=!0,y.angle=De(y.previousBearing,y.nextBearing+Math.PI),y.nodes.push(h),this._steps.push(y),t||(y.firstStep=!0);for(var v=this._steps.length-1,d=t?t.nodes.length-1:1,b=0;b<d;b++)this._nextStepsIndexes.push(v)}else t.lastStep=!0}},{key:"length",get:function(){return this._length||(this._length=this.edges.reduce((function(t,e){return t+e.length}),0)),this._length}},{key:"duration",get:function(){return this.getDuration()}},{key:"steps",get:function(){return this._steps||this.generateSteps(),this._steps}}])&&Je(n.prototype,r),o&&Je(n,o),e}(qe);function nn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var rn=.4;function on(t){return(on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function an(t,e){return!e||"object"!==on(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function un(t){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function cn(t,e){return(cn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var sn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),an(this,un(e).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cn(t,e)}(e,t),e}(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.slidingWindow=[],this.lastStepTimestamp=-rn,this.previousVerticalAcc=0,this.influence=.2}var e,n,r;return e=t,(n=[{key:"compute",value:function(t,e,n){var r=this.influence*(2*e[2])+(1-this.influence)*this.previousVerticalAcc;if(this.previousVerticalAcc=r,Math.sqrt(Math.pow(n[0],2)+Math.pow(n[1],2)+Math.pow(n[2],2))>.75)return!1;if(this.lastStepTimestamp&&this.lastStepTimestamp+rn>t)return!1;var o=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER;if(this.slidingWindow.forEach((function(e,n,r){e.timestamp<t-.3?r.splice(n,1):(o=Math.max(e.verticalAcc,o),i=Math.min(e.verticalAcc,i))})),this.slidingWindow.push({timestamp:t,verticalAcc:r}),o>.75&&i<-.3){var a=this.lastStepTimestamp?t-this.lastStepTimestamp:1;return this.frequency=Math.min(Math.max(1/a,1),4),this.lastStepTimestamp=t,!0}return!1}},{key:"mean",value:function(t){for(var e=0,n=0,r=0;r<t.length;++r)e+=t[r].verticalAcc;return n=e/t.length,n}},{key:"stddev",value:function(t){for(var e=this.mean(t),n=0,r=0;r<t.length;++r)n+=Math.pow(t[r].verticalAcc-e,2);return Math.sqrt(n/t.length)}},{key:"lastStepSize",get:function(){return this.frequency?.45+.2*this.frequency:0}},{key:"speed",get:function(){return this.lastStepSize&&this.frequency?this.lastStepSize*this.frequency:0}}])&&nn(e.prototype,n),r&&nn(e,r),t}());function ln(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var fn=15*Math.PI/180,pn=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.locked=!1}var e,n,r;return e=t,(n=[{key:"setWaitingOrientation",value:function(t){this.waitingOrientation=t,this.locked=!0}},{key:"feedHeading",value:function(t){if(!H()(this.waitingOrientation))throw new Error("HeadingUnlocker has not been initialized by setWaitingOrientation");if(!this.locked)throw new Error("HeadingUnlocker is already unlocked");return Math.abs(q(t,this.waitingOrientation))<fn&&(this.locked=!1),this.locked}}])&&ln(e.prototype,n),r&&ln(e,r),t}();function hn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var yn=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.lastDetectionTimestamp=0}var e,n,r;return e=t,(n=[{key:"compute",value:function(t,e){var n=!1;if(t-this.lastDetectionTimestamp<.5)return n;var r=R.norm(e)-Wt.EARTH_GRAVITY;return Math.abs(r)>4&&(n=!0,this.lastDetectionTimestamp=t),n}}])&&hn(e.prototype,n),r&&hn(e,r),t}();function vn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var dn=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.positionsQueue=[]}var e,n,r;return e=t,(n=[{key:"generateNextPositions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(t instanceof Me))throw new TypeError("newPosition is not instance of WGS84UserPosition");if(!t.hasOwnProperty("time"))throw new Error("newPosition does not have time property");if(!this.previousPosition)return this.previousPosition=t,void this.positionsQueue.push(this.previousPosition);var n=this.previousPosition.distanceTo(t),r=this.previousPosition.bearingTo(t),o=t.time,i=this.positionsQueue.length;i&&(o=Math.max(o,this.positionsQueue[i-1].time));var a=t.time-this.previousPosition.time;e&&(a=1);for(var u=60*Math.min(Math.max(.25,a),1),c=1;c<u+1;){c=Math.min(c,u);var s=this.previousPosition.destinationPoint(n*c/u,r);s.time=o+(c-1)/60,s.bearing=t.bearing,this.positionsQueue.push(s),c++}this.positionsQueue[this.positionsQueue.length-1].level=t.level,this.previousPosition=t}},{key:"pullPosition",value:function(t){if((void 0===t||!t)&&this.positionsQueue.length>0){var e=this.positionsQueue[this.positionsQueue.length-1];return this.positionsQueue=[],e}for(var n;this.positionsQueue.length&&this.positionsQueue[0].time<=t;)n=this.positionsQueue.shift();return n}}])&&vn(e.prototype,n),r&&vn(e,r),t}();function bn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function gn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var mn={acc:.5,gyr:.3},wn={acc:.5,gyr:.3,yc:2},_n=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[-1,0,0];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.accRef=e,this.cRef=n,this.P=a.diag(Array(4).fill(Math.pow(.1,2))),this.quaternion=null,this.noises={relative:null,absolute:null},this.setRelativeNoises(mn),this.setAbsoluteNoises(wn)}var e,n,r;return e=t,(n=[{key:"setRelativeNoises",value:function(t){this.noises.relative={accelerometer:a.diag(Array(3).fill(Math.pow(t.acc,2))),gyroscope:a.diag(Array(3).fill(Math.pow(t.gyr,2)))}}},{key:"setAbsoluteNoises",value:function(t){this.noises.absolute={accelerometer:a.diag(Array(3).fill(Math.pow(t.acc,2))),gyroscope:a.diag(Array(3).fill(Math.pow(t.gyr,2))),yc:a.diag(Array(3).fill(Math.pow(t.yc,2)))}}},{key:"setOrientationYaw",value:function(t){this.offsetYawQuaternion=_.fromAxisAngle(this.accRef,t),this.quaternion=null}},{key:"tryInitialize",value:function(t,e){var n=R.normalize(t);if(e){var r=R.normalize(e),o=R.normalize(R.cross(r,n)),i=R.cross(n,o),a=[[o[0],i[0],n[0]],[o[1],i[1],n[1]],[o[2],i[2],n[2]]];this.quaternion=_.fromMatrix3(a)}else{if(!this.offsetYawQuaternion)return null;var u=R.dot(n,this.accRef)+1,c=R.cross(n,this.accRef),s=[u,c[0],c[1],c[2]];s=_.normalize(s),this.quaternion=_.multiply(this.offsetYawQuaternion,s)}return this.quaternion}},{key:"update",value:function(t,e,n,r){if(!this.quaternion)return this.tryInitialize(e,r);var o,i,u,c=this.quaternion,s=c,l=R.multiplyScalar(n,.5*t),f=this.computeC([1,l[0],l[1],l[2]]),h=a.multiplyVector(f,c),y=a.diag([s[0],s[0],s[0]]),v=p.skew([s[1],s[2],s[3]]),d=[-1*s[1],-1*s[2],-1*s[3]],b=a.concatRow([d],p.add(v,y)),m=a.multiplyScalar(a.multiply(a.multiply(b,this.noises[r?"absolute":"relative"].gyroscope),a.transpose(b)),Math.pow(t/2,2)),w=g.add(a.multiply(a.multiply(f,this.P),a.transpose(f)),m),O=R.normalize(e);if(r){var P=R.normalize(r),E=R.cross(O,P),S=R.normalize(E),M=R.subtract(S,_.rotate(h,this.cRef)),A=R.subtract(O,_.rotate(h,this.accRef));o=k.concat(M,A);var j=this.jacobianES(h,this.cRef),T=this.jacobianES(h,this.accRef);u=a.concatRow(j,T);var I=a.concatLine(this.noises.absolute.yc,p.zeros()),x=a.concatLine(p.zeros(),this.noises.absolute.accelerometer),N=a.concatRow(I,x);i=a.multiply(a.multiply(w,a.transpose(u)),a.inverse(a.add(a.multiply(a.multiply(u,w),a.transpose(u)),N)))}else{o=R.subtract(O,_.rotate(h,this.accRef)),u=this.jacobianES(h,this.accRef);var D=this.noises.relative.accelerometer;i=a.multiply(a.multiply(w,a.transpose(u)),p.inverse(p.add(a.multiply(a.multiply(u,w),a.transpose(u)),D)))}c=_.add(h,a.multiplyVector(i,o));var C=a.multiply(g.subtract(a.identity4(),a.multiply(i,u)),w);return c=_.normalize(c),this.quaternion=c,this.P=C,c}},{key:"computeC",value:function(t){return[[t[0],-t[1],-t[2],-t[3]],[t[1],t[0],t[3],-t[2]],[t[2],-t[3],t[0],t[1]],[t[3],t[2],-t[1],t[0]]]}},{key:"jacobianES",value:function(t,e){var n=bn(t,4),r=n[0],o=n[1],i=n[2],a=n[3],u=bn(e,3),c=u[0],s=u[1],l=u[2];return[[2*a*s-2*i*l,2*i*s+2*a*l,2*o*s-2*r*l-4*i*c,2*r*s+2*o*l-4*a*c],[2*o*l-2*a*c,2*r*l-4*o*s+2*i*c,2*o*c+2*a*l,2*i*l-2*r*c-4*a*s],[2*i*c-2*o*s,2*a*c-4*o*l-2*r*s,2*r*c-4*i*l+2*a*s,2*o*c+2*i*s]]}}])&&gn(e.prototype,n),r&&gn(e,r),t}();function On(t){return(On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function En(t){return(En=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function kn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sn(t,e){return(Sn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Mn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var An=function(t){function e(t,n,r){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i=function(t,e){return!e||"object"!==On(e)&&"function"!=typeof e?kn(t):e}(this,En(e).call(this,t,n,r)),Mn(kn(i),"lastTimestamp",0),Mn(kn(i),"onImuEvent",(function(t){var e,n,r;if(t.forEach((function(t){t.dataType===o.a.Acceleration?(n=t.data,e=t.timestamp):t.dataType===o.a.AngularRate&&(r=t.data)})),0!==i.lastTimestamp){var a=e-i.lastTimestamp;i.lastTimestamp=e;var u=i.ekfAttitude.update(a,n,r);u&&i.notify(i.createEvent(o.a.RelativeAttitude,new ce(u),e))}else i.lastTimestamp=e})),i.ekfAttitude=new _n,i.relativeOffsetQuaternion=[1,0,0,0],i.imuProvider=new Rt(i.onImuEvent,n,{require:[o.a.Acceleration,o.a.AngularRate]}),i}var n,r,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Sn(t,e)}(e,t),n=e,i=[{key:"getRequiredProviders",value:function(){return[Rt]}},{key:"name",get:function(){return"RelativeAttitude"}},{key:"displayName",get:function(){return"Relative Attitude from Ekf"}},{key:"eventsType",get:function(){return[o.a.RelativeAttitude]}}],(r=[{key:"startInternal",value:function(){this.imuProvider.start()}},{key:"stopInternal",value:function(){this.imuProvider.stop()}},{key:"setOffset",value:function(t){var e=-t;e+=F(window.orientation||0),this.ekfAttitude.setOrientationYaw(e)}}])&&Pn(n.prototype,r),i&&Pn(n,i),e}(r.a);function jn(t){return(jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Rn(t,e){return!e||"object"!==jn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function In(t){return(In=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function xn(t,e){return(xn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Nn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Rn(this,In(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xn(t,e)}(e,t),n=e,(r=[{key:"enableMapMatching",value:function(t,e,n){this.mapMatching=new Ge,this.mapMatching.maxDistance=e,this.mapMatching.maxAngleBearing=n,t&&this.setNetwork(t)}},{key:"setNetwork",value:function(t){if(!(t instanceof qe))throw new TypeError(t+" is not an instance of Network");if(!this.mapMatching)throw new Error("MapMatching is not enabled");this.mapMatching.setNetwork(t)}},{key:"setItinerary",value:function(t){if(!(t instanceof en))throw new TypeError(t+" is not an instance of Itinerary");this.itinerary=t}},{key:"hasMapMatching",get:function(){return null!==this.mapMatching}}])&&Tn(n.prototype,r),o&&Tn(n,o),e}(r.a);function Dn(t){return(Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Fn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qn(t,e,n){return(qn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ln(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ln(t){return(Ln=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function zn(t,e){return(zn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Wn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Un={stepdetectionlocker:!0,smoother:!0,onThugEvent:Lt.a},Gn=function(t){function e(t,n,r){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i=function(t,e){return!e||"object"!==Dn(e)&&"function"!=typeof e?Fn(t):e}(this,Ln(e).call(this,t,n,Object.assign({},Un,r))),Wn(Fn(i),"pdrPosition",null),Wn(Fn(i),"onRelativeAttitudeEvent",(function(t){var e=t[0];i.attitude=e.data;var n=e.clone();n.dataType=o.a.AbsoluteAttitude,i.notify(n)})),Wn(Fn(i),"onImuEvent",(function(t){if(i.attitude&&i.pdrPosition&&!(i.options.stepdetectionlocker&&i.stepDetectionLocker.locked&&i.stepDetectionLocker.feedHeading(i.attitude.heading))){var n,r,a;t.forEach((function(t){t.dataType===o.a.Acceleration?(r=t.data,n=t.timestamp):t.dataType===o.a.AngularRate&&(a=t.data)}));var u=i.attitude.heading;i.onThugEvent&&i.thugDetector.compute(n,r)&&i.onThugEvent();var c=e.computeLinearAcceleration(i.attitude.quaternion,r);if(i.stepDetection.compute(n,c,a))if(i.pdrPosition=i.calculateNewPosition(i.pdrPosition,n,u,i.stepDetection.lastStepSize),i.options.smoother){i.smoother.generateNextPositions(i.pdrPosition);var s=i.smoother.pullPosition(n);s&&(i.position=s)}else i.position=i.pdrPosition;else{if(!i.options.smoother)return;var l=i.smoother.pullPosition(n);if(!l)return;i.position=l}i.notify(i.createEvent(o.a.AbsolutePosition,i.position))}})),i.relativeAttitudeProvider=new An((function(t){return i.onRelativeAttitudeEvent(t)}),n,i.options),i.imuProvider=new Rt((function(t){return i.onImuEvent(t)}),n,Object.assign({},i.options,{require:[o.a.Acceleration,o.a.AngularRate]})),i.stepDetection=new sn,i.stepDetectionLocker=new pn,i.smoother=new dn,i.thugDetector=new yn,i.options.useMapMatching&&i.enableMapMatching(),i}var n,r,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zn(t,e)}(e,t),n=e,i=[{key:"getRequiredProviders",value:function(){return[Rt,An]}},{key:"retrieveWaitingOrientationFromItinerary",value:function(t){if(!t)throw new Error("Empty itinerary");if(!(t instanceof en))throw new TypeError(t+" is not an instance of itinerary");if(t.length<1)throw new Error("Empty itinerary");var e=t.getEdgeAt(1.5);if(e)return e.bearing;if(t.length<2)throw new Error("Itinerary is too short");return t.secondEdge.bearing}},{key:"computeLinearAcceleration",value:function(t,e){var n=_.rotate(_.inverse(t),e);return n[2]-=Wt.EARTH_GRAVITY,n}},{key:"name",get:function(){return"PDR"}},{key:"displayName",get:function(){return"PDR"}},{key:"eventsType",get:function(){return[o.a.AbsoluteAttitude,o.a.AbsolutePosition]}}],(r=[{key:"startInternal",value:function(){this.imuProvider.start(),this.relativeAttitudeProvider.start()}},{key:"stopInternal",value:function(){this.imuProvider.stop(),this.relativeAttitudeProvider.stop()}},{key:"setHeading",value:function(t){this.relativeAttitudeProvider.setOffset(t)}},{key:"setPosition",value:function(t){t instanceof be?(this.pdrPosition=Me.fromWGS84(t),window&&window.performance&&(this.pdrPosition.time=window.performance.now()/1e3)):this.pdrPosition=t,this.options.smoother?(this.smoother.generateNextPositions(this.pdrPosition,!0),this.position=this.smoother.pullPosition(this.pdrPosition.time)):this.position=this.pdrPosition.clone(),this.notify(this.createEvent(o.a.AbsolutePosition,this.position))}},{key:"calculateNewPosition",value:function(t,e,n,r){var o=t.clone();if(o.move(r,n),o.bearing=L(n),o.time=e,!this.mapMatching)return o;var i=this.mapMatching.getProjection(o,!0,!0);if(!i||!i.projection)return o;var a=o;if(a.level=i.projection.level,i.distanceFromNearestElement<r)return a.lat=i.projection.lat,a.lng=i.projection.lng,a;var u=a;u.lat=t.lat,u.lng=t.lng;var c=.7*i.distanceFromNearestElement,s=t.bearingTo(i.projection);return u.move(c,s),u}},{key:"enableMapMatching",value:function(t,n,r){qn(Ln(e.prototype),"enableMapMatching",this).call(this,t,n||15,r||20)}},{key:"setItinerary",value:function(t){qn(Ln(e.prototype),"setItinerary",this).call(this,t),this.options.stepdetectionlocker&&this.stepDetectionLocker.setWaitingOrientation(e.retrieveWaitingOrientationFromItinerary(t))}},{key:"setStepDetectionLockerOrientation",value:function(t){this.stepDetectionLocker.setWaitingOrientation(t)}},{key:"nameWithOptions",get:function(){var t=this.name;return t+=" (locker: ",t+=this.options.stepdetectionlocker?"Y":"N",t+=", ",t+="smoo: ",t+=this.options.smoother?"Y":"N",t+=", ",t+="mm: ",t+=this.options.useMapMatching?"Y":"N",t+=")"}}])&&Cn(n.prototype,r),i&&Cn(n,i),e}(Nn);Wn(Gn,"MM_PDR_ANGLE",20),Wn(Gn,"MM_PDR_DIST",15);var Bn=Gn;function Vn(t){return(Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yn(t,e){return!e||"object"!==Vn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Hn(t){var e="function"==typeof Map?new Map:void 0;return(Hn=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return Qn(t,arguments,Jn(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Xn(r,t)})(t)}function Qn(t,e,n){return(Qn=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&Xn(o,n.prototype),o}).apply(null,arguments)}function Xn(t,e){return(Xn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Jn(t){return(Jn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Zn="Geolocation api is missing",Kn=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Yn(this,Jn(e).call(this,t||Zn))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xn(t,e)}(e,t),e}(Hn(Error));function $n(t){return($n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tr(t,e){return!e||"object"!==$n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function er(t){var e="function"==typeof Map?new Map:void 0;return(er=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return nr(t,arguments,or(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),rr(r,t)})(t)}function nr(t,e,n){return(nr=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&rr(o,n.prototype),o}).apply(null,arguments)}function rr(t,e){return(rr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function or(t){return(or=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ir="Geolocation permission denied",ar=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),tr(this,or(e).call(this,t||ir))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&rr(t,e)}(e,t),e}(er(Error));function ur(t){return(ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cr(t,e){return!e||"object"!==ur(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function sr(t){var e="function"==typeof Map?new Map:void 0;return(sr=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return lr(t,arguments,pr(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),fr(r,t)})(t)}function lr(t,e,n){return(lr=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&fr(o,n.prototype),o}).apply(null,arguments)}function fr(t,e){return(fr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function pr(t){return(pr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var hr="Geolocation position unavailable",yr=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),cr(this,pr(e).call(this,t||hr))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fr(t,e)}(e,t),e}(sr(Error));function vr(t){return(vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function br(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gr(t,e,n){return(gr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function mr(t){return(mr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function wr(t,e){return(wr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Or={enableHighAccuracy:!0,timeout:1/0,maximumAge:0},Pr=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=function(t,e){return!e||"object"!==vr(e)&&"function"!=typeof e?br(t):e}(this,(t=mr(e)).call.apply(t,[this].concat(i))),_r(br(n),"onNewPosition",(function(t){var r=t.coords;if(r){var i;r.heading&&(i=F(r.heading));var a=V.unixTimestampToPerformanceNow(t.timestamp)/1e3,u=new Me(r.latitude,r.longitude,r.altitude,null,a,r.accuracy,i,e.name);n.notify(n.createEvent(o.a.AbsolutePosition,u,a))}})),_r(br(n),"onPositionError",(function(t){var e;switch(t.code){case 1:e=new ar(t.message);break;case 2:e=new yr(t.message)}e&&n.notifyError(e)})),n}var n,r,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wr(t,e)}(e,t),n=e,i=[{key:"checkAvailability",value:function(t){return Pt.a.merge(gr(mr(e),"checkAvailability",this).call(this,t),navigator&&navigator.geolocation?Pt.a.yes():Pt.a.no(new Kn))}},{key:"name",get:function(){return"GnssWifi"}},{key:"displayName",get:function(){return"GNSS / Wifi from Browser"}},{key:"eventsType",get:function(){return[o.a.AbsolutePosition]}}],(r=[{key:"startInternal",value:function(){this.geoLocationId=navigator.geolocation.watchPosition(this.onNewPosition,this.onPositionError,Or)}},{key:"stopInternal",value:function(){navigator.geolocation.clearWatch(this.geoLocationId)}}])&&dr(n.prototype,r),i&&dr(n,i),e}(r.a),Er=n(16),kr=n.n(Er);function Sr(t){return(Sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mr(t,e){return!e||"object"!==Sr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ar(t){return(Ar=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jr(t,e){return(jr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Tr=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Mr(this,Ar(e).call(this,t))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jr(t,e)}(e,t),e}(nt);function Rr(t){return(Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ir(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Nr(t,e){return(Nr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Dr(t,e,n){return(Dr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Cr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Cr(t){return(Cr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Fr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var qr=function(t){function e(){var t,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=function(t,e){return!e||"object"!==Rr(e)&&"function"!=typeof e?xr(t):e}(this,(t=Cr(e)).call.apply(t,[this].concat(i))),Fr(xr(n),"onDeviceOrientationChromeEvent",(function(t){var e=t.timeStamp/1e3;t.alpha&&t.beta&&t.gamma?n.onDeviceOrientationCommonEvent(e,C.eulerToQuaternionZXYDegrees([t.alpha,t.beta,t.gamma])):n.notifyError((new nt).from("deviceorientationabsolute"))})),Fr(xr(n),"onDeviceOrientationSafariEvent",(function(t){var r=t.timeStamp/1e3;if(t.beta&&t.gamma)if(t.webkitCompassHeading){var o=-t.webkitCompassHeading;t.beta>62&&(o=e.headingEusToEnu(180-o,t.beta,t.gamma));var i=C.eulerToQuaternionZXYDegrees([o,t.beta,t.gamma]);n.onDeviceOrientationCommonEvent(r,i)}else Dr(Cr(e.prototype),"notifyError",xr(n)).call(xr(n),(new Tr).from("deviceorientation"));else n.notifyError((new nt).from("deviceorientation"))})),Fr(xr(n),"onDeviceOrientationCommonEvent",(function(t,r){if(n.declinationQuaternion){var i=_.multiply(n.declinationQuaternion,r);Dr(Cr(e.prototype),"notify",xr(n)).call(xr(n),n.createEvent(o.a.AbsoluteAttitude,new ce(i),t))}else se.a.warn("Position of AbsoluteAttitude provider is not set yet. Please call setPosition() before.")})),n}var n,r,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Nr(t,e)}(e,t),n=e,i=[{key:"checkAvailability",value:function(t){return Pt.a.merge(Dr(Cr(e),"checkAvailability",this).call(this,t),G.isMobile?Pt.a.yes():Pt.a.no(new Ot))}},{key:"headingEusToEnu",value:function(t,e,n){var r=F(t),o=F(e),i=F(n);return L(Math.atan2(Math.cos(r)*Math.sin(i)+Math.cos(i)*Math.sin(r)*Math.sin(o),Math.sin(r)*Math.sin(i)-Math.cos(r)*Math.cos(i)*Math.sin(o)))}},{key:"name",get:function(){return"AbsoluteAttitude"}},{key:"displayName",get:function(){return"Absolute Attitude from Browser"}},{key:"eventsType",get:function(){return[o.a.AbsoluteAttitude]}}],(r=[{key:"startInternal",value:function(){switch(G.name){case z.CHROME:window.addEventListener("deviceorientationabsolute",this.onDeviceOrientationChromeEvent,!0);break;case z.SAFARI:window.addEventListener("deviceorientation",this.onDeviceOrientationSafariEvent,!0)}}},{key:"stopInternal",value:function(){switch(G.name){case z.CHROME:window.removeEventListener("deviceorientationabsolute",this.onDeviceOrientationChromeEvent,!0);break;case z.SAFARI:window.removeEventListener("deviceorientation",this.onDeviceOrientationSafariEvent,!0)}}},{key:"setPosition",value:function(t){var e=kr.a.model().point([t.lat,t.lng]);this.declinationQuaternion=_.fromAxisAngle([0,0,1],-F(e.decl))}}])&&Ir(n.prototype,r),i&&Ir(n,i),e}(r.a),Lr={DEFAULT_ALTITUDE:1.6};function zr(t){return(zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Ur(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Gr(t,e){return!e||"object"!==zr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Br(t,e,n){return(Br="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Vr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Vr(t){return(Vr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Yr(t,e){return(Yr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Hr=function(t){function e(t,n,r){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=Gr(this,Vr(e).call(this,t,n,r))).pdrProvider=new Bn((function(t){return o.onPdrEvent(t)}),n,r),o.gnssWifiProvider=new Pr((function(t){return o.onGnssWifiEvent(t)}),n,r),o.absoluteAttitudeProvider=new qr((function(t){return o.onAbsoluteAttitudeEvent(t)}),n,r),o.gpsLastUpdate=0,o.isFirstGnssUpdate=!0,o.isFirstAttitudeUpdate=!0,o.options.useMapMatching&&o.enableMapMatching(),o}var n,r,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yr(t,e)}(e,t),n=e,i=[{key:"getRequiredProviders",value:function(){return[Bn,Pr,qr]}},{key:"name",get:function(){return"GnssWifi"}},{key:"displayName",get:function(){return"GnssWifiPdr"}},{key:"eventsType",get:function(){return[o.a.AbsoluteAttitude,o.a.AbsolutePosition]}}],(r=[{key:"startInternal",value:function(){this.pdrProvider.start(),this.gnssWifiProvider.start(),this.absoluteAttitudeProvider.start()}},{key:"stop",value:function(){this.pdrProvider.stop(),this.gnssWifiProvider.stop(),this.absoluteAttitudeProvider.stop()}},{key:"onPdrEvent",value:function(t){var e=this;t.forEach((function(t){t.dataType===o.a.AbsolutePosition?e.position=t.data:t.dataType===o.a.AbsoluteAttitude&&(e.attitude=t.data)})),this.notify.apply(this,Wr(t))}},{key:"onGnssWifiEvent",value:function(t){var e=t[0].data;if(this.absoluteAttitudeProvider.setPosition(e),!(e.accuracy>25)&&(this.gnssPosition=e.clone(),this.gnssPosition.alt=Lr.DEFAULT_ALTITUDE,!this.position||this.position&&this.position.distanceTo(this.gnssPosition)>25))if(this.mapMatching&&this.attitude){this.gnssPosition.bearing=this.attitude.headingDegrees;var n=this.mapMatching.getProjection(this.gnssPosition,!0,!0);n&&n.projection&&(this.gnssPosition.lat=n.projection.lat,this.gnssPosition.lng=n.projection.lng,this.lastAttitude&&this.pdrProvider.setHeading(this.lastAttitude.heading)),this.pdrProvider.setPosition(this.gnssPosition)}else this.pdrProvider.setPosition(this.gnssPosition)}},{key:"onAbsoluteAttitudeEvent",value:function(t){var e=t[0].data;this.isFirstAttitudeUpdate&&(this.pdrProvider.setHeading(e.heading),this.isFirstAttitudeUpdate=!1),this.lastAttitude=e}},{key:"enableMapMatching",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20;this.pdrProvider.enableMapMatching(t,n,r),Br(Vr(e.prototype),"enableMapMatching",this).call(this,t,n,r)}},{key:"setNetwork",value:function(t){this.pdrProvider.setNetwork(t),Br(Vr(e.prototype),"setNetwork",this).call(this,t)}},{key:"setItinerary",value:function(t){var n=!this.itinerary;if(Br(Vr(e.prototype),"setItinerary",this).call(this,t),n&&t.length>0){(!this.gnssPosition||t.length<2||!t.points[0].equalsTo(this.gnssPosition))&&console.warn("Itinerary has not been calculated from GnssWifiPdrProvider and these is not recommanded");var r=t.getEdgeAt(20);if(!r)return;var o=Me.fromWGS84(r.node1.coords);o.alt=Lr.DEFAULT_ALTITUDE,this.pdrProvider.setPosition(o),this.pdrProvider.setStepDetectionLockerOrientation(r.bearing)}}}])&&Ur(n.prototype,r),i&&Ur(n,i),e}(Nn);function Qr(t){return(Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Jr(t,e){return!e||"object"!==Qr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Zr(t){return(Zr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Kr(t,e){return(Kr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var $r=function(t){function e(t,n,r){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=Jr(this,Zr(e).call(this,t,n,r))).absoluteAttitudeProvider=new qr(t,n),o.gnssWifiProvider=new Pr((function(e){o.absoluteAttitudeProvider.setPosition(e[0].data),t(e)}),n),o}var n,r,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Kr(t,e)}(e,t),n=e,i=[{key:"getRequiredProviders",value:function(){return[qr,Pr]}},{key:"name",get:function(){return"Pose"}},{key:"displayName",get:function(){return"Pose provider"}},{key:"eventsType",get:function(){return[o.a.AbsoluteAttitude,o.a.AbsolutePosition]}}],(r=[{key:"startInternal",value:function(){this.absoluteAttitudeProvider.start(),this.gnssWifiProvider.start()}},{key:"stopInternal",value:function(){this.absoluteAttitudeProvider.stop(),this.gnssWifiProvider.stop()}}])&&Xr(n.prototype,r),i&&Xr(n,i),e}(r.a),to=n(5);function eo(t){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function no(t,e){return!e||"object"!==eo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ro(t){var e="function"==typeof Map?new Map:void 0;return(ro=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return oo(t,arguments,ao(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),io(r,t)})(t)}function oo(t,e,n){return(oo=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&io(o,n.prototype),o}).apply(null,arguments)}function io(t,e){return(io=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ao(t){return(ao=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var uo="ARCore is missing",co=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),no(this,ao(e).call(this,t||uo))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&io(t,e)}(e,t),e}(ro(Error));function so(t){return(so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lo(t,e){return!e||"object"!==so(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function fo(t){var e="function"==typeof Map?new Map:void 0;return(fo=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return po(t,arguments,yo(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ho(r,t)})(t)}function po(t,e,n){return(po=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&ho(o,n.prototype),o}).apply(null,arguments)}function ho(t,e){return(ho=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function yo(t){return(yo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var vo="Native interface is missing",bo=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),lo(this,yo(e).call(this,t||vo))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ho(t,e)}(e,t),e}(fo(Error));function go(t){return(go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function wo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _o(t,e,n){return(_o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Oo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Oo(t){return(Oo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Po(t,e){return(Po=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Eo=function(t){function e(){var t,n,i,a,u;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var c=arguments.length,s=new Array(c),l=0;l<c;l++)s[l]=arguments[l];return n=function(t,e){return!e||"object"!==go(e)&&"function"!=typeof e?wo(t):e}(this,(t=Oo(e)).call.apply(t,[this].concat(s))),i=wo(n),u=function(){if(n.state===r.a.State.STARTED){var t=JSON.parse(e.nativeProvider.getInfo());if(0!==t.length){var i=new ce(t.slice(0,4)),a=t.slice(4,7);n.notify(n.createEvent(o.a.RelativeAttitude,i),n.createEvent(o.a.RelativePosition,a))}requestAnimationFrame(n.pullDataLoop)}},(a="pullDataLoop")in i?Object.defineProperty(i,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[a]=u,n}var n,i,a;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Po(t,e)}(e,t),n=e,a=[{key:"getRequiredProviders",value:function(){return[]}},{key:"checkAvailability",value:function(t){var n=_o(Oo(e),"checkAvailability",this).call(this,t);if(!n.isSupported)return n;try{if(!this.nativeProvider.checkAvailability())return Pt.a.no(new co)}catch(t){return Pt.a.no(t)}return Pt.a.yes()}},{key:"name",get:function(){return"ArCore"}},{key:"displayName",get:function(){return"ArCore provider"}},{key:"eventsType",get:function(){return[o.a.RelativeAttitude,o.a.RelativePosition]}},{key:"nativeProvider",get:function(){if(!this._nativeProvider){if(!this.nativeInterface)throw new bo;if(this._nativeProvider=this.nativeInterface.getArCoreProvider(),!this._nativeProvider)throw new co}return this._nativeProvider}},{key:"useCameraNatively",get:function(){return!0}}],(i=[{key:"startInternal",value:function(){e.nativeProvider&&e.nativeProvider.start(),this.pullDataLoop()}},{key:"stopInternal",value:function(){e.nativeProvider&&e.nativeProvider.stop()}}])&&mo(n.prototype,i),a&&mo(n,a),e}(r.a);function ko(t){return(ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function So(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Mo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ao(t,e,n){return(Ao="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=jo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function jo(t){return(jo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function To(t,e){return(To=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ro(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Io=function(t){function e(t,n,r){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i=function(t,e){return!e||"object"!==ko(e)&&"function"!=typeof e?Mo(t):e}(this,jo(e).call(this,t,n,r)),Ro(Mo(i),"onArCoreEvent",(function(t){t.forEach((function(t){if(t.dataType===o.a.RelativeAttitude&&(i.relativeAttitude=t.data,void 0!==i.waitingForceHeading&&(i.setHeading(i.waitingForceHeading),delete i.waitingForceHeading),i.offsetQuat)){var n=_.multiply(i.offsetQuat,i.relativeAttitude.quaternion);i.absoluteAttitude=new ce(n),i.notify(i.createEvent(o.a.AbsoluteAttitude,i.absoluteAttitude,t.timestamp))}if(t.dataType===o.a.RelativePosition){if(i.oldRelativePos&&i.offsetAngle&&!e.positionEquals(i.oldRelativePos,t.data)){var r=R.subtract(t.data,i.oldRelativePos),a=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[2],2)),u=Math.atan2(r[0],-r[2])-i.offsetAngle;i.position=i.position.destinationPoint(a,u,r[1]),i.absoluteAttitude&&(i.position.bearing=i.absoluteAttitude.headingDegrees,i.updateLevel(i.position)),i.notify(i.createEvent(o.a.AbsolutePosition,i.position,t.timestamp))}i.oldRelativePos=t.data}}))})),Ro(Mo(i),"onImuEvent",(function(t){i.angularRate=t[0].data})),i.arCoreProvider=new Eo((function(t){return i.onArCoreEvent(t)}),n,r),i.imuProvider=new Rt(i.onImuEvent,n,Object.assign({},r||{},{require:[o.a.AngularRate]})),i.options.useMapMatching&&i.enableMapMatching(),i}var n,r,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&To(t,e)}(e,t),n=e,i=[{key:"getRequiredProviders",value:function(){return[Eo,Rt]}},{key:"positionEquals",value:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{key:"name",get:function(){return"ArCoreAbsolute"}},{key:"displayName",get:function(){return"ArCore absolute provider"}},{key:"eventsType",get:function(){return[o.a.AbsoluteAttitude,o.a.AbsolutePosition]}},{key:"useCameraNatively",get:function(){return!0}}],(r=[{key:"startInternal",value:function(){this.arCoreProvider.start(),this.imuProvider.start()}},{key:"stopInternal",value:function(){this.arCoreProvider.stop(),this.imuProvider.stop()}},{key:"setHeading",value:function(t){this.relativeAttitude?(this.offsetAngle=this.relativeAttitude.heading-t,this.offsetQuat=_.fromAxisAngle([0,0,1],this.offsetAngle)):this.waitingForceHeading=t}},{key:"setPosition",value:function(t){this.position=Me.fromWGS84(t),this.position.provider=this.constructor.name,this.notify(this.createEvent(o.a.AbsolutePosition,this.position))}},{key:"enableMapMatching",value:function(t,n,r){Ao(jo(e.prototype),"enableMapMatching",this).call(this,t,n||Bn.MM_PDR_DIST,r||Bn.MM_PDR_ANGLE)}},{key:"updateLevel",value:function(t){if(this.mapMatching){var e=this.mapMatching.getProjection(t,!0);e&&(t.level=e.projection.level)}}}])&&So(n.prototype,r),i&&So(n,i),e}(Nn);function xo(t){return(xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function No(t,e){return!e||"object"!==xo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Do(t){var e="function"==typeof Map?new Map:void 0;return(Do=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return Co(t,arguments,qo(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Fo(r,t)})(t)}function Co(t,e,n){return(Co=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&Fo(o,n.prototype),o}).apply(null,arguments)}function Fo(t,e){return(Fo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qo(t){return(qo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lo="Unable to find a provider with your given parameters",zo=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),No(this,qo(e).call(this,t||Lo))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fo(t,e)}(e,t),e}(Do(Error));function Wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Uo=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=[],(n="providerInstances")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r}var e,n,r;return e=t,r=[{key:"findProvider",value:function(t,e){var n=Object.assign({},to.a,e),r=Pt.a.yes(),i=function(t){return(r=t.checkAvailability(n)).isSupported};if(1===t.length&&t.includes(o.a.Inclination)){if(i(Ft))return Ft;throw r.reason}if([o.a.AbsolutePosition,o.a.AbsoluteAttitude].every((function(e){return t.includes(e)}))&&2===t.length){if(n.waitInputPosition){if(i(Io))return Io;if(i(Bn))return Bn;throw r.reason}if(i(Hr))return Hr;if(i($r))return $r;if(!n.optionalEvents.includes(o.a.AbsoluteAttitude))throw r.reason;if(i(Pr))return Pr;throw r.reason}throw new zo}}],(n=[{key:"start",value:function(e,n,r,o){this.options=Object.assign({},to.a,o);try{var i=t.findProvider(e,this.options),a=Reflect.construct(i,[n,r,this.options]);return this.providerInstances[a.id]=a,a.start(),{id:a.id,name:a.name,useCameraNatively:a.useCameraNatively}}catch(t){return r(t),null}}},{key:"stop",value:function(t){this.providerInstances[t].stop(),delete this.providerInstances[t]}},{key:"setPosition",value:function(t,e){var n=this.providerInstances[t];if(!n)throw new Error("Unknown provider");n.setPosition?n.setPosition(e):se.a.warn("Cannot set position to "+n.constructor.name)}},{key:"setHeading",value:function(t,e){var n=this.providerInstances[t];if(!n)throw new Error("Unknown provider");n.setHeading?n.setHeading(e):se.a.warn("Cannot set heading to "+n.constructor.name)}},{key:"setItinerary",value:function(t,e){var n=this.providerInstances[t];if(!n)throw new Error("Unknown provider");n.setItinerary?n.setItinerary(e):se.a.warn("Cannot set itinerary to "+n.constructor.name)}},{key:"setNetwork",value:function(t,e){var n=this.providerInstances[t];if(!n)throw new Error("Unknown provider");n.setNetwork?n.setNetwork(e):se.a.warn("Cannot set network to "+n.constructor.name)}}])&&Wo(e.prototype,n),r&&Wo(e,r),t}();function Go(t){return(Go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bo(t,e){return!e||"object"!==Go(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Vo(t){var e="function"==typeof Map?new Map:void 0;return(Vo=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return Yo(t,arguments,Qo(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ho(r,t)})(t)}function Yo(t,e,n){return(Yo=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&Ho(o,n.prototype),o}).apply(null,arguments)}function Ho(t,e){return(Ho=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Qo(t){return(Qo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Xo="IP Resolver failed",Jo=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Bo(this,Qo(e).call(this,t||Xo))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ho(t,e)}(e,t),e}(Vo(Error));function Zo(t){return(Zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ko(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $o(t,e){return!e||"object"!==Zo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ti(t){return(ti=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ei(t,e){return(ei=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ni=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),$o(this,ti(e).apply(this,arguments))}var n,r,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ei(t,e)}(e,t),n=e,i=[{key:"name",get:function(){return"IP"}},{key:"displayName",get:function(){return"IP from ipinfo.io"}},{key:"eventsType",get:function(){return[o.a.AbsolutePosition]}}],(r=[{key:"startInternal",value:function(){var t=this;fetch("https://ipinfo.io/geo?token=24a7ca2f3b489d").then((function(e){if(e){var n=performance.now()/1e3,r=new Me(parseFloat(e.loc.split(",")[0]),parseFloat(e.loc.split(",")[1]),null,null,n);t.notify(t.createEvent(o.a.AbsolutePosition,r,n))}else t.notifyError(new Jo)}))}},{key:"stopInternal",value:function(){}}])&&Ko(n.prototype,r),i&&Ko(n,i),e}(r.a),ri={AbsoluteAttitude:qr.name,ArCore:Eo.name,ArCoreAbsolute:Io.name,GnssWifi:Pr.name,GnssWifiPdr:Hr.name,Imu:Rt.name,Inclination:Ft.name,Ip:ni.name,Pdr:Bn.name,RelativeAttitude:An.name};n.d(e,"InclinationProvider",(function(){return Ft})),n.d(e,"PositioningHandler",(function(){return Uo})),n.d(e,"EventType",(function(){return o.a})),n.d(e,"ProvidersName",(function(){return ri}))}]);
package/index.js DELETED
@@ -1,8 +0,0 @@
1
- import InclinationProvider from './src/providers/others/InclinationProvider';
2
- import PositioningHandler from './src/PositioningHandler';
3
- import EventType from './src/events/EventType';
4
- import { ProvidersName } from './src/providers/ProvidersList';
5
-
6
- export {
7
- InclinationProvider, PositioningHandler, EventType, ProvidersName
8
- };