qwc2 2025.10.9 → 2025.10.14

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 (241) hide show
  1. package/actions/display.js +30 -1
  2. package/actions/editing.js +22 -1
  3. package/actions/layerinfo.js +13 -1
  4. package/actions/layers.js +213 -3
  5. package/actions/localConfig.js +58 -1
  6. package/actions/locale.js +21 -1
  7. package/actions/locate.js +26 -1
  8. package/actions/logging.js +10 -1
  9. package/actions/map.js +105 -2
  10. package/actions/measurement.js +12 -1
  11. package/actions/processNotifications.js +37 -1
  12. package/actions/redlining.js +18 -1
  13. package/actions/redliningPick.js +12 -1
  14. package/actions/search.js +12 -1
  15. package/actions/serviceinfo.js +12 -1
  16. package/actions/task.js +55 -3
  17. package/actions/theme.js +339 -19
  18. package/actions/windows.js +164 -5
  19. package/components/AppMenu.js +435 -3
  20. package/components/AttributeForm.js +928 -32
  21. package/components/AttributeTableWidget.js +1105 -13
  22. package/components/AutoEditForm.js +189 -3
  23. package/components/CoordinateDisplayer.js +78 -2
  24. package/components/EditComboField.js +190 -6
  25. package/components/EditUploadField.js +315 -3
  26. package/components/ExportSelection.js +203 -2
  27. package/components/FullscreenSwitcher.js +90 -3
  28. package/components/Icon.js +81 -2
  29. package/components/IdentifyViewer.js +1161 -6
  30. package/components/ImportLayer.js +718 -20
  31. package/components/LayerInfoWindow.js +145 -2
  32. package/components/LinkFeatureForm.js +246 -5
  33. package/components/MapButton.js +88 -2
  34. package/components/MapSelection.js +287 -8
  35. package/components/MessageBar.js +68 -2
  36. package/components/NumericInputWindow.js +359 -2
  37. package/components/PickFeature.js +266 -2
  38. package/components/PluginsContainer.js +227 -8
  39. package/components/PrintSelection.js +620 -49
  40. package/components/ProcessNotifications.js +104 -2
  41. package/components/QtDesignerForm.js +1137 -18
  42. package/components/ResizeableWindow.js +591 -8
  43. package/components/SearchBox.js +1307 -20
  44. package/components/ServiceInfoWindow.js +107 -2
  45. package/components/SideBar.js +204 -4
  46. package/components/StandardApp.js +381 -20
  47. package/components/Swipeable.js +15 -1
  48. package/components/TaskBar.js +85 -2
  49. package/components/ThemeLayersListWindow.js +216 -4
  50. package/components/ThemeList.js +381 -7
  51. package/components/Toolbar.js +106 -2
  52. package/components/WindowManager.js +178 -2
  53. package/components/map/OlLayer.js +257 -6
  54. package/components/map/OlMap.js +405 -5
  55. package/components/map/layers/BingLayer.js +31 -2
  56. package/components/map/layers/GoogleLayer.js +222 -19
  57. package/components/map/layers/GraticuleLayer.js +21 -1
  58. package/components/map/layers/ImageLayer.js +15 -1
  59. package/components/map/layers/MVTLayer.js +52 -2
  60. package/components/map/layers/OSMLayer.js +24 -2
  61. package/components/map/layers/OverlayLayer.js +55 -3
  62. package/components/map/layers/VectorLayer.js +173 -8
  63. package/components/map/layers/WFSLayer.js +220 -6
  64. package/components/map/layers/WMSLayer.js +180 -6
  65. package/components/map/layers/WMTSLayer.js +67 -3
  66. package/components/map/layers/XYZLayer.js +24 -2
  67. package/components/map/layers/index.js +28 -1
  68. package/components/map3d/EditDataset3D.js +190 -3
  69. package/components/map3d/HeightProfile3D.js +402 -3
  70. package/components/map3d/ImportObjects3D.js +162 -2
  71. package/components/map3d/Map3D.js +1304 -38
  72. package/components/map3d/MapControls3D.js +392 -7
  73. package/components/map3d/SearchField3D.js +183 -11
  74. package/components/map3d/View3DSwitcher.js +98 -2
  75. package/components/map3d/drawtool/CreateTool3D.js +174 -4
  76. package/components/map3d/drawtool/EditTool3D.js +590 -6
  77. package/components/map3d/drawtool/NumericInput3D.js +336 -4
  78. package/components/map3d/layers/GeoTIFFLayer3D.js +15 -1
  79. package/components/map3d/layers/VectorLayer3D.js +53 -2
  80. package/components/map3d/layers/WFSLayer3D.js +109 -3
  81. package/components/map3d/layers/WMSLayer3D.js +70 -2
  82. package/components/map3d/layers/WMTSLayer3D.js +27 -3
  83. package/components/map3d/layers/index.js +14 -1
  84. package/components/map3d/utils/FirstPersonControls3D.js +423 -16
  85. package/components/map3d/utils/MiscUtils3D.js +221 -13
  86. package/components/map3d/utils/OrbitControls3D.js +176 -5
  87. package/components/map3d/utils/Tiles3DStyle.js +238 -9
  88. package/components/share/ShareLink.js +54 -2
  89. package/components/share/ShareQRCode.js +62 -2
  90. package/components/share/ShareSocials.js +125 -3
  91. package/components/timeline/FixedTimeline.js +236 -5
  92. package/components/timeline/InfiniteTimeline.js +347 -8
  93. package/components/timeline/TimelineFeaturesSlider.js +439 -5
  94. package/components/widgets/AccordeonWidget.js +96 -2
  95. package/components/widgets/ButtonBar.js +124 -2
  96. package/components/widgets/ColorButton.js +201 -3
  97. package/components/widgets/ComboBox.js +166 -2
  98. package/components/widgets/CopyButton.js +110 -2
  99. package/components/widgets/DateTimeInput.js +100 -3
  100. package/components/widgets/EditableSelect.js +230 -3
  101. package/components/widgets/FileSelector.js +128 -4
  102. package/components/widgets/Input.js +124 -2
  103. package/components/widgets/InputContainer.js +96 -2
  104. package/components/widgets/LayerCatalogWidget.js +219 -3
  105. package/components/widgets/MenuButton.js +157 -1
  106. package/components/widgets/ModalDialog.js +64 -2
  107. package/components/widgets/NavBar.js +119 -2
  108. package/components/widgets/NumberInput.js +226 -4
  109. package/components/widgets/PopupMenu.js +72 -1
  110. package/components/widgets/Primitives.js +6 -1
  111. package/components/widgets/ReCaptchaWidget.js +55 -1
  112. package/components/widgets/SearchWidget.js +255 -2
  113. package/components/widgets/Spinner.js +44 -2
  114. package/components/widgets/SuggestionInput.js +77 -2
  115. package/components/widgets/TextInput.js +308 -2
  116. package/components/widgets/ToggleSwitch.js +85 -2
  117. package/components/widgets/VectorLayerPicker.js +85 -3
  118. package/libs/openlayers.js +225 -5
  119. package/package.json +1 -1
  120. package/plugins/API.js +358 -15
  121. package/plugins/AttributeTable.js +109 -3
  122. package/plugins/Authentication.js +130 -5
  123. package/plugins/BackgroundSwitcher.js +218 -4
  124. package/plugins/Bookmark.js +289 -3
  125. package/plugins/BottomBar.js +298 -4
  126. package/plugins/CookiePopup.js +67 -3
  127. package/plugins/Cyclomedia.js +442 -5
  128. package/plugins/Editing.js +497 -9
  129. package/plugins/FeatureForm.js +366 -4
  130. package/plugins/FeatureSearch.js +458 -3
  131. package/plugins/GeometryDigitizer.js +664 -7
  132. package/plugins/HeightProfile.js +763 -15
  133. package/plugins/Help.js +102 -3
  134. package/plugins/HomeButton.js +80 -3
  135. package/plugins/Identify.js +543 -5
  136. package/plugins/LayerCatalog.js +215 -4
  137. package/plugins/LayerTree.js +1194 -6
  138. package/plugins/LocateButton.js +94 -3
  139. package/plugins/Map.js +320 -16
  140. package/plugins/MapCompare.js +94 -3
  141. package/plugins/MapCopyright.js +127 -5
  142. package/plugins/MapExport.js +613 -20
  143. package/plugins/MapFilter.js +868 -12
  144. package/plugins/MapInfoTooltip.js +277 -3
  145. package/plugins/MapLegend.js +253 -4
  146. package/plugins/MapTip.js +290 -4
  147. package/plugins/Measure.js +220 -4
  148. package/plugins/NewsPopup.js +137 -3
  149. package/plugins/OverviewMap.js +167 -7
  150. package/plugins/Panoramax.js +340 -2
  151. package/plugins/Portal.js +199 -4
  152. package/plugins/Print.js +1231 -15
  153. package/plugins/Redlining.js +750 -6
  154. package/plugins/Reports.js +332 -3
  155. package/plugins/Routing.js +1278 -15
  156. package/plugins/ScratchDrawing.js +173 -5
  157. package/plugins/Settings.js +241 -4
  158. package/plugins/Share.js +198 -3
  159. package/plugins/StartupMarker.js +84 -4
  160. package/plugins/TaskButton.js +88 -3
  161. package/plugins/ThemeSwitcher.js +164 -4
  162. package/plugins/TimeManager.js +971 -10
  163. package/plugins/TopBar.js +300 -7
  164. package/plugins/TourGuide.js +213 -2
  165. package/plugins/ValueTool.js +419 -4
  166. package/plugins/View3D.js +519 -14
  167. package/plugins/ZoomButtons.js +165 -3
  168. package/plugins/map/EditingSupport.js +199 -7
  169. package/plugins/map/LocateSupport.js +260 -4
  170. package/plugins/map/MeasurementSupport.js +216 -8
  171. package/plugins/map/RedliningPickSupport.js +201 -7
  172. package/plugins/map/RedliningSupport.js +726 -17
  173. package/plugins/map/SnapInteraction.js +101 -1
  174. package/plugins/map/SnapSupport.js +210 -2
  175. package/plugins/map/SnappingSupport.js +356 -17
  176. package/plugins/map3d/BackgroundSwitcher3D.js +44 -3
  177. package/plugins/map3d/BottomBar3D.js +118 -3
  178. package/plugins/map3d/Compare3D.js +422 -8
  179. package/plugins/map3d/Draw3D.js +353 -6
  180. package/plugins/map3d/ExportObjects3D.js +393 -18
  181. package/plugins/map3d/HideObjects3D.js +313 -12
  182. package/plugins/map3d/Identify3D.js +283 -12
  183. package/plugins/map3d/LayerTree3D.js +323 -3
  184. package/plugins/map3d/MapCopyright3D.js +128 -5
  185. package/plugins/map3d/MapExport3D.js +590 -10
  186. package/plugins/map3d/MapLight3D.js +553 -6
  187. package/plugins/map3d/Measure3D.js +571 -20
  188. package/plugins/map3d/OverviewMap3D.js +169 -3
  189. package/plugins/map3d/Settings3D.js +73 -3
  190. package/plugins/map3d/TopBar3D.js +207 -9
  191. package/plugins/redlining/RedliningBufferSupport.js +206 -3
  192. package/reducers/display.js +34 -2
  193. package/reducers/editing.js +68 -3
  194. package/reducers/index.js +9 -1
  195. package/reducers/layerinfo.js +26 -2
  196. package/reducers/layers.js +456 -9
  197. package/reducers/localConfig.js +122 -2
  198. package/reducers/locale.js +38 -2
  199. package/reducers/locate.js +40 -2
  200. package/reducers/map.js +176 -5
  201. package/reducers/measurement.js +42 -2
  202. package/reducers/processNotifications.js +49 -2
  203. package/reducers/redlining.js +50 -2
  204. package/reducers/redliningPick.js +27 -2
  205. package/reducers/search.js +20 -1
  206. package/reducers/serviceinfo.js +25 -2
  207. package/reducers/task.js +45 -2
  208. package/reducers/theme.js +51 -2
  209. package/reducers/windows.js +203 -2
  210. package/scripts/dist.sh +1 -1
  211. package/scripts/gen-plugin-docs.js +152 -2
  212. package/scripts/makeIconkit.js +85 -6
  213. package/scripts/themesConfig.js +742 -40
  214. package/scripts/updateTranslations.js +251 -10
  215. package/selectors/searchproviders.js +44 -2
  216. package/stores/StandardStore.js +42 -2
  217. package/utils/ConfigUtils.js +84 -3
  218. package/utils/CoordinatesUtils.js +234 -23
  219. package/utils/DxfUtils.js +237 -11
  220. package/utils/EditingInterface.js +421 -87
  221. package/utils/EditingUtils.js +357 -13
  222. package/utils/ElevationInterface.js +83 -22
  223. package/utils/FeatureStyles.js +429 -5
  224. package/utils/IdentifyUtils.js +443 -7
  225. package/utils/ImageEditor.js +79 -9
  226. package/utils/LayerUtils.js +1516 -50
  227. package/utils/LocaleUtils.js +117 -7
  228. package/utils/MapUtils.js +241 -59
  229. package/utils/MeasureUtils.js +323 -2
  230. package/utils/MiscUtils.js +189 -11
  231. package/utils/PermaLinkUtils.js +429 -6
  232. package/utils/PluginStore.js +27 -1
  233. package/utils/ResourceRegistry.js +15 -1
  234. package/utils/RoutingInterface.js +307 -7
  235. package/utils/SearchProviders.js +722 -19
  236. package/utils/ServiceLayerUtils.js +669 -14
  237. package/utils/Signal.js +32 -2
  238. package/utils/ThemeUtils.js +341 -7
  239. package/utils/VectorLayerUtils.js +589 -15
  240. package/utils/expr_grammar/grammar.js +2239 -2
  241. package/utils/expr_grammar/test.js +65 -3
@@ -1,11 +1,434 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t)})})}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a)},function(t){invoke("throw",t,i,a)}):e.resolve(h).then(function(t){u.value=t,i(u)},function(t){return invoke("throw",t,i,a)})}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r)})}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this}),define(g,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n}})}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments))},"return":function _return(r){var n=this.s["return"];return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))},"throw":function _throw(r){var n=this.s["return"];return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))}},new AsyncFromSyncIterator(r)}/**
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
4
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
8
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
9
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
15
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
16
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
17
+ function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
18
+ function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "return": function _return(r) { var n = this.s["return"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, "throw": function _throw(r) { var n = this.s["return"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
19
+ /**
2
20
  * Copyright 2016-2024 Sourcepole AG
3
21
  * All rights reserved.
4
22
  *
5
23
  * This source code is licensed under the BSD-style license found in the
6
24
  * LICENSE file in the root directory of this source tree.
7
- */import axios from"axios";import url from"url";import{LayerRole}from"../actions/layers";import StandardApp from"../components/StandardApp";import ConfigUtils from"../utils/ConfigUtils";import LayerUtils from"../utils/LayerUtils";var UrlQuery={};var historyUpdateTimeout=null;var pendingParams={};export var UrlParams={updateParams:function updateParams(dict){var forceLocationUrl=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(ConfigUtils.getConfigProp("omitUrlParameterUpdates")===true){UrlQuery=Object.assign(UrlQuery,dict);var propNames=Object.getOwnPropertyNames(UrlQuery);var _iterator2=_createForOfIteratorHelper(propNames),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var propName=_step2.value;if(UrlQuery[propName]===undefined){delete UrlQuery[propName]}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}if(!forceLocationUrl){return}}// Delay URL updates to avoid "Too many calls to Location or History APIs within a short timeframe."
8
- if(historyUpdateTimeout!==null){clearTimeout(historyUpdateTimeout)}pendingParams=_objectSpread(_objectSpread({},pendingParams),dict);historyUpdateTimeout=setTimeout(function(){var urlObj=url.parse(window.location.href,true);urlObj.query=Object.assign(urlObj.query,pendingParams);var propNames=Object.getOwnPropertyNames(urlObj.query);var _iterator3=_createForOfIteratorHelper(propNames),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _propName=_step3.value;if(urlObj.query[_propName]===undefined){delete urlObj.query[_propName]}}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}delete urlObj.search;history.replaceState({id:urlObj.host},"",url.format(urlObj));historyUpdateTimeout=null;pendingParams={}},250)},getParam:function getParam(key){var urlObj=url.parse(window.location.href,true);if(ConfigUtils.getConfigProp("omitUrlParameterUpdates")===true){var _urlObj$query$key;return(_urlObj$query$key=urlObj.query[key])!==null&&_urlObj$query$key!==void 0?_urlObj$query$key:UrlQuery[key]}else{return urlObj.query[key]}},getParams:function getParams(){var query=url.parse(window.location.href,true).query;if(ConfigUtils.getConfigProp("omitUrlParameterUpdates")===true){return _objectSpread(_objectSpread({},UrlQuery),query)}else{return query}},clear:function clear(){var clearKeys=["k","t","l","bl","bk","c","hc","ic","s","e","crs","st","sp","f","v","v3d","bl3d"];this.updateParams(clearKeys.reduce(function(res,key){return _objectSpread(_objectSpread({},res),{},_defineProperty({},key,undefined))},{}),true)},getFullUrl:function getFullUrl(){if(ConfigUtils.getConfigProp("omitUrlParameterUpdates")===true){var urlObj=url.parse(window.location.href,true);urlObj.query=UrlQuery;delete urlObj.search;return url.format(urlObj)}else{return window.location.href}}};var PermalinkDataHooks={};export function registerPermalinkDataStoreHook(key,storeFn){PermalinkDataHooks[key]=storeFn}export function unregisterPermalinkDataStoreHook(key){delete PermalinkDataHooks[key]}function executePermalinkDataStoreHooks(_x){return _executePermalinkDataStoreHooks.apply(this,arguments)}function _executePermalinkDataStoreHooks(){_executePermalinkDataStoreHooks=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(permalinkState){var _iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step$value,key,storeFn;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_iteratorAbruptCompletion=false;_didIteratorError=false;_context.prev=2;_iterator=_asyncIterator(Object.entries(PermalinkDataHooks));case 4:_context.next=6;return _iterator.next();case 6:if(!(_iteratorAbruptCompletion=!(_step=_context.sent).done)){_context.next=14;break}_step$value=_slicedToArray(_step.value,2),key=_step$value[0],storeFn=_step$value[1];_context.next=10;return storeFn();case 10:permalinkState[key]=_context.sent;case 11:_iteratorAbruptCompletion=false;_context.next=4;break;case 14:_context.next=20;break;case 16:_context.prev=16;_context.t0=_context["catch"](2);_didIteratorError=true;_iteratorError=_context.t0;case 20:_context.prev=20;_context.prev=21;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context.next=25;break}_context.next=25;return _iterator["return"]();case 25:_context.prev=25;if(!_didIteratorError){_context.next=28;break}throw _iteratorError;case 28:return _context.finish(25);case 29:return _context.finish(20);case 30:case"end":return _context.stop()}},_callee,null,[[2,16,20,30],[21,,25,29]])}));return _executePermalinkDataStoreHooks.apply(this,arguments)}export function generatePermaLink(_x2){return _generatePermaLink.apply(this,arguments)}function _generatePermaLink(){_generatePermaLink=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(callback){var user,permittedGroup,state,fullUrl,permalinkState,exploded,redliningLayers,params,route,_args2=arguments;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:user=_args2.length>1&&_args2[1]!==undefined?_args2[1]:false;permittedGroup=_args2.length>2&&_args2[2]!==undefined?_args2[2]:"";state=StandardApp.store.getState();fullUrl=UrlParams.getFullUrl();if(ConfigUtils.getConfigProp("permalinkServiceUrl")){_context2.next=7;break}callback(fullUrl);return _context2.abrupt("return");case 7:permalinkState={};if(ConfigUtils.getConfigProp("storeAllLayersInPermalink")){permalinkState.layers=state.layers.flat.filter(function(layer){return layer.role!==LayerRole.BACKGROUND})}else{// Only store redlining layers
9
- exploded=LayerUtils.explodeLayers(state.layers.flat.filter(function(layer){return layer.role!==LayerRole.BACKGROUND}));redliningLayers=exploded.map(function(entry,idx){return _objectSpread(_objectSpread({},entry),{},{pos:idx})}).filter(function(entry){return entry.layer.role===LayerRole.USERLAYER&&entry.layer.type==="vector"}).map(function(entry){return _objectSpread(_objectSpread({},entry.layer),{},{pos:entry.pos})});permalinkState.layers=redliningLayers}permalinkState.permalinkParams=state.localConfig.permalinkParams;permalinkState.url=fullUrl;params={permitted_group:permittedGroup||null};_context2.next=14;return executePermalinkDataStoreHooks(permalinkState);case 14:route=user?"userpermalink":"createpermalink";axios.post(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/,"")+"/"+route,permalinkState,{params:params}).then(function(response){return callback(response.data.permalink||fullUrl,response.data.expires||null)})["catch"](function(){return callback(fullUrl)});case 16:case"end":return _context2.stop()}},_callee2)}));return _generatePermaLink.apply(this,arguments)}export function resolvePermaLink(initialParams,callback){var key=initialParams.k;var bkey=initialParams.bk;if(key){axios.get(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/,"")+"/resolvepermalink?key="+key).then(function(response){var data=response.data;callback(_objectSpread(_objectSpread(_objectSpread({},initialParams),data.query||{}),data.state.permalinkParams||{}),data.state||{},!!data.query)})["catch"](function(){callback(initialParams,{},false)})}else if(bkey){axios.get(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/,"")+"/bookmarks/"+bkey).then(function(response){var data=response.data;callback(_objectSpread(_objectSpread(_objectSpread({},initialParams),data.query||{}),data.state.permalinkParams||{}),data.state||{},!!data.query)})["catch"](function(){callback(initialParams,{},false)})}else{callback(initialParams,{},true)}}export function resolveBookmark(bookmarkKey,callback){axios.get(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/,"")+"/bookmarks/"+bookmarkKey).then(function(response){var data=response.data;callback(_objectSpread({},data.query||{}),data.state||{},!!data.query)})["catch"](function(){callback(bookmarkKey,{},false)})}export function getUserBookmarks(user,callback){if(user){axios.get(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/,"")+"/bookmarks/").then(function(response){callback(response.data||[])})["catch"](function(){callback([])})}}export function createBookmark(_x3,_x4){return _createBookmark.apply(this,arguments)}function _createBookmark(){_createBookmark=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(description,callback){var state,exploded,bookmarkState,redliningLayers;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(ConfigUtils.getConfigProp("permalinkServiceUrl")){_context3.next=3;break}callback(false);return _context3.abrupt("return");case 3:state=StandardApp.store.getState();// Only store redlining layers
10
- exploded=LayerUtils.explodeLayers(state.layers.flat.filter(function(layer){return layer.role!==LayerRole.BACKGROUND}));bookmarkState={};if(ConfigUtils.getConfigProp("storeAllLayersInPermalink")){bookmarkState.layers=state.layers.flat.filter(function(layer){return layer.role!==LayerRole.BACKGROUND})}else{redliningLayers=exploded.map(function(entry,idx){return _objectSpread(_objectSpread({},entry),{},{pos:idx})}).filter(function(entry){return entry.layer.role===LayerRole.USERLAYER&&entry.layer.type==="vector"}).map(function(entry){return _objectSpread(_objectSpread({},entry.layer),{},{pos:entry.pos})});bookmarkState.layers=redliningLayers}bookmarkState.permalinkParams=state.localConfig.permalinkParams;bookmarkState.url=UrlParams.getFullUrl();_context3.next=11;return executePermalinkDataStoreHooks(bookmarkState);case 11:axios.post(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/,"")+"/bookmarks/"+"?description="+description,bookmarkState).then(function(){return callback(true)})["catch"](function(){return callback(false)});case 12:case"end":return _context3.stop()}},_callee3)}));return _createBookmark.apply(this,arguments)}export function updateBookmark(_x5,_x6,_x7){return _updateBookmark.apply(this,arguments)}function _updateBookmark(){_updateBookmark=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(bkey,description,callback){var state,exploded,bookmarkState,redliningLayers;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(ConfigUtils.getConfigProp("permalinkServiceUrl")){_context4.next=3;break}callback(false);return _context4.abrupt("return");case 3:state=StandardApp.store.getState();// Only store redlining layers
11
- exploded=LayerUtils.explodeLayers(state.layers.flat.filter(function(layer){return layer.role!==LayerRole.BACKGROUND}));bookmarkState={};if(ConfigUtils.getConfigProp("storeAllLayersInPermalink")){bookmarkState.layers=state.layers.flat.filter(function(layer){return layer.role!==LayerRole.BACKGROUND})}else{redliningLayers=exploded.map(function(entry,idx){return _objectSpread(_objectSpread({},entry),{},{pos:idx})}).filter(function(entry){return entry.layer.role===LayerRole.USERLAYER&&entry.layer.type==="vector"}).map(function(entry){return _objectSpread(_objectSpread({},entry.layer),{},{pos:entry.pos})});bookmarkState.layers=redliningLayers}bookmarkState.permalinkParams=state.localConfig.permalinkParams;bookmarkState.url=UrlParams.getFullUrl();_context4.next=11;return executePermalinkDataStoreHooks(bookmarkState);case 11:axios.put(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/,"")+"/bookmarks/"+bkey+"?description="+description,bookmarkState).then(function(){return callback(true)})["catch"](function(){return callback(false)});case 12:case"end":return _context4.stop()}},_callee4)}));return _updateBookmark.apply(this,arguments)}export function removeBookmark(bkey,callback){if(bkey){axios["delete"](ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/,"")+"/bookmarks/"+bkey).then(function(){callback(true)})["catch"](function(){return callback(false)})}}
25
+ */
26
+
27
+ import axios from 'axios';
28
+ import url from 'url';
29
+ import { LayerRole } from '../actions/layers';
30
+ import StandardApp from '../components/StandardApp';
31
+ import ConfigUtils from '../utils/ConfigUtils';
32
+ import LayerUtils from '../utils/LayerUtils';
33
+ var UrlQuery = {};
34
+ var historyUpdateTimeout = null;
35
+ var pendingParams = {};
36
+ export var UrlParams = {
37
+ updateParams: function updateParams(dict) {
38
+ var forceLocationUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
39
+ if (ConfigUtils.getConfigProp("omitUrlParameterUpdates") === true) {
40
+ UrlQuery = Object.assign(UrlQuery, dict);
41
+ var propNames = Object.getOwnPropertyNames(UrlQuery);
42
+ var _iterator2 = _createForOfIteratorHelper(propNames),
43
+ _step2;
44
+ try {
45
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
46
+ var propName = _step2.value;
47
+ if (UrlQuery[propName] === undefined) {
48
+ delete UrlQuery[propName];
49
+ }
50
+ }
51
+ } catch (err) {
52
+ _iterator2.e(err);
53
+ } finally {
54
+ _iterator2.f();
55
+ }
56
+ if (!forceLocationUrl) {
57
+ return;
58
+ }
59
+ }
60
+ // Delay URL updates to avoid "Too many calls to Location or History APIs within a short timeframe."
61
+ if (historyUpdateTimeout !== null) {
62
+ clearTimeout(historyUpdateTimeout);
63
+ }
64
+ pendingParams = _objectSpread(_objectSpread({}, pendingParams), dict);
65
+ historyUpdateTimeout = setTimeout(function () {
66
+ var urlObj = url.parse(window.location.href, true);
67
+ urlObj.query = Object.assign(urlObj.query, pendingParams);
68
+ var propNames = Object.getOwnPropertyNames(urlObj.query);
69
+ var _iterator3 = _createForOfIteratorHelper(propNames),
70
+ _step3;
71
+ try {
72
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
73
+ var _propName = _step3.value;
74
+ if (urlObj.query[_propName] === undefined) {
75
+ delete urlObj.query[_propName];
76
+ }
77
+ }
78
+ } catch (err) {
79
+ _iterator3.e(err);
80
+ } finally {
81
+ _iterator3.f();
82
+ }
83
+ delete urlObj.search;
84
+ history.replaceState({
85
+ id: urlObj.host
86
+ }, '', url.format(urlObj));
87
+ historyUpdateTimeout = null;
88
+ pendingParams = {};
89
+ }, 250);
90
+ },
91
+ getParam: function getParam(key) {
92
+ var urlObj = url.parse(window.location.href, true);
93
+ if (ConfigUtils.getConfigProp("omitUrlParameterUpdates") === true) {
94
+ var _urlObj$query$key;
95
+ return (_urlObj$query$key = urlObj.query[key]) !== null && _urlObj$query$key !== void 0 ? _urlObj$query$key : UrlQuery[key];
96
+ } else {
97
+ return urlObj.query[key];
98
+ }
99
+ },
100
+ getParams: function getParams() {
101
+ var query = url.parse(window.location.href, true).query;
102
+ if (ConfigUtils.getConfigProp("omitUrlParameterUpdates") === true) {
103
+ return _objectSpread(_objectSpread({}, UrlQuery), query);
104
+ } else {
105
+ return query;
106
+ }
107
+ },
108
+ clear: function clear() {
109
+ var clearKeys = ['k', 't', 'l', 'bl', 'bk', 'c', 'hc', 'ic', 's', 'e', 'crs', 'st', 'sp', 'f', 'v', 'v3d', 'bl3d'];
110
+ this.updateParams(clearKeys.reduce(function (res, key) {
111
+ return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, undefined));
112
+ }, {}), true);
113
+ },
114
+ getFullUrl: function getFullUrl() {
115
+ if (ConfigUtils.getConfigProp("omitUrlParameterUpdates") === true) {
116
+ var urlObj = url.parse(window.location.href, true);
117
+ urlObj.query = UrlQuery;
118
+ delete urlObj.search;
119
+ return url.format(urlObj);
120
+ } else {
121
+ return window.location.href;
122
+ }
123
+ }
124
+ };
125
+ var PermalinkDataHooks = {};
126
+ export function registerPermalinkDataStoreHook(key, storeFn) {
127
+ PermalinkDataHooks[key] = storeFn;
128
+ }
129
+ export function unregisterPermalinkDataStoreHook(key) {
130
+ delete PermalinkDataHooks[key];
131
+ }
132
+ function executePermalinkDataStoreHooks(_x) {
133
+ return _executePermalinkDataStoreHooks.apply(this, arguments);
134
+ }
135
+ function _executePermalinkDataStoreHooks() {
136
+ _executePermalinkDataStoreHooks = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(permalinkState) {
137
+ var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step$value, key, storeFn;
138
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
139
+ while (1) switch (_context.prev = _context.next) {
140
+ case 0:
141
+ _iteratorAbruptCompletion = false;
142
+ _didIteratorError = false;
143
+ _context.prev = 2;
144
+ _iterator = _asyncIterator(Object.entries(PermalinkDataHooks));
145
+ case 4:
146
+ _context.next = 6;
147
+ return _iterator.next();
148
+ case 6:
149
+ if (!(_iteratorAbruptCompletion = !(_step = _context.sent).done)) {
150
+ _context.next = 14;
151
+ break;
152
+ }
153
+ _step$value = _slicedToArray(_step.value, 2), key = _step$value[0], storeFn = _step$value[1];
154
+ _context.next = 10;
155
+ return storeFn();
156
+ case 10:
157
+ permalinkState[key] = _context.sent;
158
+ case 11:
159
+ _iteratorAbruptCompletion = false;
160
+ _context.next = 4;
161
+ break;
162
+ case 14:
163
+ _context.next = 20;
164
+ break;
165
+ case 16:
166
+ _context.prev = 16;
167
+ _context.t0 = _context["catch"](2);
168
+ _didIteratorError = true;
169
+ _iteratorError = _context.t0;
170
+ case 20:
171
+ _context.prev = 20;
172
+ _context.prev = 21;
173
+ if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
174
+ _context.next = 25;
175
+ break;
176
+ }
177
+ _context.next = 25;
178
+ return _iterator["return"]();
179
+ case 25:
180
+ _context.prev = 25;
181
+ if (!_didIteratorError) {
182
+ _context.next = 28;
183
+ break;
184
+ }
185
+ throw _iteratorError;
186
+ case 28:
187
+ return _context.finish(25);
188
+ case 29:
189
+ return _context.finish(20);
190
+ case 30:
191
+ case "end":
192
+ return _context.stop();
193
+ }
194
+ }, _callee, null, [[2, 16, 20, 30], [21,, 25, 29]]);
195
+ }));
196
+ return _executePermalinkDataStoreHooks.apply(this, arguments);
197
+ }
198
+ export function generatePermaLink(_x2) {
199
+ return _generatePermaLink.apply(this, arguments);
200
+ }
201
+ function _generatePermaLink() {
202
+ _generatePermaLink = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(callback) {
203
+ var user,
204
+ permittedGroup,
205
+ state,
206
+ fullUrl,
207
+ permalinkState,
208
+ exploded,
209
+ redliningLayers,
210
+ params,
211
+ route,
212
+ _args2 = arguments;
213
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
214
+ while (1) switch (_context2.prev = _context2.next) {
215
+ case 0:
216
+ user = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : false;
217
+ permittedGroup = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : "";
218
+ state = StandardApp.store.getState();
219
+ fullUrl = UrlParams.getFullUrl();
220
+ if (ConfigUtils.getConfigProp("permalinkServiceUrl")) {
221
+ _context2.next = 7;
222
+ break;
223
+ }
224
+ callback(fullUrl);
225
+ return _context2.abrupt("return");
226
+ case 7:
227
+ permalinkState = {};
228
+ if (ConfigUtils.getConfigProp("storeAllLayersInPermalink")) {
229
+ permalinkState.layers = state.layers.flat.filter(function (layer) {
230
+ return layer.role !== LayerRole.BACKGROUND;
231
+ });
232
+ } else {
233
+ // Only store redlining layers
234
+ exploded = LayerUtils.explodeLayers(state.layers.flat.filter(function (layer) {
235
+ return layer.role !== LayerRole.BACKGROUND;
236
+ }));
237
+ redliningLayers = exploded.map(function (entry, idx) {
238
+ return _objectSpread(_objectSpread({}, entry), {}, {
239
+ pos: idx
240
+ });
241
+ }).filter(function (entry) {
242
+ return entry.layer.role === LayerRole.USERLAYER && entry.layer.type === 'vector';
243
+ }).map(function (entry) {
244
+ return _objectSpread(_objectSpread({}, entry.layer), {}, {
245
+ pos: entry.pos
246
+ });
247
+ });
248
+ permalinkState.layers = redliningLayers;
249
+ }
250
+ permalinkState.permalinkParams = state.localConfig.permalinkParams;
251
+ permalinkState.url = fullUrl;
252
+ params = {
253
+ permitted_group: permittedGroup || null
254
+ };
255
+ _context2.next = 14;
256
+ return executePermalinkDataStoreHooks(permalinkState);
257
+ case 14:
258
+ route = user ? "userpermalink" : "createpermalink";
259
+ axios.post(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/, '') + "/" + route, permalinkState, {
260
+ params: params
261
+ }).then(function (response) {
262
+ return callback(response.data.permalink || fullUrl, response.data.expires || null);
263
+ })["catch"](function () {
264
+ return callback(fullUrl);
265
+ });
266
+ case 16:
267
+ case "end":
268
+ return _context2.stop();
269
+ }
270
+ }, _callee2);
271
+ }));
272
+ return _generatePermaLink.apply(this, arguments);
273
+ }
274
+ export function resolvePermaLink(initialParams, callback) {
275
+ var key = initialParams.k;
276
+ var bkey = initialParams.bk;
277
+ if (key) {
278
+ axios.get(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/, '') + "/resolvepermalink?key=" + key).then(function (response) {
279
+ var data = response.data;
280
+ callback(_objectSpread(_objectSpread(_objectSpread({}, initialParams), data.query || {}), data.state.permalinkParams || {}), data.state || {}, !!data.query);
281
+ })["catch"](function () {
282
+ callback(initialParams, {}, false);
283
+ });
284
+ } else if (bkey) {
285
+ axios.get(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/, '') + "/bookmarks/" + bkey).then(function (response) {
286
+ var data = response.data;
287
+ callback(_objectSpread(_objectSpread(_objectSpread({}, initialParams), data.query || {}), data.state.permalinkParams || {}), data.state || {}, !!data.query);
288
+ })["catch"](function () {
289
+ callback(initialParams, {}, false);
290
+ });
291
+ } else {
292
+ callback(initialParams, {}, true);
293
+ }
294
+ }
295
+ export function resolveBookmark(bookmarkKey, callback) {
296
+ axios.get(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/, '') + "/bookmarks/" + bookmarkKey).then(function (response) {
297
+ var data = response.data;
298
+ callback(_objectSpread({}, data.query || {}), data.state || {}, !!data.query);
299
+ })["catch"](function () {
300
+ callback(bookmarkKey, {}, false);
301
+ });
302
+ }
303
+ export function getUserBookmarks(user, callback) {
304
+ if (user) {
305
+ axios.get(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/, '') + "/bookmarks/").then(function (response) {
306
+ callback(response.data || []);
307
+ })["catch"](function () {
308
+ callback([]);
309
+ });
310
+ }
311
+ }
312
+ export function createBookmark(_x3, _x4) {
313
+ return _createBookmark.apply(this, arguments);
314
+ }
315
+ function _createBookmark() {
316
+ _createBookmark = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(description, callback) {
317
+ var state, exploded, bookmarkState, redliningLayers;
318
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
319
+ while (1) switch (_context3.prev = _context3.next) {
320
+ case 0:
321
+ if (ConfigUtils.getConfigProp("permalinkServiceUrl")) {
322
+ _context3.next = 3;
323
+ break;
324
+ }
325
+ callback(false);
326
+ return _context3.abrupt("return");
327
+ case 3:
328
+ state = StandardApp.store.getState(); // Only store redlining layers
329
+ exploded = LayerUtils.explodeLayers(state.layers.flat.filter(function (layer) {
330
+ return layer.role !== LayerRole.BACKGROUND;
331
+ }));
332
+ bookmarkState = {};
333
+ if (ConfigUtils.getConfigProp("storeAllLayersInPermalink")) {
334
+ bookmarkState.layers = state.layers.flat.filter(function (layer) {
335
+ return layer.role !== LayerRole.BACKGROUND;
336
+ });
337
+ } else {
338
+ redliningLayers = exploded.map(function (entry, idx) {
339
+ return _objectSpread(_objectSpread({}, entry), {}, {
340
+ pos: idx
341
+ });
342
+ }).filter(function (entry) {
343
+ return entry.layer.role === LayerRole.USERLAYER && entry.layer.type === 'vector';
344
+ }).map(function (entry) {
345
+ return _objectSpread(_objectSpread({}, entry.layer), {}, {
346
+ pos: entry.pos
347
+ });
348
+ });
349
+ bookmarkState.layers = redliningLayers;
350
+ }
351
+ bookmarkState.permalinkParams = state.localConfig.permalinkParams;
352
+ bookmarkState.url = UrlParams.getFullUrl();
353
+ _context3.next = 11;
354
+ return executePermalinkDataStoreHooks(bookmarkState);
355
+ case 11:
356
+ axios.post(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/, '') + "/bookmarks/" + "?description=" + description, bookmarkState).then(function () {
357
+ return callback(true);
358
+ })["catch"](function () {
359
+ return callback(false);
360
+ });
361
+ case 12:
362
+ case "end":
363
+ return _context3.stop();
364
+ }
365
+ }, _callee3);
366
+ }));
367
+ return _createBookmark.apply(this, arguments);
368
+ }
369
+ export function updateBookmark(_x5, _x6, _x7) {
370
+ return _updateBookmark.apply(this, arguments);
371
+ }
372
+ function _updateBookmark() {
373
+ _updateBookmark = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(bkey, description, callback) {
374
+ var state, exploded, bookmarkState, redliningLayers;
375
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
376
+ while (1) switch (_context4.prev = _context4.next) {
377
+ case 0:
378
+ if (ConfigUtils.getConfigProp("permalinkServiceUrl")) {
379
+ _context4.next = 3;
380
+ break;
381
+ }
382
+ callback(false);
383
+ return _context4.abrupt("return");
384
+ case 3:
385
+ state = StandardApp.store.getState(); // Only store redlining layers
386
+ exploded = LayerUtils.explodeLayers(state.layers.flat.filter(function (layer) {
387
+ return layer.role !== LayerRole.BACKGROUND;
388
+ }));
389
+ bookmarkState = {};
390
+ if (ConfigUtils.getConfigProp("storeAllLayersInPermalink")) {
391
+ bookmarkState.layers = state.layers.flat.filter(function (layer) {
392
+ return layer.role !== LayerRole.BACKGROUND;
393
+ });
394
+ } else {
395
+ redliningLayers = exploded.map(function (entry, idx) {
396
+ return _objectSpread(_objectSpread({}, entry), {}, {
397
+ pos: idx
398
+ });
399
+ }).filter(function (entry) {
400
+ return entry.layer.role === LayerRole.USERLAYER && entry.layer.type === 'vector';
401
+ }).map(function (entry) {
402
+ return _objectSpread(_objectSpread({}, entry.layer), {}, {
403
+ pos: entry.pos
404
+ });
405
+ });
406
+ bookmarkState.layers = redliningLayers;
407
+ }
408
+ bookmarkState.permalinkParams = state.localConfig.permalinkParams;
409
+ bookmarkState.url = UrlParams.getFullUrl();
410
+ _context4.next = 11;
411
+ return executePermalinkDataStoreHooks(bookmarkState);
412
+ case 11:
413
+ axios.put(ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/, '') + "/bookmarks/" + bkey + "?description=" + description, bookmarkState).then(function () {
414
+ return callback(true);
415
+ })["catch"](function () {
416
+ return callback(false);
417
+ });
418
+ case 12:
419
+ case "end":
420
+ return _context4.stop();
421
+ }
422
+ }, _callee4);
423
+ }));
424
+ return _updateBookmark.apply(this, arguments);
425
+ }
426
+ export function removeBookmark(bkey, callback) {
427
+ if (bkey) {
428
+ axios["delete"](ConfigUtils.getConfigProp("permalinkServiceUrl").replace(/\/$/, '') + "/bookmarks/" + bkey).then(function () {
429
+ callback(true);
430
+ })["catch"](function () {
431
+ return callback(false);
432
+ });
433
+ }
434
+ }
@@ -1 +1,27 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var BuiltInPlugins={};var CustomPlugins={};export default{setBuiltinPlugins:function setBuiltinPlugins(plugins){Object.assign(BuiltInPlugins,plugins)},addCustomPlugin:function addCustomPlugin(name,plugin){if(name in BuiltInPlugins){/* eslint-disable-next-line */console.warn("Cannot overwrite builtin plugin "+name)}else{CustomPlugins[name]=plugin}},removeCustomPlugin:function removeCustomPlugin(name){delete CustomPlugins[name]},getPlugins:function getPlugins(){return _objectSpread(_objectSpread({},BuiltInPlugins),CustomPlugins)}};
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ var BuiltInPlugins = {};
8
+ var CustomPlugins = {};
9
+ export default {
10
+ setBuiltinPlugins: function setBuiltinPlugins(plugins) {
11
+ Object.assign(BuiltInPlugins, plugins);
12
+ },
13
+ addCustomPlugin: function addCustomPlugin(name, plugin) {
14
+ if (name in BuiltInPlugins) {
15
+ /* eslint-disable-next-line */
16
+ console.warn("Cannot overwrite builtin plugin " + name);
17
+ } else {
18
+ CustomPlugins[name] = plugin;
19
+ }
20
+ },
21
+ removeCustomPlugin: function removeCustomPlugin(name) {
22
+ delete CustomPlugins[name];
23
+ },
24
+ getPlugins: function getPlugins() {
25
+ return _objectSpread(_objectSpread({}, BuiltInPlugins), CustomPlugins);
26
+ }
27
+ };
@@ -4,4 +4,18 @@
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
- */var REGISTRY={};var ResourceRegistry={addResource:function addResource(key,data){REGISTRY[key]=data},removeResource:function removeResource(key){delete REGISTRY[key]},getResource:function getResource(key){return REGISTRY[key]}};export default ResourceRegistry;
7
+ */
8
+
9
+ var REGISTRY = {};
10
+ var ResourceRegistry = {
11
+ addResource: function addResource(key, data) {
12
+ REGISTRY[key] = data;
13
+ },
14
+ removeResource: function removeResource(key) {
15
+ delete REGISTRY[key];
16
+ },
17
+ getResource: function getResource(key) {
18
+ return REGISTRY[key];
19
+ }
20
+ };
21
+ export default ResourceRegistry;