@fluentic/style 0.1.0-beta.17 → 0.1.0-beta.19

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 (176) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/atomic/utils/types.ts +4 -2
  3. package/compiler/compiler/cache_identity.ts +115 -0
  4. package/compiler/compiler/compiler.ts +21 -1
  5. package/compiler/compiler/persistent_cache.ts +310 -0
  6. package/compiler/compiler/types.ts +12 -0
  7. package/compiler/extract/collector.ts +2 -2
  8. package/compiler/transform/evaluator/metadata_cache.ts +124 -0
  9. package/compiler/transform/evaluator/tracer.ts +71 -63
  10. package/compiler/transform/extract/plugin.ts +2 -0
  11. package/compiler/utils/check_diagnostics.ts +18 -0
  12. package/compiler/utils/file_resolver.ts +24 -0
  13. package/dist/{combine-BpOQWCtM.js → combine-B5AnX0Gb.js} +2 -2
  14. package/dist/{combine-BpOQWCtM.js.map → combine-B5AnX0Gb.js.map} +1 -1
  15. package/dist/compiler/index.mjs +1 -1
  16. package/dist/{compiler-Cat8TmMk.mjs → compiler-Dpd41bCS.mjs} +552 -41
  17. package/dist/compiler-Dpd41bCS.mjs.map +1 -0
  18. package/dist/{config-B70LIQhi.js → config-VS1lyh3Z.js} +2 -2
  19. package/dist/{config-B70LIQhi.js.map → config-VS1lyh3Z.js.map} +1 -1
  20. package/dist/{css-C7tcD3IO.js → css-CMuUcsWb.js} +99 -21
  21. package/dist/css-CMuUcsWb.js.map +1 -0
  22. package/dist/{css-Cdxkur4h.js → css-ivddFxoH.js} +6 -6
  23. package/dist/{css-Cdxkur4h.js.map → css-ivddFxoH.js.map} +1 -1
  24. package/dist/{css-BkNqUfLD.js → css-tUcQKLko.js} +5 -5
  25. package/dist/{css-BkNqUfLD.js.map → css-tUcQKLko.js.map} +1 -1
  26. package/dist/css.js +1 -1
  27. package/dist/{css_extra-BC1Z_hDy.js → css_extra-FjU7uCIO.js} +2 -2
  28. package/dist/{css_extra-BC1Z_hDy.js.map → css_extra-FjU7uCIO.js.map} +1 -1
  29. package/dist/dev/rsc.js +5 -5
  30. package/dist/{dev-BoEgFs_x.js → dev-CZUGQ_Ps.js} +3 -3
  31. package/dist/{dev-BoEgFs_x.js.map → dev-CZUGQ_Ps.js.map} +1 -1
  32. package/dist/dev.js +1 -1
  33. package/dist/{elementMarker-nYeJnJPQ.js → elementMarker-BCL0sycL.js} +99 -21
  34. package/dist/elementMarker-BCL0sycL.js.map +1 -0
  35. package/dist/entry/dev/adapter/preact.js +1 -1
  36. package/dist/entry/dev/adapter/react.js +1 -1
  37. package/dist/entry/dev/adapter/solid.js +1 -1
  38. package/dist/entry/dev/css.js +1 -1
  39. package/dist/entry/dev/jsx-dev-runtime.js +1 -1
  40. package/dist/entry/dev/jsx-runtime.js +1 -1
  41. package/dist/entry/dev.js +5 -5
  42. package/dist/entry/prod/css.js +2 -2
  43. package/dist/entry/prod.js +2 -2
  44. package/dist/entry/rsc-dev/adapter/preact.js +1 -1
  45. package/dist/entry/rsc-dev/adapter/react.js +1 -1
  46. package/dist/entry/rsc-dev/adapter/solid.js +1 -1
  47. package/dist/entry/rsc-dev/css.js +3 -3
  48. package/dist/entry/rsc-dev/dev.js +4 -4
  49. package/dist/entry/rsc-dev/jsx-dev-runtime.js +3 -3
  50. package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
  51. package/dist/entry/rsc-dev.js +6 -6
  52. package/dist/entry/rsc-dev.js.map +1 -1
  53. package/dist/entry/rsc-prod/css.js +2 -2
  54. package/dist/entry/rsc-prod.js +2 -2
  55. package/dist/{env-BcNl1tsJ.js → env-CljhzScj.js} +2 -2
  56. package/dist/{env-BcNl1tsJ.js.map → env-CljhzScj.js.map} +1 -1
  57. package/dist/{getClassName-B3azD1TO.js → getClassName-DKk03IJU.js} +3 -3
  58. package/dist/{getClassName-B3azD1TO.js.map → getClassName-DKk03IJU.js.map} +1 -1
  59. package/dist/{getClassName-CkTq92nR.js → getClassName-a1SH7I2q.js} +3 -3
  60. package/dist/{getClassName-CkTq92nR.js.map → getClassName-a1SH7I2q.js.map} +1 -1
  61. package/dist/{globalSheet-CdgVpvCb.js → globalSheet-CjX0Df0w.js} +3 -3
  62. package/dist/globalSheet-CjX0Df0w.js.map +1 -0
  63. package/dist/index.js +4 -4
  64. package/dist/jsx/jsx-dev-runtime.js +1 -1
  65. package/dist/jsx/jsx-dev-runtime.server.js +1 -1
  66. package/dist/jsx/jsx-runtime.js +1 -1
  67. package/dist/jsx/jsx-runtime.server.js +1 -1
  68. package/dist/{jsx-DA1LD8nU.js → jsx-Gs5YwesA.js} +3 -3
  69. package/dist/{jsx-DA1LD8nU.js.map → jsx-Gs5YwesA.js.map} +1 -1
  70. package/dist/{jsx_runtime-pt7DOZOE.js → jsx_runtime-D3Dc1XfC.js} +3 -3
  71. package/dist/{jsx_runtime-pt7DOZOE.js.map → jsx_runtime-D3Dc1XfC.js.map} +1 -1
  72. package/dist/{loader-Cvz2pKYV.mjs → loader-CR_NH6ub.mjs} +3 -3
  73. package/dist/{loader-Cvz2pKYV.mjs.map → loader-CR_NH6ub.mjs.map} +1 -1
  74. package/dist/{misc-BKaSZF14.mjs → misc-D5AjOWP-.mjs} +3 -3
  75. package/dist/misc-D5AjOWP-.mjs.map +1 -0
  76. package/dist/plugin/farm/index.mjs +4 -4
  77. package/dist/plugin/farm/index.mjs.map +1 -1
  78. package/dist/plugin/nextjs/index.mjs +5 -5
  79. package/dist/plugin/nextjs/index.mjs.map +1 -1
  80. package/dist/plugin/nextjs/loader.mjs +4 -4
  81. package/dist/plugin/parcel/index.cjs +1 -1
  82. package/dist/plugin/parcel/index.mjs +2 -2
  83. package/dist/plugin/parcel/optimizer.cjs +1 -1
  84. package/dist/plugin/parcel/optimizer.mjs +2 -2
  85. package/dist/plugin/parcel/resolver.cjs +1 -1
  86. package/dist/plugin/parcel/resolver.mjs +2 -2
  87. package/dist/plugin/parcel/runtime.cjs +1 -1
  88. package/dist/plugin/parcel/runtime.mjs +1 -1
  89. package/dist/plugin/parcel/transformer.cjs +1 -1
  90. package/dist/plugin/parcel/transformer.mjs +2 -2
  91. package/dist/plugin/rspack/index.mjs +2 -2
  92. package/dist/plugin/vite/index.mjs +6 -6
  93. package/dist/plugin/vite/index.mjs.map +1 -1
  94. package/dist/plugin/webpack/index.mjs +2 -2
  95. package/dist/plugin/webpack/loader.mjs +2 -2
  96. package/dist/{registry-Bbxm5X90.mjs → registry-CdSHrX-o.mjs} +2 -2
  97. package/dist/{registry-Bbxm5X90.mjs.map → registry-CdSHrX-o.mjs.map} +1 -1
  98. package/dist/{resolveClassNameRuntime-B6vKNL5y.js → resolveClassNameRuntime-BBI9nYtq.js} +2 -2
  99. package/dist/{resolveClassNameRuntime-B6vKNL5y.js.map → resolveClassNameRuntime-BBI9nYtq.js.map} +1 -1
  100. package/dist/server.js +7 -7
  101. package/dist/{shared-L-63tURh.cjs → shared-CcB1KDFI.cjs} +557 -47
  102. package/dist/shared-CcB1KDFI.cjs.map +1 -0
  103. package/dist/{shared-BVciI9ew.mjs → shared-CobOEWzt.mjs} +5 -5
  104. package/dist/shared-CobOEWzt.mjs.map +1 -0
  105. package/dist/sheet-AV0Sl7e2.js +1 -0
  106. package/dist/sheet-Bf09AL2O.js +7 -0
  107. package/dist/{sheet-D_grHnaJ.js.map → sheet-Bf09AL2O.js.map} +1 -1
  108. package/dist/{sheet-C6ymGhKV.js → sheet-CcwxBK3r.js} +2 -2
  109. package/dist/{sheet-C6ymGhKV.js.map → sheet-CcwxBK3r.js.map} +1 -1
  110. package/dist/{sidecar-B7Q2P71F.mjs → sidecar-CHDVQqN_.mjs} +3 -3
  111. package/dist/{sidecar-B7Q2P71F.mjs.map → sidecar-CHDVQqN_.mjs.map} +1 -1
  112. package/dist/{style-CRs-vfY1.js → style-DY3v7k9y.js} +3 -3
  113. package/dist/style-DY3v7k9y.js.map +1 -0
  114. package/dist/{styleStore-D1IEmq1v.js → styleStore-BpkbvtBI.js} +99 -21
  115. package/dist/styleStore-BpkbvtBI.js.map +1 -0
  116. package/dist/{styleStore-HI4V2puu.js → styleStore-DWEAtd8z.js} +3 -3
  117. package/dist/{styleStore-HI4V2puu.js.map → styleStore-DWEAtd8z.js.map} +1 -1
  118. package/dist/{trace-DdFJPELS.js → trace-BxvaCfGx.js} +2 -2
  119. package/dist/{trace-DdFJPELS.js.map → trace-BxvaCfGx.js.map} +1 -1
  120. package/dist/{trace-uHVvnYiw.js → trace-Db5et6nx.js} +2 -2
  121. package/dist/{trace-uHVvnYiw.js.map → trace-Db5et6nx.js.map} +1 -1
  122. package/dist/transform-BZ4jPwy3.js.map +1 -1
  123. package/dist/types/atomic/utils/types.d.ts +3 -2
  124. package/dist/types/builder/utils.d.ts +1 -1
  125. package/dist/types/compiler/compiler/cache_identity.d.ts +4 -0
  126. package/dist/types/compiler/compiler/compiler.d.ts +12 -0
  127. package/dist/types/compiler/compiler/persistent_cache.d.ts +14 -0
  128. package/dist/types/compiler/compiler/types.d.ts +11 -0
  129. package/dist/types/compiler/extract/collector.d.ts +1 -1
  130. package/dist/types/compiler/transform/evaluator/metadata_cache.d.ts +13 -0
  131. package/dist/types/compiler/transform/evaluator/tracer.d.ts +6 -0
  132. package/dist/types/compiler/utils/check_diagnostics.d.ts +7 -0
  133. package/dist/types/compiler/utils/file_resolver.d.ts +4 -0
  134. package/dist/types/index.d.ts +1 -1
  135. package/dist/types/plugin/bundler/vite/state.d.ts +24 -0
  136. package/dist/types/plugin/utils/compiler.d.ts +12 -1
  137. package/dist/types/style/tokens.d.ts +1 -1
  138. package/dist/types/style/transform.d.ts +4 -3
  139. package/dist/{utils-CB70kIh6.js → utils-B3O2b3Ly.js} +3 -3
  140. package/dist/{utils-CB70kIh6.js.map → utils-B3O2b3Ly.js.map} +1 -1
  141. package/dist/{utils-sG7IWYP6.js → utils-BeJmRz7x.js} +99 -21
  142. package/dist/utils-BeJmRz7x.js.map +1 -0
  143. package/dist/{utils-D2QdzQkX.mjs → utils-CICsXGqS.mjs} +5 -5
  144. package/dist/utils-CICsXGqS.mjs.map +1 -0
  145. package/dist/{utils-D3KR1ht8.mjs → utils-XfsnoteV.mjs} +3 -3
  146. package/dist/{utils-D3KR1ht8.mjs.map → utils-XfsnoteV.mjs.map} +1 -1
  147. package/dist/{webpack-DRegoWgj.mjs → webpack-BAflvDbq.mjs} +6 -6
  148. package/dist/webpack-BAflvDbq.mjs.map +1 -0
  149. package/index.ts +1 -0
  150. package/package.json +2 -2
  151. package/plugin/bundler/farm/plugin.ts +1 -1
  152. package/plugin/bundler/parcel/shared.ts +1 -1
  153. package/plugin/bundler/vite/state.ts +5 -6
  154. package/plugin/bundler/webpack/plugin.ts +1 -1
  155. package/plugin/nextjs/plugin.ts +1 -1
  156. package/plugin/nextjs/utils.ts +1 -1
  157. package/plugin/utils/compiler.ts +1 -2
  158. package/sheet/dev/dev_layer.ts +55 -11
  159. package/sheet/dev/dev_sort.ts +16 -9
  160. package/sheet/ordered.ts +43 -6
  161. package/style/tokens.ts +2 -1
  162. package/style/transform.ts +4 -3
  163. package/dist/compiler-Cat8TmMk.mjs.map +0 -1
  164. package/dist/css-C7tcD3IO.js.map +0 -1
  165. package/dist/elementMarker-nYeJnJPQ.js.map +0 -1
  166. package/dist/globalSheet-CdgVpvCb.js.map +0 -1
  167. package/dist/misc-BKaSZF14.mjs.map +0 -1
  168. package/dist/shared-BVciI9ew.mjs.map +0 -1
  169. package/dist/shared-L-63tURh.cjs.map +0 -1
  170. package/dist/sheet-Biw_rI4_.js +0 -1
  171. package/dist/sheet-D_grHnaJ.js +0 -7
  172. package/dist/style-CRs-vfY1.js.map +0 -1
  173. package/dist/styleStore-D1IEmq1v.js.map +0 -1
  174. package/dist/utils-D2QdzQkX.mjs.map +0 -1
  175. package/dist/utils-sG7IWYP6.js.map +0 -1
  176. package/dist/webpack-DRegoWgj.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { n as getGlobalData, r as globalData } from "./global-DGcWZODV.js";
2
2
  import { a as RUNTIME_CONFIG, c as CSS_CONFIG } from "./debug-Bo43rBKc.js";
3
3
  import { y as DEV_CONFIG } from "./hash-CjTP-uES.js";
4
- import { _ as serializeOrderedRules } from "./elementMarker-nYeJnJPQ.js";
5
- import { t as IS_SERVER_RUNTIME } from "./env-BcNl1tsJ.js";
4
+ import { _ as serializeOrderedRules } from "./elementMarker-BCL0sycL.js";
5
+ import { t as IS_SERVER_RUNTIME } from "./env-CljhzScj.js";
6
6
  //#region runtime/rsc/constants.ts
7
7
  const GLOBAL_SEED_ATTR = "data-css-global-seed-dev";
8
8
  const GLOBAL_RULES_ATTR = "data-css-global-rules-dev";
@@ -42,4 +42,4 @@ function getRscStyleStore() {
42
42
  //#endregion
43
43
  export { GLOBAL_RULES_ATTR as a, SEED_STYLE_TAG_ATTR as c, ELEMENT_CSS_DATA_ATTR as i, SEED_STYLE_TAG_HREF as l, getRscStyleRules as n, GLOBAL_SEED_ATTR as o, serializeRscRules as r, PRECOLLECT_LINK_TAG_ATTR as s, addRscStyleRules as t };
44
44
 
45
- //# sourceMappingURL=styleStore-HI4V2puu.js.map
45
+ //# sourceMappingURL=styleStore-DWEAtd8z.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styleStore-HI4V2puu.js","names":[],"sources":["../runtime/rsc/constants.ts","../runtime/rsc/styleStore.ts"],"sourcesContent":["export const GLOBAL_SEED_ATTR = 'data-css-global-seed-dev';\nexport const GLOBAL_RULES_ATTR = 'data-css-global-rules-dev';\n\nexport const ELEMENT_CSS_DATA_ATTR = 'data-css-dev';\n\nexport const PRECOLLECT_LINK_TAG_ATTR = 'data-fluentic-style-rsc-dev-link';\n\nexport const SEED_STYLE_TAG_ATTR = 'data-fluentic-style-rsc-dev-style';\nexport const SEED_STYLE_TAG_HREF = 'href-fluentic-style-rsc-dev-style';\n","import { CSS_CONFIG } from '../../config/config/css';\nimport { DEV_CONFIG } from '../../config/config/dev';\nimport { RUNTIME_CONFIG } from '../../config/config/runtime';\nimport type { SheetRule } from '../../sheet';\nimport { serializeOrderedRules } from '../../sheet/ordering';\nimport { clearGlobalData, getGlobalData, globalData } from '../../utils/global';\nimport { IS_SERVER_RUNTIME } from '../env';\n\nconst GLOBAL_KEY = 'runtime.rsc.styleStore';\n\ntype RscStyleStore = {\n rules: SheetRule[];\n keys: Set<string>;\n //\n counter: number;\n lastCounter: number;\n};\n\nexport function addRscStyleRules(rules: SheetRule[]): void {\n if (!RUNTIME_CONFIG.isRSC) return;\n if (!IS_SERVER_RUNTIME) return;\n\n const store = getRscStyleStore();\n\n for (let i = 0, len = rules.length; i < len; i++) {\n const rule = rules[i];\n if (!rule.key || !rule.css || store.keys.has(rule.key)) continue;\n\n store.keys.add(rule.key);\n store.rules.push(rule);\n }\n\n store.counter += 1;\n}\n\nexport function getRscStyleCssIfChanged() {\n const store = getGlobalData<RscStyleStore>(GLOBAL_KEY);\n if (!store) return null;\n\n if (store.counter === store.lastCounter) return null;\n\n store.lastCounter = store.counter;\n\n return getRscStyleCss();\n}\n\nexport function getRscStyleCss(): string {\n if (!RUNTIME_CONFIG.isRSC) return '';\n if (!IS_SERVER_RUNTIME) return '';\n\n return serializeRscRules(getRscStyleRules());\n}\n\nexport function getRscStyleRules(): readonly SheetRule[] {\n return getGlobalData<RscStyleStore>(GLOBAL_KEY)?.rules ?? [];\n}\n\nexport function serializeRscRules(rules: readonly SheetRule[]): string {\n return serializeOrderedRules(rules, CSS_CONFIG, DEV_CONFIG.stylePriorityMode);\n}\n\nfunction getRscStyleStore(): RscStyleStore {\n return globalData(GLOBAL_KEY, () => ({\n counter: 0,\n lastCounter: 0,\n rules: [],\n keys: new Set(),\n }));\n}\n\nexport function clearRscStyleStore(): void {\n clearGlobalData(GLOBAL_KEY);\n}\n"],"mappings":";;;;;;AAAA,MAAa,mBAAmB;AAChC,MAAa,oBAAoB;AAEjC,MAAa,wBAAwB;AAErC,MAAa,2BAA2B;AAExC,MAAa,sBAAsB;AACnC,MAAa,sBAAsB;;;ACAnC,MAAM,aAAa;AAUnB,SAAgB,iBAAiB,OAA0B;CACzD,IAAI,CAAC,eAAe,OAAO;CAC3B,IAAI,CAAC,mBAAmB;CAExB,MAAM,QAAQ,iBAAiB;CAE/B,KAAK,IAAI,IAAI,GAAG,MAAM,MAAM,QAAQ,IAAI,KAAK,KAAK;EAChD,MAAM,OAAO,MAAM;EACnB,IAAI,CAAC,KAAK,OAAO,CAAC,KAAK,OAAO,MAAM,KAAK,IAAI,KAAK,GAAG,GAAG;EAExD,MAAM,KAAK,IAAI,KAAK,GAAG;EACvB,MAAM,MAAM,KAAK,IAAI;CACvB;CAEA,MAAM,WAAW;AACnB;AAoBA,SAAgB,mBAAyC;CACvD,OAAO,cAA6B,UAAU,GAAG,SAAS,CAAC;AAC7D;AAEA,SAAgB,kBAAkB,OAAqC;CACrE,OAAO,sBAAsB,OAAO,YAAY,WAAW,iBAAiB;AAC9E;AAEA,SAAS,mBAAkC;CACzC,OAAO,WAAW,mBAAmB;EACnC,SAAS;EACT,aAAa;EACb,OAAO,CAAC;EACR,sBAAM,IAAI,IAAI;CAChB,EAAE;AACJ"}
1
+ {"version":3,"file":"styleStore-DWEAtd8z.js","names":[],"sources":["../runtime/rsc/constants.ts","../runtime/rsc/styleStore.ts"],"sourcesContent":["export const GLOBAL_SEED_ATTR = 'data-css-global-seed-dev';\nexport const GLOBAL_RULES_ATTR = 'data-css-global-rules-dev';\n\nexport const ELEMENT_CSS_DATA_ATTR = 'data-css-dev';\n\nexport const PRECOLLECT_LINK_TAG_ATTR = 'data-fluentic-style-rsc-dev-link';\n\nexport const SEED_STYLE_TAG_ATTR = 'data-fluentic-style-rsc-dev-style';\nexport const SEED_STYLE_TAG_HREF = 'href-fluentic-style-rsc-dev-style';\n","import { CSS_CONFIG } from '../../config/config/css';\nimport { DEV_CONFIG } from '../../config/config/dev';\nimport { RUNTIME_CONFIG } from '../../config/config/runtime';\nimport type { SheetRule } from '../../sheet';\nimport { serializeOrderedRules } from '../../sheet/ordering';\nimport { clearGlobalData, getGlobalData, globalData } from '../../utils/global';\nimport { IS_SERVER_RUNTIME } from '../env';\n\nconst GLOBAL_KEY = 'runtime.rsc.styleStore';\n\ntype RscStyleStore = {\n rules: SheetRule[];\n keys: Set<string>;\n //\n counter: number;\n lastCounter: number;\n};\n\nexport function addRscStyleRules(rules: SheetRule[]): void {\n if (!RUNTIME_CONFIG.isRSC) return;\n if (!IS_SERVER_RUNTIME) return;\n\n const store = getRscStyleStore();\n\n for (let i = 0, len = rules.length; i < len; i++) {\n const rule = rules[i];\n if (!rule.key || !rule.css || store.keys.has(rule.key)) continue;\n\n store.keys.add(rule.key);\n store.rules.push(rule);\n }\n\n store.counter += 1;\n}\n\nexport function getRscStyleCssIfChanged() {\n const store = getGlobalData<RscStyleStore>(GLOBAL_KEY);\n if (!store) return null;\n\n if (store.counter === store.lastCounter) return null;\n\n store.lastCounter = store.counter;\n\n return getRscStyleCss();\n}\n\nexport function getRscStyleCss(): string {\n if (!RUNTIME_CONFIG.isRSC) return '';\n if (!IS_SERVER_RUNTIME) return '';\n\n return serializeRscRules(getRscStyleRules());\n}\n\nexport function getRscStyleRules(): readonly SheetRule[] {\n return getGlobalData<RscStyleStore>(GLOBAL_KEY)?.rules ?? [];\n}\n\nexport function serializeRscRules(rules: readonly SheetRule[]): string {\n return serializeOrderedRules(rules, CSS_CONFIG, DEV_CONFIG.stylePriorityMode);\n}\n\nfunction getRscStyleStore(): RscStyleStore {\n return globalData(GLOBAL_KEY, () => ({\n counter: 0,\n lastCounter: 0,\n rules: [],\n keys: new Set(),\n }));\n}\n\nexport function clearRscStyleStore(): void {\n clearGlobalData(GLOBAL_KEY);\n}\n"],"mappings":";;;;;;AAAA,MAAa,mBAAmB;AAChC,MAAa,oBAAoB;AAEjC,MAAa,wBAAwB;AAErC,MAAa,2BAA2B;AAExC,MAAa,sBAAsB;AACnC,MAAa,sBAAsB;;;ACAnC,MAAM,aAAa;AAUnB,SAAgB,iBAAiB,OAA0B;CACzD,IAAI,CAAC,eAAe,OAAO;CAC3B,IAAI,CAAC,mBAAmB;CAExB,MAAM,QAAQ,iBAAiB;CAE/B,KAAK,IAAI,IAAI,GAAG,MAAM,MAAM,QAAQ,IAAI,KAAK,KAAK;EAChD,MAAM,OAAO,MAAM;EACnB,IAAI,CAAC,KAAK,OAAO,CAAC,KAAK,OAAO,MAAM,KAAK,IAAI,KAAK,GAAG,GAAG;EAExD,MAAM,KAAK,IAAI,KAAK,GAAG;EACvB,MAAM,MAAM,KAAK,IAAI;CACvB;CAEA,MAAM,WAAW;AACnB;AAoBA,SAAgB,mBAAyC;CACvD,OAAO,cAA6B,UAAU,GAAG,SAAS,CAAC;AAC7D;AAEA,SAAgB,kBAAkB,OAAqC;CACrE,OAAO,sBAAsB,OAAO,YAAY,WAAW,iBAAiB;AAC9E;AAEA,SAAS,mBAAkC;CACzC,OAAO,WAAW,mBAAmB;EACnC,SAAS;EACT,aAAa;EACb,OAAO,CAAC;EACR,sBAAM,IAAI,IAAI;CAChB,EAAE;AACJ"}
@@ -1,5 +1,5 @@
1
1
  import { h as normalizeCallsiteSourceUrl } from "./hash-CjTP-uES.js";
2
- import { f as getDevSourcemapTags, h as getSourcemapRuleCallsite, m as createSourceMapComment } from "./elementMarker-nYeJnJPQ.js";
2
+ import { f as getDevSourcemapTags, h as getSourcemapRuleCallsite, m as createSourceMapComment } from "./elementMarker-BCL0sycL.js";
3
3
  import { TraceMap, originalPositionFor, sourceContentFor } from "@jridgewell/trace-mapping";
4
4
  //#region dev/trace.ts
5
5
  const SOURCE_MAPPING_URL_REGEX = /(?:\/\/|\/\*)[#@]\s*sourceMappingURL=([^\s*]+)(?:\s*\*\/)?/g;
@@ -242,4 +242,4 @@ function isAbsoluteSource(source) {
242
242
  //#endregion
243
243
  export { traceDevSourcemaps };
244
244
 
245
- //# sourceMappingURL=trace-DdFJPELS.js.map
245
+ //# sourceMappingURL=trace-BxvaCfGx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace-DdFJPELS.js","names":[],"sources":["../dev/trace.ts"],"sourcesContent":["import { type EncodedSourceMap, originalPositionFor, sourceContentFor, TraceMap } from '@jridgewell/trace-mapping';\nimport { getDevSourcemapTags } from '../sheet/dev';\nimport { createSourceMapComment, getSourcemapRuleCallsite } from '../sheet/sourcemap';\nimport type { SheetCallsite } from '../sheet/types';\nimport { normalizeCallsiteSourceUrl } from '../utils/trace';\n\nexport type TraceSourcemapResult = {\n tags: number;\n rules: number;\n remapped: number;\n unresolved: number;\n sourcemaps: string[];\n};\n\ntype SourceMapData = {\n url: string;\n sourceBaseUrl: string;\n rawMap: EncodedSourceMap;\n map: TraceMap;\n sourceRoot?: string;\n};\n\nconst SOURCE_MAPPING_URL_REGEX = /(?:\\/\\/|\\/\\*)[#@]\\s*sourceMappingURL=([^\\s*]+)(?:\\s*\\*\\/)?/g;\n\nexport async function traceDevSourcemaps(): Promise<TraceSourcemapResult> {\n const activeTags = getDevSourcemapTags().filter((item) =>\n item.sourceMapNode && item.sourceMapNode.parentNode === item.tag\n );\n const browserWindow = getBrowserWindow();\n const fetcher = browserWindow?.fetch?.bind(browserWindow);\n const sourceMapCache = new Map<string, Promise<SourceMapData | null>>();\n const sourcemaps = new Set<string>();\n let rules = 0;\n let remapped = 0;\n let unresolved = 0;\n\n for (let i = 0, len = activeTags.length; i < len; i++) {\n const item = activeTags[i];\n let touched = false;\n\n for (let j = 0, ruleLen = item.rules.length; j < ruleLen; j++) {\n const rule = item.rules[j];\n const callsite = getSourcemapRuleCallsite(rule);\n\n if (!callsite) continue;\n if (isDisplaySourceUrl(callsite.sourceUrl || callsite.filePath)) continue;\n\n rules++;\n\n const nextCallsite = await traceCallsiteSourcemap(\n callsite,\n fetcher,\n sourceMapCache,\n );\n\n if (nextCallsite) {\n if (nextCallsite.sourceMapUrl) sourcemaps.add(nextCallsite.sourceMapUrl);\n rule.callsite = nextCallsite.callsite;\n rule.debug = null;\n rule.debugField = null;\n remapped++;\n } else {\n rule.callsite = createDisplayCallsite(callsite);\n rule.debug = null;\n rule.debugField = null;\n unresolved++;\n }\n\n touched = true;\n }\n\n if (touched) {\n rewriteDevSourcemapTag(item);\n }\n }\n\n return {\n tags: activeTags.length,\n rules,\n remapped,\n unresolved,\n sourcemaps: [...sourcemaps],\n };\n}\n\nasync function traceCallsiteSourcemap(\n callsite: SheetCallsite,\n fetcher: typeof fetch | undefined,\n sourceMapCache: Map<string, Promise<SourceMapData | null>>,\n): Promise<{ callsite: SheetCallsite; sourceMapUrl: string; } | null> {\n if (!fetcher) return null;\n\n const generatedUrl = getFetchableGeneratedUrl(\n callsite.sourceUrl || callsite.filePath,\n );\n\n if (!generatedUrl) return null;\n\n let sourceMapPromise = sourceMapCache.get(generatedUrl);\n\n if (!sourceMapPromise) {\n sourceMapPromise = fetchSourceMap(getGeneratedUrlFetchCandidates(generatedUrl), fetcher);\n sourceMapCache.set(generatedUrl, sourceMapPromise);\n }\n\n const sourceMap = await sourceMapPromise;\n\n if (!sourceMap) return null;\n\n const original = originalPositionFor(sourceMap.map, {\n line: callsite.line,\n column: Math.max(callsite.column - 1, 0),\n });\n\n if (!original.source || original.line == null || original.column == null) {\n return null;\n }\n\n const sourceUrl = resolveOriginalSourceUrl(\n original.source,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const sourceContent = getSourceContent(sourceMap, original.source, sourceUrl);\n const displaySourceUrl = getDisplaySourceUrl(sourceUrl);\n\n return {\n sourceMapUrl: sourceMap.url,\n callsite: {\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n sourceContent,\n line: original.line,\n column: original.column + 1,\n },\n };\n}\n\nfunction rewriteDevSourcemapTag(item: ReturnType<typeof getDevSourcemapTags>[number]) {\n const document = item.tag.ownerDocument;\n\n item.tag.textContent = '';\n\n for (let i = 0, len = item.rules.length; i < len; i++) {\n item.tag.appendChild(document.createTextNode(item.rules[i].css + '\\n'));\n }\n\n item.sourceMapNode = document.createTextNode('\\n' + createSourceMapComment(item.rules));\n item.tag.appendChild(item.sourceMapNode);\n}\n\nfunction createDisplayCallsite(callsite: SheetCallsite): SheetCallsite {\n const displaySourceUrl = getDisplaySourceUrl(callsite.sourceUrl || callsite.filePath);\n\n return {\n ...callsite,\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n };\n}\n\nfunction isDisplaySourceUrl(sourceUrl: string) {\n return sourceUrl.match(SOURCE_MAPPING_URL_REGEX);\n}\n\nasync function fetchSourceMap(\n generatedUrls: string[],\n fetcher: typeof fetch,\n): Promise<SourceMapData | null> {\n for (const generatedUrl of generatedUrls) {\n try {\n const response = await fetcher(generatedUrl);\n\n if (!response.ok) continue;\n\n const source = await response.text();\n const sourceMapUrl = findSourceMapUrl(source, generatedUrl);\n\n if (!sourceMapUrl) continue;\n\n const rawMap = await loadSourceMap(sourceMapUrl, fetcher);\n\n if (!rawMap) continue;\n\n const sourceBaseUrl = sourceMapUrl.startsWith('data:')\n ? normalizeGeneratedUrl(generatedUrl)\n : sourceMapUrl;\n\n return {\n url: sourceMapUrl,\n sourceBaseUrl,\n rawMap,\n map: new TraceMap(rawMap, sourceBaseUrl),\n sourceRoot: typeof rawMap.sourceRoot === 'string' ? rawMap.sourceRoot : undefined,\n };\n } catch {\n // Try the next generated URL variant.\n }\n }\n\n return null;\n}\n\nasync function loadSourceMap(sourceMapUrl: string, fetcher: typeof fetch) {\n try {\n if (sourceMapUrl.startsWith('data:')) {\n return parseDataUrlSourceMap(sourceMapUrl);\n }\n\n const response = await fetcher(sourceMapUrl);\n\n if (!response.ok) return null;\n\n return JSON.parse(await response.text()) as EncodedSourceMap;\n } catch {\n return null;\n }\n}\n\nfunction findSourceMapUrl(source: string, generatedUrl: string) {\n let match: RegExpExecArray | null = null;\n let sourceMapUrl: string | null = null;\n\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n\n while ((match = SOURCE_MAPPING_URL_REGEX.exec(source))) {\n sourceMapUrl = match[1];\n }\n\n if (!sourceMapUrl) return null;\n if (sourceMapUrl.startsWith('data:')) return sourceMapUrl;\n\n try {\n return new URL(sourceMapUrl, generatedUrl).href;\n } catch {\n return null;\n }\n}\n\nfunction parseDataUrlSourceMap(sourceMapUrl: string) {\n const commaIndex = sourceMapUrl.indexOf(',');\n\n if (commaIndex === -1) return null;\n\n const meta = sourceMapUrl.slice(0, commaIndex);\n const data = sourceMapUrl.slice(commaIndex + 1);\n const json = meta.endsWith(';base64') ? atob(data) : decodeURIComponent(data);\n\n return JSON.parse(json) as EncodedSourceMap;\n}\n\nfunction getFetchableGeneratedUrl(\n source: string,\n): string | null {\n source = normalizeCallsiteSourceUrl(source);\n\n if (source.startsWith('webpack://') || source.startsWith('node:')) {\n return null;\n }\n\n try {\n return new URL(source).href;\n } catch {\n // Continue with a browser-relative resolution below.\n }\n\n const base = getBrowserLocationHref();\n\n if (!base) return null;\n\n try {\n return new URL(source, base).href;\n } catch {\n return null;\n }\n}\n\nfunction getGeneratedUrlFetchCandidates(url: string) {\n const normalized = normalizeGeneratedUrl(url);\n\n return url === normalized ? [url] : [url, normalized];\n}\n\nfunction getDisplaySourceUrl(sourceUrl: string) {\n sourceUrl = normalizeCallsiteSourceUrl(sourceUrl);\n const normalized = normalizeGeneratedUrl(sourceUrl);\n\n try {\n const url = new URL(normalized);\n return 'source:///' + url.pathname.replace(/^\\/+/, '');\n } catch {\n return 'source:///' + normalized.replace(/^\\/+/, '');\n }\n}\n\nfunction getSourceContent(\n sourceMap: SourceMapData,\n originalSource: string,\n resolvedSourceUrl: string,\n) {\n const tracedContent = sourceContentFor(sourceMap.map, originalSource);\n\n if (tracedContent != null) return tracedContent;\n\n const rawSources = sourceMap.rawMap.sources;\n const rawSourcesContent = sourceMap.rawMap.sourcesContent;\n\n if (!rawSources || !rawSourcesContent) return undefined;\n\n const sourceKeys = getSourceMatchKeys(originalSource, resolvedSourceUrl);\n\n for (let i = 0, len = rawSources.length; i < len; i++) {\n const rawSource = rawSources[i];\n const rawContent = rawSourcesContent[i];\n\n if (typeof rawSource !== 'string') continue;\n if (typeof rawContent !== 'string') continue;\n\n const rawSourceUrl = resolveOriginalSourceUrl(\n rawSource,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const rawKeys = getSourceMatchKeys(rawSource, rawSourceUrl);\n\n for (const key of rawKeys) {\n if (sourceKeys.has(key)) return rawContent;\n }\n }\n\n return undefined;\n}\n\nfunction getSourceMatchKeys(...sources: string[]) {\n const keys = new Set<string>();\n\n for (const source of sources) {\n if (!source) continue;\n\n keys.add(source);\n keys.add(normalizeGeneratedUrl(source));\n\n try {\n const url = new URL(source);\n keys.add(url.pathname);\n keys.add(normalizeGeneratedUrl(url.pathname));\n } catch {\n // Non-URL sources are still useful as exact keys.\n }\n }\n\n return keys;\n}\n\nfunction normalizeGeneratedUrl(source: string) {\n try {\n const url = new URL(source);\n\n url.search = '';\n url.hash = '';\n\n return url.href;\n } catch {\n const queryIndex = findFirstIndex(source, ['?', '#']);\n\n return queryIndex === -1 ? source : source.slice(0, queryIndex);\n }\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction getBrowserLocationHref() {\n return getBrowserWindow()?.location.href;\n}\n\nfunction getBrowserWindow() {\n return typeof window === 'undefined' ? null : window;\n}\n\nfunction resolveOriginalSourceUrl(\n source: string,\n sourceMapUrl: string,\n sourceRoot?: string,\n) {\n if (isAbsoluteSource(source)) return source;\n\n try {\n if (sourceRoot && !isAbsoluteSource(sourceRoot)) {\n return new URL(sourceRoot.replace(/\\/?$/, '/') + source, sourceMapUrl).href;\n }\n\n if (sourceRoot) {\n return new URL(source, sourceRoot).href;\n }\n\n return new URL(source, sourceMapUrl).href;\n } catch {\n return sourceRoot ? sourceRoot.replace(/\\/?$/, '/') + source : source;\n }\n}\n\nfunction isAbsoluteSource(source: string) {\n return /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(source) || source.startsWith('/');\n}\n"],"mappings":";;;;AAsBA,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AC5C,OAAO,IAAI,IAAI,WAAW,QAAQ,QAAQ,GAAG,IAAI,QAAQ,YAAY,EAAE;EAGzE,IAAI,YACF,OAAO,IAAI,IAAI,QAAQ,UAAU,EAAE;EAGrC,OAAO,IAAI,IAAI,QAAQ,YAAY,EAAE;CACvC,QAAQ;EACN,OAAO,aAAa,WAAW,QAAQ,QAAQ,GAAG,IAAI,SAAS;CACjE;AACF;AAEA,SAAS,iBAAiB,QAAgB;CACxC,OAAO,2BAA2B,KAAK,MAAM,KAAK,OAAO,WAAW,GAAG;AACzE"}
1
+ {"version":3,"file":"trace-BxvaCfGx.js","names":[],"sources":["../dev/trace.ts"],"sourcesContent":["import { type EncodedSourceMap, originalPositionFor, sourceContentFor, TraceMap } from '@jridgewell/trace-mapping';\nimport { getDevSourcemapTags } from '../sheet/dev';\nimport { createSourceMapComment, getSourcemapRuleCallsite } from '../sheet/sourcemap';\nimport type { SheetCallsite } from '../sheet/types';\nimport { normalizeCallsiteSourceUrl } from '../utils/trace';\n\nexport type TraceSourcemapResult = {\n tags: number;\n rules: number;\n remapped: number;\n unresolved: number;\n sourcemaps: string[];\n};\n\ntype SourceMapData = {\n url: string;\n sourceBaseUrl: string;\n rawMap: EncodedSourceMap;\n map: TraceMap;\n sourceRoot?: string;\n};\n\nconst SOURCE_MAPPING_URL_REGEX = /(?:\\/\\/|\\/\\*)[#@]\\s*sourceMappingURL=([^\\s*]+)(?:\\s*\\*\\/)?/g;\n\nexport async function traceDevSourcemaps(): Promise<TraceSourcemapResult> {\n const activeTags = getDevSourcemapTags().filter((item) =>\n item.sourceMapNode && item.sourceMapNode.parentNode === item.tag\n );\n const browserWindow = getBrowserWindow();\n const fetcher = browserWindow?.fetch?.bind(browserWindow);\n const sourceMapCache = new Map<string, Promise<SourceMapData | null>>();\n const sourcemaps = new Set<string>();\n let rules = 0;\n let remapped = 0;\n let unresolved = 0;\n\n for (let i = 0, len = activeTags.length; i < len; i++) {\n const item = activeTags[i];\n let touched = false;\n\n for (let j = 0, ruleLen = item.rules.length; j < ruleLen; j++) {\n const rule = item.rules[j];\n const callsite = getSourcemapRuleCallsite(rule);\n\n if (!callsite) continue;\n if (isDisplaySourceUrl(callsite.sourceUrl || callsite.filePath)) continue;\n\n rules++;\n\n const nextCallsite = await traceCallsiteSourcemap(\n callsite,\n fetcher,\n sourceMapCache,\n );\n\n if (nextCallsite) {\n if (nextCallsite.sourceMapUrl) sourcemaps.add(nextCallsite.sourceMapUrl);\n rule.callsite = nextCallsite.callsite;\n rule.debug = null;\n rule.debugField = null;\n remapped++;\n } else {\n rule.callsite = createDisplayCallsite(callsite);\n rule.debug = null;\n rule.debugField = null;\n unresolved++;\n }\n\n touched = true;\n }\n\n if (touched) {\n rewriteDevSourcemapTag(item);\n }\n }\n\n return {\n tags: activeTags.length,\n rules,\n remapped,\n unresolved,\n sourcemaps: [...sourcemaps],\n };\n}\n\nasync function traceCallsiteSourcemap(\n callsite: SheetCallsite,\n fetcher: typeof fetch | undefined,\n sourceMapCache: Map<string, Promise<SourceMapData | null>>,\n): Promise<{ callsite: SheetCallsite; sourceMapUrl: string; } | null> {\n if (!fetcher) return null;\n\n const generatedUrl = getFetchableGeneratedUrl(\n callsite.sourceUrl || callsite.filePath,\n );\n\n if (!generatedUrl) return null;\n\n let sourceMapPromise = sourceMapCache.get(generatedUrl);\n\n if (!sourceMapPromise) {\n sourceMapPromise = fetchSourceMap(getGeneratedUrlFetchCandidates(generatedUrl), fetcher);\n sourceMapCache.set(generatedUrl, sourceMapPromise);\n }\n\n const sourceMap = await sourceMapPromise;\n\n if (!sourceMap) return null;\n\n const original = originalPositionFor(sourceMap.map, {\n line: callsite.line,\n column: Math.max(callsite.column - 1, 0),\n });\n\n if (!original.source || original.line == null || original.column == null) {\n return null;\n }\n\n const sourceUrl = resolveOriginalSourceUrl(\n original.source,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const sourceContent = getSourceContent(sourceMap, original.source, sourceUrl);\n const displaySourceUrl = getDisplaySourceUrl(sourceUrl);\n\n return {\n sourceMapUrl: sourceMap.url,\n callsite: {\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n sourceContent,\n line: original.line,\n column: original.column + 1,\n },\n };\n}\n\nfunction rewriteDevSourcemapTag(item: ReturnType<typeof getDevSourcemapTags>[number]) {\n const document = item.tag.ownerDocument;\n\n item.tag.textContent = '';\n\n for (let i = 0, len = item.rules.length; i < len; i++) {\n item.tag.appendChild(document.createTextNode(item.rules[i].css + '\\n'));\n }\n\n item.sourceMapNode = document.createTextNode('\\n' + createSourceMapComment(item.rules));\n item.tag.appendChild(item.sourceMapNode);\n}\n\nfunction createDisplayCallsite(callsite: SheetCallsite): SheetCallsite {\n const displaySourceUrl = getDisplaySourceUrl(callsite.sourceUrl || callsite.filePath);\n\n return {\n ...callsite,\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n };\n}\n\nfunction isDisplaySourceUrl(sourceUrl: string) {\n return sourceUrl.match(SOURCE_MAPPING_URL_REGEX);\n}\n\nasync function fetchSourceMap(\n generatedUrls: string[],\n fetcher: typeof fetch,\n): Promise<SourceMapData | null> {\n for (const generatedUrl of generatedUrls) {\n try {\n const response = await fetcher(generatedUrl);\n\n if (!response.ok) continue;\n\n const source = await response.text();\n const sourceMapUrl = findSourceMapUrl(source, generatedUrl);\n\n if (!sourceMapUrl) continue;\n\n const rawMap = await loadSourceMap(sourceMapUrl, fetcher);\n\n if (!rawMap) continue;\n\n const sourceBaseUrl = sourceMapUrl.startsWith('data:')\n ? normalizeGeneratedUrl(generatedUrl)\n : sourceMapUrl;\n\n return {\n url: sourceMapUrl,\n sourceBaseUrl,\n rawMap,\n map: new TraceMap(rawMap, sourceBaseUrl),\n sourceRoot: typeof rawMap.sourceRoot === 'string' ? rawMap.sourceRoot : undefined,\n };\n } catch {\n // Try the next generated URL variant.\n }\n }\n\n return null;\n}\n\nasync function loadSourceMap(sourceMapUrl: string, fetcher: typeof fetch) {\n try {\n if (sourceMapUrl.startsWith('data:')) {\n return parseDataUrlSourceMap(sourceMapUrl);\n }\n\n const response = await fetcher(sourceMapUrl);\n\n if (!response.ok) return null;\n\n return JSON.parse(await response.text()) as EncodedSourceMap;\n } catch {\n return null;\n }\n}\n\nfunction findSourceMapUrl(source: string, generatedUrl: string) {\n let match: RegExpExecArray | null = null;\n let sourceMapUrl: string | null = null;\n\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n\n while ((match = SOURCE_MAPPING_URL_REGEX.exec(source))) {\n sourceMapUrl = match[1];\n }\n\n if (!sourceMapUrl) return null;\n if (sourceMapUrl.startsWith('data:')) return sourceMapUrl;\n\n try {\n return new URL(sourceMapUrl, generatedUrl).href;\n } catch {\n return null;\n }\n}\n\nfunction parseDataUrlSourceMap(sourceMapUrl: string) {\n const commaIndex = sourceMapUrl.indexOf(',');\n\n if (commaIndex === -1) return null;\n\n const meta = sourceMapUrl.slice(0, commaIndex);\n const data = sourceMapUrl.slice(commaIndex + 1);\n const json = meta.endsWith(';base64') ? atob(data) : decodeURIComponent(data);\n\n return JSON.parse(json) as EncodedSourceMap;\n}\n\nfunction getFetchableGeneratedUrl(\n source: string,\n): string | null {\n source = normalizeCallsiteSourceUrl(source);\n\n if (source.startsWith('webpack://') || source.startsWith('node:')) {\n return null;\n }\n\n try {\n return new URL(source).href;\n } catch {\n // Continue with a browser-relative resolution below.\n }\n\n const base = getBrowserLocationHref();\n\n if (!base) return null;\n\n try {\n return new URL(source, base).href;\n } catch {\n return null;\n }\n}\n\nfunction getGeneratedUrlFetchCandidates(url: string) {\n const normalized = normalizeGeneratedUrl(url);\n\n return url === normalized ? [url] : [url, normalized];\n}\n\nfunction getDisplaySourceUrl(sourceUrl: string) {\n sourceUrl = normalizeCallsiteSourceUrl(sourceUrl);\n const normalized = normalizeGeneratedUrl(sourceUrl);\n\n try {\n const url = new URL(normalized);\n return 'source:///' + url.pathname.replace(/^\\/+/, '');\n } catch {\n return 'source:///' + normalized.replace(/^\\/+/, '');\n }\n}\n\nfunction getSourceContent(\n sourceMap: SourceMapData,\n originalSource: string,\n resolvedSourceUrl: string,\n) {\n const tracedContent = sourceContentFor(sourceMap.map, originalSource);\n\n if (tracedContent != null) return tracedContent;\n\n const rawSources = sourceMap.rawMap.sources;\n const rawSourcesContent = sourceMap.rawMap.sourcesContent;\n\n if (!rawSources || !rawSourcesContent) return undefined;\n\n const sourceKeys = getSourceMatchKeys(originalSource, resolvedSourceUrl);\n\n for (let i = 0, len = rawSources.length; i < len; i++) {\n const rawSource = rawSources[i];\n const rawContent = rawSourcesContent[i];\n\n if (typeof rawSource !== 'string') continue;\n if (typeof rawContent !== 'string') continue;\n\n const rawSourceUrl = resolveOriginalSourceUrl(\n rawSource,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const rawKeys = getSourceMatchKeys(rawSource, rawSourceUrl);\n\n for (const key of rawKeys) {\n if (sourceKeys.has(key)) return rawContent;\n }\n }\n\n return undefined;\n}\n\nfunction getSourceMatchKeys(...sources: string[]) {\n const keys = new Set<string>();\n\n for (const source of sources) {\n if (!source) continue;\n\n keys.add(source);\n keys.add(normalizeGeneratedUrl(source));\n\n try {\n const url = new URL(source);\n keys.add(url.pathname);\n keys.add(normalizeGeneratedUrl(url.pathname));\n } catch {\n // Non-URL sources are still useful as exact keys.\n }\n }\n\n return keys;\n}\n\nfunction normalizeGeneratedUrl(source: string) {\n try {\n const url = new URL(source);\n\n url.search = '';\n url.hash = '';\n\n return url.href;\n } catch {\n const queryIndex = findFirstIndex(source, ['?', '#']);\n\n return queryIndex === -1 ? source : source.slice(0, queryIndex);\n }\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction getBrowserLocationHref() {\n return getBrowserWindow()?.location.href;\n}\n\nfunction getBrowserWindow() {\n return typeof window === 'undefined' ? null : window;\n}\n\nfunction resolveOriginalSourceUrl(\n source: string,\n sourceMapUrl: string,\n sourceRoot?: string,\n) {\n if (isAbsoluteSource(source)) return source;\n\n try {\n if (sourceRoot && !isAbsoluteSource(sourceRoot)) {\n return new URL(sourceRoot.replace(/\\/?$/, '/') + source, sourceMapUrl).href;\n }\n\n if (sourceRoot) {\n return new URL(source, sourceRoot).href;\n }\n\n return new URL(source, sourceMapUrl).href;\n } catch {\n return sourceRoot ? sourceRoot.replace(/\\/?$/, '/') + source : source;\n }\n}\n\nfunction isAbsoluteSource(source: string) {\n return /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(source) || source.startsWith('/');\n}\n"],"mappings":";;;;AAsBA,MAAM,2BAA2B;AAEjC,eAAsB,qBAAoD;CACxE,MAAM,aAAa,oBAAoB,EAAE,QAAQ,SAC/C,KAAK,iBAAiB,KAAK,cAAc,eAAe,KAAK,GAC/D;CACA,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,UAAU,eAAe,OAAO,KAAK,aAAa;CACxD,MAAM,iCAAiB,IAAI,IAA2C;CACtE,MAAM,6BAAa,IAAI,IAAY;CACnC,IAAI,QAAQ;CACZ,IAAI,WAAW;CACf,IAAI,aAAa;CAEjB,KAAK,IAAI,IAAI,GAAG,MAAM,WAAW,QAAQ,IAAI,KAAK,KAAK;EACrD,MAAM,OAAO,WAAW;EACxB,IAAI,UAAU;EAEd,KAAK,IAAI,IAAI,GAAG,UAAU,KAAK,MAAM,QAAQ,IAAI,SAAS,KAAK;GAC7D,MAAM,OAAO,KAAK,MAAM;GACxB,MAAM,WAAW,yBAAyB,IAAI;GAE9C,IAAI,CAAC,UAAU;GACf,IAAI,mBAAmB,SAAS,aAAa,SAAS,QAAQ,GAAG;GAEjE;GAEA,MAAM,eAAe,MAAM,uBACzB,UACA,SACA,cACF;GAEA,IAAI,cAAc;IAChB,IAAI,aAAa,cAAc,WAAW,IAAI,aAAa,YAAY;IACvE,KAAK,WAAW,aAAa;IAC7B,KAAK,QAAQ;IACb,KAAK,aAA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ACvD,IAAI,QAAQ;CAEZ,KAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,OAAO,KAAK,QAAQ,MAAM;EAChC,IAAI,SAAS,OAAO,UAAU,MAAM,OAAO,QAAQ,QAAQ;CAC7D;CAEA,OAAO;AACT;AAEA,SAAS,yBAAyB;CAChC,OAAO,iBAAiB,GAAG,SAAS;AACtC;AAEA,SAAS,mBAAmB;CAC1B,OAAO,OAAO,WAAW,cAAc,OAAO;AAChD;AAEA,SAAS,yBACP,QACA,cACA,YACA;CACA,IAAI,iBAAiB,MAAM,GAAG,OAAO;CAErC,IAAI;EACF,IAAI,cAAc,CAAC,iBAAiB,UAAU,GAC5C,OAAO,IAAI,IAAI,WAAW,QAAQ,QAAQ,GAAG,IAAI,QAAQ,YAAY,EAAE;EAGzE,IAAI,YACF,OAAO,IAAI,IAAI,QAAQ,UAAU,EAAE;EAGrC,OAAO,IAAI,IAAI,QAAQ,YAAY,EAAE;CACvC,QAAQ;EACN,OAAO,aAAa,WAAW,QAAQ,QAAQ,GAAG,IAAI,SAAS;CACjE;AACF;AAEA,SAAS,iBAAiB,QAAgB;CACxC,OAAO,2BAA2B,KAAK,MAAM,KAAK,OAAO,WAAW,GAAG;AACzE"}
@@ -1,4 +1,4 @@
1
- import { It as createSourceMapComment, Lt as getSourcemapRuleCallsite, Pt as getDevSourcemapTags, Wt as normalizeCallsiteSourceUrl } from "./styleStore-D1IEmq1v.js";
1
+ import { It as createSourceMapComment, Lt as getSourcemapRuleCallsite, Pt as getDevSourcemapTags, Wt as normalizeCallsiteSourceUrl } from "./styleStore-BpkbvtBI.js";
2
2
  import { TraceMap, originalPositionFor, sourceContentFor } from "@jridgewell/trace-mapping";
3
3
  //#region dev/trace.ts
4
4
  const SOURCE_MAPPING_URL_REGEX = /(?:\/\/|\/\*)[#@]\s*sourceMappingURL=([^\s*]+)(?:\s*\*\/)?/g;
@@ -241,4 +241,4 @@ function isAbsoluteSource(source) {
241
241
  //#endregion
242
242
  export { traceDevSourcemaps };
243
243
 
244
- //# sourceMappingURL=trace-uHVvnYiw.js.map
244
+ //# sourceMappingURL=trace-Db5et6nx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace-uHVvnYiw.js","names":[],"sources":["../dev/trace.ts"],"sourcesContent":["import { type EncodedSourceMap, originalPositionFor, sourceContentFor, TraceMap } from '@jridgewell/trace-mapping';\nimport { getDevSourcemapTags } from '../sheet/dev';\nimport { createSourceMapComment, getSourcemapRuleCallsite } from '../sheet/sourcemap';\nimport type { SheetCallsite } from '../sheet/types';\nimport { normalizeCallsiteSourceUrl } from '../utils/trace';\n\nexport type TraceSourcemapResult = {\n tags: number;\n rules: number;\n remapped: number;\n unresolved: number;\n sourcemaps: string[];\n};\n\ntype SourceMapData = {\n url: string;\n sourceBaseUrl: string;\n rawMap: EncodedSourceMap;\n map: TraceMap;\n sourceRoot?: string;\n};\n\nconst SOURCE_MAPPING_URL_REGEX = /(?:\\/\\/|\\/\\*)[#@]\\s*sourceMappingURL=([^\\s*]+)(?:\\s*\\*\\/)?/g;\n\nexport async function traceDevSourcemaps(): Promise<TraceSourcemapResult> {\n const activeTags = getDevSourcemapTags().filter((item) =>\n item.sourceMapNode && item.sourceMapNode.parentNode === item.tag\n );\n const browserWindow = getBrowserWindow();\n const fetcher = browserWindow?.fetch?.bind(browserWindow);\n const sourceMapCache = new Map<string, Promise<SourceMapData | null>>();\n const sourcemaps = new Set<string>();\n let rules = 0;\n let remapped = 0;\n let unresolved = 0;\n\n for (let i = 0, len = activeTags.length; i < len; i++) {\n const item = activeTags[i];\n let touched = false;\n\n for (let j = 0, ruleLen = item.rules.length; j < ruleLen; j++) {\n const rule = item.rules[j];\n const callsite = getSourcemapRuleCallsite(rule);\n\n if (!callsite) continue;\n if (isDisplaySourceUrl(callsite.sourceUrl || callsite.filePath)) continue;\n\n rules++;\n\n const nextCallsite = await traceCallsiteSourcemap(\n callsite,\n fetcher,\n sourceMapCache,\n );\n\n if (nextCallsite) {\n if (nextCallsite.sourceMapUrl) sourcemaps.add(nextCallsite.sourceMapUrl);\n rule.callsite = nextCallsite.callsite;\n rule.debug = null;\n rule.debugField = null;\n remapped++;\n } else {\n rule.callsite = createDisplayCallsite(callsite);\n rule.debug = null;\n rule.debugField = null;\n unresolved++;\n }\n\n touched = true;\n }\n\n if (touched) {\n rewriteDevSourcemapTag(item);\n }\n }\n\n return {\n tags: activeTags.length,\n rules,\n remapped,\n unresolved,\n sourcemaps: [...sourcemaps],\n };\n}\n\nasync function traceCallsiteSourcemap(\n callsite: SheetCallsite,\n fetcher: typeof fetch | undefined,\n sourceMapCache: Map<string, Promise<SourceMapData | null>>,\n): Promise<{ callsite: SheetCallsite; sourceMapUrl: string; } | null> {\n if (!fetcher) return null;\n\n const generatedUrl = getFetchableGeneratedUrl(\n callsite.sourceUrl || callsite.filePath,\n );\n\n if (!generatedUrl) return null;\n\n let sourceMapPromise = sourceMapCache.get(generatedUrl);\n\n if (!sourceMapPromise) {\n sourceMapPromise = fetchSourceMap(getGeneratedUrlFetchCandidates(generatedUrl), fetcher);\n sourceMapCache.set(generatedUrl, sourceMapPromise);\n }\n\n const sourceMap = await sourceMapPromise;\n\n if (!sourceMap) return null;\n\n const original = originalPositionFor(sourceMap.map, {\n line: callsite.line,\n column: Math.max(callsite.column - 1, 0),\n });\n\n if (!original.source || original.line == null || original.column == null) {\n return null;\n }\n\n const sourceUrl = resolveOriginalSourceUrl(\n original.source,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const sourceContent = getSourceContent(sourceMap, original.source, sourceUrl);\n const displaySourceUrl = getDisplaySourceUrl(sourceUrl);\n\n return {\n sourceMapUrl: sourceMap.url,\n callsite: {\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n sourceContent,\n line: original.line,\n column: original.column + 1,\n },\n };\n}\n\nfunction rewriteDevSourcemapTag(item: ReturnType<typeof getDevSourcemapTags>[number]) {\n const document = item.tag.ownerDocument;\n\n item.tag.textContent = '';\n\n for (let i = 0, len = item.rules.length; i < len; i++) {\n item.tag.appendChild(document.createTextNode(item.rules[i].css + '\\n'));\n }\n\n item.sourceMapNode = document.createTextNode('\\n' + createSourceMapComment(item.rules));\n item.tag.appendChild(item.sourceMapNode);\n}\n\nfunction createDisplayCallsite(callsite: SheetCallsite): SheetCallsite {\n const displaySourceUrl = getDisplaySourceUrl(callsite.sourceUrl || callsite.filePath);\n\n return {\n ...callsite,\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n };\n}\n\nfunction isDisplaySourceUrl(sourceUrl: string) {\n return sourceUrl.match(SOURCE_MAPPING_URL_REGEX);\n}\n\nasync function fetchSourceMap(\n generatedUrls: string[],\n fetcher: typeof fetch,\n): Promise<SourceMapData | null> {\n for (const generatedUrl of generatedUrls) {\n try {\n const response = await fetcher(generatedUrl);\n\n if (!response.ok) continue;\n\n const source = await response.text();\n const sourceMapUrl = findSourceMapUrl(source, generatedUrl);\n\n if (!sourceMapUrl) continue;\n\n const rawMap = await loadSourceMap(sourceMapUrl, fetcher);\n\n if (!rawMap) continue;\n\n const sourceBaseUrl = sourceMapUrl.startsWith('data:')\n ? normalizeGeneratedUrl(generatedUrl)\n : sourceMapUrl;\n\n return {\n url: sourceMapUrl,\n sourceBaseUrl,\n rawMap,\n map: new TraceMap(rawMap, sourceBaseUrl),\n sourceRoot: typeof rawMap.sourceRoot === 'string' ? rawMap.sourceRoot : undefined,\n };\n } catch {\n // Try the next generated URL variant.\n }\n }\n\n return null;\n}\n\nasync function loadSourceMap(sourceMapUrl: string, fetcher: typeof fetch) {\n try {\n if (sourceMapUrl.startsWith('data:')) {\n return parseDataUrlSourceMap(sourceMapUrl);\n }\n\n const response = await fetcher(sourceMapUrl);\n\n if (!response.ok) return null;\n\n return JSON.parse(await response.text()) as EncodedSourceMap;\n } catch {\n return null;\n }\n}\n\nfunction findSourceMapUrl(source: string, generatedUrl: string) {\n let match: RegExpExecArray | null = null;\n let sourceMapUrl: string | null = null;\n\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n\n while ((match = SOURCE_MAPPING_URL_REGEX.exec(source))) {\n sourceMapUrl = match[1];\n }\n\n if (!sourceMapUrl) return null;\n if (sourceMapUrl.startsWith('data:')) return sourceMapUrl;\n\n try {\n return new URL(sourceMapUrl, generatedUrl).href;\n } catch {\n return null;\n }\n}\n\nfunction parseDataUrlSourceMap(sourceMapUrl: string) {\n const commaIndex = sourceMapUrl.indexOf(',');\n\n if (commaIndex === -1) return null;\n\n const meta = sourceMapUrl.slice(0, commaIndex);\n const data = sourceMapUrl.slice(commaIndex + 1);\n const json = meta.endsWith(';base64') ? atob(data) : decodeURIComponent(data);\n\n return JSON.parse(json) as EncodedSourceMap;\n}\n\nfunction getFetchableGeneratedUrl(\n source: string,\n): string | null {\n source = normalizeCallsiteSourceUrl(source);\n\n if (source.startsWith('webpack://') || source.startsWith('node:')) {\n return null;\n }\n\n try {\n return new URL(source).href;\n } catch {\n // Continue with a browser-relative resolution below.\n }\n\n const base = getBrowserLocationHref();\n\n if (!base) return null;\n\n try {\n return new URL(source, base).href;\n } catch {\n return null;\n }\n}\n\nfunction getGeneratedUrlFetchCandidates(url: string) {\n const normalized = normalizeGeneratedUrl(url);\n\n return url === normalized ? [url] : [url, normalized];\n}\n\nfunction getDisplaySourceUrl(sourceUrl: string) {\n sourceUrl = normalizeCallsiteSourceUrl(sourceUrl);\n const normalized = normalizeGeneratedUrl(sourceUrl);\n\n try {\n const url = new URL(normalized);\n return 'source:///' + url.pathname.replace(/^\\/+/, '');\n } catch {\n return 'source:///' + normalized.replace(/^\\/+/, '');\n }\n}\n\nfunction getSourceContent(\n sourceMap: SourceMapData,\n originalSource: string,\n resolvedSourceUrl: string,\n) {\n const tracedContent = sourceContentFor(sourceMap.map, originalSource);\n\n if (tracedContent != null) return tracedContent;\n\n const rawSources = sourceMap.rawMap.sources;\n const rawSourcesContent = sourceMap.rawMap.sourcesContent;\n\n if (!rawSources || !rawSourcesContent) return undefined;\n\n const sourceKeys = getSourceMatchKeys(originalSource, resolvedSourceUrl);\n\n for (let i = 0, len = rawSources.length; i < len; i++) {\n const rawSource = rawSources[i];\n const rawContent = rawSourcesContent[i];\n\n if (typeof rawSource !== 'string') continue;\n if (typeof rawContent !== 'string') continue;\n\n const rawSourceUrl = resolveOriginalSourceUrl(\n rawSource,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const rawKeys = getSourceMatchKeys(rawSource, rawSourceUrl);\n\n for (const key of rawKeys) {\n if (sourceKeys.has(key)) return rawContent;\n }\n }\n\n return undefined;\n}\n\nfunction getSourceMatchKeys(...sources: string[]) {\n const keys = new Set<string>();\n\n for (const source of sources) {\n if (!source) continue;\n\n keys.add(source);\n keys.add(normalizeGeneratedUrl(source));\n\n try {\n const url = new URL(source);\n keys.add(url.pathname);\n keys.add(normalizeGeneratedUrl(url.pathname));\n } catch {\n // Non-URL sources are still useful as exact keys.\n }\n }\n\n return keys;\n}\n\nfunction normalizeGeneratedUrl(source: string) {\n try {\n const url = new URL(source);\n\n url.search = '';\n url.hash = '';\n\n return url.href;\n } catch {\n const queryIndex = findFirstIndex(source, ['?', '#']);\n\n return queryIndex === -1 ? source : source.slice(0, queryIndex);\n }\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction getBrowserLocationHref() {\n return getBrowserWindow()?.location.href;\n}\n\nfunction getBrowserWindow() {\n return typeof window === 'undefined' ? null : window;\n}\n\nfunction resolveOriginalSourceUrl(\n source: string,\n sourceMapUrl: string,\n sourceRoot?: string,\n) {\n if (isAbsoluteSource(source)) return source;\n\n try {\n if (sourceRoot && !isAbsoluteSource(sourceRoot)) {\n return new URL(sourceRoot.replace(/\\/?$/, '/') + source, sourceMapUrl).href;\n }\n\n if (sourceRoot) {\n return new URL(source, sourceRoot).href;\n }\n\n return new URL(source, sourceMapUrl).href;\n } catch {\n return sourceRoot ? sourceRoot.replace(/\\/?$/, '/') + source : source;\n }\n}\n\nfunction isAbsoluteSource(source: string) {\n return /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(source) || source.startsWith('/');\n}\n"],"mappings":";;;AAsBA,MAAM,2BAA2B;AAEjC,eAAsB,qBAAoD;CACxE,MAAM,aAAa,oBAAoB,EAAE,QAAQ,SAC/C,KAAK,iBAAiB,KAAK,cAAc,eAAe,KAAK,GAC/D;CACA,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,UAAU,eAAe,OAAO,KAAK,aAAa;CACxD,MAAM,iCAAiB,IAAI,IAA2C;CACtE,MAAM,6BAAa,IAAI,IAAY;CACnC,IAAI,QAAQ;CACZ,IAAI,WAAW;CACf,IAAI,aAAa;CAEjB,KAAK,IAAI,IAAI,GAAG,MAAM,WAAW,QAAQ,IAAI,KAAK,KAAK;EACrD,MAAM,OAAO,WAAW;EACxB,IAAI,UAAU;EAEd,KAAK,IAAI,IAAI,GAAG,UAAU,KAAK,MAAM,QAAQ,IAAI,SAAS,KAAK;GAC7D,MAAM,OAAO,KAAK,MAAM;GACxB,MAAM,WAAW,yBAAyB,IAAI;GAE9C,IAAI,CAAC,UAAU;GACf,IAAI,mBAAmB,SAAS,aAAa,SAAS,QAAQ,GAAG;GAEjE;GAEA,MAAM,eAAe,MAAM,uBACzB,UACA,SACA,cACF;GAEA,IAAI,cAAc;IAChB,IAAI,aAAa,cAAc,WAAW,IAAI,aAAa,YAAY;IACvE,KAAK,WAAW,aAAa;IAC7B,KAAK,QAAQ;IACb,KAAK,aAAa;IAClB;GACF,OAAO;IACL,KAAK,WAAW,sBAAsB,QAAQ;IAC9C,KAAK,QAAQ;IACb,KAAK,aAAa;IAClB;GACF;GAEA,UAAU;EACZ;EAEA,IAAI,SACF,uBAAuB,IAAI;CAE/B;CAEA,OAAO;EACL,MAAM,WAAW;EACjB;EACA;EACA;EACA,YAAY,CAAC,GAAG,UAAU;CAC5B;AACF;AAEA,e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AC1B,OAAO,OAAO,WAAW,cAAc,OAAO;AAChD;AAEA,SAAS,yBACP,QACA,cACA,YACA;CACA,IAAI,iBAAiB,MAAM,GAAG,OAAO;CAErC,IAAI;EACF,IAAI,cAAc,CAAC,iBAAiB,UAAU,GAC5C,OAAO,IAAI,IAAI,WAAW,QAAQ,QAAQ,GAAG,IAAI,QAAQ,YAAY,EAAE;EAGzE,IAAI,YACF,OAAO,IAAI,IAAI,QAAQ,UAAU,EAAE;EAGrC,OAAO,IAAI,IAAI,QAAQ,YAAY,EAAE;CACvC,QAAQ;EACN,OAAO,aAAa,WAAW,QAAQ,QAAQ,GAAG,IAAI,SAAS;CACjE;AACF;AAEA,SAAS,iBAAiB,QAAgB;CACxC,OAAO,2BAA2B,KAAK,MAAM,KAAK,OAAO,WAAW,GAAG;AACzE"}
1
+ {"version":3,"file":"trace-Db5et6nx.js","names":[],"sources":["../dev/trace.ts"],"sourcesContent":["import { type EncodedSourceMap, originalPositionFor, sourceContentFor, TraceMap } from '@jridgewell/trace-mapping';\nimport { getDevSourcemapTags } from '../sheet/dev';\nimport { createSourceMapComment, getSourcemapRuleCallsite } from '../sheet/sourcemap';\nimport type { SheetCallsite } from '../sheet/types';\nimport { normalizeCallsiteSourceUrl } from '../utils/trace';\n\nexport type TraceSourcemapResult = {\n tags: number;\n rules: number;\n remapped: number;\n unresolved: number;\n sourcemaps: string[];\n};\n\ntype SourceMapData = {\n url: string;\n sourceBaseUrl: string;\n rawMap: EncodedSourceMap;\n map: TraceMap;\n sourceRoot?: string;\n};\n\nconst SOURCE_MAPPING_URL_REGEX = /(?:\\/\\/|\\/\\*)[#@]\\s*sourceMappingURL=([^\\s*]+)(?:\\s*\\*\\/)?/g;\n\nexport async function traceDevSourcemaps(): Promise<TraceSourcemapResult> {\n const activeTags = getDevSourcemapTags().filter((item) =>\n item.sourceMapNode && item.sourceMapNode.parentNode === item.tag\n );\n const browserWindow = getBrowserWindow();\n const fetcher = browserWindow?.fetch?.bind(browserWindow);\n const sourceMapCache = new Map<string, Promise<SourceMapData | null>>();\n const sourcemaps = new Set<string>();\n let rules = 0;\n let remapped = 0;\n let unresolved = 0;\n\n for (let i = 0, len = activeTags.length; i < len; i++) {\n const item = activeTags[i];\n let touched = false;\n\n for (let j = 0, ruleLen = item.rules.length; j < ruleLen; j++) {\n const rule = item.rules[j];\n const callsite = getSourcemapRuleCallsite(rule);\n\n if (!callsite) continue;\n if (isDisplaySourceUrl(callsite.sourceUrl || callsite.filePath)) continue;\n\n rules++;\n\n const nextCallsite = await traceCallsiteSourcemap(\n callsite,\n fetcher,\n sourceMapCache,\n );\n\n if (nextCallsite) {\n if (nextCallsite.sourceMapUrl) sourcemaps.add(nextCallsite.sourceMapUrl);\n rule.callsite = nextCallsite.callsite;\n rule.debug = null;\n rule.debugField = null;\n remapped++;\n } else {\n rule.callsite = createDisplayCallsite(callsite);\n rule.debug = null;\n rule.debugField = null;\n unresolved++;\n }\n\n touched = true;\n }\n\n if (touched) {\n rewriteDevSourcemapTag(item);\n }\n }\n\n return {\n tags: activeTags.length,\n rules,\n remapped,\n unresolved,\n sourcemaps: [...sourcemaps],\n };\n}\n\nasync function traceCallsiteSourcemap(\n callsite: SheetCallsite,\n fetcher: typeof fetch | undefined,\n sourceMapCache: Map<string, Promise<SourceMapData | null>>,\n): Promise<{ callsite: SheetCallsite; sourceMapUrl: string; } | null> {\n if (!fetcher) return null;\n\n const generatedUrl = getFetchableGeneratedUrl(\n callsite.sourceUrl || callsite.filePath,\n );\n\n if (!generatedUrl) return null;\n\n let sourceMapPromise = sourceMapCache.get(generatedUrl);\n\n if (!sourceMapPromise) {\n sourceMapPromise = fetchSourceMap(getGeneratedUrlFetchCandidates(generatedUrl), fetcher);\n sourceMapCache.set(generatedUrl, sourceMapPromise);\n }\n\n const sourceMap = await sourceMapPromise;\n\n if (!sourceMap) return null;\n\n const original = originalPositionFor(sourceMap.map, {\n line: callsite.line,\n column: Math.max(callsite.column - 1, 0),\n });\n\n if (!original.source || original.line == null || original.column == null) {\n return null;\n }\n\n const sourceUrl = resolveOriginalSourceUrl(\n original.source,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const sourceContent = getSourceContent(sourceMap, original.source, sourceUrl);\n const displaySourceUrl = getDisplaySourceUrl(sourceUrl);\n\n return {\n sourceMapUrl: sourceMap.url,\n callsite: {\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n sourceContent,\n line: original.line,\n column: original.column + 1,\n },\n };\n}\n\nfunction rewriteDevSourcemapTag(item: ReturnType<typeof getDevSourcemapTags>[number]) {\n const document = item.tag.ownerDocument;\n\n item.tag.textContent = '';\n\n for (let i = 0, len = item.rules.length; i < len; i++) {\n item.tag.appendChild(document.createTextNode(item.rules[i].css + '\\n'));\n }\n\n item.sourceMapNode = document.createTextNode('\\n' + createSourceMapComment(item.rules));\n item.tag.appendChild(item.sourceMapNode);\n}\n\nfunction createDisplayCallsite(callsite: SheetCallsite): SheetCallsite {\n const displaySourceUrl = getDisplaySourceUrl(callsite.sourceUrl || callsite.filePath);\n\n return {\n ...callsite,\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n };\n}\n\nfunction isDisplaySourceUrl(sourceUrl: string) {\n return sourceUrl.match(SOURCE_MAPPING_URL_REGEX);\n}\n\nasync function fetchSourceMap(\n generatedUrls: string[],\n fetcher: typeof fetch,\n): Promise<SourceMapData | null> {\n for (const generatedUrl of generatedUrls) {\n try {\n const response = await fetcher(generatedUrl);\n\n if (!response.ok) continue;\n\n const source = await response.text();\n const sourceMapUrl = findSourceMapUrl(source, generatedUrl);\n\n if (!sourceMapUrl) continue;\n\n const rawMap = await loadSourceMap(sourceMapUrl, fetcher);\n\n if (!rawMap) continue;\n\n const sourceBaseUrl = sourceMapUrl.startsWith('data:')\n ? normalizeGeneratedUrl(generatedUrl)\n : sourceMapUrl;\n\n return {\n url: sourceMapUrl,\n sourceBaseUrl,\n rawMap,\n map: new TraceMap(rawMap, sourceBaseUrl),\n sourceRoot: typeof rawMap.sourceRoot === 'string' ? rawMap.sourceRoot : undefined,\n };\n } catch {\n // Try the next generated URL variant.\n }\n }\n\n return null;\n}\n\nasync function loadSourceMap(sourceMapUrl: string, fetcher: typeof fetch) {\n try {\n if (sourceMapUrl.startsWith('data:')) {\n return parseDataUrlSourceMap(sourceMapUrl);\n }\n\n const response = await fetcher(sourceMapUrl);\n\n if (!response.ok) return null;\n\n return JSON.parse(await response.text()) as EncodedSourceMap;\n } catch {\n return null;\n }\n}\n\nfunction findSourceMapUrl(source: string, generatedUrl: string) {\n let match: RegExpExecArray | null = null;\n let sourceMapUrl: string | null = null;\n\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n\n while ((match = SOURCE_MAPPING_URL_REGEX.exec(source))) {\n sourceMapUrl = match[1];\n }\n\n if (!sourceMapUrl) return null;\n if (sourceMapUrl.startsWith('data:')) return sourceMapUrl;\n\n try {\n return new URL(sourceMapUrl, generatedUrl).href;\n } catch {\n return null;\n }\n}\n\nfunction parseDataUrlSourceMap(sourceMapUrl: string) {\n const commaIndex = sourceMapUrl.indexOf(',');\n\n if (commaIndex === -1) return null;\n\n const meta = sourceMapUrl.slice(0, commaIndex);\n const data = sourceMapUrl.slice(commaIndex + 1);\n const json = meta.endsWith(';base64') ? atob(data) : decodeURIComponent(data);\n\n return JSON.parse(json) as EncodedSourceMap;\n}\n\nfunction getFetchableGeneratedUrl(\n source: string,\n): string | null {\n source = normalizeCallsiteSourceUrl(source);\n\n if (source.startsWith('webpack://') || source.startsWith('node:')) {\n return null;\n }\n\n try {\n return new URL(source).href;\n } catch {\n // Continue with a browser-relative resolution below.\n }\n\n const base = getBrowserLocationHref();\n\n if (!base) return null;\n\n try {\n return new URL(source, base).href;\n } catch {\n return null;\n }\n}\n\nfunction getGeneratedUrlFetchCandidates(url: string) {\n const normalized = normalizeGeneratedUrl(url);\n\n return url === normalized ? [url] : [url, normalized];\n}\n\nfunction getDisplaySourceUrl(sourceUrl: string) {\n sourceUrl = normalizeCallsiteSourceUrl(sourceUrl);\n const normalized = normalizeGeneratedUrl(sourceUrl);\n\n try {\n const url = new URL(normalized);\n return 'source:///' + url.pathname.replace(/^\\/+/, '');\n } catch {\n return 'source:///' + normalized.replace(/^\\/+/, '');\n }\n}\n\nfunction getSourceContent(\n sourceMap: SourceMapData,\n originalSource: string,\n resolvedSourceUrl: string,\n) {\n const tracedContent = sourceContentFor(sourceMap.map, originalSource);\n\n if (tracedContent != null) return tracedContent;\n\n const rawSources = sourceMap.rawMap.sources;\n const rawSourcesContent = sourceMap.rawMap.sourcesContent;\n\n if (!rawSources || !rawSourcesContent) return undefined;\n\n const sourceKeys = getSourceMatchKeys(originalSource, resolvedSourceUrl);\n\n for (let i = 0, len = rawSources.length; i < len; i++) {\n const rawSource = rawSources[i];\n const rawContent = rawSourcesContent[i];\n\n if (typeof rawSource !== 'string') continue;\n if (typeof rawContent !== 'string') continue;\n\n const rawSourceUrl = resolveOriginalSourceUrl(\n rawSource,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const rawKeys = getSourceMatchKeys(rawSource, rawSourceUrl);\n\n for (const key of rawKeys) {\n if (sourceKeys.has(key)) return rawContent;\n }\n }\n\n return undefined;\n}\n\nfunction getSourceMatchKeys(...sources: string[]) {\n const keys = new Set<string>();\n\n for (const source of sources) {\n if (!source) continue;\n\n keys.add(source);\n keys.add(normalizeGeneratedUrl(source));\n\n try {\n const url = new URL(source);\n keys.add(url.pathname);\n keys.add(normalizeGeneratedUrl(url.pathname));\n } catch {\n // Non-URL sources are still useful as exact keys.\n }\n }\n\n return keys;\n}\n\nfunction normalizeGeneratedUrl(source: string) {\n try {\n const url = new URL(source);\n\n url.search = '';\n url.hash = '';\n\n return url.href;\n } catch {\n const queryIndex = findFirstIndex(source, ['?', '#']);\n\n return queryIndex === -1 ? source : source.slice(0, queryIndex);\n }\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction getBrowserLocationHref() {\n return getBrowserWindow()?.location.href;\n}\n\nfunction getBrowserWindow() {\n return typeof window === 'undefined' ? null : window;\n}\n\nfunction resolveOriginalSourceUrl(\n source: string,\n sourceMapUrl: string,\n sourceRoot?: string,\n) {\n if (isAbsoluteSource(source)) return source;\n\n try {\n if (sourceRoot && !isAbsoluteSource(sourceRoot)) {\n return new URL(sourceRoot.replace(/\\/?$/, '/') + source, sourceMapUrl).href;\n }\n\n if (sourceRoot) {\n return new URL(source, sourceRoot).href;\n }\n\n return new URL(source, sourceMapUrl).href;\n } catch {\n return sourceRoot ? sourceRoot.replace(/\\/?$/, '/') + source : source;\n }\n}\n\nfunction isAbsoluteSource(source: string) {\n return /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(source) || source.startsWith('/');\n}\n"],"mappings":";;;AAsBA,MAAM,2BAA2B;AAEjC,eAAsB,qBAAoD;CACxE,MAAM,aAAa,oBAAoB,EAAE,QAAQ,SAC/C,KAAK,iBAAiB,KAAK,cAAc,eAAe,KAAK,GAC/D;CACA,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,UAAU,eAAe,OAAO,KAAK,aAAa;CACxD,MAAM,iCAAiB,IAAI,IAA2C;CACtE,MAAM,6BAAa,IAAI,IAAY;CACnC,IAAI,QAAQ;CACZ,IAAI,WAAW;CACf,IAAI,aAAa;CAEjB,KAAK,IAAI,IAAI,GAAG,MAAM,WAAW,QAAQ,IAAI,KAAK,KAAK;EACrD,MAAM,OAAO,WAAW;EACxB,IAAI,UAAU;EAEd,KAAK,IAAI,IAAI,GAAG,UAAU,KAAK,MAAM,QAAQ,IAAI,SAAS,KAAK;GAC7D,MAAM,OAAO,KAAK,MAAM;GACxB,MAAM,WAAW,yBAAyB,IAAI;GAE9C,IAAI,CAAC,UAAU;GACf,IAAI,mBAAmB,SAAS,aAAa,SAAS,QAAQ,GAAG;GAEjE;GAEA,MAAM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QAAQ;EACN,MAAM,aAAa,eAAe,QAAQ,CAAC,KAAK,GAAG,CAAC;EAEpD,OAAO,eAAe,KAAK,SAAS,OAAO,MAAM,GAAG,UAAU;CAChE;AACF;AAEA,SAAS,eAAe,MAAc,SAAmB;CACvD,IAAI,QAAQ;CAEZ,KAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,OAAO,KAAK,QAAQ,MAAM;EAChC,IAAI,SAAS,OAAO,UAAU,MAAM,OAAO,QAAQ,QAAQ;CAC7D;CAEA,OAAO;AACT;AAEA,SAAS,yBAAyB;CAChC,OAAO,iBAAiB,GAAG,SAAS;AACtC;AAEA,SAAS,mBAAmB;CAC1B,OAAO,OAAO,WAAW,cAAc,OAAO;AAChD;AAEA,SAAS,yBACP,QACA,cACA,YACA;CACA,IAAI,iBAAiB,MAAM,GAAG,OAAO;CAErC,IAAI;EACF,IAAI,cAAc,CAAC,iBAAiB,UAAU,GAC5C,OAAO,IAAI,IAAI,WAAW,QAAQ,QAAQ,GAAG,IAAI,QAAQ,YAAY,EAAE;EAGzE,IAAI,YACF,OAAO,IAAI,IAAI,QAAQ,UAAU,EAAE;EAGrC,OAAO,IAAI,IAAI,QAAQ,YAAY,EAAE;CACvC,QAAQ;EACN,OAAO,aAAa,WAAW,QAAQ,QAAQ,GAAG,IAAI,SAAS;CACjE;AACF;AAEA,SAAS,iBAAiB,QAAgB;CACxC,OAAO,2BAA2B,KAAK,MAAM,KAAK,OAAO,WAAW,GAAG;AACzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"transform-BZ4jPwy3.js","names":[],"sources":["../style/transform.ts"],"sourcesContent":["import { symbol } from '../utils/symbol';\nimport type { CSSProperties, StyleObject, StyleValue } from './types';\n\nconst CLASS_NAME_VALUE: unique symbol = symbol('transform.classNameValue');\n\nexport type ClassNameValue<Value = unknown> = {\n readonly [CLASS_NAME_VALUE]: true;\n readonly value: Value;\n readonly className: string;\n};\n\nexport type TransformStyleObject<Style = unknown> = {\n [P in keyof Style]: StyleValue<Style[P] | ClassNameValue<Style[P]>>;\n};\n\nexport type StyleTransform<Style = unknown> = {\n transform(style: StyleObject<Style>): TransformStyleObject<CSSProperties>;\n};\n\nexport type ClassNameTransform<ClassName extends string = string> = {\n transform(className: ClassName): TransformStyleObject<CSSProperties>;\n};\n\nexport function classNameValue<const Value>(\n value: Value,\n className: string,\n): ClassNameValue<Value> {\n return {\n [CLASS_NAME_VALUE]: true,\n value,\n className,\n };\n}\n\nexport function isClassNameValue(value: unknown): value is ClassNameValue {\n return !!value &&\n typeof value === 'object' &&\n (value as ClassNameValue)[CLASS_NAME_VALUE] === true &&\n typeof (value as ClassNameValue).className === 'string';\n}\n\nexport function styleTransform<Style>(options: StyleTransform<Style>) {\n return options;\n}\n\nexport function classNameTransform<ClassName extends string>(options: ClassNameTransform<ClassName>) {\n return options;\n}\n"],"mappings":";;AAGA,MAAM,mBAAkC,OAAO,0BAA0B;AAoBzE,SAAgB,eACd,OACA,WACuB;CACvB,OAAO;GACJ,mBAAmB;EACpB;EACA;CACF;AACF;AAEA,SAAgB,iBAAiB,OAAyC;CACxE,OAAO,CAAC,CAAC,SACP,OAAO,UAAU,YAChB,MAAyB,sBAAsB,QAChD,OAAQ,MAAyB,cAAc;AACnD;AAEA,SAAgB,eAAsB,SAAgC;CACpE,OAAO;AACT;AAEA,SAAgB,mBAA6C,SAAwC;CACnG,OAAO;AACT"}
1
+ {"version":3,"file":"transform-BZ4jPwy3.js","names":[],"sources":["../style/transform.ts"],"sourcesContent":["import type { CSSPropertiesRaw } from '../atomic/utils/types';\nimport { symbol } from '../utils/symbol';\nimport type { StyleObject, StyleValue } from './types';\n\nconst CLASS_NAME_VALUE: unique symbol = symbol('transform.classNameValue');\n\nexport type ClassNameValue<Value = unknown> = {\n readonly [CLASS_NAME_VALUE]: true;\n readonly value: Value;\n readonly className: string;\n};\n\nexport type TransformStyleObject<Style = unknown> = {\n [P in keyof Style]: StyleValue<Style[P] | ClassNameValue<Style[P]>>;\n};\n\nexport type StyleTransform<Style = unknown> = {\n transform(style: StyleObject<Style>): TransformStyleObject<CSSPropertiesRaw>;\n};\n\nexport type ClassNameTransform<ClassName extends string = string> = {\n transform(className: ClassName): TransformStyleObject<CSSPropertiesRaw>;\n};\n\nexport function classNameValue<const Value>(\n value: Value,\n className: string,\n): ClassNameValue<Value> {\n return {\n [CLASS_NAME_VALUE]: true,\n value,\n className,\n };\n}\n\nexport function isClassNameValue(value: unknown): value is ClassNameValue {\n return !!value &&\n typeof value === 'object' &&\n (value as ClassNameValue)[CLASS_NAME_VALUE] === true &&\n typeof (value as ClassNameValue).className === 'string';\n}\n\nexport function styleTransform<Style>(options: StyleTransform<Style>) {\n return options;\n}\n\nexport function classNameTransform<ClassName extends string>(options: ClassNameTransform<ClassName>) {\n return options;\n}\n"],"mappings":";;AAIA,MAAM,mBAAkC,OAAO,0BAA0B;AAoBzE,SAAgB,eACd,OACA,WACuB;CACvB,OAAO;GACJ,mBAAmB;EACpB;EACA;CACF;AACF;AAEA,SAAgB,iBAAiB,OAAyC;CACxE,OAAO,CAAC,CAAC,SACP,OAAO,UAAU,YAChB,MAAyB,sBAAsB,QAChD,OAAQ,MAAyB,cAAc;AACnD;AAEA,SAAgB,eAAsB,SAAgC;CACpE,OAAO;AACT;AAEA,SAAgB,mBAA6C,SAAwC;CACnG,OAAO;AACT"}
@@ -1,7 +1,8 @@
1
1
  import type * as CSS from 'csstype';
2
2
  export type * as CSS from 'csstype';
3
3
  export type CSSValueExclude = '-moz-initial';
4
+ export type CSSPropertiesRaw = CSS.Properties<string | number>;
4
5
  export type CSSProperties = {
5
- [P in keyof CSS.Properties<string | number>]: Exclude<CSS.Properties<string | number>[P], CSSValueExclude>;
6
+ [P in keyof CSSPropertiesRaw]: Exclude<CSSPropertiesRaw[P], CSSValueExclude>;
6
7
  };
7
- export type CSSPropertyName = keyof CSS.Properties<string | number>;
8
+ export type CSSPropertyName = keyof CSSPropertiesRaw;
@@ -6,4 +6,4 @@ export declare const FnPrefixScope = "scope.";
6
6
  export declare const FnPrefixSelector = "selector.";
7
7
  export declare function runtimeCallsite(): import("../utils/trace.js").TraceCallsite | null;
8
8
  export declare function resolveCallsite(debug: DebugData | null | undefined): import("../utils/trace.js").TraceCallsite | null;
9
- export declare function transformStyle<Style>(style: StyleObject<Style>, transform: StyleTransform<Style> | null): StyleObject<Style> | import("../index.js").TransformStyleObject<import("../index.js").CSSProperties>;
9
+ export declare function transformStyle<Style>(style: StyleObject<Style>, transform: StyleTransform<Style> | null): StyleObject<Style> | import("../index.js").TransformStyleObject<import("../index.js").CSSPropertiesRaw>;
@@ -0,0 +1,4 @@
1
+ /** Fingerprint actual compiler and dependency bytes, including locally patched packages.
2
+ * Computed once per process: replacing loaded compiler code requires restarting Node.
3
+ */
4
+ export declare function getCompilerCacheIdentity(): string | null;
@@ -13,6 +13,18 @@ export declare function createCompiler(args: CompilerArgs, options: CompilerOpti
13
13
  compileExtract: (args: TransformExtractArgs) => TransformExtractResult | null;
14
14
  getExtractedCss: () => string;
15
15
  invalidateFile: (_info: CompilerInvalidateFileInfo) => void;
16
+ getPersistentCacheStats: () => {
17
+ hits: number;
18
+ misses: number;
19
+ bypasses: number;
20
+ writes: number;
21
+ };
22
+ getTraceMetadataCacheStats: () => {
23
+ parses: number;
24
+ memoryHits: number;
25
+ diskHits: number;
26
+ writes: number;
27
+ };
16
28
  };
17
29
  declare function createCompilerInternal(args: CompilerArgs, options: CompilerOptions): {
18
30
  projectDir: string;
@@ -0,0 +1,14 @@
1
+ import type { CompilerInternal } from "./compiler.js";
2
+ import type { TransformExtractArgs, TransformExtractResult } from "./types.js";
3
+ export declare function createPersistentTransformCache(internal: CompilerInternal): {
4
+ run: (args: TransformExtractArgs, compile: () => TransformExtractResult | null) => {
5
+ result: TransformExtractResult | null;
6
+ hit: boolean;
7
+ };
8
+ getStats: () => {
9
+ hits: number;
10
+ misses: number;
11
+ bypasses: number;
12
+ writes: number;
13
+ };
14
+ };
@@ -15,7 +15,18 @@ export type CompilerDevOptions = ReplaceProps<DevRuntimeOptions, {
15
15
  checkSelector?: CheckSelectorMode;
16
16
  }>;
17
17
  export type DevSourcemapMode = 'sourceUrl' | 'sourceContent' | 'sidecarServer';
18
+ export type CompilerCacheOptions = {
19
+ /** Persist transform results and tracer syntax. Defaults to true. */
20
+ persistent?: boolean;
21
+ /** Cache callbacks by source. Defaults to true; bump version when captured/external inputs change. */
22
+ dynamicConfig?: boolean;
23
+ /** Manual invalidation namespace for external inputs. */
24
+ version?: string | number;
25
+ /** Cache directory; relative paths resolve from the project root. */
26
+ location?: string;
27
+ };
18
28
  export type CompilerOptions = {
29
+ cache?: CompilerCacheOptions;
19
30
  hoist?: boolean;
20
31
  check?: StyleCheckOptions;
21
32
  css?: CompilerCssOptions;
@@ -2,7 +2,7 @@ import type { CssExtractRule } from "./types.js";
2
2
  export type CompilerCssCollector = ReturnType<typeof createCssCollector>;
3
3
  export declare function createCssCollector(): {
4
4
  add(item: CssExtractRule): void;
5
- addMany(items: CssExtractRule[]): void;
5
+ addMany(rules: CssExtractRule[]): void;
6
6
  getItems(): CssExtractRule[];
7
7
  clear(): void;
8
8
  };
@@ -0,0 +1,13 @@
1
+ import type { CompilerInternal } from "../../compiler/index.js";
2
+ import { BabelCore } from "../utils/babel.js";
3
+ import type { BabelTypes } from "../utils/babel.js";
4
+ /** Immutable syntax only. Every consumer gets fresh nodes before annotations/evaluation. */
5
+ export declare function createTraceMetadataCache(internal: CompilerInternal): {
6
+ parse: (babel: typeof BabelCore, filePath: string, content: string) => BabelTypes.File | null;
7
+ getStats: () => {
8
+ parses: number;
9
+ memoryHits: number;
10
+ diskHits: number;
11
+ writes: number;
12
+ };
13
+ };
@@ -5,5 +5,11 @@ export type Tracer = ReturnType<typeof createTracer>;
5
5
  export declare function createTracer(internal: CompilerInternal): {
6
6
  resolveImport: (babel: typeof BabelCore, source: string, fromFile: string) => EvalModuleBindings | null;
7
7
  traceModule: (babel: typeof BabelCore, source: string, fromFile: string) => EvalModuleBindings | null;
8
+ getMetadataCacheStats: () => {
9
+ parses: number;
10
+ memoryHits: number;
11
+ diskHits: number;
12
+ writes: number;
13
+ };
8
14
  beginCompilation(): void;
9
15
  };
@@ -0,0 +1,7 @@
1
+ export type CheckDiagnostic = {
2
+ level: 'warn' | 'error';
3
+ message: string;
4
+ };
5
+ /** Extraction is synchronous; restore the previous observer for nested compilations. */
6
+ export declare function observeCheckDiagnostics<T>(onDiagnostic: (diagnostic: CheckDiagnostic) => void, run: () => T): T;
7
+ export declare function recordCheckDiagnostic(diagnostic: CheckDiagnostic): void;
@@ -8,5 +8,9 @@ export type ResolvedFile = {
8
8
  mtimeMs: number;
9
9
  };
10
10
  export type ResolveFileFn = (info: ResolveFileInfo) => ResolvedFile | null;
11
+ declare let resolutionObserver: ((source: string, fromFile: string, result: ResolvedFile | null) => void) | null;
12
+ /** Synchronous extraction only; restore the previous observer even when extraction throws. */
13
+ export declare function observeFileResolutions<T>(observer: NonNullable<typeof resolutionObserver>, run: () => T): T;
11
14
  export declare function clearResolverCache(): void;
12
15
  export declare function resolveFile(source: string, fromFile: string): ResolvedFile | null;
16
+ export {};
@@ -4,6 +4,6 @@ export { type } from "./utils/type.js";
4
4
  export { type ClassNameProps, type ClassNameResult, type CombinedStyle, getClassName, getToken, transformElement, } from "./runtime/core/index.js";
5
5
  export { bindScope, type CombinedStyleFor, combineScope, combineStyle, } from "./runtime/style/index.js";
6
6
  export type { StyleProp, StyleTheme, StyleTokenInput, } from "./runtime/types.js";
7
- export type { CSS, CSSProperties, CSSPropertyName, CSSValueExclude, } from "./atomic/utils/types.js";
7
+ export type { CSS, CSSProperties, CSSPropertiesRaw, CSSPropertyName, CSSValueExclude, } from "./atomic/utils/types.js";
8
8
  export { createElement } from "./jsx/runtime/jsx_runtime.js";
9
9
  export * from "./jsx/types/index.js";
@@ -12,6 +12,18 @@ export declare function createVitePluginState(options: PluginOptions): {
12
12
  compileExtract: (args: import("../../../compiler/index.js").TransformExtractArgs) => import("../../../compiler/index.js").TransformExtractResult | null;
13
13
  getExtractedCss: () => string;
14
14
  invalidateFile: (_info: import("../../../compiler/index.js").CompilerInvalidateFileInfo) => void;
15
+ getPersistentCacheStats: () => {
16
+ hits: number;
17
+ misses: number;
18
+ bypasses: number;
19
+ writes: number;
20
+ };
21
+ getTraceMetadataCacheStats: () => {
22
+ parses: number;
23
+ memoryHits: number;
24
+ diskHits: number;
25
+ writes: number;
26
+ };
15
27
  };
16
28
  filter: import("../../utils/index.js").TransformFilter;
17
29
  transform: (code: string, id: string, sourcemap?: import("../../utils/index.js").BundlerSourceMap | null) => {
@@ -44,6 +56,18 @@ export declare function createVitePluginState(options: PluginOptions): {
44
56
  compileExtract: (args: import("../../../compiler/index.js").TransformExtractArgs) => import("../../../compiler/index.js").TransformExtractResult | null;
45
57
  getExtractedCss: () => string;
46
58
  invalidateFile: (_info: import("../../../compiler/index.js").CompilerInvalidateFileInfo) => void;
59
+ getPersistentCacheStats: () => {
60
+ hits: number;
61
+ misses: number;
62
+ bypasses: number;
63
+ writes: number;
64
+ };
65
+ getTraceMetadataCacheStats: () => {
66
+ parses: number;
67
+ memoryHits: number;
68
+ diskHits: number;
69
+ writes: number;
70
+ };
47
71
  };
48
72
  filter: import("../../utils/index.js").TransformFilter;
49
73
  transform: (code: string, id: string, sourcemap?: import("../../utils/index.js").BundlerSourceMap | null) => {
@@ -6,7 +6,6 @@ export type PluginCssOptions = CompilerCssOptions;
6
6
  export { CssPropPresets } from "../../compiler/index.js";
7
7
  export type { CompilerCssPropOptions } from "../../compiler/index.js";
8
8
  export type PluginOptions = CompilerOptions & TransformFilterOptions & {
9
- cacheDir?: string;
10
9
  cssOutput?: PluginCssOutputOptions;
11
10
  };
12
11
  export type PluginCompiler = ReturnType<typeof createPluginCompiler>;
@@ -29,6 +28,18 @@ export declare function createPluginCompiler(args: PluginCompilerArgs): {
29
28
  compileExtract: (args: import("../../compiler/index.js").TransformExtractArgs) => import("../../compiler/index.js").TransformExtractResult | null;
30
29
  getExtractedCss: () => string;
31
30
  invalidateFile: (_info: import("../../compiler/index.js").CompilerInvalidateFileInfo) => void;
31
+ getPersistentCacheStats: () => {
32
+ hits: number;
33
+ misses: number;
34
+ bypasses: number;
35
+ writes: number;
36
+ };
37
+ getTraceMetadataCacheStats: () => {
38
+ parses: number;
39
+ memoryHits: number;
40
+ diskHits: number;
41
+ writes: number;
42
+ };
32
43
  };
33
44
  filter: import("./filter.js").TransformFilter;
34
45
  transform: (code: string, id: string, sourcemap?: BundlerSourceMap | null) => {
@@ -4,7 +4,7 @@ export type TokenTuple<T extends readonly ValueBase[]> = {
4
4
  [P in T[number]]: StyleToken<InferValue<P>>;
5
5
  };
6
6
  export type TokenRecord<T extends object> = {
7
- [P in keyof T]: T[P] extends readonly unknown[] ? StyleToken<T[P]> : T[P] extends object ? TokenRecord<T[P]> : T[P] extends ValueBase ? StyleToken<InferValue<T[P]>> : StyleToken<T[P]>;
7
+ [P in keyof T]: T[P] extends StyleToken<infer V> ? StyleToken<V> : T[P] extends readonly unknown[] ? StyleToken<T[P]> : T[P] extends object ? TokenRecord<T[P]> : T[P] extends ValueBase ? StyleToken<InferValue<T[P]>> : StyleToken<T[P]>;
8
8
  };
9
9
  export declare function createTokens<const T extends readonly ValueBase[]>(values: T): TokenTuple<T>;
10
10
  export declare function createTokens<T extends object>(values: T): TokenRecord<T>;
@@ -1,4 +1,5 @@
1
- import type { CSSProperties, StyleObject, StyleValue } from "./types.js";
1
+ import type { CSSPropertiesRaw } from "../atomic/utils/types.js";
2
+ import type { StyleObject, StyleValue } from "./types.js";
2
3
  declare const CLASS_NAME_VALUE: unique symbol;
3
4
  export type ClassNameValue<Value = unknown> = {
4
5
  readonly [CLASS_NAME_VALUE]: true;
@@ -9,10 +10,10 @@ export type TransformStyleObject<Style = unknown> = {
9
10
  [P in keyof Style]: StyleValue<Style[P] | ClassNameValue<Style[P]>>;
10
11
  };
11
12
  export type StyleTransform<Style = unknown> = {
12
- transform(style: StyleObject<Style>): TransformStyleObject<CSSProperties>;
13
+ transform(style: StyleObject<Style>): TransformStyleObject<CSSPropertiesRaw>;
13
14
  };
14
15
  export type ClassNameTransform<ClassName extends string = string> = {
15
- transform(className: ClassName): TransformStyleObject<CSSProperties>;
16
+ transform(className: ClassName): TransformStyleObject<CSSPropertiesRaw>;
16
17
  };
17
18
  export declare function classNameValue<const Value>(value: Value, className: string): ClassNameValue<Value>;
18
19
  export declare function isClassNameValue(value: unknown): value is ClassNameValue;
@@ -1,5 +1,5 @@
1
- import { t as getClassName } from "./getClassName-B3azD1TO.js";
2
- import { a as createTransformElement } from "./globalSheet-CdgVpvCb.js";
1
+ import { t as getClassName } from "./getClassName-DKk03IJU.js";
2
+ import { a as createTransformElement } from "./globalSheet-CjX0Df0w.js";
3
3
  //#region runtime/rsc/jsx.ts
4
4
  const transformElement = createTransformElement(getClassName);
5
5
  //#endregion
@@ -39,4 +39,4 @@ function createJsx(fn, transformElement) {
39
39
  //#endregion
40
40
  export { transformElement as a, wrapFragment as i, createJsxDEV as n, wrapCreateElement as r, createJsx as t };
41
41
 
42
- //# sourceMappingURL=utils-CB70kIh6.js.map
42
+ //# sourceMappingURL=utils-B3O2b3Ly.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-CB70kIh6.js","names":[],"sources":["../runtime/rsc/jsx.ts","../jsx/utils.ts"],"sourcesContent":["import { createTransformElement } from '../core/createTransformElement';\nimport { getClassName } from './getClassName';\n\nexport const transformElement = createTransformElement(getClassName);\n","import type { createElement, ElementType, Fragment } from 'react';\nimport type { jsxDEV } from 'react/jsx-dev-runtime';\nimport type { jsx, jsxs } from 'react/jsx-runtime';\n\nexport type FnJsxDEV = typeof jsxDEV;\nexport type FnJsx = typeof jsx;\nexport type FnJsxs = typeof jsxs;\nexport type FnCreateElement = typeof createElement;\n\nexport type TransformElementArgs = {\n type: ElementType;\n props: unknown;\n source?: unknown;\n};\n\nexport type TransformElement = {\n (args: TransformElementArgs): TransformElementArgs;\n};\n\nexport function wrapCreateElement(\n createElement: FnCreateElement,\n transformElement: TransformElement,\n): FnCreateElement {\n const fn = (type: ElementType, props: unknown, ...children: []) => {\n const result = transformElement({ type, props });\n\n return createElement(result.type, result.props, ...children);\n };\n\n return fn as FnCreateElement;\n}\n\nexport function wrapFragment(\n fragment: typeof Fragment,\n) {\n return fragment;\n}\n\nexport function createJsxDEV(\n fn: FnJsxDEV,\n transformElement: TransformElement,\n): FnJsxDEV {\n return (type, props, key, isStatic, source, self) => {\n const result = transformElement({ type, props, source });\n\n return fn(result.type, result.props, key, isStatic, source, self);\n };\n}\n\nexport function createJsx(\n fn: FnJsx,\n transformElement: TransformElement,\n): FnJsx {\n return (type, props, key) => {\n const result = transformElement({ type, props });\n\n return fn(result.type, result.props, key);\n };\n}\n"],"mappings":";;;AAGA,MAAa,mBAAmB,uBAAuB,YAAY;;;ACgBnE,SAAgB,kBACd,eACA,kBACiB;CACjB,MAAM,MAAM,MAAmB,OAAgB,GAAG,aAAiB;EACjE,MAAM,SAAS,iBAAiB;GAAE;GAAM;EAAM,CAAC;EAE/C,OAAO,cAAc,OAAO,MAAM,OAAO,OAAO,GAAG,QAAQ;CAC7D;CAEA,OAAO;AACT;AAEA,SAAgB,aACd,UACA;CACA,OAAO;AACT;AAEA,SAAgB,aACd,IACA,kBACU;CACV,QAAQ,MAAM,OAAO,KAAK,UAAU,QAAQ,SAAS;EACnD,MAAM,SAAS,iBAAiB;GAAE;GAAM;GAAO;EAAO,CAAC;EAEvD,OAAO,GAAG,OAAO,MAAM,OAAO,OAAO,KAAK,UAAU,QAAQ,IAAI;CAClE;AACF;AAEA,SAAgB,UACd,IACA,kBACO;CACP,QAAQ,MAAM,OAAO,QAAQ;EAC3B,MAAM,SAAS,iBAAiB;GAAE;GAAM;EAAM,CAAC;EAE/C,OAAO,GAAG,OAAO,MAAM,OAAO,OAAO,GAAG;CAC1C;AACF"}
1
+ {"version":3,"file":"utils-B3O2b3Ly.js","names":[],"sources":["../runtime/rsc/jsx.ts","../jsx/utils.ts"],"sourcesContent":["import { createTransformElement } from '../core/createTransformElement';\nimport { getClassName } from './getClassName';\n\nexport const transformElement = createTransformElement(getClassName);\n","import type { createElement, ElementType, Fragment } from 'react';\nimport type { jsxDEV } from 'react/jsx-dev-runtime';\nimport type { jsx, jsxs } from 'react/jsx-runtime';\n\nexport type FnJsxDEV = typeof jsxDEV;\nexport type FnJsx = typeof jsx;\nexport type FnJsxs = typeof jsxs;\nexport type FnCreateElement = typeof createElement;\n\nexport type TransformElementArgs = {\n type: ElementType;\n props: unknown;\n source?: unknown;\n};\n\nexport type TransformElement = {\n (args: TransformElementArgs): TransformElementArgs;\n};\n\nexport function wrapCreateElement(\n createElement: FnCreateElement,\n transformElement: TransformElement,\n): FnCreateElement {\n const fn = (type: ElementType, props: unknown, ...children: []) => {\n const result = transformElement({ type, props });\n\n return createElement(result.type, result.props, ...children);\n };\n\n return fn as FnCreateElement;\n}\n\nexport function wrapFragment(\n fragment: typeof Fragment,\n) {\n return fragment;\n}\n\nexport function createJsxDEV(\n fn: FnJsxDEV,\n transformElement: TransformElement,\n): FnJsxDEV {\n return (type, props, key, isStatic, source, self) => {\n const result = transformElement({ type, props, source });\n\n return fn(result.type, result.props, key, isStatic, source, self);\n };\n}\n\nexport function createJsx(\n fn: FnJsx,\n transformElement: TransformElement,\n): FnJsx {\n return (type, props, key) => {\n const result = transformElement({ type, props });\n\n return fn(result.type, result.props, key);\n };\n}\n"],"mappings":";;;AAGA,MAAa,mBAAmB,uBAAuB,YAAY;;;ACgBnE,SAAgB,kBACd,eACA,kBACiB;CACjB,MAAM,MAAM,MAAmB,OAAgB,GAAG,aAAiB;EACjE,MAAM,SAAS,iBAAiB;GAAE;GAAM;EAAM,CAAC;EAE/C,OAAO,cAAc,OAAO,MAAM,OAAO,OAAO,GAAG,QAAQ;CAC7D;CAEA,OAAO;AACT;AAEA,SAAgB,aACd,UACA;CACA,OAAO;AACT;AAEA,SAAgB,aACd,IACA,kBACU;CACV,QAAQ,MAAM,OAAO,KAAK,UAAU,QAAQ,SAAS;EACnD,MAAM,SAAS,iBAAiB;GAAE;GAAM;GAAO;EAAO,CAAC;EAEvD,OAAO,GAAG,OAAO,MAAM,OAAO,OAAO,KAAK,UAAU,QAAQ,IAAI;CAClE;AACF;AAEA,SAAgB,UACd,IACA,kBACO;CACP,QAAQ,MAAM,OAAO,QAAQ;EAC3B,MAAM,SAAS,iBAAiB;GAAE;GAAM;EAAM,CAAC;EAE/C,OAAO,GAAG,OAAO,MAAM,OAAO,OAAO,GAAG;CAC1C;AACF"}