@jsenv/core 26.0.1 → 27.0.0-alpha.2

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 (465) hide show
  1. package/main.js +17 -24
  2. package/package.json +35 -71
  3. package/readme.md +30 -37
  4. package/src/build/build.js +737 -0
  5. package/src/build/build_urls_generator.js +64 -0
  6. package/src/build/inject_version_mappings.js +62 -0
  7. package/src/build/plugins/bundle_js_module/jsenv_plugin_bundle_js_module.js +225 -0
  8. package/src/build/plugins/minify_html/jsenv_plugin_minify_html.js +30 -0
  9. package/src/build/plugins/minify_js/jsenv_plugin_minify_js.js +47 -0
  10. package/src/dev/plugins/autoreload/babel_plugin_metadata_import_meta_hot.js +98 -0
  11. package/src/dev/plugins/autoreload/client/autoreload_preference.js +11 -0
  12. package/src/dev/plugins/autoreload/client/event_source_client.js +186 -0
  13. package/src/{internal/dev_server/event_source_client → dev/plugins/autoreload/client}/event_source_connection.js +21 -25
  14. package/src/dev/plugins/autoreload/client/import_meta_hot.js +80 -0
  15. package/src/dev/plugins/autoreload/client/reload.js +101 -0
  16. package/src/dev/plugins/autoreload/client/url_helpers.js +20 -0
  17. package/src/dev/plugins/autoreload/html_hot_dependencies.js +156 -0
  18. package/src/dev/plugins/autoreload/jsenv_plugin_autoreload.js +374 -0
  19. package/src/dev/plugins/autoreload/sse_service.js +149 -0
  20. package/src/dev/plugins/explorer/client/explorer.html +607 -0
  21. package/src/{internal → dev/plugins/explorer/client}/jsenv.png +0 -0
  22. package/src/dev/plugins/explorer/jsenv_plugin_explorer.js +74 -0
  23. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/animation/toolbar_animation.js +0 -0
  24. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/eventsource/eventsource.css +2 -2
  25. package/src/dev/plugins/toolbar/client/eventsource/toolbar_eventsource.js +57 -0
  26. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/execution/execution.css +0 -0
  27. package/src/dev/plugins/toolbar/client/execution/toolbar_execution.js +88 -0
  28. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/focus.css +0 -0
  29. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/toolbar_focus.js +0 -0
  30. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/jsenv_logo.svg +0 -0
  31. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/notification/toolbar_notification.js +0 -0
  32. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/responsive/overflow_menu.css +0 -0
  33. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/responsive/toolbar_responsive.js +0 -0
  34. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/settings.css +0 -0
  35. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/toolbar_settings.js +1 -0
  36. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/jsenv_theme.css +1 -15
  37. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/light_theme.css +0 -17
  38. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/toolbar_theme.js +0 -0
  39. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar.html +40 -199
  40. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_injector.js +8 -28
  41. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_main.css +0 -24
  42. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_main.js +10 -56
  43. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.css +1 -1
  44. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.js +0 -0
  45. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/animation.js +0 -0
  46. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/dom.js +0 -0
  47. package/src/{internal/browser_utils → dev/plugins/toolbar/client/util}/fetch_using_xhr.js +0 -0
  48. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/fetching.js +2 -4
  49. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/iframe_to_parent_href.js +0 -0
  50. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/jsenv_logger.js +0 -0
  51. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/preferences.js +0 -0
  52. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/responsive.js +0 -0
  53. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/util.js +0 -0
  54. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/variant/variant.js +0 -0
  55. package/src/dev/plugins/toolbar/jsenv_plugin_toolbar.js +62 -0
  56. package/src/dev/start_dev_server.js +105 -0
  57. package/src/execute/execute.js +132 -0
  58. package/src/execute/run.js +208 -0
  59. package/src/execute/runtimes/browsers/chromium.js +8 -0
  60. package/src/execute/runtimes/browsers/firefox.js +7 -0
  61. package/src/execute/runtimes/browsers/from_playwright.js +464 -0
  62. package/src/{browser_runtimes.js → execute/runtimes/browsers/webkit.js} +4 -18
  63. package/src/{internal/node_launcher/child_process_options.js → execute/runtimes/node/child_exec_options.js} +25 -36
  64. package/src/{internal/node_launcher/node_controllable_file.mjs → execute/runtimes/node/controllable_file.mjs} +1 -18
  65. package/src/{internal/node_launcher/node_controllable_process.js → execute/runtimes/node/controlled_process.js} +128 -150
  66. package/src/execute/runtimes/node/exec_options.js +44 -0
  67. package/src/{internal/node_launcher → execute/runtimes/node}/kill_process_tree.js +3 -1
  68. package/src/execute/runtimes/node/node_process.js +92 -0
  69. package/src/execute/runtimes/node/node_worker_thread.js +28 -0
  70. package/src/omega/core_plugins/babel/babel_helper/babel_helper_directory.js +29 -0
  71. package/src/{internal/compile_server/js → omega/core_plugins/babel/babel_helper}/babel_plugin_babel_helpers_as_jsenv_imports.js +15 -19
  72. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/.eslintrc.cjs +0 -0
  73. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AsyncGenerator/AsyncGenerator.js +0 -0
  74. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AwaitValue/AwaitValue.js +0 -0
  75. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -0
  76. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayLikeToArray/arrayLikeToArray.js +0 -0
  77. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithHoles/arrayWithHoles.js +0 -0
  78. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithoutHoles/arrayWithoutHoles.js +0 -0
  79. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/assertThisInitialized/assertThisInitialized.js +0 -0
  80. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -0
  81. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncIterator/asyncIterator.js +0 -0
  82. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncToGenerator/asyncToGenerator.js +0 -0
  83. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -0
  84. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -0
  85. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -0
  86. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -0
  87. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCallCheck/classCallCheck.js +0 -0
  88. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -0
  89. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -0
  90. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -0
  91. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classNameTDZError/classNameTDZError.js +0 -0
  92. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -0
  93. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldGet/classPrivateFieldGet.js +0 -0
  94. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -0
  95. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -0
  96. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldSet/classPrivateFieldSet.js +0 -0
  97. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodGet/classPrivateMethodGet.js +0 -0
  98. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodSet/classPrivateMethodSet.js +0 -0
  99. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -0
  100. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -0
  101. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -0
  102. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -0
  103. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/construct/construct.js +0 -0
  104. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createClass/createClass.js +0 -0
  105. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -0
  106. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -0
  107. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createRawReactElement/createRawReactElement.js +0 -0
  108. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createSuper/createSuper.js +0 -0
  109. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/decorate/decorate.js +0 -0
  110. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defaults/defaults.js +0 -0
  111. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineEnumerableProperties/defineEnumerableProperties.js +0 -0
  112. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineProperty/defineProperty.js +0 -0
  113. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/extends/extends.js +0 -0
  114. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/get/get.js +0 -0
  115. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/getPrototypeOf/getPrototypeOf.js +0 -0
  116. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inherits/inherits.js +0 -0
  117. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inheritsLoose/inheritsLoose.js +0 -0
  118. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerDefineProperty/initializerDefineProperty.js +0 -0
  119. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerWarningHelper/initializerWarningHelper.js +0 -0
  120. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/instanceof/instanceof.js +0 -0
  121. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireDefault/interopRequireDefault.js +0 -0
  122. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireWildcard/interopRequireWildcard.js +0 -0
  123. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeFunction/isNativeFunction.js +0 -0
  124. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -0
  125. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArray/iterableToArray.js +0 -0
  126. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimit/iterableToArrayLimit.js +0 -0
  127. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -0
  128. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/jsx/jsx.js +0 -0
  129. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/maybeArrayLike/maybeArrayLike.js +0 -0
  130. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/newArrowCheck/newArrowCheck.js +0 -0
  131. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableRest/nonIterableRest.js +0 -0
  132. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableSpread/nonIterableSpread.js +0 -0
  133. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -0
  134. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread/objectSpread.js +0 -0
  135. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread2/objectSpread2.js +0 -0
  136. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutProperties/objectWithoutProperties.js +0 -0
  137. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -0
  138. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/possibleConstructorReturn/possibleConstructorReturn.js +0 -0
  139. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readOnlyError/readOnlyError.js +0 -0
  140. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readme.md +0 -0
  141. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/set/set.js +0 -0
  142. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/setPrototypeOf/setPrototypeOf.js +0 -0
  143. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -0
  144. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArray/slicedToArray.js +0 -0
  145. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArrayLoose/slicedToArrayLoose.js +0 -0
  146. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/superPropBase/superPropBase.js +0 -0
  147. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -0
  148. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -0
  149. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/tdz/tdz.js +0 -0
  150. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalRef/temporalRef.js +0 -0
  151. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalUndefined/temporalUndefined.js +0 -0
  152. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toArray/toArray.js +0 -0
  153. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toConsumableArray/toConsumableArray.js +0 -0
  154. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPrimitive/toPrimitive.js +0 -0
  155. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPropertyKey/toPropertyKey.js +0 -0
  156. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/typeof/typeof.js +0 -0
  157. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -0
  158. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -0
  159. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapNativeSuper/wrapNativeSuper.js +0 -0
  160. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapRegExp/wrapRegExp.js +0 -0
  161. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/writeOnlyError/writeOnlyError.js +0 -0
  162. package/src/omega/core_plugins/babel/global_this/babel_plugin_global_this_as_jsenv_import.js +35 -0
  163. package/{helpers/global-this/global-this.js → src/omega/core_plugins/babel/global_this/client/global_this.js} +0 -0
  164. package/src/omega/core_plugins/babel/helpers/babel_plugin_structure.js +187 -0
  165. package/src/{internal/features → omega/core_plugins/babel/helpers}/babel_plugins_compatibility.js +1 -24
  166. package/src/omega/core_plugins/babel/jsenv_plugin_babel.js +97 -0
  167. package/src/omega/core_plugins/babel/new_stylesheet/babel_plugin_new_stylesheet_as_jsenv_import.js +117 -0
  168. package/src/omega/core_plugins/babel/new_stylesheet/client/.eslintrc.cjs +24 -0
  169. package/{helpers/new_stylesheet → src/omega/core_plugins/babel/new_stylesheet/client}/new_stylesheet.js +0 -0
  170. package/src/omega/core_plugins/babel/regenerator_runtime/babel_plugin_regenerator_runtime_as_jsenv_import.js +34 -0
  171. package/{helpers/regenerator-runtime/regenerator-runtime.js → src/omega/core_plugins/babel/regenerator_runtime/client/regenerator_runtime.js} +0 -0
  172. package/src/omega/core_plugins/commonjs_globals/jsenv_plugin_commonjs_globals.js +169 -0
  173. package/src/omega/core_plugins/file_urls/jsenv_plugin_file_urls.js +67 -0
  174. package/src/omega/core_plugins/filesystem_magic/jsenv_plugin_filesystem_magic.js +58 -0
  175. package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/error_in_document.js +10 -16
  176. package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/error_in_notification.js +0 -0
  177. package/src/omega/core_plugins/html_supervisor/client/html_supervisor_installer.js +168 -0
  178. package/src/omega/core_plugins/html_supervisor/client/html_supervisor_setup.js +77 -0
  179. package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/perf_browser.js +0 -0
  180. package/src/{internal/runtime_client → omega/core_plugins/html_supervisor/client}/uneval_exception.js +0 -0
  181. package/src/omega/core_plugins/html_supervisor/jsenv_plugin_html_supervisor.js +233 -0
  182. package/src/omega/core_plugins/import_assertions/helpers/babel_plugin_metadata_import_assertions.js +98 -0
  183. package/src/{internal/building/import_assertions → omega/core_plugins/import_assertions/helpers}/json_module.js +3 -2
  184. package/src/omega/core_plugins/import_assertions/helpers/text_module.js +6 -0
  185. package/src/omega/core_plugins/import_assertions/jsenv_plugin_import_assertions.js +211 -0
  186. package/src/omega/core_plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +80 -0
  187. package/src/omega/core_plugins/importmap/jsenv_plugin_importmap.js +212 -0
  188. package/src/omega/core_plugins/inline/client/inline_content.js +6 -0
  189. package/src/omega/core_plugins/inline/jsenv_plugin_data_urls.js +70 -0
  190. package/src/omega/core_plugins/inline/jsenv_plugin_inline.js +13 -0
  191. package/src/omega/core_plugins/inline/jsenv_plugin_inline_query_param.js +42 -0
  192. package/src/omega/core_plugins/inline/jsenv_plugin_js_and_css_inside_html.js +142 -0
  193. package/src/omega/core_plugins/inline/jsenv_plugin_new_inline_content.js +210 -0
  194. package/src/omega/core_plugins/leading_slash/jsenv_plugin_leading_slash.js +12 -0
  195. package/src/omega/core_plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +77 -0
  196. package/src/omega/core_plugins/url_resolution/jsenv_plugin_url_resolution.js +28 -0
  197. package/src/omega/core_plugins/url_version/jsenv_plugin_url_version.js +50 -0
  198. package/src/omega/core_plugins.js +39 -0
  199. package/src/omega/errors.js +168 -0
  200. package/src/omega/file_url_converter.js +63 -0
  201. package/src/omega/kitchen.js +777 -0
  202. package/src/omega/omega_server.js +129 -0
  203. package/src/omega/plugin_controller.js +240 -0
  204. package/src/omega/runtime_support/default_runtime_support.js +13 -0
  205. package/src/omega/runtime_support/features_compatibility.js +91 -0
  206. package/src/omega/runtime_support/runtime_support.js +20 -0
  207. package/src/omega/server/file_service.js +155 -0
  208. package/src/omega/server/user_agent.js +22 -0
  209. package/src/omega/url_graph/url_graph_load.js +68 -0
  210. package/src/omega/url_graph/url_graph_report.js +151 -0
  211. package/src/omega/url_graph/url_graph_sort.js +29 -0
  212. package/src/omega/url_graph/url_info_transformations.js +161 -0
  213. package/src/omega/url_graph.js +132 -0
  214. package/src/omega/url_mentions/css_url_mentions.js +63 -0
  215. package/src/omega/url_mentions/html_url_mentions.js +185 -0
  216. package/src/omega/url_mentions/js_module_url_mentions.js +91 -0
  217. package/src/omega/url_mentions/parse_url_mentions.js +37 -0
  218. package/src/omega/url_mentions/worker_classic_url_mentions.js +37 -0
  219. package/src/{internal/executing → test}/execute_plan.js +154 -211
  220. package/src/{execute_test_plan.js → test/execute_test_plan.js} +26 -81
  221. package/src/{internal/executing → test}/execution_colors.js +0 -0
  222. package/src/{internal/executing → test}/execution_steps.js +2 -8
  223. package/src/{internal/executing → test}/gc.js +0 -0
  224. package/src/test/logs_file_execution.js +223 -0
  225. package/dist/browser_client/asset-manifest.json +0 -4
  226. package/dist/browser_client/browser_client_fb33eaa4.js +0 -5320
  227. package/dist/browser_client/browser_client_fb33eaa4.js.map +0 -1089
  228. package/dist/build_manifest.js +0 -12
  229. package/dist/compile_proxy/asset-manifest.json +0 -4
  230. package/dist/compile_proxy/compile_proxy.html__inline__20_651d1e7b.js.map +0 -343
  231. package/dist/compile_proxy/compile_proxy_62f952c4.html +0 -2245
  232. package/dist/event_source_client/asset-manifest.json +0 -4
  233. package/dist/event_source_client/event_source_client_69f48287.js +0 -354
  234. package/dist/event_source_client/event_source_client_69f48287.js.map +0 -128
  235. package/dist/redirector/asset-manifest.json +0 -4
  236. package/dist/redirector/redirector.html__inline__12_171e07b4.js.map +0 -349
  237. package/dist/redirector/redirector_8117ec92.html +0 -2290
  238. package/dist/toolbar/asset-manifest.json +0 -13
  239. package/dist/toolbar/assets/compilation.css_7421bd55.map +0 -12
  240. package/dist/toolbar/assets/eventsource.css_c0c71e7b.map +0 -12
  241. package/dist/toolbar/assets/execution.css_f3377c10.map +0 -12
  242. package/dist/toolbar/assets/focus.css_896f3e45.map +0 -12
  243. package/dist/toolbar/assets/light_theme.css_5bff0336.map +0 -12
  244. package/dist/toolbar/assets/overflow_menu.css_9a0fc3d8.map +0 -12
  245. package/dist/toolbar/assets/settings.css_942b5a9e.map +0 -12
  246. package/dist/toolbar/assets/toolbar_main.css_b1c67dd7.map +0 -28
  247. package/dist/toolbar/assets/tooltip.css_a94a8bdd.map +0 -12
  248. package/dist/toolbar/toolbar_b0c9100c.html +0 -4976
  249. package/dist/toolbar/toolbar_main_f54c1bb0.js.map +0 -776
  250. package/dist/toolbar_injector/asset-manifest.json +0 -5
  251. package/dist/toolbar_injector/assets/jsenv_logo_192011c2.svg +0 -95
  252. package/dist/toolbar_injector/toolbar_injector_65b501eb.js +0 -976
  253. package/dist/toolbar_injector/toolbar_injector_65b501eb.js.map +0 -294
  254. package/helpers/import-meta/import-meta-url-commonjs.js +0 -9
  255. package/helpers/import-meta/import-meta-url-global.js +0 -54
  256. package/src/build_project.js +0 -336
  257. package/src/commonjs_to_js_module.js +0 -180
  258. package/src/dev_server.js +0 -302
  259. package/src/execute.js +0 -184
  260. package/src/import_using_child_process.js +0 -68
  261. package/src/internal/browser_client/browser_client.js +0 -220
  262. package/src/internal/browser_client/browser_client_factory.js +0 -144
  263. package/src/internal/browser_client/browser_error_stack_remap.js +0 -43
  264. package/src/internal/browser_client/browser_system.js +0 -216
  265. package/src/internal/browser_client/module_namespace_transfer.js +0 -90
  266. package/src/internal/browser_detection/browser_detection.js +0 -65
  267. package/src/internal/browser_detection/detect_android.js +0 -13
  268. package/src/internal/browser_detection/detect_chrome.js +0 -28
  269. package/src/internal/browser_detection/detect_edge.js +0 -13
  270. package/src/internal/browser_detection/detect_electron.js +0 -1
  271. package/src/internal/browser_detection/detect_firefox.js +0 -17
  272. package/src/internal/browser_detection/detect_internet_explorer.js +0 -14
  273. package/src/internal/browser_detection/detect_ios.js +0 -19
  274. package/src/internal/browser_detection/detect_opera.js +0 -27
  275. package/src/internal/browser_detection/detect_safari.js +0 -13
  276. package/src/internal/browser_detection/user_agent_data.js +0 -25
  277. package/src/internal/browser_detection/util.js +0 -13
  278. package/src/internal/browser_launcher/browser_runtime_profile.js +0 -81
  279. package/src/internal/browser_launcher/execute_html_file.js +0 -355
  280. package/src/internal/browser_launcher/from_playwright.js +0 -320
  281. package/src/internal/browser_launcher/page_errors_and_logs.js +0 -77
  282. package/src/internal/browser_utils/fetch_and_eval.js +0 -27
  283. package/src/internal/browser_utils/fetch_and_eval_using_script.js +0 -47
  284. package/src/internal/browser_utils/fetch_browser.js +0 -34
  285. package/src/internal/browser_utils/fetch_json.js +0 -7
  286. package/src/internal/building/build_logs.js +0 -134
  287. package/src/internal/building/build_stats.js +0 -100
  288. package/src/internal/building/build_url_generator.js +0 -153
  289. package/src/internal/building/build_using_rollup.js +0 -359
  290. package/src/internal/building/css/apply_post_css.js +0 -55
  291. package/src/internal/building/css/jsenv_parse_css.js +0 -260
  292. package/src/internal/building/css/move_css_urls.js +0 -44
  293. package/src/internal/building/css/parse_css_urls.js +0 -38
  294. package/src/internal/building/css/postcss_plugin_url_visitor.js +0 -245
  295. package/src/internal/building/css/replace_css_urls.js +0 -68
  296. package/src/internal/building/global_format/es_to_system.js +0 -34
  297. package/src/internal/building/html/html_node_mutations.js +0 -29
  298. package/src/internal/building/html/html_scan.js +0 -70
  299. package/src/internal/building/html/jsenv_parse_html.js +0 -813
  300. package/src/internal/building/html/minify_html.js +0 -7
  301. package/src/internal/building/import_assertions/css_module.js +0 -43
  302. package/src/internal/building/import_references.js +0 -80
  303. package/src/internal/building/importmap/jsenv_parse_importmap.js +0 -28
  304. package/src/internal/building/js/babel_plugin_inline_worker_imports.js +0 -96
  305. package/src/internal/building/js/jsenv_parse_js.js +0 -122
  306. package/src/internal/building/js/minify_js.js +0 -33
  307. package/src/internal/building/js/transform_worker.js +0 -55
  308. package/src/internal/building/json/jsenv_parse_json.js +0 -11
  309. package/src/internal/building/parse_ressource.js +0 -207
  310. package/src/internal/building/ressource_builder.js +0 -1098
  311. package/src/internal/building/ressource_builder_util.js +0 -194
  312. package/src/internal/building/rollup_plugin_jsenv.js +0 -1965
  313. package/src/internal/building/sort_pathnames.js +0 -10
  314. package/src/internal/building/sourcemap/sourcemap_loader.js +0 -70
  315. package/src/internal/building/svg/jsenv_parse_svg.js +0 -112
  316. package/src/internal/building/url_fetcher.js +0 -85
  317. package/src/internal/building/url_loader.js +0 -127
  318. package/src/internal/building/url_trace.js +0 -229
  319. package/src/internal/building/url_versioning/resolve_import_url_helper.js +0 -12
  320. package/src/internal/building/url_versioning/url_versioning.js +0 -65
  321. package/src/internal/building/webmanifest/jsenv_parse_webmanifest.js +0 -48
  322. package/src/internal/compile_server/commonjs/rollup_plugin_commonjs_named_exports.js +0 -187
  323. package/src/internal/compile_server/compile_file.js +0 -273
  324. package/src/internal/compile_server/compile_server.js +0 -519
  325. package/src/internal/compile_server/compiled_file_service.js +0 -264
  326. package/src/internal/compile_server/html/html_ast.js +0 -534
  327. package/src/internal/compile_server/html/html_source_file_service.js +0 -453
  328. package/src/internal/compile_server/html/jsenv_compile_html.js +0 -674
  329. package/src/internal/compile_server/importmap/jsenv_compile_importmap.js +0 -28
  330. package/src/internal/compile_server/js/ansi_to_html.js +0 -9
  331. package/src/internal/compile_server/js/babelHelper.js +0 -145
  332. package/src/internal/compile_server/js/babel_parse_error.js +0 -9
  333. package/src/internal/compile_server/js/babel_plugin_global_this_as_jsenv_import.js +0 -34
  334. package/src/internal/compile_server/js/babel_plugin_import_assertions.js +0 -121
  335. package/src/internal/compile_server/js/babel_plugin_import_metadata.js +0 -18
  336. package/src/internal/compile_server/js/babel_plugin_import_visitor.js +0 -84
  337. package/src/internal/compile_server/js/babel_plugin_new_stylesheet_as_jsenv_import.js +0 -113
  338. package/src/internal/compile_server/js/babel_plugin_proxy_external_imports.js +0 -31
  339. package/src/internal/compile_server/js/babel_plugin_regenerator_runtime_as_jsenv_import.js +0 -48
  340. package/src/internal/compile_server/js/babel_plugin_replace_expressions.js +0 -101
  341. package/src/internal/compile_server/js/babel_plugin_systemjs_prepend.js +0 -23
  342. package/src/internal/compile_server/js/babel_plugin_transform_import_meta.js +0 -134
  343. package/src/internal/compile_server/js/babel_plugins.js +0 -37
  344. package/src/internal/compile_server/js/generateBabelHelper.js +0 -36
  345. package/src/internal/compile_server/js/js_transformer.js +0 -195
  346. package/src/internal/compile_server/js/jsenv_compile_js.js +0 -62
  347. package/src/internal/compile_server/js/load_babel_plugin_map_from_file.js +0 -49
  348. package/src/internal/compile_server/jsenv_directory/comparison_utils.js +0 -27
  349. package/src/internal/compile_server/jsenv_directory/compilation_result.js +0 -243
  350. package/src/internal/compile_server/jsenv_directory/compilation_result_from_build.js +0 -184
  351. package/src/internal/compile_server/jsenv_directory/compile_asset.js +0 -24
  352. package/src/internal/compile_server/jsenv_directory/compile_context.js +0 -60
  353. package/src/internal/compile_server/jsenv_directory/compile_profile.js +0 -217
  354. package/src/internal/compile_server/jsenv_directory/file_lock_registry.js +0 -24
  355. package/src/internal/compile_server/jsenv_directory/file_lock_registry.test.js +0 -47
  356. package/src/internal/compile_server/jsenv_directory/fs_optimized_for_cache.js +0 -57
  357. package/src/internal/compile_server/jsenv_directory/jsenv_directory.js +0 -183
  358. package/src/internal/compile_server/jsenv_directory/reuse_or_create_compiled_file.js +0 -269
  359. package/src/internal/compile_server/jsenv_directory/update_compile_cache.js +0 -131
  360. package/src/internal/compile_server/jsenv_directory/validate_compile_cache.js +0 -264
  361. package/src/internal/compile_server/sse_service/sse_service.js +0 -369
  362. package/src/internal/coverage/babel_plugin_instrument.js +0 -90
  363. package/src/internal/coverage/coverage_reporter_html_directory.js +0 -37
  364. package/src/internal/coverage/coverage_reporter_json_file.js +0 -22
  365. package/src/internal/coverage/coverage_reporter_text_log.js +0 -20
  366. package/src/internal/coverage/empty_coverage_factory.js +0 -70
  367. package/src/internal/coverage/file_by_file_coverage.js +0 -28
  368. package/src/internal/coverage/istanbul_coverage_composition.js +0 -28
  369. package/src/internal/coverage/istanbul_coverage_map_from_coverage.js +0 -16
  370. package/src/internal/coverage/list_files_not_covered.js +0 -20
  371. package/src/internal/coverage/missing_coverage.js +0 -46
  372. package/src/internal/coverage/report_to_coverage.js +0 -198
  373. package/src/internal/coverage/v8_and_istanbul.js +0 -38
  374. package/src/internal/coverage/v8_coverage_composition.js +0 -23
  375. package/src/internal/coverage/v8_coverage_from_directory.js +0 -86
  376. package/src/internal/coverage/v8_coverage_to_istanbul.js +0 -100
  377. package/src/internal/data_url.js +0 -54
  378. package/src/internal/dev_server/event_source_client/event_source_client.js +0 -63
  379. package/src/internal/dev_server/event_source_client/file_changes.js +0 -82
  380. package/src/internal/dev_server/event_source_client/livereload_preference.js +0 -13
  381. package/src/internal/dev_server/exploring/exploring.css +0 -237
  382. package/src/internal/dev_server/exploring/exploring.html +0 -79
  383. package/src/internal/dev_server/exploring/exploring.js +0 -243
  384. package/src/internal/dev_server/exploring/fetch_exploring_json.js +0 -19
  385. package/src/internal/dev_server/toolbar/compilation/compilation.css +0 -23
  386. package/src/internal/dev_server/toolbar/compilation/toolbar_compilation.js +0 -202
  387. package/src/internal/dev_server/toolbar/eventsource/toolbar_eventsource.js +0 -83
  388. package/src/internal/dev_server/toolbar/execution/toolbar_execution.js +0 -91
  389. package/src/internal/error_stack_remap/install_error_stack_remapping.js +0 -142
  390. package/src/internal/error_stack_remap/remap_call_site.js +0 -315
  391. package/src/internal/error_stack_remap/remap_stack.js +0 -218
  392. package/src/internal/error_stack_remap/stringify_stack.js +0 -9
  393. package/src/internal/executing/launch_and_execute.js +0 -458
  394. package/src/internal/executing/logs_file_execution.js +0 -160
  395. package/src/internal/executing/logs_plan_summary.js +0 -144
  396. package/src/internal/features/browser_feature_detection/browser_feature_detect_dynamic_import.js +0 -20
  397. package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_css.js +0 -23
  398. package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_json.js +0 -25
  399. package/src/internal/features/browser_feature_detection/browser_feature_detect_importmap.js +0 -37
  400. package/src/internal/features/browser_feature_detection/browser_feature_detect_new_stylesheet.js +0 -9
  401. package/src/internal/features/browser_feature_detection/browser_feature_detect_top_level_await.js +0 -14
  402. package/src/internal/features/browser_feature_detection/browser_feature_detection.js +0 -89
  403. package/src/internal/features/browser_feature_detection/compile_proxy.html +0 -27
  404. package/src/internal/features/browser_feature_detection/execute_with_script_module.js +0 -24
  405. package/src/internal/features/features_compat_from_runtime.js +0 -38
  406. package/src/internal/features/features_compat_from_runtime_support.js +0 -31
  407. package/src/internal/features/features_compatibility.js +0 -37
  408. package/src/internal/features/node_feature_detection/feature_detect_dynamic_import.mjs +0 -5
  409. package/src/internal/features/node_feature_detection/feature_detect_top_level_await.mjs +0 -1
  410. package/src/internal/features/node_feature_detection/node_feature_detect_dynamic_import.js +0 -5
  411. package/src/internal/features/node_feature_detection/node_feature_detect_top_level_await.js +0 -16
  412. package/src/internal/features/node_feature_detection/node_feature_detection.js +0 -66
  413. package/src/internal/fetching.js +0 -28
  414. package/src/internal/import_resolution/default_extension.js +0 -40
  415. package/src/internal/import_resolution/import_resolver_importmap.js +0 -64
  416. package/src/internal/import_resolution/import_resolver_node.js +0 -254
  417. package/src/internal/import_resolution/importmap_default.js +0 -37
  418. package/src/internal/jsenv_builds.js +0 -19
  419. package/src/internal/jsenv_params_assertions.js +0 -12
  420. package/src/internal/jsenv_remote_directory.js +0 -156
  421. package/src/internal/logs/byte.js +0 -10
  422. package/src/internal/logs/byte_as_file_size.js +0 -9
  423. package/src/internal/logs/ms_as_duration.js +0 -12
  424. package/src/internal/memoize.js +0 -24
  425. package/src/internal/node_launcher/eval_source.js +0 -6
  426. package/src/internal/node_launcher/fetch_source.js +0 -8
  427. package/src/internal/node_launcher/node_error_stack_remap.js +0 -22
  428. package/src/internal/node_launcher/node_execution_dynamic_import.js +0 -75
  429. package/src/internal/node_launcher/node_execution_performance.js +0 -67
  430. package/src/internal/node_launcher/node_execution_systemjs.js +0 -125
  431. package/src/internal/node_launcher/node_runtime_report.js +0 -77
  432. package/src/internal/node_launcher/node_system.js +0 -192
  433. package/src/internal/node_launcher/perf_node.js +0 -13
  434. package/src/internal/node_launcher/process_options.js +0 -46
  435. package/src/internal/node_launcher/value_install.js +0 -14
  436. package/src/internal/origin_directory_converter.js +0 -62
  437. package/src/internal/promise_race.js +0 -19
  438. package/src/internal/redirector/redirector.html +0 -40
  439. package/src/internal/regexp_escape.js +0 -34
  440. package/src/internal/require.js +0 -3
  441. package/src/internal/response_validation.js +0 -130
  442. package/src/internal/runtime_client/module_registration.js +0 -207
  443. package/src/internal/runtime_client/s.js +0 -864
  444. package/src/internal/runtime_client/s.js.md +0 -1
  445. package/src/internal/runtime_support/jsenv_runtime_support.js +0 -15
  446. package/src/internal/runtime_support/runtime_support.js +0 -70
  447. package/src/internal/semantic_versioning/compare_versions.js +0 -28
  448. package/src/internal/semantic_versioning/highest_version.js +0 -11
  449. package/src/internal/semantic_versioning/is_above.js +0 -5
  450. package/src/internal/semantic_versioning/is_below.js +0 -5
  451. package/src/internal/semantic_versioning/is_equal.js +0 -3
  452. package/src/internal/semantic_versioning/lowest_version.js +0 -11
  453. package/src/internal/semantic_versioning/version_from_value.js +0 -42
  454. package/src/internal/sourcemap_utils.js +0 -112
  455. package/src/internal/template_string_escape.js +0 -20
  456. package/src/internal/url_conversion.js +0 -313
  457. package/src/internal/url_utils.js +0 -33
  458. package/src/internal/url_utils.test.js +0 -39
  459. package/src/internal/windows_file_path_utils.js +0 -16
  460. package/src/jsenv_file_urls.js +0 -35
  461. package/src/jsenv_service_worker_finalizer.js +0 -55
  462. package/src/json_to_js_module.js +0 -13
  463. package/src/node_runtime.js +0 -227
  464. package/src/require_using_child_process.js +0 -67
  465. package/src/text_to_js_module.js +0 -13
@@ -1,2290 +0,0 @@
1
- <!DOCTYPE html><html><head>
2
- <title>Jsenv redirector</title>
3
- <meta name="viewport" content="width=device-width, initial-scale=1">
4
- <meta charset="utf-8">
5
-
6
- <script id="jsenv_inject_systemjs">/*
7
- * SJS 6.11.0
8
- * Minimal SystemJS Build
9
- */
10
- (function () {
11
-
12
- function errMsg(errCode, msg) {
13
- return (msg || "") + " (SystemJS https://git.io/JvFET#" + errCode + ")";
14
- }
15
-
16
- var hasSymbol = typeof Symbol !== 'undefined';
17
- var hasSelf = typeof self !== 'undefined';
18
- var hasDocument = typeof document !== 'undefined';
19
-
20
- var envGlobal = hasSelf ? self : global;
21
-
22
- var baseUrl;
23
-
24
- if (hasDocument) {
25
- var baseEl = document.querySelector('base[href]');
26
- if (baseEl)
27
- baseUrl = baseEl.href;
28
- }
29
-
30
- if (!baseUrl && typeof location !== 'undefined') {
31
- baseUrl = location.href.split('#')[0].split('?')[0];
32
- var lastSepIndex = baseUrl.lastIndexOf('/');
33
- if (lastSepIndex !== -1)
34
- baseUrl = baseUrl.slice(0, lastSepIndex + 1);
35
- }
36
-
37
- var backslashRegEx = /\\/g;
38
- function resolveIfNotPlainOrUrl (relUrl, parentUrl) {
39
- if (relUrl.indexOf('\\') !== -1)
40
- relUrl = relUrl.replace(backslashRegEx, '/');
41
- // protocol-relative
42
- if (relUrl[0] === '/' && relUrl[1] === '/') {
43
- return parentUrl.slice(0, parentUrl.indexOf(':') + 1) + relUrl;
44
- }
45
- // relative-url
46
- else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
47
- relUrl.length === 1 && (relUrl += '/')) ||
48
- relUrl[0] === '/') {
49
- var parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1);
50
- // Disabled, but these cases will give inconsistent results for deep backtracking
51
- //if (parentUrl[parentProtocol.length] !== '/')
52
- // throw Error('Cannot resolve');
53
- // read pathname from parent URL
54
- // pathname taken to be part after leading "/"
55
- var pathname;
56
- if (parentUrl[parentProtocol.length + 1] === '/') {
57
- // resolving to a :// so we need to read out the auth and host
58
- if (parentProtocol !== 'file:') {
59
- pathname = parentUrl.slice(parentProtocol.length + 2);
60
- pathname = pathname.slice(pathname.indexOf('/') + 1);
61
- }
62
- else {
63
- pathname = parentUrl.slice(8);
64
- }
65
- }
66
- else {
67
- // resolving to :/ so pathname is the /... part
68
- pathname = parentUrl.slice(parentProtocol.length + (parentUrl[parentProtocol.length] === '/'));
69
- }
70
-
71
- if (relUrl[0] === '/')
72
- return parentUrl.slice(0, parentUrl.length - pathname.length - 1) + relUrl;
73
-
74
- // join together and split for removal of .. and . segments
75
- // looping the string instead of anything fancy for perf reasons
76
- // '../../../../../z' resolved to 'x/y' is just 'z'
77
- var segmented = pathname.slice(0, pathname.lastIndexOf('/') + 1) + relUrl;
78
-
79
- var output = [];
80
- var segmentIndex = -1;
81
- for (var i = 0; i < segmented.length; i++) {
82
- // busy reading a segment - only terminate on '/'
83
- if (segmentIndex !== -1) {
84
- if (segmented[i] === '/') {
85
- output.push(segmented.slice(segmentIndex, i + 1));
86
- segmentIndex = -1;
87
- }
88
- }
89
-
90
- // new segment - check if it is relative
91
- else if (segmented[i] === '.') {
92
- // ../ segment
93
- if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {
94
- output.pop();
95
- i += 2;
96
- }
97
- // ./ segment
98
- else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {
99
- i += 1;
100
- }
101
- else {
102
- // the start of a new segment as below
103
- segmentIndex = i;
104
- }
105
- }
106
- // it is the start of a new segment
107
- else {
108
- segmentIndex = i;
109
- }
110
- }
111
- // finish reading out the last segment
112
- if (segmentIndex !== -1)
113
- output.push(segmented.slice(segmentIndex));
114
- return parentUrl.slice(0, parentUrl.length - pathname.length) + output.join('');
115
- }
116
- }
117
-
118
- /*
119
- * Import maps implementation
120
- *
121
- * To make lookups fast we pre-resolve the entire import map
122
- * and then match based on backtracked hash lookups
123
- *
124
- */
125
-
126
- function resolveUrl (relUrl, parentUrl) {
127
- return resolveIfNotPlainOrUrl(relUrl, parentUrl) || (relUrl.indexOf(':') !== -1 ? relUrl : resolveIfNotPlainOrUrl('./' + relUrl, parentUrl));
128
- }
129
-
130
- function resolveAndComposePackages (packages, outPackages, baseUrl, parentMap, parentUrl) {
131
- for (var p in packages) {
132
- var resolvedLhs = resolveIfNotPlainOrUrl(p, baseUrl) || p;
133
- var rhs = packages[p];
134
- // package fallbacks not currently supported
135
- if (typeof rhs !== 'string')
136
- continue;
137
- var mapped = resolveImportMap(parentMap, resolveIfNotPlainOrUrl(rhs, baseUrl) || rhs, parentUrl);
138
- if (!mapped) {
139
- targetWarning('W1', p, rhs);
140
- }
141
- else
142
- outPackages[resolvedLhs] = mapped;
143
- }
144
- }
145
-
146
- function resolveAndComposeImportMap (json, baseUrl, outMap) {
147
- if (json.imports)
148
- resolveAndComposePackages(json.imports, outMap.imports, baseUrl, outMap, null);
149
-
150
- var u;
151
- for (u in json.scopes || {}) {
152
- var resolvedScope = resolveUrl(u, baseUrl);
153
- resolveAndComposePackages(json.scopes[u], outMap.scopes[resolvedScope] || (outMap.scopes[resolvedScope] = {}), baseUrl, outMap, resolvedScope);
154
- }
155
-
156
- for (u in json.depcache || {})
157
- outMap.depcache[resolveUrl(u, baseUrl)] = json.depcache[u];
158
-
159
- for (u in json.integrity || {})
160
- outMap.integrity[resolveUrl(u, baseUrl)] = json.integrity[u];
161
- }
162
-
163
- function getMatch (path, matchObj) {
164
- if (matchObj[path])
165
- return path;
166
- var sepIndex = path.length;
167
- do {
168
- var segment = path.slice(0, sepIndex + 1);
169
- if (segment in matchObj)
170
- return segment;
171
- } while ((sepIndex = path.lastIndexOf('/', sepIndex - 1)) !== -1)
172
- }
173
-
174
- function applyPackages (id, packages) {
175
- var pkgName = getMatch(id, packages);
176
- if (pkgName) {
177
- var pkg = packages[pkgName];
178
- if (pkg === null) return;
179
- if (id.length > pkgName.length && pkg[pkg.length - 1] !== '/') {
180
- targetWarning('W2', pkgName, pkg);
181
- }
182
- else
183
- return pkg + id.slice(pkgName.length);
184
- }
185
- }
186
-
187
- function targetWarning (code, match, target, msg) {
188
- console.warn(errMsg(code, [target, match].join(', ') ));
189
- }
190
-
191
- function resolveImportMap (importMap, resolvedOrPlain, parentUrl) {
192
- var scopes = importMap.scopes;
193
- var scopeUrl = parentUrl && getMatch(parentUrl, scopes);
194
- while (scopeUrl) {
195
- var packageResolution = applyPackages(resolvedOrPlain, scopes[scopeUrl]);
196
- if (packageResolution)
197
- return packageResolution;
198
- scopeUrl = getMatch(scopeUrl.slice(0, scopeUrl.lastIndexOf('/')), scopes);
199
- }
200
- return applyPackages(resolvedOrPlain, importMap.imports) || resolvedOrPlain.indexOf(':') !== -1 && resolvedOrPlain;
201
- }
202
-
203
- /*
204
- * SystemJS Core
205
- *
206
- * Provides
207
- * - System.import
208
- * - System.register support for
209
- * live bindings, function hoisting through circular references,
210
- * reexports, dynamic import, import.meta.url, top-level await
211
- * - System.getRegister to get the registration
212
- * - Symbol.toStringTag support in Module objects
213
- * - Hookable System.createContext to customize import.meta
214
- * - System.onload(err, id, deps) handler for tracing / hot-reloading
215
- *
216
- * Core comes with no System.prototype.resolve or
217
- * System.prototype.instantiate implementations
218
- */
219
-
220
- var toStringTag = hasSymbol && Symbol.toStringTag;
221
- var REGISTRY = hasSymbol ? Symbol() : '@';
222
-
223
- function SystemJS () {
224
- this[REGISTRY] = {};
225
- }
226
-
227
- var systemJSPrototype = SystemJS.prototype;
228
-
229
- systemJSPrototype.import = function (id, parentUrl) {
230
- var loader = this;
231
- return Promise.resolve(loader.prepareImport())
232
- .then(function() {
233
- return loader.resolve(String(id), parentUrl);
234
- })
235
- .then(function (id) {
236
- var load = getOrCreateLoad(loader, id);
237
- return load.C || topLevelLoad(loader, load);
238
- });
239
- };
240
-
241
- // Hookable createContext function -> allowing eg custom import meta
242
- systemJSPrototype.createContext = function (parentId) {
243
- var loader = this;
244
- return {
245
- url: parentId,
246
- resolve: function (id, parentUrl) {
247
- return Promise.resolve(loader.resolve(id, parentUrl || parentId));
248
- }
249
- };
250
- };
251
- function loadToId (load) {
252
- return load.id;
253
- }
254
- function triggerOnload (loader, load, err, isErrSource) {
255
- loader.onload(err, load.id, load.d && load.d.map(loadToId), !!isErrSource);
256
- if (err)
257
- throw err;
258
- }
259
-
260
- var lastRegister;
261
- systemJSPrototype.register = function (deps, declare) {
262
- lastRegister = [deps, declare];
263
- };
264
-
265
- /*
266
- * getRegister provides the last anonymous System.register call
267
- */
268
- systemJSPrototype.getRegister = function () {
269
- var _lastRegister = lastRegister;
270
- lastRegister = undefined;
271
- return _lastRegister;
272
- };
273
-
274
- function getOrCreateLoad (loader, id, firstParentUrl) {
275
- var load = loader[REGISTRY][id];
276
- if (load)
277
- return load;
278
-
279
- var importerSetters = [];
280
- var ns = Object.create(null);
281
- if (toStringTag)
282
- Object.defineProperty(ns, toStringTag, { value: 'Module' });
283
-
284
- var instantiatePromise = Promise.resolve()
285
- .then(function () {
286
- return loader.instantiate(id, firstParentUrl);
287
- })
288
- .then(function (registration) {
289
- if (!registration)
290
- throw Error(errMsg(2, id ));
291
- function _export (name, value) {
292
- // note if we have hoisted exports (including reexports)
293
- load.h = true;
294
- var changed = false;
295
- if (typeof name === 'string') {
296
- if (!(name in ns) || ns[name] !== value) {
297
- ns[name] = value;
298
- changed = true;
299
- }
300
- }
301
- else {
302
- for (var p in name) {
303
- var value = name[p];
304
- if (!(p in ns) || ns[p] !== value) {
305
- ns[p] = value;
306
- changed = true;
307
- }
308
- }
309
-
310
- if (name && name.__esModule) {
311
- ns.__esModule = name.__esModule;
312
- }
313
- }
314
- if (changed)
315
- for (var i = 0; i < importerSetters.length; i++) {
316
- var setter = importerSetters[i];
317
- if (setter) setter(ns);
318
- }
319
- return value;
320
- }
321
- var declared = registration[1](_export, registration[1].length === 2 ? {
322
- import: function (importId) {
323
- return loader.import(importId, id);
324
- },
325
- meta: loader.createContext(id)
326
- } : undefined);
327
- load.e = declared.execute || function () {};
328
- return [registration[0], declared.setters || []];
329
- }, function (err) {
330
- load.e = null;
331
- load.er = err;
332
- throw err;
333
- });
334
-
335
- var linkPromise = instantiatePromise
336
- .then(function (instantiation) {
337
- return Promise.all(instantiation[0].map(function (dep, i) {
338
- var setter = instantiation[1][i];
339
- return Promise.resolve(loader.resolve(dep, id))
340
- .then(function (depId) {
341
- var depLoad = getOrCreateLoad(loader, depId, id);
342
- // depLoad.I may be undefined for already-evaluated
343
- return Promise.resolve(depLoad.I)
344
- .then(function () {
345
- if (setter) {
346
- depLoad.i.push(setter);
347
- // only run early setters when there are hoisted exports of that module
348
- // the timing works here as pending hoisted export calls will trigger through importerSetters
349
- if (depLoad.h || !depLoad.I)
350
- setter(depLoad.n);
351
- }
352
- return depLoad;
353
- });
354
- });
355
- }))
356
- .then(function (depLoads) {
357
- load.d = depLoads;
358
- });
359
- });
360
-
361
- // Capital letter = a promise function
362
- return load = loader[REGISTRY][id] = {
363
- id: id,
364
- // importerSetters, the setters functions registered to this dependency
365
- // we retain this to add more later
366
- i: importerSetters,
367
- // module namespace object
368
- n: ns,
369
-
370
- // instantiate
371
- I: instantiatePromise,
372
- // link
373
- L: linkPromise,
374
- // whether it has hoisted exports
375
- h: false,
376
-
377
- // On instantiate completion we have populated:
378
- // dependency load records
379
- d: undefined,
380
- // execution function
381
- e: undefined,
382
-
383
- // On execution we have populated:
384
- // the execution error if any
385
- er: undefined,
386
- // in the case of TLA, the execution promise
387
- E: undefined,
388
-
389
- // On execution, L, I, E cleared
390
-
391
- // Promise for top-level completion
392
- C: undefined,
393
-
394
- // parent instantiator / executor
395
- p: undefined
396
- };
397
- }
398
-
399
- function instantiateAll (loader, load, parent, loaded) {
400
- if (!loaded[load.id]) {
401
- loaded[load.id] = true;
402
- // load.L may be undefined for already-instantiated
403
- return Promise.resolve(load.L)
404
- .then(function () {
405
- if (!load.p || load.p.e === null)
406
- load.p = parent;
407
- return Promise.all(load.d.map(function (dep) {
408
- return instantiateAll(loader, dep, parent, loaded);
409
- }));
410
- })
411
- .catch(function (err) {
412
- if (load.er)
413
- throw err;
414
- load.e = null;
415
- throw err;
416
- });
417
- }
418
- }
419
-
420
- function topLevelLoad (loader, load) {
421
- return load.C = instantiateAll(loader, load, load, {})
422
- .then(function () {
423
- return postOrderExec(loader, load, {});
424
- })
425
- .then(function () {
426
- return load.n;
427
- });
428
- }
429
-
430
- // the closest we can get to call(undefined)
431
- var nullContext = Object.freeze(Object.create(null));
432
-
433
- // returns a promise if and only if a top-level await subgraph
434
- // throws on sync errors
435
- function postOrderExec (loader, load, seen) {
436
- if (seen[load.id])
437
- return;
438
- seen[load.id] = true;
439
-
440
- if (!load.e) {
441
- if (load.er)
442
- throw load.er;
443
- if (load.E)
444
- return load.E;
445
- return;
446
- }
447
-
448
- // deps execute first, unless circular
449
- var depLoadPromises;
450
- load.d.forEach(function (depLoad) {
451
- try {
452
- var depLoadPromise = postOrderExec(loader, depLoad, seen);
453
- if (depLoadPromise)
454
- (depLoadPromises = depLoadPromises || []).push(depLoadPromise);
455
- }
456
- catch (err) {
457
- load.e = null;
458
- load.er = err;
459
- throw err;
460
- }
461
- });
462
- if (depLoadPromises)
463
- return Promise.all(depLoadPromises).then(doExec);
464
-
465
- return doExec();
466
-
467
- function doExec () {
468
- try {
469
- var execPromise = load.e.call(nullContext);
470
- if (execPromise) {
471
- execPromise = execPromise.then(function () {
472
- load.C = load.n;
473
- load.E = null; // indicates completion
474
- if (!true) ;
475
- }, function (err) {
476
- load.er = err;
477
- load.E = null;
478
- if (!true) ;
479
- throw err;
480
- });
481
- return load.E = execPromise;
482
- }
483
- // (should be a promise, but a minify optimization to leave out Promise.resolve)
484
- load.C = load.n;
485
- load.L = load.I = undefined;
486
- }
487
- catch (err) {
488
- load.er = err;
489
- throw err;
490
- }
491
- finally {
492
- load.e = null;
493
- }
494
- }
495
- }
496
-
497
- envGlobal.System = new SystemJS();
498
-
499
- /*
500
- * SystemJS browser attachments for script and import map processing
501
- */
502
-
503
- var importMapPromise = Promise.resolve();
504
- var importMap = { imports: {}, scopes: {}, depcache: {}, integrity: {} };
505
- systemJSPrototype.importMap = importMap;
506
- systemJSPrototype.baseUrl = baseUrl;
507
-
508
- // Scripts are processed immediately, on the first System.import, and on DOMReady.
509
- // Import map scripts are processed only once (by being marked) and in order for each phase.
510
- // This is to avoid using DOM mutation observers in core, although that would be an alternative.
511
- var processFirst = hasDocument;
512
- systemJSPrototype.prepareImport = function (doProcessScripts) {
513
- if (processFirst || doProcessScripts) {
514
- processScripts();
515
- processFirst = false;
516
- }
517
- return importMapPromise;
518
- };
519
- if (hasDocument) {
520
- processScripts();
521
- window.addEventListener('DOMContentLoaded', processScripts);
522
- }
523
-
524
- function processScripts () {
525
- [].forEach.call(document.querySelectorAll('script'), function (script) {
526
- if (script.sp) // sp marker = systemjs processed
527
- return;
528
- // TODO: deprecate systemjs-module in next major now that we have auto import
529
- if (script.type === 'systemjs-module') {
530
- script.sp = true;
531
- if (!script.src)
532
- return;
533
- System.import(script.src.slice(0, 7) === 'import:' ? script.src.slice(7) : resolveUrl(script.src, baseUrl)).catch(function (e) {
534
- // if there is a script load error, dispatch an "error" event
535
- // on the script tag.
536
- if (e.message.indexOf('https://git.io/JvFET#3') > -1) {
537
- var event = document.createEvent('Event');
538
- event.initEvent('error', false, false);
539
- script.dispatchEvent(event);
540
- }
541
- return Promise.reject(e);
542
- });
543
- }
544
- else if (script.type === 'systemjs-importmap') {
545
- script.sp = true;
546
- var fetchPromise = script.src ? fetch(script.src, { integrity: script.integrity }).then(function (res) {
547
- if (!res.ok)
548
- throw Error( res.status );
549
- return res.text();
550
- }).catch(function (err) {
551
- err.message = errMsg('W4', script.src ) + '\n' + err.message;
552
- console.warn(err);
553
- if (typeof script.onerror === 'function') {
554
- script.onerror();
555
- }
556
- return '{}';
557
- }) : script.innerHTML;
558
- importMapPromise = importMapPromise.then(function () {
559
- return fetchPromise;
560
- }).then(function (text) {
561
- extendImportMap(importMap, text, script.src || baseUrl);
562
- return importMap
563
- });
564
- }
565
- });
566
- }
567
-
568
- function extendImportMap (importMap, newMapText, newMapUrl) {
569
- var newMap = {};
570
- try {
571
- newMap = JSON.parse(newMapText);
572
- } catch (err) {
573
- console.warn(Error(( errMsg('W5') )));
574
- }
575
- resolveAndComposeImportMap(newMap, newMapUrl, importMap);
576
- }
577
- System.extendImportMap = extendImportMap
578
-
579
- /*
580
- * Script instantiation loading
581
- */
582
-
583
- if (hasDocument) {
584
- window.addEventListener('error', function (evt) {
585
- lastWindowErrorUrl = evt.filename;
586
- lastWindowError = evt.error;
587
- });
588
- var baseOrigin = location.origin;
589
- }
590
-
591
- systemJSPrototype.createScript = function (url) {
592
- var script = document.createElement('script');
593
- script.async = true;
594
- // Only add cross origin for actual cross origin
595
- // this is because Safari triggers for all
596
- // - https://bugs.webkit.org/show_bug.cgi?id=171566
597
- if (url.indexOf(baseOrigin + '/'))
598
- script.crossOrigin = 'anonymous';
599
- var integrity = importMap.integrity[url];
600
- if (integrity)
601
- script.integrity = integrity;
602
- script.src = url;
603
- return script;
604
- };
605
-
606
- // Auto imports -> script tags can be inlined directly for load phase
607
- var lastAutoImportDeps, lastAutoImportTimeout;
608
- var autoImportCandidates = {};
609
- var systemRegister = systemJSPrototype.register;
610
- var inlineScriptCount = 0;
611
- systemJSPrototype.register = function (deps, declare, autoUrl) {
612
- if (hasDocument && document.readyState === 'loading' && typeof deps !== 'string') {
613
- var scripts = document.querySelectorAll('script[src]');
614
- var lastScript = scripts[scripts.length - 1];
615
- var lastAutoImportUrl
616
- lastAutoImportDeps = deps;
617
- if (lastScript && lastScript.src) {
618
- lastAutoImportUrl = lastScript.src;
619
- }
620
- else if (autoUrl) {
621
- lastAutoImportUrl = autoUrl
622
- }
623
- else {
624
- inlineScriptCount++
625
- lastAutoImportUrl = document.location.href + "__inline_script__" + inlineScriptCount;
626
- }
627
- // if this is already a System load, then the instantiate has already begun
628
- // so this re-import has no consequence
629
- var loader = this;
630
- lastAutoImportTimeout = setTimeout(function () {
631
- autoImportCandidates[lastAutoImportUrl] = [deps, declare];
632
- loader.import(lastAutoImportUrl);
633
- });
634
- }
635
- else {
636
- lastAutoImportDeps = undefined;
637
- }
638
- return systemRegister.call(this, deps, declare);
639
- };
640
-
641
- var lastWindowErrorUrl, lastWindowError;
642
- systemJSPrototype.instantiate = function (url, firstParentUrl) {
643
- var autoImportRegistration = autoImportCandidates[url];
644
- if (autoImportRegistration) {
645
- delete autoImportCandidates[url];
646
- return autoImportRegistration;
647
- }
648
- var loader = this;
649
- return Promise.resolve(systemJSPrototype.createScript(url)).then(function (script) {
650
- return new Promise(function (resolve, reject) {
651
- script.addEventListener('error', function () {
652
- reject(Error(errMsg(3, [url, firstParentUrl].join(', ') )));
653
- });
654
- script.addEventListener('load', function () {
655
- document.head.removeChild(script);
656
- // Note that if an error occurs that isn't caught by this if statement,
657
- // that getRegister will return null and a "did not instantiate" error will be thrown.
658
- if (lastWindowErrorUrl === url) {
659
- reject(lastWindowError);
660
- }
661
- else {
662
- var register = loader.getRegister(url);
663
- // Clear any auto import registration for dynamic import scripts during load
664
- if (register && register[0] === lastAutoImportDeps)
665
- clearTimeout(lastAutoImportTimeout);
666
- resolve(register);
667
- }
668
- });
669
- document.head.appendChild(script);
670
- });
671
- });
672
- };
673
-
674
- /*
675
- * Fetch loader, sets up shouldFetch and fetch hooks
676
- */
677
- systemJSPrototype.shouldFetch = function () {
678
- return false;
679
- };
680
- if (typeof fetch !== 'undefined')
681
- systemJSPrototype.fetch = fetch;
682
-
683
- var instantiate = systemJSPrototype.instantiate;
684
- var jsContentTypeRegEx = /^(text|application)\/(x-)?javascript(;|$)/;
685
- systemJSPrototype.instantiate = function (url, parent) {
686
- var loader = this;
687
- if (!this.shouldFetch(url))
688
- return instantiate.apply(this, arguments);
689
- return this.fetch(url, {
690
- credentials: 'same-origin',
691
- integrity: importMap.integrity[url]
692
- })
693
- .then(function (res) {
694
- if (!res.ok)
695
- throw Error(errMsg(7, [res.status, res.statusText, url, parent].join(', ') ));
696
- var contentType = res.headers.get('content-type');
697
- if (!contentType || !jsContentTypeRegEx.test(contentType))
698
- throw Error(errMsg(4, contentType ));
699
- return res.text().then(function (source) {
700
- if (source.indexOf('//# sourceURL=') < 0)
701
- source += '\n//# sourceURL=' + url;
702
- (0, eval)(source);
703
- return loader.getRegister(url);
704
- });
705
- });
706
- };
707
-
708
- systemJSPrototype.resolve = function (id, parentUrl) {
709
- parentUrl = parentUrl || !true || baseUrl;
710
- return resolveImportMap(( importMap), resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl) || throwUnresolved(id, parentUrl);
711
- };
712
-
713
- function throwUnresolved (id, parentUrl) {
714
- throw Error(errMsg(8, [id, parentUrl].join(', ') ));
715
- }
716
-
717
- var systemInstantiate = systemJSPrototype.instantiate;
718
- systemJSPrototype.instantiate = function (url, firstParentUrl) {
719
- var preloads = ( importMap).depcache[url];
720
- if (preloads) {
721
- for (var i = 0; i < preloads.length; i++)
722
- getOrCreateLoad(this, this.resolve(preloads[i], url), url);
723
- }
724
- return systemInstantiate.call(this, url, firstParentUrl);
725
- };
726
-
727
- /*
728
- * Supports loading System.register in workers
729
- */
730
-
731
- if (hasSelf && typeof importScripts === 'function') {
732
- systemJSPrototype.instantiate = function (url) {
733
- var loader = this;
734
- return self.fetch(url, {
735
- credentials: 'same-origin',
736
- }).then(function (response) {
737
- if (!response.ok) {
738
- throw Error(errMsg(7, [response.status, response.statusText, url].join(', ') ));
739
- }
740
- return response.text()
741
- }).then(function (source) {
742
- if (source.indexOf('//# sourceURL=') < 0) source += '\n//# sourceURL=' + url;
743
- (0, eval)(source);
744
- return loader.getRegister(url);
745
- })
746
- };
747
- }
748
-
749
- }());
750
-
751
- (function(){
752
- var envGlobal = typeof self !== 'undefined' ? self : global;
753
- var System = envGlobal.System;
754
-
755
- var registerRegistry = Object.create(null)
756
- var register = System.register;
757
- System.registerRegistry = registerRegistry;
758
- System.register = function (name, deps, declare) {
759
- if (typeof name !== 'string') return register.apply(this, arguments);
760
- var define = [deps, declare];
761
- return System.prepareImport().then(function () {
762
- var url = System.resolve(`./${name}`);
763
- registerRegistry[url] = define;
764
- return register.call(System, deps, declare, url);
765
- })
766
- };
767
-
768
- var instantiate = System.instantiate;
769
- System.instantiate = function (url, firstParentUrl) {
770
- var result = registerRegistry[url];
771
-
772
- if (result) {
773
- registerRegistry[url] = null;
774
- return result;
775
- } else {
776
- return instantiate.call(this, url, firstParentUrl);
777
- }
778
- };
779
-
780
- var getRegister = System.getRegister;
781
- System.getRegister = function (url) {
782
- // Calling getRegister() because other extras need to know it was called so they can perform side effects
783
- var register = getRegister.call(this, url);
784
- var result = registerRegistry[url] || register;
785
- return result;
786
- };
787
- }());
788
-
789
- (function () {
790
- // worker or service worker
791
- if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {
792
- var importMapFromParentPromise = new Promise((resolve) => {
793
- var importmapMessageCallback = function (e) {
794
- if (e.data === "__importmap_init__") {
795
- self.removeEventListener("message", importmapMessageCallback)
796
- e.ports[0].onmessage = (message) => {
797
- resolve(message.data)
798
- }
799
- e.ports[0].postMessage('__importmap_request__')
800
- }
801
- };
802
- self.addEventListener("message", importmapMessageCallback)
803
- })
804
- // var prepareImport = System.prepareImport
805
- System.prepareImport = function () {
806
- return importMapFromParentPromise.then(function (importmap) {
807
- System.extendImportMap(System.importMap, JSON.stringify(importmap), System.baseUrl)
808
- })
809
- }
810
-
811
- // auto import first register
812
- var messageEvents = []
813
- var messageCallback = (event) => {
814
- messageEvents.push(event)
815
- }
816
- self.addEventListener('message', messageCallback)
817
- var register = System.register;
818
- System.register = function(deps, declare) {
819
- System.register = register;
820
- System.registerRegistry[self.location.href] = [deps, declare];
821
- return System.import(self.location.href).then((result) => {
822
- self.removeEventListener('message', messageCallback)
823
- messageEvents.forEach((messageEvent) => {
824
- self.dispatchEvent(messageEvent)
825
- })
826
- messageEvents = null
827
- return result
828
- })
829
- }
830
- }
831
- else if (typeof window === 'object') {
832
- var WorkerConstructor = window.Worker;
833
- if (typeof WorkerConstructor === 'function') {
834
- window.Worker = function (url, options) {
835
- var worker = new WorkerConstructor(url, options);
836
- var importmapChannel = new MessageChannel();
837
- importmapChannel.port1.onmessage = function (message) {
838
- System.prepareImport().then(function (importmap) {
839
- message.target.postMessage(importmap);
840
- });
841
- }
842
- worker.postMessage('__importmap_init__', [importmapChannel.port2]);
843
- return worker
844
- }
845
- }
846
-
847
- var serviceWorker = navigator.serviceWorker;
848
- if (serviceWorker) {
849
- var register = serviceWorker.register;
850
- serviceWorker.register = function(url, options) {
851
- var registrationPromise = register.call(this, url, options);
852
- registrationPromise.then(function(registration) {
853
- var installing = registration.installing;
854
- var waiting = registration.waiting;
855
- var active = registration.active;
856
- var worker = installing || waiting || active;
857
- var importmapChannel = new MessageChannel();
858
- importmapChannel.port1.onmessage = function (message) {
859
- System.prepareImport().then(function (importmap) {
860
- message.target.postMessage(importmap)
861
- });
862
- }
863
- worker.postMessage('__importmap_init__', [importmapChannel.port2]);
864
- })
865
- return registrationPromise
866
- }
867
- }
868
- }
869
- }());</script>
870
- </head>
871
-
872
- <body>
873
- <script type="systemjs-importmap">{
874
- "imports": {}
875
- }</script>
876
- <script>System.register("redirector.html__inline__12.js", [], function () {
877
- 'use strict';
878
-
879
- return {
880
- execute: function () {
881
- var _defineProperty = function (obj, key, value) {
882
- // Shortcircuit the slow defineProperty path when possible.
883
- // We are trying to avoid issues where setters defined on the
884
- // prototype cause side effects under the fast path of simple
885
- // assignment. By checking for existence of the property with
886
- // the in operator, we can optimize most of this overhead away.
887
- if (key in obj) {
888
- Object.defineProperty(obj, key, {
889
- value: value,
890
- enumerable: true,
891
- configurable: true,
892
- writable: true
893
- });
894
- } else {
895
- obj[key] = value;
896
- }
897
-
898
- return obj;
899
- }; // filters on symbol properties only. Returned string properties are always
900
- // enumerable. It is good to use in objectSpread.
901
-
902
-
903
- function ownKeys(object, enumerableOnly) {
904
- var keys = Object.keys(object);
905
-
906
- if (Object.getOwnPropertySymbols) {
907
- var symbols = Object.getOwnPropertySymbols(object);
908
-
909
- if (enumerableOnly) {
910
- symbols = symbols.filter(function (sym) {
911
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
912
- });
913
- }
914
-
915
- keys.push.apply(keys, symbols);
916
- }
917
-
918
- return keys;
919
- }
920
-
921
- function _objectSpread2(target) {
922
- for (var i = 1; i < arguments.length; i++) {
923
- var source = arguments[i] != null ? arguments[i] : {};
924
-
925
- if (i % 2) {
926
- ownKeys(Object(source), true).forEach(function (key) {
927
- _defineProperty(target, key, source[key]);
928
- });
929
- } else if (Object.getOwnPropertyDescriptors) {
930
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
931
- } else {
932
- ownKeys(Object(source)).forEach(function (key) {
933
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
934
- });
935
- }
936
- }
937
-
938
- return target;
939
- }
940
-
941
- var objectWithoutPropertiesLoose = function (source, excluded) {
942
- if (source === null) return {};
943
- var target = {};
944
- var sourceKeys = Object.keys(source);
945
- var key;
946
- var i;
947
-
948
- for (i = 0; i < sourceKeys.length; i++) {
949
- key = sourceKeys[i];
950
- if (excluded.indexOf(key) >= 0) continue;
951
- target[key] = source[key];
952
- }
953
-
954
- return target;
955
- };
956
-
957
- var _objectWithoutProperties = function (source, excluded) {
958
- if (source === null) return {};
959
- var target = objectWithoutPropertiesLoose(source, excluded);
960
- var key;
961
- var i;
962
-
963
- if (Object.getOwnPropertySymbols) {
964
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
965
-
966
- for (i = 0; i < sourceSymbolKeys.length; i++) {
967
- key = sourceSymbolKeys[i];
968
- if (excluded.indexOf(key) >= 0) continue;
969
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
970
- target[key] = source[key];
971
- }
972
- }
973
-
974
- return target;
975
- };
976
-
977
- var nativeTypeOf = function nativeTypeOf(obj) {
978
- return typeof obj;
979
- };
980
-
981
- var customTypeOf = function customTypeOf(obj) {
982
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
983
- };
984
-
985
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? nativeTypeOf : customTypeOf;
986
-
987
- function _await$9(value, then, direct) {
988
- if (direct) {
989
- return then ? then(value) : value;
990
- }
991
-
992
- if (!value || !value.then) {
993
- value = Promise.resolve(value);
994
- }
995
-
996
- return then ? value.then(then) : value;
997
- }
998
-
999
- function _async$8(f) {
1000
- return function () {
1001
- for (var args = [], i = 0; i < arguments.length; i++) {
1002
- args[i] = arguments[i];
1003
- }
1004
-
1005
- try {
1006
- return Promise.resolve(f.apply(this, args));
1007
- } catch (e) {
1008
- return Promise.reject(e);
1009
- }
1010
- };
1011
- }
1012
-
1013
- function _call$1(body, then, direct) {
1014
- if (direct) {
1015
- return then ? then(body()) : body();
1016
- }
1017
-
1018
- try {
1019
- var result = Promise.resolve(body());
1020
- return then ? result.then(then) : result;
1021
- } catch (e) {
1022
- return Promise.reject(e);
1023
- }
1024
- }
1025
-
1026
- var fetchUsingXHR = _async$8(function (url) {
1027
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
1028
- signal = _ref.signal,
1029
- _ref$method = _ref.method,
1030
- method = _ref$method === void 0 ? "GET" : _ref$method,
1031
- _ref$credentials = _ref.credentials,
1032
- credentials = _ref$credentials === void 0 ? "same-origin" : _ref$credentials,
1033
- _ref$headers = _ref.headers,
1034
- headers = _ref$headers === void 0 ? {} : _ref$headers,
1035
- _ref$body = _ref.body,
1036
- body = _ref$body === void 0 ? null : _ref$body;
1037
-
1038
- var headersPromise = createPromiseAndHooks();
1039
- var bodyPromise = createPromiseAndHooks();
1040
- var xhr = new XMLHttpRequest();
1041
-
1042
- var failure = function failure(error) {
1043
- // if it was already resolved, we must reject the body promise
1044
- if (headersPromise.settled) {
1045
- bodyPromise.reject(error);
1046
- } else {
1047
- headersPromise.reject(error);
1048
- }
1049
- };
1050
-
1051
- var cleanup = function cleanup() {
1052
- xhr.ontimeout = null;
1053
- xhr.onerror = null;
1054
- xhr.onload = null;
1055
- xhr.onreadystatechange = null;
1056
- };
1057
-
1058
- xhr.ontimeout = function () {
1059
- cleanup();
1060
- failure(new Error("xhr request timeout on ".concat(url, ".")));
1061
- };
1062
-
1063
- xhr.onerror = function (error) {
1064
- cleanup(); // unfortunately with have no clue why it fails
1065
- // might be cors for instance
1066
-
1067
- failure(createRequestError(error, {
1068
- url: url
1069
- }));
1070
- };
1071
-
1072
- xhr.onload = function () {
1073
- cleanup();
1074
- bodyPromise.resolve();
1075
- };
1076
-
1077
- signal.addEventListener("abort", function () {
1078
- xhr.abort();
1079
- var abortError = new Error("aborted");
1080
- abortError.name = "AbortError";
1081
- failure(abortError);
1082
- });
1083
-
1084
- xhr.onreadystatechange = function () {
1085
- // https://developer.mozilla.org/fr/docs/Web/API/XMLHttpRequest/readyState
1086
- var readyState = xhr.readyState;
1087
-
1088
- if (readyState === 2) {
1089
- headersPromise.resolve();
1090
- } else if (readyState === 4) {
1091
- cleanup();
1092
- bodyPromise.resolve();
1093
- }
1094
- };
1095
-
1096
- xhr.open(method, url, true);
1097
- Object.keys(headers).forEach(function (key) {
1098
- xhr.setRequestHeader(key, headers[key]);
1099
- });
1100
- xhr.withCredentials = computeWithCredentials({
1101
- credentials: credentials,
1102
- url: url
1103
- });
1104
-
1105
- if ("responseType" in xhr && hasBlob) {
1106
- xhr.responseType = "blob";
1107
- }
1108
-
1109
- xhr.send(body);
1110
- return _await$9(headersPromise, function () {
1111
- // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseURL
1112
- var responseUrl = "responseURL" in xhr ? xhr.responseURL : headers["x-request-url"];
1113
- var responseStatus = xhr.status;
1114
- var responseStatusText = xhr.statusText;
1115
- var responseHeaders = getHeadersFromXHR(xhr);
1116
-
1117
- var readBody = function readBody() {
1118
- return _await$9(bodyPromise, function () {
1119
- var status = xhr.status; // in Chrome on file:/// URLs, status is 0
1120
-
1121
- if (status === 0) {
1122
- responseStatus = 200;
1123
- }
1124
-
1125
- var body = "response" in xhr ? xhr.response : xhr.responseText;
1126
- return {
1127
- responseBody: body,
1128
- responseBodyType: detectBodyType(body)
1129
- };
1130
- });
1131
- };
1132
-
1133
- var text = function text() {
1134
- return _call$1(readBody, function (_ref2) {
1135
- var responseBody = _ref2.responseBody,
1136
- responseBodyType = _ref2.responseBodyType;
1137
-
1138
- if (responseBodyType === "blob") {
1139
- return blobToText(responseBody);
1140
- }
1141
-
1142
- if (responseBodyType === "formData") {
1143
- throw new Error("could not read FormData body as text");
1144
- }
1145
-
1146
- return responseBodyType === "dataView" ? arrayBufferToText(responseBody.buffer) : responseBodyType === "arrayBuffer" ? arrayBufferToText(responseBody) : String(responseBody);
1147
- });
1148
- };
1149
-
1150
- var json = function json() {
1151
- return _call$1(text, JSON.parse);
1152
- };
1153
-
1154
- var blob = _async$8(function () {
1155
- if (!hasBlob) {
1156
- throw new Error("blob not supported");
1157
- }
1158
-
1159
- return _call$1(readBody, function (_ref3) {
1160
- var responseBody = _ref3.responseBody,
1161
- responseBodyType = _ref3.responseBodyType;
1162
-
1163
- if (responseBodyType === "blob") {
1164
- return responseBody;
1165
- }
1166
-
1167
- if (responseBodyType === "dataView") {
1168
- return new Blob([cloneBuffer(responseBody.buffer)]);
1169
- }
1170
-
1171
- if (responseBodyType === "arrayBuffer") {
1172
- return new Blob([cloneBuffer(responseBody)]);
1173
- }
1174
-
1175
- if (responseBodyType === "formData") {
1176
- throw new Error("could not read FormData body as blob");
1177
- }
1178
-
1179
- return new Blob([String(responseBody)]);
1180
- });
1181
- });
1182
-
1183
- var arrayBuffer = function arrayBuffer() {
1184
- return _call$1(readBody, function (_ref4) {
1185
- var responseBody = _ref4.responseBody,
1186
- responseBodyType = _ref4.responseBodyType;
1187
- return responseBodyType === "arrayBuffer" ? cloneBuffer(responseBody) : _call$1(blob, blobToArrayBuffer);
1188
- });
1189
- };
1190
-
1191
- var formData = _async$8(function () {
1192
- if (!hasFormData) {
1193
- throw new Error("formData not supported");
1194
- }
1195
-
1196
- return _call$1(text, textToFormData);
1197
- });
1198
-
1199
- return {
1200
- url: responseUrl,
1201
- status: responseStatus,
1202
- statusText: responseStatusText,
1203
- headers: responseHeaders,
1204
- text: text,
1205
- json: json,
1206
- blob: blob,
1207
- arrayBuffer: arrayBuffer,
1208
- formData: formData
1209
- };
1210
- });
1211
- });
1212
-
1213
- var canUseBlob = function canUseBlob() {
1214
- if (typeof window.FileReader !== "function") return false;
1215
- if (typeof window.Blob !== "function") return false;
1216
-
1217
- try {
1218
- // eslint-disable-next-line no-new
1219
- new Blob();
1220
- return true;
1221
- } catch (e) {
1222
- return false;
1223
- }
1224
- };
1225
-
1226
- var hasBlob = canUseBlob();
1227
- var hasFormData = typeof window.FormData === "function";
1228
- var hasArrayBuffer = typeof window.ArrayBuffer === "function";
1229
- var hasSearchParams = typeof window.URLSearchParams === "function";
1230
-
1231
- var createRequestError = function createRequestError(error, _ref5) {
1232
- var url = _ref5.url;
1233
- return new Error("error during xhr request on ".concat(url, ".\n--- error stack ---\n").concat(error.stack));
1234
- };
1235
-
1236
- var createPromiseAndHooks = function createPromiseAndHooks() {
1237
- var resolve;
1238
- var reject;
1239
- var promise = new Promise(function (res, rej) {
1240
- resolve = function resolve(value) {
1241
- promise.settled = true;
1242
- res(value);
1243
- };
1244
-
1245
- reject = function reject(value) {
1246
- promise.settled = true;
1247
- rej(value);
1248
- };
1249
- });
1250
- promise.resolve = resolve;
1251
- promise.reject = reject;
1252
- return promise;
1253
- }; // https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
1254
-
1255
-
1256
- var computeWithCredentials = function computeWithCredentials(_ref6) {
1257
- var credentials = _ref6.credentials,
1258
- url = _ref6.url;
1259
-
1260
- if (credentials === "same-origin") {
1261
- return originSameAsGlobalOrigin(url);
1262
- }
1263
-
1264
- return credentials === "include";
1265
- };
1266
-
1267
- var originSameAsGlobalOrigin = function originSameAsGlobalOrigin(url) {
1268
- // if we cannot read globalOrigin from window.location.origin, let's consider it's ok
1269
- if ((typeof window === "undefined" ? "undefined" : _typeof(window)) !== "object") return true;
1270
- if (_typeof(window.location) !== "object") return true;
1271
- var globalOrigin = window.location.origin;
1272
- if (globalOrigin === "null") return true;
1273
- return hrefToOrigin(url) === globalOrigin;
1274
- };
1275
-
1276
- var detectBodyType = function detectBodyType(body) {
1277
- if (!body) {
1278
- return "";
1279
- }
1280
-
1281
- if (typeof body === "string") {
1282
- return "text";
1283
- }
1284
-
1285
- if (hasBlob && Blob.prototype.isPrototypeOf(body)) {
1286
- return "blob";
1287
- }
1288
-
1289
- if (hasFormData && FormData.prototype.isPrototypeOf(body)) {
1290
- return "formData";
1291
- }
1292
-
1293
- if (hasArrayBuffer) {
1294
- if (hasBlob && isDataView(body)) {
1295
- return "dataView";
1296
- }
1297
-
1298
- if (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body)) {
1299
- return "arrayBuffer";
1300
- }
1301
- }
1302
-
1303
- if (hasSearchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
1304
- return "searchParams";
1305
- }
1306
-
1307
- return "";
1308
- }; // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders#Example
1309
-
1310
-
1311
- var getHeadersFromXHR = function getHeadersFromXHR(xhr) {
1312
- var headerMap = {};
1313
- var headersString = xhr.getAllResponseHeaders();
1314
- if (headersString === "") return headerMap;
1315
- var lines = headersString.trim().split(/[\r\n]+/);
1316
- lines.forEach(function (line) {
1317
- var parts = line.split(": ");
1318
- var name = parts.shift();
1319
- var value = parts.join(": ");
1320
- headerMap[name.toLowerCase()] = value;
1321
- });
1322
- return headerMap;
1323
- };
1324
-
1325
- var hrefToOrigin = function hrefToOrigin(href) {
1326
- var scheme = hrefToScheme(href);
1327
-
1328
- if (scheme === "file") {
1329
- return "file://";
1330
- }
1331
-
1332
- if (scheme === "http" || scheme === "https") {
1333
- var secondProtocolSlashIndex = scheme.length + "://".length;
1334
- var pathnameSlashIndex = href.indexOf("/", secondProtocolSlashIndex);
1335
- if (pathnameSlashIndex === -1) return href;
1336
- return href.slice(0, pathnameSlashIndex);
1337
- }
1338
-
1339
- return href.slice(0, scheme.length + 1);
1340
- };
1341
-
1342
- var hrefToScheme = function hrefToScheme(href) {
1343
- var colonIndex = href.indexOf(":");
1344
- if (colonIndex === -1) return "";
1345
- return href.slice(0, colonIndex);
1346
- };
1347
-
1348
- var isDataView = function isDataView(obj) {
1349
- return obj && DataView.prototype.isPrototypeOf(obj);
1350
- };
1351
-
1352
- var isArrayBufferView = ArrayBuffer.isView || function () {
1353
- var viewClasses = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"];
1354
- return function (value) {
1355
- return value && viewClasses.includes(Object.prototype.toString.call(value));
1356
- };
1357
- }();
1358
-
1359
- var textToFormData = function textToFormData(text) {
1360
- var form = new FormData();
1361
- text.trim().split("&").forEach(function (bytes) {
1362
- if (bytes) {
1363
- var split = bytes.split("=");
1364
- var name = split.shift().replace(/\+/g, " ");
1365
- var value = split.join("=").replace(/\+/g, " ");
1366
- form.append(decodeURIComponent(name), decodeURIComponent(value));
1367
- }
1368
- });
1369
- return form;
1370
- };
1371
-
1372
- var blobToArrayBuffer = _async$8(function (blob) {
1373
- var reader = new FileReader();
1374
- var promise = fileReaderReady(reader);
1375
- reader.readAsArrayBuffer(blob);
1376
- return promise;
1377
- });
1378
-
1379
- var blobToText = function blobToText(blob) {
1380
- var reader = new FileReader();
1381
- var promise = fileReaderReady(reader);
1382
- reader.readAsText(blob);
1383
- return promise;
1384
- };
1385
-
1386
- var arrayBufferToText = function arrayBufferToText(arrayBuffer) {
1387
- var view = new Uint8Array(arrayBuffer);
1388
- var chars = new Array(view.length);
1389
- var i = 0;
1390
-
1391
- while (i < view.length) {
1392
- chars[i] = String.fromCharCode(view[i]);
1393
- i++;
1394
- }
1395
-
1396
- return chars.join("");
1397
- };
1398
-
1399
- var fileReaderReady = function fileReaderReady(reader) {
1400
- return new Promise(function (resolve, reject) {
1401
- reader.onload = function () {
1402
- resolve(reader.result);
1403
- };
1404
-
1405
- reader.onerror = function () {
1406
- reject(reader.error);
1407
- };
1408
- });
1409
- };
1410
-
1411
- var cloneBuffer = function cloneBuffer(buffer) {
1412
- if (buffer.slice) {
1413
- return buffer.slice(0);
1414
- }
1415
-
1416
- var view = new Uint8Array(buffer.byteLength);
1417
- view.set(new Uint8Array(buffer));
1418
- return view.buffer;
1419
- };
1420
-
1421
- var _excluded = ["mode"];
1422
-
1423
- function _await$8(value, then, direct) {
1424
- if (direct) {
1425
- return then ? then(value) : value;
1426
- }
1427
-
1428
- if (!value || !value.then) {
1429
- value = Promise.resolve(value);
1430
- }
1431
-
1432
- return then ? value.then(then) : value;
1433
- }
1434
-
1435
- function _async$7(f) {
1436
- return function () {
1437
- for (var args = [], i = 0; i < arguments.length; i++) {
1438
- args[i] = arguments[i];
1439
- }
1440
-
1441
- try {
1442
- return Promise.resolve(f.apply(this, args));
1443
- } catch (e) {
1444
- return Promise.reject(e);
1445
- }
1446
- };
1447
- }
1448
-
1449
- var fetchNative = _async$7(function (url) {
1450
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1451
-
1452
- var _ref$mode = _ref.mode,
1453
- mode = _ref$mode === void 0 ? "cors" : _ref$mode,
1454
- options = _objectWithoutProperties(_ref, _excluded);
1455
-
1456
- return _await$8(window.fetch(url, _objectSpread2({
1457
- mode: mode
1458
- }, options)), function (response) {
1459
- return {
1460
- url: response.url,
1461
- status: response.status,
1462
- statusText: "",
1463
- headers: responseToHeaders(response),
1464
- text: function text() {
1465
- return response.text();
1466
- },
1467
- json: function json() {
1468
- return response.json();
1469
- },
1470
- blob: function blob() {
1471
- return response.blob();
1472
- },
1473
- arrayBuffer: function arrayBuffer() {
1474
- return response.arrayBuffer();
1475
- },
1476
- formData: function formData() {
1477
- return response.formData();
1478
- }
1479
- };
1480
- });
1481
- });
1482
-
1483
- var responseToHeaders = function responseToHeaders(response) {
1484
- var headers = {};
1485
- response.headers.forEach(function (value, name) {
1486
- headers[name] = value;
1487
- });
1488
- return headers;
1489
- };
1490
-
1491
- var fetchUrl = typeof window.fetch === "function" && typeof window.AbortController === "function" ? fetchNative : fetchUsingXHR;
1492
-
1493
- function _await$7(value, then, direct) {
1494
- if (direct) {
1495
- return then ? then(value) : value;
1496
- }
1497
-
1498
- if (!value || !value.then) {
1499
- value = Promise.resolve(value);
1500
- }
1501
-
1502
- return then ? value.then(then) : value;
1503
- }
1504
-
1505
- function _async$6(f) {
1506
- return function () {
1507
- for (var args = [], i = 0; i < arguments.length; i++) {
1508
- args[i] = arguments[i];
1509
- }
1510
-
1511
- try {
1512
- return Promise.resolve(f.apply(this, args));
1513
- } catch (e) {
1514
- return Promise.reject(e);
1515
- }
1516
- };
1517
- }
1518
-
1519
- var fetchJson = _async$6(function (url) {
1520
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1521
- return _await$7(fetchUrl(url, options), function (response) {
1522
- return _await$7(response.json());
1523
- });
1524
- });
1525
- /*
1526
- * Prefer window.navigator.userAgentData before resorting to
1527
- * window.navigator.userAgent because of
1528
- * https://blog.chromium.org/2021/09/user-agent-reduction-origin-trial-and-dates.html
1529
- */
1530
-
1531
-
1532
- var detectFromUserAgentData = function detectFromUserAgentData() {
1533
- var userAgentData = window.navigator.userAgentData;
1534
-
1535
- if (!userAgentData) {
1536
- return null;
1537
- }
1538
-
1539
- var brands = userAgentData.brands;
1540
- var i = 0;
1541
-
1542
- while (i < brands.length) {
1543
- var _brands$i = brands[i],
1544
- brand = _brands$i.brand,
1545
- version = _brands$i.version;
1546
- i++;
1547
-
1548
- if (brand === "chromium" || brand === "Google Chrome") {
1549
- return {
1550
- name: "chrome",
1551
- version: version
1552
- };
1553
- }
1554
- }
1555
-
1556
- return null;
1557
- };
1558
-
1559
- var firstMatch = function firstMatch(regexp, string) {
1560
- var match = string.match(regexp);
1561
- return match && match.length > 0 ? match[1] || undefined : undefined;
1562
- };
1563
-
1564
- var secondMatch = function secondMatch(regexp, string) {
1565
- var match = string.match(regexp);
1566
- return match && match.length > 1 ? match[2] || undefined : undefined;
1567
- };
1568
-
1569
- var userAgentToVersion = function userAgentToVersion(userAgent) {
1570
- return firstMatch(/version\/(\d+(\.?_?\d+)+)/i, userAgent) || undefined;
1571
- };
1572
-
1573
- var detectAndroid = function detectAndroid() {
1574
- return navigatorToBrowser$1(window.navigator);
1575
- };
1576
-
1577
- var navigatorToBrowser$1 = function navigatorToBrowser(_ref) {
1578
- var userAgent = _ref.userAgent,
1579
- appVersion = _ref.appVersion;
1580
-
1581
- if (/(android)/i.test(userAgent)) {
1582
- return {
1583
- name: "android",
1584
- version: firstMatch(/Android (\d+(\.?_?\d+)+)/i, appVersion)
1585
- };
1586
- }
1587
-
1588
- return null;
1589
- };
1590
-
1591
- var detectInternetExplorer = function detectInternetExplorer() {
1592
- return userAgentToBrowser$5(window.navigator.userAgent);
1593
- };
1594
-
1595
- var userAgentToBrowser$5 = function userAgentToBrowser(userAgent) {
1596
- if (/msie|trident/i.test(userAgent)) {
1597
- return {
1598
- name: "ie",
1599
- version: firstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, userAgent)
1600
- };
1601
- }
1602
-
1603
- return null;
1604
- };
1605
-
1606
- var detectOpera = function detectOpera() {
1607
- return userAgentToBrowser$4(window.navigator.userAgent);
1608
- };
1609
-
1610
- var userAgentToBrowser$4 = function userAgentToBrowser(userAgent) {
1611
- // opera below 13
1612
- if (/opera/i.test(userAgent)) {
1613
- return {
1614
- name: "opera",
1615
- version: userAgentToVersion(userAgent) || firstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, userAgent)
1616
- };
1617
- } // opera above 13
1618
-
1619
-
1620
- if (/opr\/|opios/i.test(userAgent)) {
1621
- return {
1622
- name: "opera",
1623
- version: firstMatch(/(?:opr|opios)[\s/](\S+)/i, userAgent) || userAgentToVersion(userAgent)
1624
- };
1625
- }
1626
-
1627
- return null;
1628
- };
1629
-
1630
- var detectEdge = function detectEdge() {
1631
- return userAgentToBrowser$3(window.navigator.userAgent);
1632
- };
1633
-
1634
- var userAgentToBrowser$3 = function userAgentToBrowser(userAgent) {
1635
- if (/edg([ea]|ios)/i.test(userAgent)) {
1636
- return {
1637
- name: "edge",
1638
- version: secondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, userAgent)
1639
- };
1640
- }
1641
-
1642
- return null;
1643
- };
1644
-
1645
- var detectFirefox = function detectFirefox() {
1646
- return userAgentToBrowser$2(window.navigator.userAgent);
1647
- };
1648
-
1649
- var userAgentToBrowser$2 = function userAgentToBrowser(userAgent) {
1650
- if (/firefox|iceweasel|fxios/i.test(userAgent)) {
1651
- return {
1652
- name: "firefox",
1653
- version: firstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, userAgent)
1654
- };
1655
- }
1656
-
1657
- return null;
1658
- };
1659
-
1660
- var detectChrome = function detectChrome() {
1661
- return userAgentToBrowser$1(window.navigator.userAgent);
1662
- };
1663
-
1664
- var userAgentToBrowser$1 = function userAgentToBrowser(userAgent) {
1665
- if (/chromium/i.test(userAgent)) {
1666
- return {
1667
- name: "chrome",
1668
- version: firstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, userAgent) || userAgentToVersion(userAgent)
1669
- };
1670
- }
1671
-
1672
- if (/chrome|crios|crmo/i.test(userAgent)) {
1673
- return {
1674
- name: "chrome",
1675
- version: firstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, userAgent)
1676
- };
1677
- }
1678
-
1679
- return null;
1680
- };
1681
-
1682
- var detectSafari = function detectSafari() {
1683
- return userAgentToBrowser(window.navigator.userAgent);
1684
- };
1685
-
1686
- var userAgentToBrowser = function userAgentToBrowser(userAgent) {
1687
- if (/safari|applewebkit/i.test(userAgent)) {
1688
- return {
1689
- name: "safari",
1690
- version: userAgentToVersion(userAgent)
1691
- };
1692
- }
1693
-
1694
- return null;
1695
- };
1696
-
1697
- var detectElectron = function detectElectron() {
1698
- return null;
1699
- }; // TODO
1700
-
1701
-
1702
- var detectIOS = function detectIOS() {
1703
- return navigatorToBrowser(window.navigator);
1704
- };
1705
-
1706
- var navigatorToBrowser = function navigatorToBrowser(_ref) {
1707
- var userAgent = _ref.userAgent,
1708
- appVersion = _ref.appVersion;
1709
-
1710
- if (/iPhone;/.test(userAgent)) {
1711
- return {
1712
- name: "ios",
1713
- version: firstMatch(/OS (\d+(\.?_?\d+)+)/i, appVersion)
1714
- };
1715
- }
1716
-
1717
- if (/iPad;/.test(userAgent)) {
1718
- return {
1719
- name: "ios",
1720
- version: firstMatch(/OS (\d+(\.?_?\d+)+)/i, appVersion)
1721
- };
1722
- }
1723
-
1724
- return null;
1725
- }; // https://github.com/Ahmdrza/detect-browser/blob/26254f85cf92795655a983bfd759d85f3de850c6/detect-browser.js#L1
1726
-
1727
-
1728
- var detectorCompose = function detectorCompose(detectors) {
1729
- return function () {
1730
- var i = 0;
1731
-
1732
- while (i < detectors.length) {
1733
- var _detector = detectors[i];
1734
- i++;
1735
-
1736
- var result = _detector();
1737
-
1738
- if (result) {
1739
- return result;
1740
- }
1741
- }
1742
-
1743
- return null;
1744
- };
1745
- };
1746
-
1747
- var detector = detectorCompose([detectFromUserAgentData, // keep this first
1748
- detectOpera, detectInternetExplorer, detectEdge, detectFirefox, detectChrome, detectSafari, detectElectron, detectIOS, detectAndroid]);
1749
-
1750
- var detectBrowser = function detectBrowser() {
1751
- var _ref = detector() || {},
1752
- _ref$name = _ref.name,
1753
- name = _ref$name === void 0 ? "other" : _ref$name,
1754
- _ref$version = _ref.version,
1755
- version = _ref$version === void 0 ? "unknown" : _ref$version;
1756
-
1757
- return {
1758
- name: normalizeName(name),
1759
- version: normalizeVersion(version)
1760
- };
1761
- };
1762
-
1763
- var normalizeName = function normalizeName(name) {
1764
- return name.toLowerCase();
1765
- };
1766
-
1767
- var normalizeVersion = function normalizeVersion(version) {
1768
- if (version.indexOf(".") > -1) {
1769
- var parts = version.split("."); // remove extraneous .
1770
-
1771
- return parts.slice(0, 3).join(".");
1772
- }
1773
-
1774
- if (version.indexOf("_") > -1) {
1775
- var _parts = version.split("_"); // remove extraneous _
1776
-
1777
-
1778
- return _parts.slice(0, 3).join("_");
1779
- }
1780
-
1781
- return version;
1782
- };
1783
-
1784
- var executeWithScriptModuleInjection = function executeWithScriptModuleInjection(code) {
1785
- var scriptModule = document.createElement("script");
1786
- scriptModule.type = "module";
1787
- var loadPromise = new Promise(function (resolve, reject) {
1788
- scriptModule.onload = function () {
1789
- document.body.removeChild(scriptModule);
1790
- resolve();
1791
- };
1792
-
1793
- scriptModule.onerror = function () {
1794
- document.body.removeChild(scriptModule);
1795
- reject();
1796
- };
1797
-
1798
- document.body.appendChild(scriptModule);
1799
- });
1800
- scriptModule.src = asBase64Url(code);
1801
- return loadPromise;
1802
- };
1803
-
1804
- var asBase64Url = function asBase64Url(text) {
1805
- var mimeType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "application/javascript";
1806
- return "data:".concat(mimeType, ";base64,").concat(window.btoa(text));
1807
- };
1808
-
1809
- function _await$6(value, then, direct) {
1810
- if (direct) {
1811
- return then ? then(value) : value;
1812
- }
1813
-
1814
- if (!value || !value.then) {
1815
- value = Promise.resolve(value);
1816
- }
1817
-
1818
- return then ? value.then(then) : value;
1819
- }
1820
-
1821
- function _catch$4(body, recover) {
1822
- try {
1823
- var result = body();
1824
- } catch (e) {
1825
- return recover(e);
1826
- }
1827
-
1828
- if (result && result.then) {
1829
- return result.then(void 0, recover);
1830
- }
1831
-
1832
- return result;
1833
- }
1834
-
1835
- function _async$5(f) {
1836
- return function () {
1837
- for (var args = [], i = 0; i < arguments.length; i++) {
1838
- args[i] = arguments[i];
1839
- }
1840
-
1841
- try {
1842
- return Promise.resolve(f.apply(this, args));
1843
- } catch (e) {
1844
- return Promise.reject(e);
1845
- }
1846
- };
1847
- }
1848
-
1849
- var supportsImportmap = _async$5(function () {
1850
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1851
- _ref$remote = _ref.remote,
1852
- remote = _ref$remote === void 0 ? true : _ref$remote;
1853
-
1854
- var specifier = asBase64Url("export default false");
1855
- var importMap = {
1856
- imports: _defineProperty({}, specifier, asBase64Url("export default true"))
1857
- };
1858
- var importmapScript = document.createElement("script");
1859
- var importmapString = JSON.stringify(importMap, null, " ");
1860
- importmapScript.type = "importmap";
1861
-
1862
- if (remote) {
1863
- importmapScript.src = "data:application/json;base64,".concat(window.btoa(importmapString));
1864
- } else {
1865
- importmapScript.textContent = importmapString;
1866
- }
1867
-
1868
- document.body.appendChild(importmapScript);
1869
- return _catch$4(function () {
1870
- return _await$6(executeWithScriptModuleInjection("import supported from \"".concat(specifier, "\"; window.__jsenv_runtime_test_importmap__ = supported")), function () {
1871
- document.body.removeChild(importmapScript);
1872
- var supported = window.__jsenv_runtime_test_importmap__;
1873
- delete window.__jsenv_runtime_test_importmap__;
1874
- return supported;
1875
- });
1876
- }, function () {
1877
- document.body.removeChild(importmapScript);
1878
- return false;
1879
- });
1880
- });
1881
-
1882
- function _await$5(value, then, direct) {
1883
- if (direct) {
1884
- return then ? then(value) : value;
1885
- }
1886
-
1887
- if (!value || !value.then) {
1888
- value = Promise.resolve(value);
1889
- }
1890
-
1891
- return then ? value.then(then) : value;
1892
- }
1893
-
1894
- function _catch$3(body, recover) {
1895
- try {
1896
- var result = body();
1897
- } catch (e) {
1898
- return recover(e);
1899
- }
1900
-
1901
- if (result && result.then) {
1902
- return result.then(void 0, recover);
1903
- }
1904
-
1905
- return result;
1906
- }
1907
-
1908
- function _async$4(f) {
1909
- return function () {
1910
- for (var args = [], i = 0; i < arguments.length; i++) {
1911
- args[i] = arguments[i];
1912
- }
1913
-
1914
- try {
1915
- return Promise.resolve(f.apply(this, args));
1916
- } catch (e) {
1917
- return Promise.reject(e);
1918
- }
1919
- };
1920
- }
1921
-
1922
- var supportsDynamicImport = _async$4(function () {
1923
- var moduleSource = asBase64Url("export default 42");
1924
- return _catch$3(function () {
1925
- return _await$5(executeWithScriptModuleInjection("window.__jsenv_runtime_test_dynamic_import__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
1926
- return _await$5(window.__jsenv_runtime_test_dynamic_import__, function (namespace) {
1927
- delete window.__jsenv_runtime_test_dynamic_import__;
1928
- return namespace.default === 42;
1929
- });
1930
- });
1931
- }, function () {
1932
- return false;
1933
- });
1934
- });
1935
-
1936
- function _await$4(value, then, direct) {
1937
- if (direct) {
1938
- return then ? then(value) : value;
1939
- }
1940
-
1941
- if (!value || !value.then) {
1942
- value = Promise.resolve(value);
1943
- }
1944
-
1945
- return then ? value.then(then) : value;
1946
- }
1947
-
1948
- function _catch$2(body, recover) {
1949
- try {
1950
- var result = body();
1951
- } catch (e) {
1952
- return recover(e);
1953
- }
1954
-
1955
- if (result && result.then) {
1956
- return result.then(void 0, recover);
1957
- }
1958
-
1959
- return result;
1960
- }
1961
-
1962
- var supportsTopLevelAwait = function supportsTopLevelAwait() {
1963
- return _await$4(_catch$2(function () {
1964
- return _await$4(executeWithScriptModuleInjection("window.__jsenv_runtime_test_top_level_await__ = await Promise.resolve(42)"), function () {
1965
- var supported = window.__jsenv_runtime_test_top_level_await__ === 42;
1966
- delete window.__jsenv_runtime_test_top_level_await__;
1967
- return supported;
1968
- });
1969
- }, function () {
1970
- return false;
1971
- }));
1972
- };
1973
-
1974
- function _await$3(value, then, direct) {
1975
- if (direct) {
1976
- return then ? then(value) : value;
1977
- }
1978
-
1979
- if (!value || !value.then) {
1980
- value = Promise.resolve(value);
1981
- }
1982
-
1983
- return then ? value.then(then) : value;
1984
- }
1985
-
1986
- function _catch$1(body, recover) {
1987
- try {
1988
- var result = body();
1989
- } catch (e) {
1990
- return recover(e);
1991
- }
1992
-
1993
- if (result && result.then) {
1994
- return result.then(void 0, recover);
1995
- }
1996
-
1997
- return result;
1998
- }
1999
-
2000
- function _async$3(f) {
2001
- return function () {
2002
- for (var args = [], i = 0; i < arguments.length; i++) {
2003
- args[i] = arguments[i];
2004
- }
2005
-
2006
- try {
2007
- return Promise.resolve(f.apply(this, args));
2008
- } catch (e) {
2009
- return Promise.reject(e);
2010
- }
2011
- };
2012
- }
2013
-
2014
- var supportsJsonImportAssertions = _async$3(function () {
2015
- var jsonBase64Url = asBase64Url("42", "application/json");
2016
- var moduleSource = asBase64Url("import data from \"".concat(jsonBase64Url, "\" assert { type: \"json\" }\n export default data"));
2017
- return _catch$1(function () {
2018
- return _await$3(executeWithScriptModuleInjection("window.__jsenv_runtime_test_json_import_assertion__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
2019
- return _await$3(window.__jsenv_runtime_test_json_import_assertion__, function (namespace) {
2020
- var supported = namespace.default === 42;
2021
- delete window.__jsenv_runtime_test_json_import_assertion__;
2022
- return supported;
2023
- });
2024
- });
2025
- }, function () {
2026
- return false;
2027
- });
2028
- });
2029
-
2030
- function _await$2(value, then, direct) {
2031
- if (direct) {
2032
- return then ? then(value) : value;
2033
- }
2034
-
2035
- if (!value || !value.then) {
2036
- value = Promise.resolve(value);
2037
- }
2038
-
2039
- return then ? value.then(then) : value;
2040
- }
2041
-
2042
- function _catch(body, recover) {
2043
- try {
2044
- var result = body();
2045
- } catch (e) {
2046
- return recover(e);
2047
- }
2048
-
2049
- if (result && result.then) {
2050
- return result.then(void 0, recover);
2051
- }
2052
-
2053
- return result;
2054
- }
2055
-
2056
- function _async$2(f) {
2057
- return function () {
2058
- for (var args = [], i = 0; i < arguments.length; i++) {
2059
- args[i] = arguments[i];
2060
- }
2061
-
2062
- try {
2063
- return Promise.resolve(f.apply(this, args));
2064
- } catch (e) {
2065
- return Promise.reject(e);
2066
- }
2067
- };
2068
- }
2069
-
2070
- var supportsCssImportAssertions = _async$2(function () {
2071
- var cssBase64Url = asBase64Url("p { color: red; }", "text/css");
2072
- var moduleSource = asBase64Url("import css from \"".concat(cssBase64Url, "\" assert { type: \"css\" }\n export default css"));
2073
- return _catch(function () {
2074
- return _await$2(executeWithScriptModuleInjection("window.__jsenv_runtime_test_css_import_assertion__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
2075
- return _await$2(window.__jsenv_runtime_test_css_import_assertion__, function (namespace) {
2076
- return namespace.default instanceof CSSStyleSheet;
2077
- });
2078
- });
2079
- }, function () {
2080
- return false;
2081
- });
2082
- });
2083
-
2084
- var supportsNewStylesheet = function supportsNewStylesheet() {
2085
- try {
2086
- // eslint-disable-next-line no-new
2087
- new CSSStyleSheet();
2088
- return true;
2089
- } catch (e) {
2090
- return false;
2091
- }
2092
- };
2093
-
2094
- function _await$1(value, then, direct) {
2095
- if (direct) {
2096
- return then ? then(value) : value;
2097
- }
2098
-
2099
- if (!value || !value.then) {
2100
- value = Promise.resolve(value);
2101
- }
2102
-
2103
- return then ? value.then(then) : value;
2104
- }
2105
-
2106
- function _async$1(f) {
2107
- return function () {
2108
- for (var args = [], i = 0; i < arguments.length; i++) {
2109
- args[i] = arguments[i];
2110
- }
2111
-
2112
- try {
2113
- return Promise.resolve(f.apply(this, args));
2114
- } catch (e) {
2115
- return Promise.reject(e);
2116
- }
2117
- };
2118
- }
2119
-
2120
- function _call(body, then, direct) {
2121
- if (direct) {
2122
- return then ? then(body()) : body();
2123
- }
2124
-
2125
- try {
2126
- var result = Promise.resolve(body());
2127
- return then ? result.then(then) : result;
2128
- } catch (e) {
2129
- return Promise.reject(e);
2130
- }
2131
- }
2132
-
2133
- var scanBrowserRuntimeFeatures = _async$1(function () {
2134
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
2135
- _ref$coverageHandledF = _ref.coverageHandledFromOutside,
2136
- coverageHandledFromOutside = _ref$coverageHandledF === void 0 ? false : _ref$coverageHandledF,
2137
- _ref$forceCompilation = _ref.forceCompilation,
2138
- forceCompilation = _ref$forceCompilation === void 0 ? false : _ref$forceCompilation,
2139
- _ref$forceSource = _ref.forceSource,
2140
- forceSource = _ref$forceSource === void 0 ? false : _ref$forceSource;
2141
-
2142
- var jsenvCompileProfileUrl = "/__jsenv_compile_profile__";
2143
- return _await$1(fetchJson(jsenvCompileProfileUrl), function (_ref2) {
2144
- var jsenvDirectoryRelativeUrl = _ref2.jsenvDirectoryRelativeUrl,
2145
- inlineImportMapIntoHTML = _ref2.inlineImportMapIntoHTML,
2146
- availableCompileIds = _ref2.availableCompileIds;
2147
-
2148
- var _detectBrowser = detectBrowser(),
2149
- name = _detectBrowser.name,
2150
- version = _detectBrowser.version;
2151
-
2152
- return _await$1(detectSupportedFeatures({
2153
- coverageHandledFromOutside: coverageHandledFromOutside,
2154
- inlineImportMapIntoHTML: inlineImportMapIntoHTML
2155
- }), function (featuresReport) {
2156
- var runtimeReport = {
2157
- env: {
2158
- browser: true
2159
- },
2160
- name: name,
2161
- version: version,
2162
- featuresReport: featuresReport,
2163
- forceSource: forceSource,
2164
- forceCompilation: forceCompilation
2165
- };
2166
- return _await$1(fetchJson(jsenvCompileProfileUrl, {
2167
- method: "POST",
2168
- headers: {
2169
- "content-type": "application/json"
2170
- },
2171
- body: JSON.stringify(runtimeReport)
2172
- }), function (_ref3) {
2173
- var compileProfile = _ref3.compileProfile,
2174
- compileId = _ref3.compileId;
2175
- return {
2176
- jsenvDirectoryRelativeUrl: jsenvDirectoryRelativeUrl,
2177
- inlineImportMapIntoHTML: inlineImportMapIntoHTML,
2178
- availableCompileIds: availableCompileIds,
2179
- runtimeReport: runtimeReport,
2180
- compileProfile: compileProfile,
2181
- compileId: compileId
2182
- };
2183
- });
2184
- });
2185
- });
2186
- });
2187
-
2188
- var detectSupportedFeatures = _async$1(function (_ref4) {
2189
- var coverageHandledFromOutside = _ref4.coverageHandledFromOutside,
2190
- inlineImportMapIntoHTML = _ref4.inlineImportMapIntoHTML;
2191
- var featuresReport = {};
2192
- featuresReport["import_http"] = true;
2193
- featuresReport["coverage_js"] = coverageHandledFromOutside; // new CSSStyleSheet
2194
-
2195
- featuresReport["new_stylesheet"] = supportsNewStylesheet(); // importmap
2196
- // start testing importmap support first and not in paralell
2197
- // so that there is not module script loaded beore importmap is injected
2198
- // it would log an error in chrome console and return undefined
2199
-
2200
- return _await$1(supportsImportmap({
2201
- // chrome supports inline but not remote importmap
2202
- // https://github.com/WICG/import-maps/issues/235
2203
- // at this stage we won't know if the html file will use
2204
- // an importmap or not and if that importmap is inline or specified with an src
2205
- // so we should test if browser support local and remote importmap.
2206
- // But there exploring server can inline importmap by transforming html
2207
- // and in that case we can test only the local importmap support
2208
- // so we test importmap support and the remote one
2209
- remote: !inlineImportMapIntoHTML
2210
- }), function (_supportsImportmap) {
2211
- featuresReport.importmap = _supportsImportmap; // dynamic import
2212
-
2213
- return _call(supportsDynamicImport, function (_supportsDynamicImpor) {
2214
- featuresReport["import_dynamic"] = _supportsDynamicImpor; // top level await
2215
-
2216
- return _call(supportsTopLevelAwait, function (_supportsTopLevelAwai) {
2217
- featuresReport["top_level_await"] = _supportsTopLevelAwai; // import assertions
2218
-
2219
- return _call(supportsJsonImportAssertions, function (_supportsJsonImportAs) {
2220
- featuresReport["import_assertion_type_json"] = _supportsJsonImportAs;
2221
- return _call(supportsCssImportAssertions, function (_supportsCssImportAss) {
2222
- featuresReport["import_assertion_type_css"] = _supportsCssImportAss;
2223
- return featuresReport;
2224
- });
2225
- });
2226
- });
2227
- });
2228
- });
2229
- });
2230
-
2231
- function _await(value, then, direct) {
2232
- if (direct) {
2233
- return then ? then(value) : value;
2234
- }
2235
-
2236
- if (!value || !value.then) {
2237
- value = Promise.resolve(value);
2238
- }
2239
-
2240
- return then ? value.then(then) : value;
2241
- }
2242
-
2243
- var redirect = _async(function () {
2244
- var searchParams = new URLSearchParams(window.location.search);
2245
- var redirectTarget = searchParams.get("redirect");
2246
- var forceCompilation = searchParams.get("force_compilation");
2247
- return _await(scanBrowserRuntimeFeatures({
2248
- forceCompilation: forceCompilation === "1"
2249
- }), function (browserRuntimeProfile) {
2250
- var href = "".concat(getDirectoryUrl(browserRuntimeProfile)).concat(redirectTarget); // It's IMPORTANT to use location.replace and NOT location.href = url
2251
- // otherwise it would break the back button
2252
-
2253
- window.location.replace(href);
2254
- });
2255
- });
2256
-
2257
- function _async(f) {
2258
- return function () {
2259
- for (var args = [], i = 0; i < arguments.length; i++) {
2260
- args[i] = arguments[i];
2261
- }
2262
-
2263
- try {
2264
- return Promise.resolve(f.apply(this, args));
2265
- } catch (e) {
2266
- return Promise.reject(e);
2267
- }
2268
- };
2269
- }
2270
-
2271
- var getDirectoryUrl = function getDirectoryUrl(_ref) {
2272
- var jsenvDirectoryRelativeUrl = _ref.jsenvDirectoryRelativeUrl,
2273
- compileId = _ref.compileId;
2274
-
2275
- if (compileId) {
2276
- return "/".concat(jsenvDirectoryRelativeUrl).concat(compileId, "/");
2277
- }
2278
-
2279
- return "/";
2280
- };
2281
-
2282
- redirect();
2283
- }
2284
- };
2285
- });
2286
-
2287
- //# sourceMappingURL=redirector.html__inline__12_171e07b4.js.map</script>
2288
-
2289
-
2290
- </body></html>