tungsten 0.4.11 → 0.4.13

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 (449) hide show
  1. package/dist/.build-complete +1 -1
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/AnyComponent.d.ts.map +1 -1
  4. package/dist/AnyComponent.js +1 -1
  5. package/dist/Components.d.ts.map +1 -1
  6. package/dist/Components.js +25 -23
  7. package/dist/ContentNode.js +2 -2
  8. package/dist/DomPointer.js +1 -1
  9. package/dist/DomRegion.js +3 -3
  10. package/dist/Framework.d.ts +2 -1
  11. package/dist/Framework.d.ts.map +1 -1
  12. package/dist/Framework.js +44 -35
  13. package/dist/FrameworkConfig.d.ts +16 -0
  14. package/dist/FrameworkConfig.d.ts.map +1 -1
  15. package/dist/FunctionComponentStandIn.js +8 -8
  16. package/dist/Instance/Instance.js +12 -12
  17. package/dist/RenderedContentNode.d.ts.map +1 -1
  18. package/dist/RenderedContentNode.js +4 -3
  19. package/dist/RenderingNode.js +2 -2
  20. package/dist/Sass.d.ts.map +1 -1
  21. package/dist/Sass.js +1 -0
  22. package/dist/Script.js +1 -1
  23. package/dist/Servers/DevServer.d.ts.map +1 -1
  24. package/dist/Servers/DevServer.js +33 -32
  25. package/dist/Servers/ProdServer.js +15 -15
  26. package/dist/Servers/StaticSiteServer.js +4 -4
  27. package/dist/Servers/TungstenServer.js +5 -5
  28. package/dist/Servers/devErrorPageAutoRetry.js +1 -1
  29. package/dist/Servers/initStores.js +3 -3
  30. package/dist/Servers/loadEnvsDev.d.ts +1 -1
  31. package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
  32. package/dist/Servers/loadEnvsDev.js +10 -8
  33. package/dist/Servers/routing.d.ts.map +1 -1
  34. package/dist/Servers/routing.js +4 -4
  35. package/dist/Store/Store.js +1 -1
  36. package/dist/Store/TypeSafeStore.js +1 -1
  37. package/dist/Store/createStores.js +2 -2
  38. package/dist/Store/makeStore.js +3 -3
  39. package/dist/Store/registerStore.js +3 -3
  40. package/dist/TElement.js +1 -1
  41. package/dist/TungstenApp.js +9 -5
  42. package/dist/TungstenStyleObject.js +1 -1
  43. package/dist/__deproxy.js +2 -2
  44. package/dist/_client/client.js +3 -3
  45. package/dist/alive.js +1 -1
  46. package/dist/api/getApiRoutes.js +3 -3
  47. package/dist/api/getExport.d.ts.map +1 -1
  48. package/dist/api/getExport.js +5 -4
  49. package/dist/api/getExportDev.js +1 -1
  50. package/dist/appOutput.js +1 -1
  51. package/dist/auth/index.js +2 -2
  52. package/dist/babelPlugins/BabelAddDevCacheBust.d.ts.map +1 -1
  53. package/dist/babelPlugins/BabelAddDevCacheBust.js +4 -2
  54. package/dist/babelPlugins/BabelTransformBindDirect.js +4 -2
  55. package/dist/babelPlugins/BabelTransformBindVar.d.ts.map +1 -1
  56. package/dist/babelPlugins/BabelTransformBindVar.js +3 -3
  57. package/dist/babelPlugins/BabelTransformCjsToEsm.js +1 -1
  58. package/dist/babelPlugins/BabelTransformComponentState.d.ts.map +1 -1
  59. package/dist/babelPlugins/BabelTransformComponentState.js +2 -2
  60. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts +2 -0
  61. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
  62. package/dist/babelPlugins/BabelTransformComponentStyles.js +32 -15
  63. package/dist/babelPlugins/BabelTransformCssImports.d.ts.map +1 -1
  64. package/dist/babelPlugins/BabelTransformCssImports.js +3 -3
  65. package/dist/babelPlugins/BabelTransformDependencyImportsOld.js +1 -1
  66. package/dist/babelPlugins/BabelTransformDeproxyState.d.ts.map +1 -1
  67. package/dist/babelPlugins/BabelTransformDeproxyState.js +1 -1
  68. package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.d.ts.map +1 -1
  69. package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.js +6 -2
  70. package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
  71. package/dist/babelPlugins/BabelTransformPackageImports.js +75 -53
  72. package/dist/babelPlugins/BabelTransformReactive.js +1 -1
  73. package/dist/babelPlugins/BabelTransformReactiveSvelteStyle.js +1 -1
  74. package/dist/babelPlugins/BabelTransformRemoveBlocks.d.ts.map +1 -1
  75. package/dist/babelPlugins/BabelTransformSxyFrameworkImports.js +1 -1
  76. package/dist/babelPlugins/BabelTransformUniqueComponents.js +1 -1
  77. package/dist/babelPlugins/fixImportsInSassErrorMessage.js +1 -1
  78. package/dist/babelPlugins/test.js +1 -1
  79. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.d.ts.map +1 -1
  80. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +5 -4
  81. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.d.ts.map +1 -1
  82. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +3 -2
  83. package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.js +2 -2
  84. package/dist/bin/args.js +2 -2
  85. package/dist/bin/commands/build.js +6 -6
  86. package/dist/bin/commands/buildHelp.js +1 -1
  87. package/dist/bin/commands/clean.js +4 -4
  88. package/dist/bin/commands/compile.d.ts.map +1 -1
  89. package/dist/bin/commands/compile.js +24 -17
  90. package/dist/bin/commands/compileSimplePackage.js +3 -2
  91. package/dist/bin/commands/dev.d.ts.map +1 -1
  92. package/dist/bin/commands/dev.js +16 -9
  93. package/dist/bin/commands/devmon.js +4 -4
  94. package/dist/bin/commands/help.js +2 -2
  95. package/dist/bin/commands/start.js +2 -2
  96. package/dist/bin/commands/static.js +3 -3
  97. package/dist/bin/index.d.ts.map +1 -1
  98. package/dist/bin/index.js +24 -16
  99. package/dist/bin/moduleLoadAnalysis.js +2 -2
  100. package/dist/bin/vendorHook.d.ts +3 -0
  101. package/dist/bin/vendorHook.d.ts.map +1 -0
  102. package/dist/bin/vendorHook.js +34 -0
  103. package/dist/browserStorage.js +6 -4
  104. package/dist/build/babel.user.common.config.d.ts +9 -2
  105. package/dist/build/babel.user.common.config.d.ts.map +1 -1
  106. package/dist/build/babel.user.common.config.js +21 -16
  107. package/dist/build/bundle.d.ts +1 -1
  108. package/dist/build/bundle.d.ts.map +1 -1
  109. package/dist/build/bundle.js +15 -7
  110. package/dist/build/bundleBabelOptions.d.ts +6 -0
  111. package/dist/build/bundleBabelOptions.d.ts.map +1 -0
  112. package/dist/build/bundleBabelOptions.js +23 -0
  113. package/dist/build/combineComponentCss.js +2 -2
  114. package/dist/build/compileJavascript.d.ts +4 -0
  115. package/dist/build/compileJavascript.d.ts.map +1 -1
  116. package/dist/build/compileJavascript.js +174 -103
  117. package/dist/build/compileStyles.js +8 -8
  118. package/dist/build/compileUserApp.d.ts +1 -1
  119. package/dist/build/compileUserApp.d.ts.map +1 -1
  120. package/dist/build/compileUserApp.js +15 -12
  121. package/dist/build/componentStylesCache.d.ts +10 -0
  122. package/dist/build/componentStylesCache.d.ts.map +1 -0
  123. package/dist/build/componentStylesCache.js +54 -0
  124. package/dist/build/copyAssets.js +4 -4
  125. package/dist/build/copyPackageModulesToPackagesFolder.js +4 -4
  126. package/dist/build/copyPublicFiles.js +4 -4
  127. package/dist/build/createClientFiles.js +3 -3
  128. package/dist/build/createInstanceConfigFile.js +2 -2
  129. package/dist/build/createPackageVirtualFileSystems.js +1 -1
  130. package/dist/build/devBundle.js +5 -5
  131. package/dist/build/devBundle.rollup.config.d.ts.map +1 -1
  132. package/dist/build/devBundle.rollup.config.js +0 -1
  133. package/dist/build/frameworkDestLocation.d.ts +1 -0
  134. package/dist/build/frameworkDestLocation.d.ts.map +1 -1
  135. package/dist/build/frameworkDestLocation.js +8 -4
  136. package/dist/build/frameworkStylesheets.js +2 -2
  137. package/dist/build/getAllSxyClientModules.d.ts.map +1 -1
  138. package/dist/build/getAllSxyClientModules.js +4 -28
  139. package/dist/build/getPackageDirForFile.js +1 -1
  140. package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
  141. package/dist/build/getSxyClientPackageAliases.js +4 -2
  142. package/dist/build/getTempDirForAppCompilation.js +1 -1
  143. package/dist/build/makeBabelRawConfig.d.ts +3 -0
  144. package/dist/build/makeBabelRawConfig.d.ts.map +1 -0
  145. package/dist/build/makeBabelRawConfig.js +12 -0
  146. package/dist/build/makeBabelUserDevConfig.d.ts +1 -1
  147. package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
  148. package/dist/build/makeBabelUserDevConfig.js +11 -8
  149. package/dist/build/makeBabelUserProdConfig.d.ts +1 -1
  150. package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
  151. package/dist/build/makeBabelUserProdConfig.js +10 -5
  152. package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
  153. package/dist/build/rollup.user.prod.config.js +13 -11
  154. package/dist/build/rollupExtractComponentStylesheets.js +3 -3
  155. package/dist/build/sassImportParser.js +4 -4
  156. package/dist/build/tallyBabel.d.ts +3 -0
  157. package/dist/build/tallyBabel.d.ts.map +1 -0
  158. package/dist/build/tallyBabel.js +11 -0
  159. package/dist/calculateImportedStaticFileLocations.js +2 -2
  160. package/dist/calledFrom.js +2 -2
  161. package/dist/clone.js +4 -4
  162. package/dist/compat/context.d.ts.map +1 -1
  163. package/dist/compat/forwardRef.js +1 -1
  164. package/dist/compat/index.js +1 -1
  165. package/dist/compat/types.d.ts.map +1 -1
  166. package/dist/componentProxyHandlers.d.ts.map +1 -1
  167. package/dist/componentProxyHandlers.js +8 -12
  168. package/dist/components/Link.js +2 -2
  169. package/dist/components/PopMessages.js +3 -3
  170. package/dist/components/RawHtml.js +2 -2
  171. package/dist/components/Stylesheet.d.ts +1 -2
  172. package/dist/components/Stylesheet.d.ts.map +1 -1
  173. package/dist/components/Stylesheet.js +4 -4
  174. package/dist/components/bindable/BindableCheckbox.d.ts.map +1 -1
  175. package/dist/components/bindable/BindableCheckbox.js +1 -1
  176. package/dist/components/bindable/BindableInput.d.ts.map +1 -1
  177. package/dist/components/bindable/BindableInput.js +1 -1
  178. package/dist/components/bindable/BindableInputNonString.js +1 -1
  179. package/dist/components/bindable/BindableInputString.js +1 -1
  180. package/dist/components/bindable/BindableInputTyped.js +1 -1
  181. package/dist/components/bindable/BindableInputTypedLegacy.d.ts.map +1 -1
  182. package/dist/components/bindable/BindableInputTypedLegacy.js +1 -1
  183. package/dist/components/bindable/BindableRadio.d.ts.map +1 -1
  184. package/dist/components/bindable/BindableRadio.js +1 -1
  185. package/dist/components/bindable/BindableSelect.js +1 -1
  186. package/dist/components/bindable/BindableTextarea.d.ts.map +1 -1
  187. package/dist/components/bindable/BindableTextarea.js +1 -1
  188. package/dist/components/library/RichTextEditor/RichTextEditor.js +10 -10
  189. package/dist/components/library/RichTextEditor/contentTree.js +5 -5
  190. package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.js +2 -2
  191. package/dist/components/library/__StatefulMessage/StatefulMessage.js +2 -2
  192. package/dist/components/library/index.js +2 -2
  193. package/dist/concat.d.ts.map +1 -1
  194. package/dist/concat.js +2 -2
  195. package/dist/copy.d.ts.map +1 -1
  196. package/dist/createElement.js +1 -1
  197. package/dist/createRoutes.d.ts +1 -1
  198. package/dist/createRoutes.d.ts.map +1 -1
  199. package/dist/defaultConfig.d.ts +0 -1
  200. package/dist/defaultConfig.d.ts.map +1 -1
  201. package/dist/defaultConfig.js +2 -2
  202. package/dist/deleteDirs.js +1 -1
  203. package/dist/env/Env.js +2 -2
  204. package/dist/env/addToEnv.js +1 -1
  205. package/dist/env/funcs.js +4 -4
  206. package/dist/env/getEnvSchemas.d.ts +2 -2
  207. package/dist/env/getEnvSchemas.d.ts.map +1 -1
  208. package/dist/env/getEnvSchemas.js +16 -10
  209. package/dist/env/privateEnv.js +2 -2
  210. package/dist/env/privateEnvOrThrow.js +1 -1
  211. package/dist/env/publicEnv.js +1 -1
  212. package/dist/env/publicEnvOrThrow.js +1 -1
  213. package/dist/env/windowGlobalEnvStatement.d.ts.map +1 -1
  214. package/dist/filePathFromUrl.js +1 -1
  215. package/dist/findProjectDir.d.ts.map +1 -1
  216. package/dist/findProjectDir.js +19 -5
  217. package/dist/findUserConfig.js +7 -7
  218. package/dist/fixExtension.d.ts.map +1 -1
  219. package/dist/fixExtension.js +5 -3
  220. package/dist/foreach.js +1 -0
  221. package/dist/frameworkConfigSchema.d.ts +16 -0
  222. package/dist/frameworkConfigSchema.d.ts.map +1 -1
  223. package/dist/frameworkConfigSchema.js +14 -2
  224. package/dist/getComponent.d.ts.map +1 -1
  225. package/dist/getComponent.js +5 -5
  226. package/dist/getComponentDev.d.ts.map +1 -1
  227. package/dist/getComponentDev.js +1 -1
  228. package/dist/getFrameworkDir.js +1 -1
  229. package/dist/getRoutes.d.ts.map +1 -1
  230. package/dist/getRoutes.js +18 -27
  231. package/dist/getRoutesDevs.d.ts.map +1 -1
  232. package/dist/getRoutesDevs.js +1 -1
  233. package/dist/getStackTrace.js +1 -1
  234. package/dist/getUserConfig.js +7 -7
  235. package/dist/glob.d.ts +5 -0
  236. package/dist/glob.d.ts.map +1 -0
  237. package/dist/glob.js +103 -0
  238. package/dist/hasValidKey.js +1 -1
  239. package/dist/helpers/getFetchCompatibleHeaders.js +2 -2
  240. package/dist/helpers/index.js +2 -2
  241. package/dist/hmr/applyHmrModule.js +10 -10
  242. package/dist/hmr/componentIdentity.js +3 -3
  243. package/dist/hmr/instanceRegistry.js +2 -2
  244. package/dist/hooks/clearCurrentComponent.js +1 -1
  245. package/dist/hooks/getCurrentComponent.js +3 -3
  246. package/dist/hooks/index.js +5 -5
  247. package/dist/hooks/setCurrentComponent.js +1 -1
  248. package/dist/hooks/useCallback.js +2 -2
  249. package/dist/hooks/useEffect.js +2 -2
  250. package/dist/hooks/useInstance.js +1 -1
  251. package/dist/hooks/useMemo.js +2 -2
  252. package/dist/hooks/useReducer.d.ts.map +1 -1
  253. package/dist/hooks/useState.d.ts.map +1 -1
  254. package/dist/hooks/useState.js +3 -9
  255. package/dist/hydrate/hydrate.d.ts +1 -1
  256. package/dist/hydrate/hydrate.d.ts.map +1 -1
  257. package/dist/hydrate/hydrate.js +56 -54
  258. package/dist/hydrate/reconcileHydratedAttributes.js +5 -5
  259. package/dist/index.js +2 -2
  260. package/dist/indexInner.d.ts +1 -1
  261. package/dist/indexInner.d.ts.map +1 -1
  262. package/dist/indexInner.js +45 -45
  263. package/dist/innerHtmlFromProps.js +1 -1
  264. package/dist/isBrowser.js +1 -1
  265. package/dist/isDev.js +1 -1
  266. package/dist/isProd.js +1 -1
  267. package/dist/isServer.js +1 -1
  268. package/dist/jsx-runtime.js +1 -1
  269. package/dist/jsxRuntime.d.ts.map +1 -1
  270. package/dist/jsxRuntime.js +12 -7
  271. package/dist/jsxRuntimeSignals.d.ts.map +1 -1
  272. package/dist/jsxRuntimeSignals.js +15 -8
  273. package/dist/makeFinalConfig.d.ts.map +1 -1
  274. package/dist/makeFinalConfig.js +3 -3
  275. package/dist/makeInstanceConfigFromFrameworkConfig.js +1 -1
  276. package/dist/makeServerRpc.js +3 -3
  277. package/dist/markOptionSelected.js +2 -2
  278. package/dist/mergeConfigs.d.ts.map +1 -1
  279. package/dist/mergeConfigs.js +11 -2
  280. package/dist/mutatingFunctions.js +3 -3
  281. package/dist/nbsp.js +1 -1
  282. package/dist/output.js +1 -1
  283. package/dist/pop.js +2 -2
  284. package/dist/postcssPlugins/TransformCssNames.js +8 -8
  285. package/dist/postcssPlugins/parseSelectors.js +1 -1
  286. package/dist/postcssPlugins/parseSelectorsRich.js +1 -1
  287. package/dist/postcssPlugins/scopeAnimationValue.js +2 -2
  288. package/dist/propsAreEqual.js +3 -3
  289. package/dist/rawHtml/filterContentNode.js +4 -4
  290. package/dist/rawHtml/parseHtml.js +5 -5
  291. package/dist/rawHtml/sanitizeHtml.js +3 -3
  292. package/dist/rawHtml/tokenizeHtml.js +2 -2
  293. package/dist/render/addImportMap.js +2 -2
  294. package/dist/render/classComponentNodeToRenderingTree.js +4 -4
  295. package/dist/render/componentNodeToRenderingTree.d.ts.map +1 -1
  296. package/dist/render/componentNodeToRenderingTree.js +13 -24
  297. package/dist/render/contentNodeToHtml.js +11 -11
  298. package/dist/render/contentToHtml.d.ts.map +1 -1
  299. package/dist/render/contentToHtml.js +5 -5
  300. package/dist/render/contentToHtmlDev.js +1 -1
  301. package/dist/render/contentTreeToRenderingTree.js +7 -7
  302. package/dist/render/functionComponentNodeToRenderingTree.js +4 -4
  303. package/dist/render/getFunctionBodyAsString.d.ts.map +1 -1
  304. package/dist/render/getFunctionBodyAsString.js +3 -6
  305. package/dist/render/instantiateClassComponent.js +2 -2
  306. package/dist/render/instantiateComponent.js +3 -3
  307. package/dist/render/instantiateFunctionComponent.js +2 -2
  308. package/dist/render/printComponentNameInSource.js +1 -1
  309. package/dist/render/processHead.js +5 -5
  310. package/dist/render/processHtmlNode.js +1 -1
  311. package/dist/render/processProps.js +4 -4
  312. package/dist/render/processRenderingNodeHtml.js +6 -6
  313. package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
  314. package/dist/render/renderingTreeToHtml.js +16 -16
  315. package/dist/render/rootToHtml.d.ts.map +1 -1
  316. package/dist/render/rootToHtml.js +2 -2
  317. package/dist/render/rootToHtmlDev.js +1 -1
  318. package/dist/requests/fetch/delete.js +2 -2
  319. package/dist/requests/fetch/get.js +3 -3
  320. package/dist/requests/fetch/patch.js +2 -2
  321. package/dist/requests/fetch/post.js +2 -2
  322. package/dist/requests/fetch/put.js +2 -2
  323. package/dist/requests/index.js +5 -5
  324. package/dist/routing/MatchedRoute.js +2 -2
  325. package/dist/routing/Route.js +1 -1
  326. package/dist/routing/RouteDataFunction.type.d.ts.map +1 -1
  327. package/dist/routing/RoutesWithSafeParams.js +1 -1
  328. package/dist/routing/WebRedirect.d.ts.map +1 -1
  329. package/dist/routing/compareRequestToRegex.js +2 -2
  330. package/dist/routing/getPathPriority.js +2 -2
  331. package/dist/routing/matchPath.js +3 -3
  332. package/dist/routing/patternToRegex.js +1 -1
  333. package/dist/server.js +3 -3
  334. package/dist/serverModuleLocation.d.ts +3 -0
  335. package/dist/serverModuleLocation.d.ts.map +1 -0
  336. package/dist/serverModuleLocation.js +12 -0
  337. package/dist/serverRpc.d.ts.map +1 -1
  338. package/dist/settings.d.ts +4 -0
  339. package/dist/settings.d.ts.map +1 -1
  340. package/dist/settings.js +9 -0
  341. package/dist/slash.d.ts +2 -0
  342. package/dist/slash.d.ts.map +1 -0
  343. package/dist/slash.js +5 -0
  344. package/dist/spawnShellCommand.js +1 -1
  345. package/dist/standardSchema.js +1 -1
  346. package/dist/staticGen/getAppRoutes.js +3 -3
  347. package/dist/staticGen/staticGen.d.ts.map +1 -1
  348. package/dist/staticGen/staticGen.js +16 -14
  349. package/dist/staticGen/staticGenFunctions.js +1 -1
  350. package/dist/style/jssToCss.d.ts.map +1 -1
  351. package/dist/style/jssToCss.js +13 -11
  352. package/dist/style/styleContent.js +1 -1
  353. package/dist/style/styleContentSxy.js +8 -8
  354. package/dist/style/unusedStyles.d.ts.map +1 -1
  355. package/dist/style/unusedStyles.js +1 -1
  356. package/dist/sync/index.js +1 -1
  357. package/dist/syncServer/preload.js +1 -1
  358. package/dist/testing/host.js +12 -12
  359. package/dist/testing/hydrateTestApp.d.ts.map +1 -1
  360. package/dist/testing/hydrateTestApp.js +18 -18
  361. package/dist/testing/index.d.ts.map +1 -1
  362. package/dist/testing/index.js +11 -11
  363. package/dist/testing/installTestStyleProcessors.js +2 -2
  364. package/dist/testing/loadEnv.d.ts +4 -1
  365. package/dist/testing/loadEnv.d.ts.map +1 -1
  366. package/dist/testing/loadEnv.js +5 -5
  367. package/dist/testing/temp/componentPackageMock.js +5 -5
  368. package/dist/testing/temp/contentHtmlElements.js +2 -2
  369. package/dist/throwError.js +2 -2
  370. package/dist/timeProfiler.d.ts +5 -1
  371. package/dist/timeProfiler.d.ts.map +1 -1
  372. package/dist/timeProfiler.js +76 -24
  373. package/dist/todo.js +2 -1
  374. package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
  375. package/dist/update/integrateUpdateVdom.js +44 -41
  376. package/dist/update/integrateUpdateVdomPrebuild.js +5 -5
  377. package/dist/validChildren.js +2 -2
  378. package/dist/warnOnFrameworkChange.js +2 -2
  379. package/dist/watch.js +2 -2
  380. package/dist/zones/react.js +3 -3
  381. package/package.json +27 -39
  382. package/types/modules.d.ts +2 -1
  383. package/vendor/babel-core.js +26 -0
  384. package/vendor/babel-parser.js +9 -0
  385. package/vendor/babel-plugin-syntax-import-assertions.js +50 -0
  386. package/vendor/babel-preset-react.js +872 -0
  387. package/vendor/babel-preset-typescript.js +26 -0
  388. package/vendor/babel-types.js +9 -0
  389. package/vendor/chalk-extensions.js +1994 -0
  390. package/vendor/chalk.js +647 -0
  391. package/vendor/chokidar.js +6889 -0
  392. package/vendor/chunk-1TN2rK3j.js +1218 -0
  393. package/vendor/chunk-1UuLTU0U.js +34 -0
  394. package/vendor/chunk-B_NeooyV.js +86 -0
  395. package/vendor/chunk-C12hSZn7.js +88 -0
  396. package/vendor/chunk-C3YkUGz5.js +19 -0
  397. package/vendor/chunk-C3fcZDjl.js +41964 -0
  398. package/vendor/chunk-C9FSKeSx.js +14603 -0
  399. package/vendor/chunk-CPArXGxa.js +14623 -0
  400. package/vendor/cjs-module-lexer.js +6 -0
  401. package/vendor/dotenv.js +412 -0
  402. package/vendor/express.js +40577 -0
  403. package/vendor/import-meta-resolve.js +2201 -0
  404. package/vendor/manifest.json +29 -0
  405. package/vendor/postcss.js +8546 -0
  406. package/vendor/serialize-javascript.js +293 -0
  407. package/vendor/sxy-lib-arrays.js +113 -0
  408. package/vendor/sxy-lib-object-copy.js +1781 -0
  409. package/vendor/sxy-lib-objects.js +156 -0
  410. package/vendor/sxy-lib-promises.js +47 -0
  411. package/vendor/sxy-package-investigator.js +202 -0
  412. package/vendor/valibot.js +7664 -0
  413. package/dist/Servers/hono/DevServerHono.d.ts +0 -2
  414. package/dist/Servers/hono/DevServerHono.d.ts.map +0 -1
  415. package/dist/Servers/hono/DevServerHono.js +0 -423
  416. package/dist/Servers/hono/ProdServerHono.d.ts +0 -2
  417. package/dist/Servers/hono/ProdServerHono.d.ts.map +0 -1
  418. package/dist/Servers/hono/ProdServerHono.js +0 -220
  419. package/dist/Servers/hono/TungstenServerHono.d.ts +0 -6
  420. package/dist/Servers/hono/TungstenServerHono.d.ts.map +0 -1
  421. package/dist/Servers/hono/TungstenServerHono.js +0 -36
  422. package/dist/api/ApiEndpointHono.d.ts +0 -3
  423. package/dist/api/ApiEndpointHono.d.ts.map +0 -1
  424. package/dist/api/ApiEndpointHono.js +0 -1
  425. package/dist/api/ApiRouteHono.d.ts +0 -7
  426. package/dist/api/ApiRouteHono.d.ts.map +0 -1
  427. package/dist/api/ApiRouteHono.js +0 -1
  428. package/dist/api/ApiRoutesHono.d.ts +0 -5
  429. package/dist/api/ApiRoutesHono.d.ts.map +0 -1
  430. package/dist/api/ApiRoutesHono.js +0 -1
  431. package/dist/api/getApiRoutesHono.d.ts +0 -6
  432. package/dist/api/getApiRoutesHono.d.ts.map +0 -1
  433. package/dist/api/getApiRoutesHono.js +0 -14
  434. package/dist/build/compilePackages.d.ts +0 -2
  435. package/dist/build/compilePackages.d.ts.map +0 -1
  436. package/dist/build/compilePackages.js +0 -89
  437. package/dist/build/findRequiredUserModule.d.ts +0 -2
  438. package/dist/build/findRequiredUserModule.d.ts.map +0 -1
  439. package/dist/build/findRequiredUserModule.js +0 -36
  440. package/dist/build/processPackage.d.ts +0 -4
  441. package/dist/build/processPackage.d.ts.map +0 -1
  442. package/dist/build/processPackage.js +0 -91
  443. package/dist/build/tallyBabelPlugins.d.ts +0 -3
  444. package/dist/build/tallyBabelPlugins.d.ts.map +0 -1
  445. package/dist/build/tallyBabelPlugins.js +0 -68
  446. package/dist/testing/loadEnvSetup.d.ts +0 -2
  447. package/dist/testing/loadEnvSetup.d.ts.map +0 -1
  448. package/dist/testing/loadEnvSetup.js +0 -7
  449. package/sxy-loader.config.js +0 -7
@@ -0,0 +1,1994 @@
1
+ import { createRequire as __tungstenCreateRequire } from 'node:module';
2
+ const require = __tungstenCreateRequire(import.meta.url);
3
+ import require$$0 from 'os';
4
+ import require$$1 from 'tty';
5
+ import { r as requireHasFlag } from './chunk-C3YkUGz5.js';
6
+
7
+ var ansiStyles = {exports: {}};
8
+
9
+ var colorName;
10
+ var hasRequiredColorName;
11
+
12
+ function requireColorName () {
13
+ if (hasRequiredColorName) return colorName;
14
+ hasRequiredColorName = 1;
15
+
16
+ colorName = {
17
+ "aliceblue": [240, 248, 255],
18
+ "antiquewhite": [250, 235, 215],
19
+ "aqua": [0, 255, 255],
20
+ "aquamarine": [127, 255, 212],
21
+ "azure": [240, 255, 255],
22
+ "beige": [245, 245, 220],
23
+ "bisque": [255, 228, 196],
24
+ "black": [0, 0, 0],
25
+ "blanchedalmond": [255, 235, 205],
26
+ "blue": [0, 0, 255],
27
+ "blueviolet": [138, 43, 226],
28
+ "brown": [165, 42, 42],
29
+ "burlywood": [222, 184, 135],
30
+ "cadetblue": [95, 158, 160],
31
+ "chartreuse": [127, 255, 0],
32
+ "chocolate": [210, 105, 30],
33
+ "coral": [255, 127, 80],
34
+ "cornflowerblue": [100, 149, 237],
35
+ "cornsilk": [255, 248, 220],
36
+ "crimson": [220, 20, 60],
37
+ "cyan": [0, 255, 255],
38
+ "darkblue": [0, 0, 139],
39
+ "darkcyan": [0, 139, 139],
40
+ "darkgoldenrod": [184, 134, 11],
41
+ "darkgray": [169, 169, 169],
42
+ "darkgreen": [0, 100, 0],
43
+ "darkgrey": [169, 169, 169],
44
+ "darkkhaki": [189, 183, 107],
45
+ "darkmagenta": [139, 0, 139],
46
+ "darkolivegreen": [85, 107, 47],
47
+ "darkorange": [255, 140, 0],
48
+ "darkorchid": [153, 50, 204],
49
+ "darkred": [139, 0, 0],
50
+ "darksalmon": [233, 150, 122],
51
+ "darkseagreen": [143, 188, 143],
52
+ "darkslateblue": [72, 61, 139],
53
+ "darkslategray": [47, 79, 79],
54
+ "darkslategrey": [47, 79, 79],
55
+ "darkturquoise": [0, 206, 209],
56
+ "darkviolet": [148, 0, 211],
57
+ "deeppink": [255, 20, 147],
58
+ "deepskyblue": [0, 191, 255],
59
+ "dimgray": [105, 105, 105],
60
+ "dimgrey": [105, 105, 105],
61
+ "dodgerblue": [30, 144, 255],
62
+ "firebrick": [178, 34, 34],
63
+ "floralwhite": [255, 250, 240],
64
+ "forestgreen": [34, 139, 34],
65
+ "fuchsia": [255, 0, 255],
66
+ "gainsboro": [220, 220, 220],
67
+ "ghostwhite": [248, 248, 255],
68
+ "gold": [255, 215, 0],
69
+ "goldenrod": [218, 165, 32],
70
+ "gray": [128, 128, 128],
71
+ "green": [0, 128, 0],
72
+ "greenyellow": [173, 255, 47],
73
+ "grey": [128, 128, 128],
74
+ "honeydew": [240, 255, 240],
75
+ "hotpink": [255, 105, 180],
76
+ "indianred": [205, 92, 92],
77
+ "indigo": [75, 0, 130],
78
+ "ivory": [255, 255, 240],
79
+ "khaki": [240, 230, 140],
80
+ "lavender": [230, 230, 250],
81
+ "lavenderblush": [255, 240, 245],
82
+ "lawngreen": [124, 252, 0],
83
+ "lemonchiffon": [255, 250, 205],
84
+ "lightblue": [173, 216, 230],
85
+ "lightcoral": [240, 128, 128],
86
+ "lightcyan": [224, 255, 255],
87
+ "lightgoldenrodyellow": [250, 250, 210],
88
+ "lightgray": [211, 211, 211],
89
+ "lightgreen": [144, 238, 144],
90
+ "lightgrey": [211, 211, 211],
91
+ "lightpink": [255, 182, 193],
92
+ "lightsalmon": [255, 160, 122],
93
+ "lightseagreen": [32, 178, 170],
94
+ "lightskyblue": [135, 206, 250],
95
+ "lightslategray": [119, 136, 153],
96
+ "lightslategrey": [119, 136, 153],
97
+ "lightsteelblue": [176, 196, 222],
98
+ "lightyellow": [255, 255, 224],
99
+ "lime": [0, 255, 0],
100
+ "limegreen": [50, 205, 50],
101
+ "linen": [250, 240, 230],
102
+ "magenta": [255, 0, 255],
103
+ "maroon": [128, 0, 0],
104
+ "mediumaquamarine": [102, 205, 170],
105
+ "mediumblue": [0, 0, 205],
106
+ "mediumorchid": [186, 85, 211],
107
+ "mediumpurple": [147, 112, 219],
108
+ "mediumseagreen": [60, 179, 113],
109
+ "mediumslateblue": [123, 104, 238],
110
+ "mediumspringgreen": [0, 250, 154],
111
+ "mediumturquoise": [72, 209, 204],
112
+ "mediumvioletred": [199, 21, 133],
113
+ "midnightblue": [25, 25, 112],
114
+ "mintcream": [245, 255, 250],
115
+ "mistyrose": [255, 228, 225],
116
+ "moccasin": [255, 228, 181],
117
+ "navajowhite": [255, 222, 173],
118
+ "navy": [0, 0, 128],
119
+ "oldlace": [253, 245, 230],
120
+ "olive": [128, 128, 0],
121
+ "olivedrab": [107, 142, 35],
122
+ "orange": [255, 165, 0],
123
+ "orangered": [255, 69, 0],
124
+ "orchid": [218, 112, 214],
125
+ "palegoldenrod": [238, 232, 170],
126
+ "palegreen": [152, 251, 152],
127
+ "paleturquoise": [175, 238, 238],
128
+ "palevioletred": [219, 112, 147],
129
+ "papayawhip": [255, 239, 213],
130
+ "peachpuff": [255, 218, 185],
131
+ "peru": [205, 133, 63],
132
+ "pink": [255, 192, 203],
133
+ "plum": [221, 160, 221],
134
+ "powderblue": [176, 224, 230],
135
+ "purple": [128, 0, 128],
136
+ "rebeccapurple": [102, 51, 153],
137
+ "red": [255, 0, 0],
138
+ "rosybrown": [188, 143, 143],
139
+ "royalblue": [65, 105, 225],
140
+ "saddlebrown": [139, 69, 19],
141
+ "salmon": [250, 128, 114],
142
+ "sandybrown": [244, 164, 96],
143
+ "seagreen": [46, 139, 87],
144
+ "seashell": [255, 245, 238],
145
+ "sienna": [160, 82, 45],
146
+ "silver": [192, 192, 192],
147
+ "skyblue": [135, 206, 235],
148
+ "slateblue": [106, 90, 205],
149
+ "slategray": [112, 128, 144],
150
+ "slategrey": [112, 128, 144],
151
+ "snow": [255, 250, 250],
152
+ "springgreen": [0, 255, 127],
153
+ "steelblue": [70, 130, 180],
154
+ "tan": [210, 180, 140],
155
+ "teal": [0, 128, 128],
156
+ "thistle": [216, 191, 216],
157
+ "tomato": [255, 99, 71],
158
+ "turquoise": [64, 224, 208],
159
+ "violet": [238, 130, 238],
160
+ "wheat": [245, 222, 179],
161
+ "white": [255, 255, 255],
162
+ "whitesmoke": [245, 245, 245],
163
+ "yellow": [255, 255, 0],
164
+ "yellowgreen": [154, 205, 50]
165
+ };
166
+ return colorName;
167
+ }
168
+
169
+ /* MIT license */
170
+
171
+ var conversions;
172
+ var hasRequiredConversions;
173
+
174
+ function requireConversions () {
175
+ if (hasRequiredConversions) return conversions;
176
+ hasRequiredConversions = 1;
177
+ /* eslint-disable no-mixed-operators */
178
+ const cssKeywords = requireColorName();
179
+
180
+ // NOTE: conversions should only return primitive values (i.e. arrays, or
181
+ // values that give correct `typeof` results).
182
+ // do not use box values types (i.e. Number(), String(), etc.)
183
+
184
+ const reverseKeywords = {};
185
+ for (const key of Object.keys(cssKeywords)) {
186
+ reverseKeywords[cssKeywords[key]] = key;
187
+ }
188
+
189
+ const convert = {
190
+ rgb: {channels: 3, labels: 'rgb'},
191
+ hsl: {channels: 3, labels: 'hsl'},
192
+ hsv: {channels: 3, labels: 'hsv'},
193
+ hwb: {channels: 3, labels: 'hwb'},
194
+ cmyk: {channels: 4, labels: 'cmyk'},
195
+ xyz: {channels: 3, labels: 'xyz'},
196
+ lab: {channels: 3, labels: 'lab'},
197
+ lch: {channels: 3, labels: 'lch'},
198
+ hex: {channels: 1, labels: ['hex']},
199
+ keyword: {channels: 1, labels: ['keyword']},
200
+ ansi16: {channels: 1, labels: ['ansi16']},
201
+ ansi256: {channels: 1, labels: ['ansi256']},
202
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
203
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
204
+ gray: {channels: 1, labels: ['gray']}
205
+ };
206
+
207
+ conversions = convert;
208
+
209
+ // Hide .channels and .labels properties
210
+ for (const model of Object.keys(convert)) {
211
+ if (!('channels' in convert[model])) {
212
+ throw new Error('missing channels property: ' + model);
213
+ }
214
+
215
+ if (!('labels' in convert[model])) {
216
+ throw new Error('missing channel labels property: ' + model);
217
+ }
218
+
219
+ if (convert[model].labels.length !== convert[model].channels) {
220
+ throw new Error('channel and label counts mismatch: ' + model);
221
+ }
222
+
223
+ const {channels, labels} = convert[model];
224
+ delete convert[model].channels;
225
+ delete convert[model].labels;
226
+ Object.defineProperty(convert[model], 'channels', {value: channels});
227
+ Object.defineProperty(convert[model], 'labels', {value: labels});
228
+ }
229
+
230
+ convert.rgb.hsl = function (rgb) {
231
+ const r = rgb[0] / 255;
232
+ const g = rgb[1] / 255;
233
+ const b = rgb[2] / 255;
234
+ const min = Math.min(r, g, b);
235
+ const max = Math.max(r, g, b);
236
+ const delta = max - min;
237
+ let h;
238
+ let s;
239
+
240
+ if (max === min) {
241
+ h = 0;
242
+ } else if (r === max) {
243
+ h = (g - b) / delta;
244
+ } else if (g === max) {
245
+ h = 2 + (b - r) / delta;
246
+ } else if (b === max) {
247
+ h = 4 + (r - g) / delta;
248
+ }
249
+
250
+ h = Math.min(h * 60, 360);
251
+
252
+ if (h < 0) {
253
+ h += 360;
254
+ }
255
+
256
+ const l = (min + max) / 2;
257
+
258
+ if (max === min) {
259
+ s = 0;
260
+ } else if (l <= 0.5) {
261
+ s = delta / (max + min);
262
+ } else {
263
+ s = delta / (2 - max - min);
264
+ }
265
+
266
+ return [h, s * 100, l * 100];
267
+ };
268
+
269
+ convert.rgb.hsv = function (rgb) {
270
+ let rdif;
271
+ let gdif;
272
+ let bdif;
273
+ let h;
274
+ let s;
275
+
276
+ const r = rgb[0] / 255;
277
+ const g = rgb[1] / 255;
278
+ const b = rgb[2] / 255;
279
+ const v = Math.max(r, g, b);
280
+ const diff = v - Math.min(r, g, b);
281
+ const diffc = function (c) {
282
+ return (v - c) / 6 / diff + 1 / 2;
283
+ };
284
+
285
+ if (diff === 0) {
286
+ h = 0;
287
+ s = 0;
288
+ } else {
289
+ s = diff / v;
290
+ rdif = diffc(r);
291
+ gdif = diffc(g);
292
+ bdif = diffc(b);
293
+
294
+ if (r === v) {
295
+ h = bdif - gdif;
296
+ } else if (g === v) {
297
+ h = (1 / 3) + rdif - bdif;
298
+ } else if (b === v) {
299
+ h = (2 / 3) + gdif - rdif;
300
+ }
301
+
302
+ if (h < 0) {
303
+ h += 1;
304
+ } else if (h > 1) {
305
+ h -= 1;
306
+ }
307
+ }
308
+
309
+ return [
310
+ h * 360,
311
+ s * 100,
312
+ v * 100
313
+ ];
314
+ };
315
+
316
+ convert.rgb.hwb = function (rgb) {
317
+ const r = rgb[0];
318
+ const g = rgb[1];
319
+ let b = rgb[2];
320
+ const h = convert.rgb.hsl(rgb)[0];
321
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
322
+
323
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
324
+
325
+ return [h, w * 100, b * 100];
326
+ };
327
+
328
+ convert.rgb.cmyk = function (rgb) {
329
+ const r = rgb[0] / 255;
330
+ const g = rgb[1] / 255;
331
+ const b = rgb[2] / 255;
332
+
333
+ const k = Math.min(1 - r, 1 - g, 1 - b);
334
+ const c = (1 - r - k) / (1 - k) || 0;
335
+ const m = (1 - g - k) / (1 - k) || 0;
336
+ const y = (1 - b - k) / (1 - k) || 0;
337
+
338
+ return [c * 100, m * 100, y * 100, k * 100];
339
+ };
340
+
341
+ function comparativeDistance(x, y) {
342
+ /*
343
+ See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
344
+ */
345
+ return (
346
+ ((x[0] - y[0]) ** 2) +
347
+ ((x[1] - y[1]) ** 2) +
348
+ ((x[2] - y[2]) ** 2)
349
+ );
350
+ }
351
+
352
+ convert.rgb.keyword = function (rgb) {
353
+ const reversed = reverseKeywords[rgb];
354
+ if (reversed) {
355
+ return reversed;
356
+ }
357
+
358
+ let currentClosestDistance = Infinity;
359
+ let currentClosestKeyword;
360
+
361
+ for (const keyword of Object.keys(cssKeywords)) {
362
+ const value = cssKeywords[keyword];
363
+
364
+ // Compute comparative distance
365
+ const distance = comparativeDistance(rgb, value);
366
+
367
+ // Check if its less, if so set as closest
368
+ if (distance < currentClosestDistance) {
369
+ currentClosestDistance = distance;
370
+ currentClosestKeyword = keyword;
371
+ }
372
+ }
373
+
374
+ return currentClosestKeyword;
375
+ };
376
+
377
+ convert.keyword.rgb = function (keyword) {
378
+ return cssKeywords[keyword];
379
+ };
380
+
381
+ convert.rgb.xyz = function (rgb) {
382
+ let r = rgb[0] / 255;
383
+ let g = rgb[1] / 255;
384
+ let b = rgb[2] / 255;
385
+
386
+ // Assume sRGB
387
+ r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
388
+ g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
389
+ b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
390
+
391
+ const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
392
+ const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
393
+ const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
394
+
395
+ return [x * 100, y * 100, z * 100];
396
+ };
397
+
398
+ convert.rgb.lab = function (rgb) {
399
+ const xyz = convert.rgb.xyz(rgb);
400
+ let x = xyz[0];
401
+ let y = xyz[1];
402
+ let z = xyz[2];
403
+
404
+ x /= 95.047;
405
+ y /= 100;
406
+ z /= 108.883;
407
+
408
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
409
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
410
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
411
+
412
+ const l = (116 * y) - 16;
413
+ const a = 500 * (x - y);
414
+ const b = 200 * (y - z);
415
+
416
+ return [l, a, b];
417
+ };
418
+
419
+ convert.hsl.rgb = function (hsl) {
420
+ const h = hsl[0] / 360;
421
+ const s = hsl[1] / 100;
422
+ const l = hsl[2] / 100;
423
+ let t2;
424
+ let t3;
425
+ let val;
426
+
427
+ if (s === 0) {
428
+ val = l * 255;
429
+ return [val, val, val];
430
+ }
431
+
432
+ if (l < 0.5) {
433
+ t2 = l * (1 + s);
434
+ } else {
435
+ t2 = l + s - l * s;
436
+ }
437
+
438
+ const t1 = 2 * l - t2;
439
+
440
+ const rgb = [0, 0, 0];
441
+ for (let i = 0; i < 3; i++) {
442
+ t3 = h + 1 / 3 * -(i - 1);
443
+ if (t3 < 0) {
444
+ t3++;
445
+ }
446
+
447
+ if (t3 > 1) {
448
+ t3--;
449
+ }
450
+
451
+ if (6 * t3 < 1) {
452
+ val = t1 + (t2 - t1) * 6 * t3;
453
+ } else if (2 * t3 < 1) {
454
+ val = t2;
455
+ } else if (3 * t3 < 2) {
456
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
457
+ } else {
458
+ val = t1;
459
+ }
460
+
461
+ rgb[i] = val * 255;
462
+ }
463
+
464
+ return rgb;
465
+ };
466
+
467
+ convert.hsl.hsv = function (hsl) {
468
+ const h = hsl[0];
469
+ let s = hsl[1] / 100;
470
+ let l = hsl[2] / 100;
471
+ let smin = s;
472
+ const lmin = Math.max(l, 0.01);
473
+
474
+ l *= 2;
475
+ s *= (l <= 1) ? l : 2 - l;
476
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
477
+ const v = (l + s) / 2;
478
+ const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
479
+
480
+ return [h, sv * 100, v * 100];
481
+ };
482
+
483
+ convert.hsv.rgb = function (hsv) {
484
+ const h = hsv[0] / 60;
485
+ const s = hsv[1] / 100;
486
+ let v = hsv[2] / 100;
487
+ const hi = Math.floor(h) % 6;
488
+
489
+ const f = h - Math.floor(h);
490
+ const p = 255 * v * (1 - s);
491
+ const q = 255 * v * (1 - (s * f));
492
+ const t = 255 * v * (1 - (s * (1 - f)));
493
+ v *= 255;
494
+
495
+ switch (hi) {
496
+ case 0:
497
+ return [v, t, p];
498
+ case 1:
499
+ return [q, v, p];
500
+ case 2:
501
+ return [p, v, t];
502
+ case 3:
503
+ return [p, q, v];
504
+ case 4:
505
+ return [t, p, v];
506
+ case 5:
507
+ return [v, p, q];
508
+ }
509
+ };
510
+
511
+ convert.hsv.hsl = function (hsv) {
512
+ const h = hsv[0];
513
+ const s = hsv[1] / 100;
514
+ const v = hsv[2] / 100;
515
+ const vmin = Math.max(v, 0.01);
516
+ let sl;
517
+ let l;
518
+
519
+ l = (2 - s) * v;
520
+ const lmin = (2 - s) * vmin;
521
+ sl = s * vmin;
522
+ sl /= (lmin <= 1) ? lmin : 2 - lmin;
523
+ sl = sl || 0;
524
+ l /= 2;
525
+
526
+ return [h, sl * 100, l * 100];
527
+ };
528
+
529
+ // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
530
+ convert.hwb.rgb = function (hwb) {
531
+ const h = hwb[0] / 360;
532
+ let wh = hwb[1] / 100;
533
+ let bl = hwb[2] / 100;
534
+ const ratio = wh + bl;
535
+ let f;
536
+
537
+ // Wh + bl cant be > 1
538
+ if (ratio > 1) {
539
+ wh /= ratio;
540
+ bl /= ratio;
541
+ }
542
+
543
+ const i = Math.floor(6 * h);
544
+ const v = 1 - bl;
545
+ f = 6 * h - i;
546
+
547
+ if ((i & 0x01) !== 0) {
548
+ f = 1 - f;
549
+ }
550
+
551
+ const n = wh + f * (v - wh); // Linear interpolation
552
+
553
+ let r;
554
+ let g;
555
+ let b;
556
+ /* eslint-disable max-statements-per-line,no-multi-spaces */
557
+ switch (i) {
558
+ default:
559
+ case 6:
560
+ case 0: r = v; g = n; b = wh; break;
561
+ case 1: r = n; g = v; b = wh; break;
562
+ case 2: r = wh; g = v; b = n; break;
563
+ case 3: r = wh; g = n; b = v; break;
564
+ case 4: r = n; g = wh; b = v; break;
565
+ case 5: r = v; g = wh; b = n; break;
566
+ }
567
+ /* eslint-enable max-statements-per-line,no-multi-spaces */
568
+
569
+ return [r * 255, g * 255, b * 255];
570
+ };
571
+
572
+ convert.cmyk.rgb = function (cmyk) {
573
+ const c = cmyk[0] / 100;
574
+ const m = cmyk[1] / 100;
575
+ const y = cmyk[2] / 100;
576
+ const k = cmyk[3] / 100;
577
+
578
+ const r = 1 - Math.min(1, c * (1 - k) + k);
579
+ const g = 1 - Math.min(1, m * (1 - k) + k);
580
+ const b = 1 - Math.min(1, y * (1 - k) + k);
581
+
582
+ return [r * 255, g * 255, b * 255];
583
+ };
584
+
585
+ convert.xyz.rgb = function (xyz) {
586
+ const x = xyz[0] / 100;
587
+ const y = xyz[1] / 100;
588
+ const z = xyz[2] / 100;
589
+ let r;
590
+ let g;
591
+ let b;
592
+
593
+ r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
594
+ g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
595
+ b = (x * 0.0557) + (y * -0.204) + (z * 1.0570);
596
+
597
+ // Assume sRGB
598
+ r = r > 0.0031308
599
+ ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
600
+ : r * 12.92;
601
+
602
+ g = g > 0.0031308
603
+ ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
604
+ : g * 12.92;
605
+
606
+ b = b > 0.0031308
607
+ ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
608
+ : b * 12.92;
609
+
610
+ r = Math.min(Math.max(0, r), 1);
611
+ g = Math.min(Math.max(0, g), 1);
612
+ b = Math.min(Math.max(0, b), 1);
613
+
614
+ return [r * 255, g * 255, b * 255];
615
+ };
616
+
617
+ convert.xyz.lab = function (xyz) {
618
+ let x = xyz[0];
619
+ let y = xyz[1];
620
+ let z = xyz[2];
621
+
622
+ x /= 95.047;
623
+ y /= 100;
624
+ z /= 108.883;
625
+
626
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
627
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
628
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
629
+
630
+ const l = (116 * y) - 16;
631
+ const a = 500 * (x - y);
632
+ const b = 200 * (y - z);
633
+
634
+ return [l, a, b];
635
+ };
636
+
637
+ convert.lab.xyz = function (lab) {
638
+ const l = lab[0];
639
+ const a = lab[1];
640
+ const b = lab[2];
641
+ let x;
642
+ let y;
643
+ let z;
644
+
645
+ y = (l + 16) / 116;
646
+ x = a / 500 + y;
647
+ z = y - b / 200;
648
+
649
+ const y2 = y ** 3;
650
+ const x2 = x ** 3;
651
+ const z2 = z ** 3;
652
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
653
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
654
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
655
+
656
+ x *= 95.047;
657
+ y *= 100;
658
+ z *= 108.883;
659
+
660
+ return [x, y, z];
661
+ };
662
+
663
+ convert.lab.lch = function (lab) {
664
+ const l = lab[0];
665
+ const a = lab[1];
666
+ const b = lab[2];
667
+ let h;
668
+
669
+ const hr = Math.atan2(b, a);
670
+ h = hr * 360 / 2 / Math.PI;
671
+
672
+ if (h < 0) {
673
+ h += 360;
674
+ }
675
+
676
+ const c = Math.sqrt(a * a + b * b);
677
+
678
+ return [l, c, h];
679
+ };
680
+
681
+ convert.lch.lab = function (lch) {
682
+ const l = lch[0];
683
+ const c = lch[1];
684
+ const h = lch[2];
685
+
686
+ const hr = h / 360 * 2 * Math.PI;
687
+ const a = c * Math.cos(hr);
688
+ const b = c * Math.sin(hr);
689
+
690
+ return [l, a, b];
691
+ };
692
+
693
+ convert.rgb.ansi16 = function (args, saturation = null) {
694
+ const [r, g, b] = args;
695
+ let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
696
+
697
+ value = Math.round(value / 50);
698
+
699
+ if (value === 0) {
700
+ return 30;
701
+ }
702
+
703
+ let ansi = 30
704
+ + ((Math.round(b / 255) << 2)
705
+ | (Math.round(g / 255) << 1)
706
+ | Math.round(r / 255));
707
+
708
+ if (value === 2) {
709
+ ansi += 60;
710
+ }
711
+
712
+ return ansi;
713
+ };
714
+
715
+ convert.hsv.ansi16 = function (args) {
716
+ // Optimization here; we already know the value and don't need to get
717
+ // it converted for us.
718
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
719
+ };
720
+
721
+ convert.rgb.ansi256 = function (args) {
722
+ const r = args[0];
723
+ const g = args[1];
724
+ const b = args[2];
725
+
726
+ // We use the extended greyscale palette here, with the exception of
727
+ // black and white. normal palette only has 4 greyscale shades.
728
+ if (r === g && g === b) {
729
+ if (r < 8) {
730
+ return 16;
731
+ }
732
+
733
+ if (r > 248) {
734
+ return 231;
735
+ }
736
+
737
+ return Math.round(((r - 8) / 247) * 24) + 232;
738
+ }
739
+
740
+ const ansi = 16
741
+ + (36 * Math.round(r / 255 * 5))
742
+ + (6 * Math.round(g / 255 * 5))
743
+ + Math.round(b / 255 * 5);
744
+
745
+ return ansi;
746
+ };
747
+
748
+ convert.ansi16.rgb = function (args) {
749
+ let color = args % 10;
750
+
751
+ // Handle greyscale
752
+ if (color === 0 || color === 7) {
753
+ if (args > 50) {
754
+ color += 3.5;
755
+ }
756
+
757
+ color = color / 10.5 * 255;
758
+
759
+ return [color, color, color];
760
+ }
761
+
762
+ const mult = (~~(args > 50) + 1) * 0.5;
763
+ const r = ((color & 1) * mult) * 255;
764
+ const g = (((color >> 1) & 1) * mult) * 255;
765
+ const b = (((color >> 2) & 1) * mult) * 255;
766
+
767
+ return [r, g, b];
768
+ };
769
+
770
+ convert.ansi256.rgb = function (args) {
771
+ // Handle greyscale
772
+ if (args >= 232) {
773
+ const c = (args - 232) * 10 + 8;
774
+ return [c, c, c];
775
+ }
776
+
777
+ args -= 16;
778
+
779
+ let rem;
780
+ const r = Math.floor(args / 36) / 5 * 255;
781
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
782
+ const b = (rem % 6) / 5 * 255;
783
+
784
+ return [r, g, b];
785
+ };
786
+
787
+ convert.rgb.hex = function (args) {
788
+ const integer = ((Math.round(args[0]) & 0xFF) << 16)
789
+ + ((Math.round(args[1]) & 0xFF) << 8)
790
+ + (Math.round(args[2]) & 0xFF);
791
+
792
+ const string = integer.toString(16).toUpperCase();
793
+ return '000000'.substring(string.length) + string;
794
+ };
795
+
796
+ convert.hex.rgb = function (args) {
797
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
798
+ if (!match) {
799
+ return [0, 0, 0];
800
+ }
801
+
802
+ let colorString = match[0];
803
+
804
+ if (match[0].length === 3) {
805
+ colorString = colorString.split('').map(char => {
806
+ return char + char;
807
+ }).join('');
808
+ }
809
+
810
+ const integer = parseInt(colorString, 16);
811
+ const r = (integer >> 16) & 0xFF;
812
+ const g = (integer >> 8) & 0xFF;
813
+ const b = integer & 0xFF;
814
+
815
+ return [r, g, b];
816
+ };
817
+
818
+ convert.rgb.hcg = function (rgb) {
819
+ const r = rgb[0] / 255;
820
+ const g = rgb[1] / 255;
821
+ const b = rgb[2] / 255;
822
+ const max = Math.max(Math.max(r, g), b);
823
+ const min = Math.min(Math.min(r, g), b);
824
+ const chroma = (max - min);
825
+ let grayscale;
826
+ let hue;
827
+
828
+ if (chroma < 1) {
829
+ grayscale = min / (1 - chroma);
830
+ } else {
831
+ grayscale = 0;
832
+ }
833
+
834
+ if (chroma <= 0) {
835
+ hue = 0;
836
+ } else
837
+ if (max === r) {
838
+ hue = ((g - b) / chroma) % 6;
839
+ } else
840
+ if (max === g) {
841
+ hue = 2 + (b - r) / chroma;
842
+ } else {
843
+ hue = 4 + (r - g) / chroma;
844
+ }
845
+
846
+ hue /= 6;
847
+ hue %= 1;
848
+
849
+ return [hue * 360, chroma * 100, grayscale * 100];
850
+ };
851
+
852
+ convert.hsl.hcg = function (hsl) {
853
+ const s = hsl[1] / 100;
854
+ const l = hsl[2] / 100;
855
+
856
+ const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
857
+
858
+ let f = 0;
859
+ if (c < 1.0) {
860
+ f = (l - 0.5 * c) / (1.0 - c);
861
+ }
862
+
863
+ return [hsl[0], c * 100, f * 100];
864
+ };
865
+
866
+ convert.hsv.hcg = function (hsv) {
867
+ const s = hsv[1] / 100;
868
+ const v = hsv[2] / 100;
869
+
870
+ const c = s * v;
871
+ let f = 0;
872
+
873
+ if (c < 1.0) {
874
+ f = (v - c) / (1 - c);
875
+ }
876
+
877
+ return [hsv[0], c * 100, f * 100];
878
+ };
879
+
880
+ convert.hcg.rgb = function (hcg) {
881
+ const h = hcg[0] / 360;
882
+ const c = hcg[1] / 100;
883
+ const g = hcg[2] / 100;
884
+
885
+ if (c === 0.0) {
886
+ return [g * 255, g * 255, g * 255];
887
+ }
888
+
889
+ const pure = [0, 0, 0];
890
+ const hi = (h % 1) * 6;
891
+ const v = hi % 1;
892
+ const w = 1 - v;
893
+ let mg = 0;
894
+
895
+ /* eslint-disable max-statements-per-line */
896
+ switch (Math.floor(hi)) {
897
+ case 0:
898
+ pure[0] = 1; pure[1] = v; pure[2] = 0; break;
899
+ case 1:
900
+ pure[0] = w; pure[1] = 1; pure[2] = 0; break;
901
+ case 2:
902
+ pure[0] = 0; pure[1] = 1; pure[2] = v; break;
903
+ case 3:
904
+ pure[0] = 0; pure[1] = w; pure[2] = 1; break;
905
+ case 4:
906
+ pure[0] = v; pure[1] = 0; pure[2] = 1; break;
907
+ default:
908
+ pure[0] = 1; pure[1] = 0; pure[2] = w;
909
+ }
910
+ /* eslint-enable max-statements-per-line */
911
+
912
+ mg = (1.0 - c) * g;
913
+
914
+ return [
915
+ (c * pure[0] + mg) * 255,
916
+ (c * pure[1] + mg) * 255,
917
+ (c * pure[2] + mg) * 255
918
+ ];
919
+ };
920
+
921
+ convert.hcg.hsv = function (hcg) {
922
+ const c = hcg[1] / 100;
923
+ const g = hcg[2] / 100;
924
+
925
+ const v = c + g * (1.0 - c);
926
+ let f = 0;
927
+
928
+ if (v > 0.0) {
929
+ f = c / v;
930
+ }
931
+
932
+ return [hcg[0], f * 100, v * 100];
933
+ };
934
+
935
+ convert.hcg.hsl = function (hcg) {
936
+ const c = hcg[1] / 100;
937
+ const g = hcg[2] / 100;
938
+
939
+ const l = g * (1.0 - c) + 0.5 * c;
940
+ let s = 0;
941
+
942
+ if (l > 0.0 && l < 0.5) {
943
+ s = c / (2 * l);
944
+ } else
945
+ if (l >= 0.5 && l < 1.0) {
946
+ s = c / (2 * (1 - l));
947
+ }
948
+
949
+ return [hcg[0], s * 100, l * 100];
950
+ };
951
+
952
+ convert.hcg.hwb = function (hcg) {
953
+ const c = hcg[1] / 100;
954
+ const g = hcg[2] / 100;
955
+ const v = c + g * (1.0 - c);
956
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
957
+ };
958
+
959
+ convert.hwb.hcg = function (hwb) {
960
+ const w = hwb[1] / 100;
961
+ const b = hwb[2] / 100;
962
+ const v = 1 - b;
963
+ const c = v - w;
964
+ let g = 0;
965
+
966
+ if (c < 1) {
967
+ g = (v - c) / (1 - c);
968
+ }
969
+
970
+ return [hwb[0], c * 100, g * 100];
971
+ };
972
+
973
+ convert.apple.rgb = function (apple) {
974
+ return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
975
+ };
976
+
977
+ convert.rgb.apple = function (rgb) {
978
+ return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
979
+ };
980
+
981
+ convert.gray.rgb = function (args) {
982
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
983
+ };
984
+
985
+ convert.gray.hsl = function (args) {
986
+ return [0, 0, args[0]];
987
+ };
988
+
989
+ convert.gray.hsv = convert.gray.hsl;
990
+
991
+ convert.gray.hwb = function (gray) {
992
+ return [0, 100, gray[0]];
993
+ };
994
+
995
+ convert.gray.cmyk = function (gray) {
996
+ return [0, 0, 0, gray[0]];
997
+ };
998
+
999
+ convert.gray.lab = function (gray) {
1000
+ return [gray[0], 0, 0];
1001
+ };
1002
+
1003
+ convert.gray.hex = function (gray) {
1004
+ const val = Math.round(gray[0] / 100 * 255) & 0xFF;
1005
+ const integer = (val << 16) + (val << 8) + val;
1006
+
1007
+ const string = integer.toString(16).toUpperCase();
1008
+ return '000000'.substring(string.length) + string;
1009
+ };
1010
+
1011
+ convert.rgb.gray = function (rgb) {
1012
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1013
+ return [val / 255 * 100];
1014
+ };
1015
+ return conversions;
1016
+ }
1017
+
1018
+ var route;
1019
+ var hasRequiredRoute;
1020
+
1021
+ function requireRoute () {
1022
+ if (hasRequiredRoute) return route;
1023
+ hasRequiredRoute = 1;
1024
+ const conversions = requireConversions();
1025
+
1026
+ /*
1027
+ This function routes a model to all other models.
1028
+
1029
+ all functions that are routed have a property `.conversion` attached
1030
+ to the returned synthetic function. This property is an array
1031
+ of strings, each with the steps in between the 'from' and 'to'
1032
+ color models (inclusive).
1033
+
1034
+ conversions that are not possible simply are not included.
1035
+ */
1036
+
1037
+ function buildGraph() {
1038
+ const graph = {};
1039
+ // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1040
+ const models = Object.keys(conversions);
1041
+
1042
+ for (let len = models.length, i = 0; i < len; i++) {
1043
+ graph[models[i]] = {
1044
+ // http://jsperf.com/1-vs-infinity
1045
+ // micro-opt, but this is simple.
1046
+ distance: -1,
1047
+ parent: null
1048
+ };
1049
+ }
1050
+
1051
+ return graph;
1052
+ }
1053
+
1054
+ // https://en.wikipedia.org/wiki/Breadth-first_search
1055
+ function deriveBFS(fromModel) {
1056
+ const graph = buildGraph();
1057
+ const queue = [fromModel]; // Unshift -> queue -> pop
1058
+
1059
+ graph[fromModel].distance = 0;
1060
+
1061
+ while (queue.length) {
1062
+ const current = queue.pop();
1063
+ const adjacents = Object.keys(conversions[current]);
1064
+
1065
+ for (let len = adjacents.length, i = 0; i < len; i++) {
1066
+ const adjacent = adjacents[i];
1067
+ const node = graph[adjacent];
1068
+
1069
+ if (node.distance === -1) {
1070
+ node.distance = graph[current].distance + 1;
1071
+ node.parent = current;
1072
+ queue.unshift(adjacent);
1073
+ }
1074
+ }
1075
+ }
1076
+
1077
+ return graph;
1078
+ }
1079
+
1080
+ function link(from, to) {
1081
+ return function (args) {
1082
+ return to(from(args));
1083
+ };
1084
+ }
1085
+
1086
+ function wrapConversion(toModel, graph) {
1087
+ const path = [graph[toModel].parent, toModel];
1088
+ let fn = conversions[graph[toModel].parent][toModel];
1089
+
1090
+ let cur = graph[toModel].parent;
1091
+ while (graph[cur].parent) {
1092
+ path.unshift(graph[cur].parent);
1093
+ fn = link(conversions[graph[cur].parent][cur], fn);
1094
+ cur = graph[cur].parent;
1095
+ }
1096
+
1097
+ fn.conversion = path;
1098
+ return fn;
1099
+ }
1100
+
1101
+ route = function (fromModel) {
1102
+ const graph = deriveBFS(fromModel);
1103
+ const conversion = {};
1104
+
1105
+ const models = Object.keys(graph);
1106
+ for (let len = models.length, i = 0; i < len; i++) {
1107
+ const toModel = models[i];
1108
+ const node = graph[toModel];
1109
+
1110
+ if (node.parent === null) {
1111
+ // No possible conversion, or this node is the source model.
1112
+ continue;
1113
+ }
1114
+
1115
+ conversion[toModel] = wrapConversion(toModel, graph);
1116
+ }
1117
+
1118
+ return conversion;
1119
+ };
1120
+ return route;
1121
+ }
1122
+
1123
+ var colorConvert;
1124
+ var hasRequiredColorConvert;
1125
+
1126
+ function requireColorConvert () {
1127
+ if (hasRequiredColorConvert) return colorConvert;
1128
+ hasRequiredColorConvert = 1;
1129
+ const conversions = requireConversions();
1130
+ const route = requireRoute();
1131
+
1132
+ const convert = {};
1133
+
1134
+ const models = Object.keys(conversions);
1135
+
1136
+ function wrapRaw(fn) {
1137
+ const wrappedFn = function (...args) {
1138
+ const arg0 = args[0];
1139
+ if (arg0 === undefined || arg0 === null) {
1140
+ return arg0;
1141
+ }
1142
+
1143
+ if (arg0.length > 1) {
1144
+ args = arg0;
1145
+ }
1146
+
1147
+ return fn(args);
1148
+ };
1149
+
1150
+ // Preserve .conversion property if there is one
1151
+ if ('conversion' in fn) {
1152
+ wrappedFn.conversion = fn.conversion;
1153
+ }
1154
+
1155
+ return wrappedFn;
1156
+ }
1157
+
1158
+ function wrapRounded(fn) {
1159
+ const wrappedFn = function (...args) {
1160
+ const arg0 = args[0];
1161
+
1162
+ if (arg0 === undefined || arg0 === null) {
1163
+ return arg0;
1164
+ }
1165
+
1166
+ if (arg0.length > 1) {
1167
+ args = arg0;
1168
+ }
1169
+
1170
+ const result = fn(args);
1171
+
1172
+ // We're assuming the result is an array here.
1173
+ // see notice in conversions.js; don't use box types
1174
+ // in conversion functions.
1175
+ if (typeof result === 'object') {
1176
+ for (let len = result.length, i = 0; i < len; i++) {
1177
+ result[i] = Math.round(result[i]);
1178
+ }
1179
+ }
1180
+
1181
+ return result;
1182
+ };
1183
+
1184
+ // Preserve .conversion property if there is one
1185
+ if ('conversion' in fn) {
1186
+ wrappedFn.conversion = fn.conversion;
1187
+ }
1188
+
1189
+ return wrappedFn;
1190
+ }
1191
+
1192
+ models.forEach(fromModel => {
1193
+ convert[fromModel] = {};
1194
+
1195
+ Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
1196
+ Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
1197
+
1198
+ const routes = route(fromModel);
1199
+ const routeModels = Object.keys(routes);
1200
+
1201
+ routeModels.forEach(toModel => {
1202
+ const fn = routes[toModel];
1203
+
1204
+ convert[fromModel][toModel] = wrapRounded(fn);
1205
+ convert[fromModel][toModel].raw = wrapRaw(fn);
1206
+ });
1207
+ });
1208
+
1209
+ colorConvert = convert;
1210
+ return colorConvert;
1211
+ }
1212
+
1213
+ ansiStyles.exports;
1214
+
1215
+ var hasRequiredAnsiStyles;
1216
+
1217
+ function requireAnsiStyles () {
1218
+ if (hasRequiredAnsiStyles) return ansiStyles.exports;
1219
+ hasRequiredAnsiStyles = 1;
1220
+ (function (module) {
1221
+
1222
+ const wrapAnsi16 = (fn, offset) => (...args) => {
1223
+ const code = fn(...args);
1224
+ return `\u001B[${code + offset}m`;
1225
+ };
1226
+
1227
+ const wrapAnsi256 = (fn, offset) => (...args) => {
1228
+ const code = fn(...args);
1229
+ return `\u001B[${38 + offset};5;${code}m`;
1230
+ };
1231
+
1232
+ const wrapAnsi16m = (fn, offset) => (...args) => {
1233
+ const rgb = fn(...args);
1234
+ return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
1235
+ };
1236
+
1237
+ const ansi2ansi = n => n;
1238
+ const rgb2rgb = (r, g, b) => [r, g, b];
1239
+
1240
+ const setLazyProperty = (object, property, get) => {
1241
+ Object.defineProperty(object, property, {
1242
+ get: () => {
1243
+ const value = get();
1244
+
1245
+ Object.defineProperty(object, property, {
1246
+ value,
1247
+ enumerable: true,
1248
+ configurable: true
1249
+ });
1250
+
1251
+ return value;
1252
+ },
1253
+ enumerable: true,
1254
+ configurable: true
1255
+ });
1256
+ };
1257
+
1258
+ /** @type {typeof import('color-convert')} */
1259
+ let colorConvert;
1260
+ const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1261
+ if (colorConvert === undefined) {
1262
+ colorConvert = requireColorConvert();
1263
+ }
1264
+
1265
+ const offset = isBackground ? 10 : 0;
1266
+ const styles = {};
1267
+
1268
+ for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
1269
+ const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;
1270
+ if (sourceSpace === targetSpace) {
1271
+ styles[name] = wrap(identity, offset);
1272
+ } else if (typeof suite === 'object') {
1273
+ styles[name] = wrap(suite[targetSpace], offset);
1274
+ }
1275
+ }
1276
+
1277
+ return styles;
1278
+ };
1279
+
1280
+ function assembleStyles() {
1281
+ const codes = new Map();
1282
+ const styles = {
1283
+ modifier: {
1284
+ reset: [0, 0],
1285
+ // 21 isn't widely supported and 22 does the same thing
1286
+ bold: [1, 22],
1287
+ dim: [2, 22],
1288
+ italic: [3, 23],
1289
+ underline: [4, 24],
1290
+ inverse: [7, 27],
1291
+ hidden: [8, 28],
1292
+ strikethrough: [9, 29]
1293
+ },
1294
+ color: {
1295
+ black: [30, 39],
1296
+ red: [31, 39],
1297
+ green: [32, 39],
1298
+ yellow: [33, 39],
1299
+ blue: [34, 39],
1300
+ magenta: [35, 39],
1301
+ cyan: [36, 39],
1302
+ white: [37, 39],
1303
+
1304
+ // Bright color
1305
+ blackBright: [90, 39],
1306
+ redBright: [91, 39],
1307
+ greenBright: [92, 39],
1308
+ yellowBright: [93, 39],
1309
+ blueBright: [94, 39],
1310
+ magentaBright: [95, 39],
1311
+ cyanBright: [96, 39],
1312
+ whiteBright: [97, 39]
1313
+ },
1314
+ bgColor: {
1315
+ bgBlack: [40, 49],
1316
+ bgRed: [41, 49],
1317
+ bgGreen: [42, 49],
1318
+ bgYellow: [43, 49],
1319
+ bgBlue: [44, 49],
1320
+ bgMagenta: [45, 49],
1321
+ bgCyan: [46, 49],
1322
+ bgWhite: [47, 49],
1323
+
1324
+ // Bright color
1325
+ bgBlackBright: [100, 49],
1326
+ bgRedBright: [101, 49],
1327
+ bgGreenBright: [102, 49],
1328
+ bgYellowBright: [103, 49],
1329
+ bgBlueBright: [104, 49],
1330
+ bgMagentaBright: [105, 49],
1331
+ bgCyanBright: [106, 49],
1332
+ bgWhiteBright: [107, 49]
1333
+ }
1334
+ };
1335
+
1336
+ // Alias bright black as gray (and grey)
1337
+ styles.color.gray = styles.color.blackBright;
1338
+ styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
1339
+ styles.color.grey = styles.color.blackBright;
1340
+ styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
1341
+
1342
+ for (const [groupName, group] of Object.entries(styles)) {
1343
+ for (const [styleName, style] of Object.entries(group)) {
1344
+ styles[styleName] = {
1345
+ open: `\u001B[${style[0]}m`,
1346
+ close: `\u001B[${style[1]}m`
1347
+ };
1348
+
1349
+ group[styleName] = styles[styleName];
1350
+
1351
+ codes.set(style[0], style[1]);
1352
+ }
1353
+
1354
+ Object.defineProperty(styles, groupName, {
1355
+ value: group,
1356
+ enumerable: false
1357
+ });
1358
+ }
1359
+
1360
+ Object.defineProperty(styles, 'codes', {
1361
+ value: codes,
1362
+ enumerable: false
1363
+ });
1364
+
1365
+ styles.color.close = '\u001B[39m';
1366
+ styles.bgColor.close = '\u001B[49m';
1367
+
1368
+ setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));
1369
+ setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));
1370
+ setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));
1371
+ setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));
1372
+ setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));
1373
+ setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));
1374
+
1375
+ return styles;
1376
+ }
1377
+
1378
+ // Make the export immutable
1379
+ Object.defineProperty(module, 'exports', {
1380
+ enumerable: true,
1381
+ get: assembleStyles
1382
+ });
1383
+ } (ansiStyles));
1384
+ return ansiStyles.exports;
1385
+ }
1386
+
1387
+ var supportsColor_1;
1388
+ var hasRequiredSupportsColor;
1389
+
1390
+ function requireSupportsColor () {
1391
+ if (hasRequiredSupportsColor) return supportsColor_1;
1392
+ hasRequiredSupportsColor = 1;
1393
+ const os = require$$0;
1394
+ const tty = require$$1;
1395
+ const hasFlag = requireHasFlag();
1396
+
1397
+ const {env} = process;
1398
+
1399
+ let forceColor;
1400
+ if (hasFlag('no-color') ||
1401
+ hasFlag('no-colors') ||
1402
+ hasFlag('color=false') ||
1403
+ hasFlag('color=never')) {
1404
+ forceColor = 0;
1405
+ } else if (hasFlag('color') ||
1406
+ hasFlag('colors') ||
1407
+ hasFlag('color=true') ||
1408
+ hasFlag('color=always')) {
1409
+ forceColor = 1;
1410
+ }
1411
+
1412
+ if ('FORCE_COLOR' in env) {
1413
+ if (env.FORCE_COLOR === 'true') {
1414
+ forceColor = 1;
1415
+ } else if (env.FORCE_COLOR === 'false') {
1416
+ forceColor = 0;
1417
+ } else {
1418
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
1419
+ }
1420
+ }
1421
+
1422
+ function translateLevel(level) {
1423
+ if (level === 0) {
1424
+ return false;
1425
+ }
1426
+
1427
+ return {
1428
+ level,
1429
+ hasBasic: true,
1430
+ has256: level >= 2,
1431
+ has16m: level >= 3
1432
+ };
1433
+ }
1434
+
1435
+ function supportsColor(haveStream, streamIsTTY) {
1436
+ if (forceColor === 0) {
1437
+ return 0;
1438
+ }
1439
+
1440
+ if (hasFlag('color=16m') ||
1441
+ hasFlag('color=full') ||
1442
+ hasFlag('color=truecolor')) {
1443
+ return 3;
1444
+ }
1445
+
1446
+ if (hasFlag('color=256')) {
1447
+ return 2;
1448
+ }
1449
+
1450
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
1451
+ return 0;
1452
+ }
1453
+
1454
+ const min = forceColor || 0;
1455
+
1456
+ if (env.TERM === 'dumb') {
1457
+ return min;
1458
+ }
1459
+
1460
+ if (process.platform === 'win32') {
1461
+ // Windows 10 build 10586 is the first Windows release that supports 256 colors.
1462
+ // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
1463
+ const osRelease = os.release().split('.');
1464
+ if (
1465
+ Number(osRelease[0]) >= 10 &&
1466
+ Number(osRelease[2]) >= 10586
1467
+ ) {
1468
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
1469
+ }
1470
+
1471
+ return 1;
1472
+ }
1473
+
1474
+ if ('CI' in env) {
1475
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
1476
+ return 1;
1477
+ }
1478
+
1479
+ return min;
1480
+ }
1481
+
1482
+ if ('TEAMCITY_VERSION' in env) {
1483
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1484
+ }
1485
+
1486
+ if (env.COLORTERM === 'truecolor') {
1487
+ return 3;
1488
+ }
1489
+
1490
+ if ('TERM_PROGRAM' in env) {
1491
+ const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
1492
+
1493
+ switch (env.TERM_PROGRAM) {
1494
+ case 'iTerm.app':
1495
+ return version >= 3 ? 3 : 2;
1496
+ case 'Apple_Terminal':
1497
+ return 2;
1498
+ // No default
1499
+ }
1500
+ }
1501
+
1502
+ if (/-256(color)?$/i.test(env.TERM)) {
1503
+ return 2;
1504
+ }
1505
+
1506
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
1507
+ return 1;
1508
+ }
1509
+
1510
+ if ('COLORTERM' in env) {
1511
+ return 1;
1512
+ }
1513
+
1514
+ return min;
1515
+ }
1516
+
1517
+ function getSupportLevel(stream) {
1518
+ const level = supportsColor(stream, stream && stream.isTTY);
1519
+ return translateLevel(level);
1520
+ }
1521
+
1522
+ supportsColor_1 = {
1523
+ supportsColor: getSupportLevel,
1524
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
1525
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
1526
+ };
1527
+ return supportsColor_1;
1528
+ }
1529
+
1530
+ var util;
1531
+ var hasRequiredUtil;
1532
+
1533
+ function requireUtil () {
1534
+ if (hasRequiredUtil) return util;
1535
+ hasRequiredUtil = 1;
1536
+
1537
+ const stringReplaceAll = (string, substring, replacer) => {
1538
+ let index = string.indexOf(substring);
1539
+ if (index === -1) {
1540
+ return string;
1541
+ }
1542
+
1543
+ const substringLength = substring.length;
1544
+ let endIndex = 0;
1545
+ let returnValue = '';
1546
+ do {
1547
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
1548
+ endIndex = index + substringLength;
1549
+ index = string.indexOf(substring, endIndex);
1550
+ } while (index !== -1);
1551
+
1552
+ returnValue += string.substr(endIndex);
1553
+ return returnValue;
1554
+ };
1555
+
1556
+ const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
1557
+ let endIndex = 0;
1558
+ let returnValue = '';
1559
+ do {
1560
+ const gotCR = string[index - 1] === '\r';
1561
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
1562
+ endIndex = index + 1;
1563
+ index = string.indexOf('\n', endIndex);
1564
+ } while (index !== -1);
1565
+
1566
+ returnValue += string.substr(endIndex);
1567
+ return returnValue;
1568
+ };
1569
+
1570
+ util = {
1571
+ stringReplaceAll,
1572
+ stringEncaseCRLFWithFirstIndex
1573
+ };
1574
+ return util;
1575
+ }
1576
+
1577
+ var templates;
1578
+ var hasRequiredTemplates;
1579
+
1580
+ function requireTemplates () {
1581
+ if (hasRequiredTemplates) return templates;
1582
+ hasRequiredTemplates = 1;
1583
+ const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
1584
+ const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
1585
+ const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
1586
+ const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
1587
+
1588
+ const ESCAPES = new Map([
1589
+ ['n', '\n'],
1590
+ ['r', '\r'],
1591
+ ['t', '\t'],
1592
+ ['b', '\b'],
1593
+ ['f', '\f'],
1594
+ ['v', '\v'],
1595
+ ['0', '\0'],
1596
+ ['\\', '\\'],
1597
+ ['e', '\u001B'],
1598
+ ['a', '\u0007']
1599
+ ]);
1600
+
1601
+ function unescape(c) {
1602
+ const u = c[0] === 'u';
1603
+ const bracket = c[1] === '{';
1604
+
1605
+ if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
1606
+ return String.fromCharCode(parseInt(c.slice(1), 16));
1607
+ }
1608
+
1609
+ if (u && bracket) {
1610
+ return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
1611
+ }
1612
+
1613
+ return ESCAPES.get(c) || c;
1614
+ }
1615
+
1616
+ function parseArguments(name, arguments_) {
1617
+ const results = [];
1618
+ const chunks = arguments_.trim().split(/\s*,\s*/g);
1619
+ let matches;
1620
+
1621
+ for (const chunk of chunks) {
1622
+ const number = Number(chunk);
1623
+ if (!Number.isNaN(number)) {
1624
+ results.push(number);
1625
+ } else if ((matches = chunk.match(STRING_REGEX))) {
1626
+ results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
1627
+ } else {
1628
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
1629
+ }
1630
+ }
1631
+
1632
+ return results;
1633
+ }
1634
+
1635
+ function parseStyle(style) {
1636
+ STYLE_REGEX.lastIndex = 0;
1637
+
1638
+ const results = [];
1639
+ let matches;
1640
+
1641
+ while ((matches = STYLE_REGEX.exec(style)) !== null) {
1642
+ const name = matches[1];
1643
+
1644
+ if (matches[2]) {
1645
+ const args = parseArguments(name, matches[2]);
1646
+ results.push([name].concat(args));
1647
+ } else {
1648
+ results.push([name]);
1649
+ }
1650
+ }
1651
+
1652
+ return results;
1653
+ }
1654
+
1655
+ function buildStyle(chalk, styles) {
1656
+ const enabled = {};
1657
+
1658
+ for (const layer of styles) {
1659
+ for (const style of layer.styles) {
1660
+ enabled[style[0]] = layer.inverse ? null : style.slice(1);
1661
+ }
1662
+ }
1663
+
1664
+ let current = chalk;
1665
+ for (const [styleName, styles] of Object.entries(enabled)) {
1666
+ if (!Array.isArray(styles)) {
1667
+ continue;
1668
+ }
1669
+
1670
+ if (!(styleName in current)) {
1671
+ throw new Error(`Unknown Chalk style: ${styleName}`);
1672
+ }
1673
+
1674
+ current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
1675
+ }
1676
+
1677
+ return current;
1678
+ }
1679
+
1680
+ templates = (chalk, temporary) => {
1681
+ const styles = [];
1682
+ const chunks = [];
1683
+ let chunk = [];
1684
+
1685
+ // eslint-disable-next-line max-params
1686
+ temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
1687
+ if (escapeCharacter) {
1688
+ chunk.push(unescape(escapeCharacter));
1689
+ } else if (style) {
1690
+ const string = chunk.join('');
1691
+ chunk = [];
1692
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
1693
+ styles.push({inverse, styles: parseStyle(style)});
1694
+ } else if (close) {
1695
+ if (styles.length === 0) {
1696
+ throw new Error('Found extraneous } in Chalk template literal');
1697
+ }
1698
+
1699
+ chunks.push(buildStyle(chalk, styles)(chunk.join('')));
1700
+ chunk = [];
1701
+ styles.pop();
1702
+ } else {
1703
+ chunk.push(character);
1704
+ }
1705
+ });
1706
+
1707
+ chunks.push(chunk.join(''));
1708
+
1709
+ if (styles.length > 0) {
1710
+ const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
1711
+ throw new Error(errMessage);
1712
+ }
1713
+
1714
+ return chunks.join('');
1715
+ };
1716
+ return templates;
1717
+ }
1718
+
1719
+ var source;
1720
+ var hasRequiredSource;
1721
+
1722
+ function requireSource () {
1723
+ if (hasRequiredSource) return source;
1724
+ hasRequiredSource = 1;
1725
+ const ansiStyles = requireAnsiStyles();
1726
+ const {stdout: stdoutColor, stderr: stderrColor} = requireSupportsColor();
1727
+ const {
1728
+ stringReplaceAll,
1729
+ stringEncaseCRLFWithFirstIndex
1730
+ } = requireUtil();
1731
+
1732
+ const {isArray} = Array;
1733
+
1734
+ // `supportsColor.level` → `ansiStyles.color[name]` mapping
1735
+ const levelMapping = [
1736
+ 'ansi',
1737
+ 'ansi',
1738
+ 'ansi256',
1739
+ 'ansi16m'
1740
+ ];
1741
+
1742
+ const styles = Object.create(null);
1743
+
1744
+ const applyOptions = (object, options = {}) => {
1745
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
1746
+ throw new Error('The `level` option should be an integer from 0 to 3');
1747
+ }
1748
+
1749
+ // Detect level if not set manually
1750
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
1751
+ object.level = options.level === undefined ? colorLevel : options.level;
1752
+ };
1753
+
1754
+ class ChalkClass {
1755
+ constructor(options) {
1756
+ // eslint-disable-next-line no-constructor-return
1757
+ return chalkFactory(options);
1758
+ }
1759
+ }
1760
+
1761
+ const chalkFactory = options => {
1762
+ const chalk = {};
1763
+ applyOptions(chalk, options);
1764
+
1765
+ chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
1766
+
1767
+ Object.setPrototypeOf(chalk, Chalk.prototype);
1768
+ Object.setPrototypeOf(chalk.template, chalk);
1769
+
1770
+ chalk.template.constructor = () => {
1771
+ throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.');
1772
+ };
1773
+
1774
+ chalk.template.Instance = ChalkClass;
1775
+
1776
+ return chalk.template;
1777
+ };
1778
+
1779
+ function Chalk(options) {
1780
+ return chalkFactory(options);
1781
+ }
1782
+
1783
+ for (const [styleName, style] of Object.entries(ansiStyles)) {
1784
+ styles[styleName] = {
1785
+ get() {
1786
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
1787
+ Object.defineProperty(this, styleName, {value: builder});
1788
+ return builder;
1789
+ }
1790
+ };
1791
+ }
1792
+
1793
+ styles.visible = {
1794
+ get() {
1795
+ const builder = createBuilder(this, this._styler, true);
1796
+ Object.defineProperty(this, 'visible', {value: builder});
1797
+ return builder;
1798
+ }
1799
+ };
1800
+
1801
+ const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256'];
1802
+
1803
+ for (const model of usedModels) {
1804
+ styles[model] = {
1805
+ get() {
1806
+ const {level} = this;
1807
+ return function (...arguments_) {
1808
+ const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
1809
+ return createBuilder(this, styler, this._isEmpty);
1810
+ };
1811
+ }
1812
+ };
1813
+ }
1814
+
1815
+ for (const model of usedModels) {
1816
+ const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
1817
+ styles[bgModel] = {
1818
+ get() {
1819
+ const {level} = this;
1820
+ return function (...arguments_) {
1821
+ const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
1822
+ return createBuilder(this, styler, this._isEmpty);
1823
+ };
1824
+ }
1825
+ };
1826
+ }
1827
+
1828
+ const proto = Object.defineProperties(() => {}, {
1829
+ ...styles,
1830
+ level: {
1831
+ enumerable: true,
1832
+ get() {
1833
+ return this._generator.level;
1834
+ },
1835
+ set(level) {
1836
+ this._generator.level = level;
1837
+ }
1838
+ }
1839
+ });
1840
+
1841
+ const createStyler = (open, close, parent) => {
1842
+ let openAll;
1843
+ let closeAll;
1844
+ if (parent === undefined) {
1845
+ openAll = open;
1846
+ closeAll = close;
1847
+ } else {
1848
+ openAll = parent.openAll + open;
1849
+ closeAll = close + parent.closeAll;
1850
+ }
1851
+
1852
+ return {
1853
+ open,
1854
+ close,
1855
+ openAll,
1856
+ closeAll,
1857
+ parent
1858
+ };
1859
+ };
1860
+
1861
+ const createBuilder = (self, _styler, _isEmpty) => {
1862
+ const builder = (...arguments_) => {
1863
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
1864
+ // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}`
1865
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
1866
+ }
1867
+
1868
+ // Single argument is hot path, implicit coercion is faster than anything
1869
+ // eslint-disable-next-line no-implicit-coercion
1870
+ return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
1871
+ };
1872
+
1873
+ // We alter the prototype because we must return a function, but there is
1874
+ // no way to create a function with a different prototype
1875
+ Object.setPrototypeOf(builder, proto);
1876
+
1877
+ builder._generator = self;
1878
+ builder._styler = _styler;
1879
+ builder._isEmpty = _isEmpty;
1880
+
1881
+ return builder;
1882
+ };
1883
+
1884
+ const applyStyle = (self, string) => {
1885
+ if (self.level <= 0 || !string) {
1886
+ return self._isEmpty ? '' : string;
1887
+ }
1888
+
1889
+ let styler = self._styler;
1890
+
1891
+ if (styler === undefined) {
1892
+ return string;
1893
+ }
1894
+
1895
+ const {openAll, closeAll} = styler;
1896
+ if (string.indexOf('\u001B') !== -1) {
1897
+ while (styler !== undefined) {
1898
+ // Replace any instances already present with a re-opening code
1899
+ // otherwise only the part of the string until said closing code
1900
+ // will be colored, and the rest will simply be 'plain'.
1901
+ string = stringReplaceAll(string, styler.close, styler.open);
1902
+
1903
+ styler = styler.parent;
1904
+ }
1905
+ }
1906
+
1907
+ // We can move both next actions out of loop, because remaining actions in loop won't have
1908
+ // any/visible effect on parts we add here. Close the styling before a linebreak and reopen
1909
+ // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
1910
+ const lfIndex = string.indexOf('\n');
1911
+ if (lfIndex !== -1) {
1912
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
1913
+ }
1914
+
1915
+ return openAll + string + closeAll;
1916
+ };
1917
+
1918
+ let template;
1919
+ const chalkTag = (chalk, ...strings) => {
1920
+ const [firstString] = strings;
1921
+
1922
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
1923
+ // If chalk() was called by itself or with a string,
1924
+ // return the string itself as a string.
1925
+ return strings.join(' ');
1926
+ }
1927
+
1928
+ const arguments_ = strings.slice(1);
1929
+ const parts = [firstString.raw[0]];
1930
+
1931
+ for (let i = 1; i < firstString.length; i++) {
1932
+ parts.push(
1933
+ String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'),
1934
+ String(firstString.raw[i])
1935
+ );
1936
+ }
1937
+
1938
+ if (template === undefined) {
1939
+ template = requireTemplates();
1940
+ }
1941
+
1942
+ return template(chalk, parts.join(''));
1943
+ };
1944
+
1945
+ Object.defineProperties(Chalk.prototype, styles);
1946
+
1947
+ const chalk = Chalk(); // eslint-disable-line new-cap
1948
+ chalk.supportsColor = stdoutColor;
1949
+ chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap
1950
+ chalk.stderr.supportsColor = stderrColor;
1951
+
1952
+ source = chalk;
1953
+ return source;
1954
+ }
1955
+
1956
+ var chalkExtensions;
1957
+ var hasRequiredChalkExtensions;
1958
+
1959
+ function requireChalkExtensions () {
1960
+ if (hasRequiredChalkExtensions) return chalkExtensions;
1961
+ hasRequiredChalkExtensions = 1;
1962
+ const chalk = requireSource();
1963
+
1964
+ chalk.brightblue = chalk.keyword('dodgerblue');
1965
+ chalk.lightblue = chalk.keyword('lightskyblue');
1966
+ chalk.brightgreen = chalk.keyword('springgreen');
1967
+ chalk.boldgreen = chalk.keyword('yellowgreen');
1968
+ chalk.mediumgreen = chalk.hex('#20d970');
1969
+ chalk.lightgreen = chalk.keyword('palegreen');
1970
+ chalk.lime = chalk.keyword('lime');
1971
+ chalk.mediumred = chalk.hex('#e0444c');
1972
+ chalk.brightred = chalk.keyword('red');
1973
+ chalk.warmred = chalk.keyword('orangered');
1974
+ chalk.orange = chalk.keyword('darkorange');
1975
+ chalk.purple = chalk.keyword('mediumorchid');
1976
+ chalk.brown = chalk.keyword('sienna');
1977
+ chalk.lightpink = chalk.keyword('pink');
1978
+ chalk.pink = chalk.keyword('deeppink');
1979
+ chalk.turquoise = chalk.keyword('turquoise');
1980
+ chalk.aquamarine = chalk.keyword('aquamarine');
1981
+ chalk.mediumgrey = chalk.keyword('grey');
1982
+ chalk.mediumgray = chalk.keyword('grey');
1983
+ chalk.lightgrey = chalk.keyword('silver');
1984
+ chalk.lightgray = chalk.keyword('silver');
1985
+ chalk.nearwhite = chalk.keyword('whitesmoke');
1986
+ chalk.truewhite =chalk.keyword('white');
1987
+
1988
+ chalkExtensions = chalk;
1989
+ return chalkExtensions;
1990
+ }
1991
+
1992
+ var chalkExtensionsExports = requireChalkExtensions();
1993
+
1994
+ export { chalkExtensionsExports as default };