shelfware 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/.output/nitro.json +15 -0
  2. package/.output/public/_nuxt/6IstVYrV.js +1 -0
  3. package/.output/public/_nuxt/9C5WUlLE.js +36 -0
  4. package/.output/public/_nuxt/BDNMzG2s.js +1 -0
  5. package/.output/public/_nuxt/BW3xJdEx.js +1 -0
  6. package/.output/public/_nuxt/BXXtFil5.js +1 -0
  7. package/.output/public/_nuxt/BZuUK3cr.js +1 -0
  8. package/.output/public/_nuxt/BeLyMmd4.js +1 -0
  9. package/.output/public/_nuxt/C_VgD9ZI.js +3 -0
  10. package/.output/public/_nuxt/DB5Vxbte.js +2 -0
  11. package/.output/public/_nuxt/DMg0j7gv.js +14 -0
  12. package/.output/public/_nuxt/builds/latest.json +1 -0
  13. package/.output/public/_nuxt/builds/meta/4c307968-4837-497b-a570-d6ee336accc4.json +1 -0
  14. package/.output/public/_nuxt/entry.b3_DJTEt.css +2 -0
  15. package/.output/public/_nuxt/error-404.CHsn7XF-.css +1 -0
  16. package/.output/public/_nuxt/error-500.Bawx2bLr.css +1 -0
  17. package/.output/server/chunks/_/api-handler.mjs +44 -0
  18. package/.output/server/chunks/_/batch.mjs +27 -0
  19. package/.output/server/chunks/_/catalog.mjs +1115 -0
  20. package/.output/server/chunks/_/detail.mjs +16 -0
  21. package/.output/server/chunks/_/error-500.mjs +19 -0
  22. package/.output/server/chunks/_/quarantine.mjs +159 -0
  23. package/.output/server/chunks/nitro/nitro.mjs +5399 -0
  24. package/.output/server/chunks/routes/api/_..._.mjs +16 -0
  25. package/.output/server/chunks/routes/api/health.get.mjs +13 -0
  26. package/.output/server/chunks/routes/api/skills/_id/file.get.mjs +25 -0
  27. package/.output/server/chunks/routes/api/skills/_id_.get.mjs +25 -0
  28. package/.output/server/chunks/routes/api/skills/_id_.put.mjs +74 -0
  29. package/.output/server/chunks/routes/api/skills/delete.post.mjs +48 -0
  30. package/.output/server/chunks/routes/api/skills/quarantine.post.mjs +26 -0
  31. package/.output/server/chunks/routes/api/skills/restore.post.mjs +26 -0
  32. package/.output/server/chunks/routes/api/skills.get.mjs +41 -0
  33. package/.output/server/chunks/routes/renderer.mjs +341 -0
  34. package/.output/server/chunks/virtual/_virtual_spa-template.mjs +3 -0
  35. package/.output/server/chunks/virtual/precomputed.mjs +3 -0
  36. package/.output/server/index.mjs +9 -0
  37. package/.output/server/node_modules/@babel/parser/lib/index.js +14611 -0
  38. package/.output/server/node_modules/@babel/parser/package.json +50 -0
  39. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6801 -0
  40. package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
  41. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +692 -0
  42. package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
  43. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1420 -0
  44. package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
  45. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1903 -0
  46. package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
  47. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6980 -0
  48. package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
  49. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1867 -0
  50. package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
  51. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +904 -0
  52. package/.output/server/node_modules/@vue/server-renderer/package.json +53 -0
  53. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +636 -0
  54. package/.output/server/node_modules/@vue/shared/package.json +47 -0
  55. package/.output/server/node_modules/devalue/index.js +17 -0
  56. package/.output/server/node_modules/devalue/package.json +39 -0
  57. package/.output/server/node_modules/devalue/src/base64.js +60 -0
  58. package/.output/server/node_modules/devalue/src/constants.js +12 -0
  59. package/.output/server/node_modules/devalue/src/operations.js +193 -0
  60. package/.output/server/node_modules/devalue/src/parse.js +274 -0
  61. package/.output/server/node_modules/devalue/src/stringify.js +428 -0
  62. package/.output/server/node_modules/devalue/src/uneval.js +606 -0
  63. package/.output/server/node_modules/devalue/src/utils.js +185 -0
  64. package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  65. package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
  66. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
  67. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
  68. package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
  69. package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
  70. package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
  71. package/.output/server/node_modules/entities/package.json +120 -0
  72. package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
  73. package/.output/server/node_modules/estree-walker/package.json +37 -0
  74. package/.output/server/node_modules/hookable/dist/index.mjs +257 -0
  75. package/.output/server/node_modules/hookable/package.json +53 -0
  76. package/.output/server/node_modules/nostics/dist/formatters/ansi.mjs +19 -0
  77. package/.output/server/node_modules/nostics/dist/index.mjs +187 -0
  78. package/.output/server/node_modules/nostics/package.json +125 -0
  79. package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
  80. package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  81. package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
  82. package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
  83. package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
  84. package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
  85. package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  86. package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  87. package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
  88. package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
  89. package/.output/server/node_modules/source-map-js/package.json +71 -0
  90. package/.output/server/node_modules/source-map-js/source-map.js +8 -0
  91. package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
  92. package/.output/server/node_modules/ufo/package.json +48 -0
  93. package/.output/server/node_modules/unhead/dist/client.mjs +22 -0
  94. package/.output/server/node_modules/unhead/dist/legacy.mjs +33 -0
  95. package/.output/server/node_modules/unhead/dist/minify.mjs +183 -0
  96. package/.output/server/node_modules/unhead/dist/parser.mjs +518 -0
  97. package/.output/server/node_modules/unhead/dist/plugins.mjs +720 -0
  98. package/.output/server/node_modules/unhead/dist/server.mjs +99 -0
  99. package/.output/server/node_modules/unhead/dist/shared/unhead.-hZVKou0.mjs +400 -0
  100. package/.output/server/node_modules/unhead/dist/shared/unhead.BEmVMkeA.mjs +673 -0
  101. package/.output/server/node_modules/unhead/dist/shared/unhead.BGFxPGPQ.mjs +47 -0
  102. package/.output/server/node_modules/unhead/dist/shared/unhead.BQWSw36o.mjs +192 -0
  103. package/.output/server/node_modules/unhead/dist/shared/unhead.Bf_fPVYA.mjs +6 -0
  104. package/.output/server/node_modules/unhead/dist/shared/unhead.Bjbp1C8D.mjs +224 -0
  105. package/.output/server/node_modules/unhead/dist/shared/unhead.Bm4Y6XQI.mjs +17 -0
  106. package/.output/server/node_modules/unhead/dist/shared/unhead.C5Bksi2B.mjs +49 -0
  107. package/.output/server/node_modules/unhead/dist/shared/unhead.CGPOfp5O.mjs +32 -0
  108. package/.output/server/node_modules/unhead/dist/shared/unhead.CHEy9ana.mjs +7 -0
  109. package/.output/server/node_modules/unhead/dist/shared/unhead.D7HkBzZn.mjs +59 -0
  110. package/.output/server/node_modules/unhead/dist/shared/unhead.Dssd7L5I.mjs +196 -0
  111. package/.output/server/node_modules/unhead/dist/shared/unhead.jEy9BmRq.mjs +264 -0
  112. package/.output/server/node_modules/unhead/dist/shared/unhead.oZ7pkTV1.mjs +19 -0
  113. package/.output/server/node_modules/unhead/dist/shared/unhead.tQnRaXfX.mjs +240 -0
  114. package/.output/server/node_modules/unhead/dist/stream/client.mjs +33 -0
  115. package/.output/server/node_modules/unhead/dist/stream/iife.mjs +2 -0
  116. package/.output/server/node_modules/unhead/dist/stream/server.mjs +445 -0
  117. package/.output/server/node_modules/unhead/dist/utils.mjs +7 -0
  118. package/.output/server/node_modules/unhead/package.json +179 -0
  119. package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
  120. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
  121. package/.output/server/node_modules/vue/index.js +7 -0
  122. package/.output/server/node_modules/vue/index.mjs +1 -0
  123. package/.output/server/node_modules/vue/package.json +112 -0
  124. package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
  125. package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +278 -0
  126. package/.output/server/node_modules/vue-bundle-renderer/package.json +54 -0
  127. package/.output/server/node_modules/yaml/dist/compose/compose-collection.js +90 -0
  128. package/.output/server/node_modules/yaml/dist/compose/compose-doc.js +45 -0
  129. package/.output/server/node_modules/yaml/dist/compose/compose-node.js +112 -0
  130. package/.output/server/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
  131. package/.output/server/node_modules/yaml/dist/compose/composer.js +224 -0
  132. package/.output/server/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
  133. package/.output/server/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
  134. package/.output/server/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
  135. package/.output/server/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  136. package/.output/server/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
  137. package/.output/server/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
  138. package/.output/server/node_modules/yaml/dist/compose/resolve-props.js +148 -0
  139. package/.output/server/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  140. package/.output/server/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
  141. package/.output/server/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  142. package/.output/server/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
  143. package/.output/server/node_modules/yaml/dist/doc/Document.js +337 -0
  144. package/.output/server/node_modules/yaml/dist/doc/anchors.js +76 -0
  145. package/.output/server/node_modules/yaml/dist/doc/applyReviver.js +57 -0
  146. package/.output/server/node_modules/yaml/dist/doc/createNode.js +90 -0
  147. package/.output/server/node_modules/yaml/dist/doc/directives.js +178 -0
  148. package/.output/server/node_modules/yaml/dist/errors.js +62 -0
  149. package/.output/server/node_modules/yaml/dist/index.js +50 -0
  150. package/.output/server/node_modules/yaml/dist/log.js +19 -0
  151. package/.output/server/node_modules/yaml/dist/nodes/Alias.js +118 -0
  152. package/.output/server/node_modules/yaml/dist/nodes/Collection.js +151 -0
  153. package/.output/server/node_modules/yaml/dist/nodes/Node.js +40 -0
  154. package/.output/server/node_modules/yaml/dist/nodes/Pair.js +39 -0
  155. package/.output/server/node_modules/yaml/dist/nodes/Scalar.js +27 -0
  156. package/.output/server/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
  157. package/.output/server/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
  158. package/.output/server/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
  159. package/.output/server/node_modules/yaml/dist/nodes/identity.js +53 -0
  160. package/.output/server/node_modules/yaml/dist/nodes/toJS.js +39 -0
  161. package/.output/server/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
  162. package/.output/server/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  163. package/.output/server/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  164. package/.output/server/node_modules/yaml/dist/parse/cst.js +112 -0
  165. package/.output/server/node_modules/yaml/dist/parse/lexer.js +723 -0
  166. package/.output/server/node_modules/yaml/dist/parse/line-counter.js +41 -0
  167. package/.output/server/node_modules/yaml/dist/parse/parser.js +980 -0
  168. package/.output/server/node_modules/yaml/dist/public-api.js +107 -0
  169. package/.output/server/node_modules/yaml/dist/schema/Schema.js +39 -0
  170. package/.output/server/node_modules/yaml/dist/schema/common/map.js +19 -0
  171. package/.output/server/node_modules/yaml/dist/schema/common/null.js +17 -0
  172. package/.output/server/node_modules/yaml/dist/schema/common/seq.js +19 -0
  173. package/.output/server/node_modules/yaml/dist/schema/common/string.js +16 -0
  174. package/.output/server/node_modules/yaml/dist/schema/core/bool.js +21 -0
  175. package/.output/server/node_modules/yaml/dist/schema/core/float.js +47 -0
  176. package/.output/server/node_modules/yaml/dist/schema/core/int.js +42 -0
  177. package/.output/server/node_modules/yaml/dist/schema/core/schema.js +25 -0
  178. package/.output/server/node_modules/yaml/dist/schema/json/schema.js +64 -0
  179. package/.output/server/node_modules/yaml/dist/schema/tags.js +99 -0
  180. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
  181. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  182. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  183. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  184. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
  185. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
  186. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
  187. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
  188. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
  189. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  190. package/.output/server/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
  191. package/.output/server/node_modules/yaml/dist/stringify/stringify.js +132 -0
  192. package/.output/server/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
  193. package/.output/server/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
  194. package/.output/server/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
  195. package/.output/server/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
  196. package/.output/server/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
  197. package/.output/server/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
  198. package/.output/server/node_modules/yaml/dist/visit.js +236 -0
  199. package/.output/server/node_modules/yaml/package.json +97 -0
  200. package/.output/server/package.json +28 -0
  201. package/LICENSE +21 -0
  202. package/README.md +57 -1
  203. package/bin/launch.mjs +158 -0
  204. package/bin/shelfware.mjs +6 -0
  205. package/package.json +64 -5
  206. package/cli.mjs +0 -3
@@ -0,0 +1,240 @@
1
+ import { d as defineHeadPlugin } from './unhead.CHEy9ana.mjs';
2
+ import { p as processTemplateParams } from './unhead.BGFxPGPQ.mjs';
3
+
4
+ const sortTags = (a, b) => a._w === b._w ? a._p - b._p : a._w - b._w;
5
+ const formatKey = (k) => !k.includes(":key") ? k.split(":").join(":key:") : k;
6
+ const AliasSortingPlugin = /* @__PURE__ */ defineHeadPlugin({
7
+ key: "aliasSorting",
8
+ hooks: {
9
+ "tags:resolve": (ctx) => {
10
+ let m = false;
11
+ for (const t of ctx.tags) {
12
+ const p = t.tagPriority;
13
+ if (!p)
14
+ continue;
15
+ const s = String(p);
16
+ if (s.startsWith("before:")) {
17
+ const k = formatKey(s.slice(7));
18
+ const l = ctx.tagMap.get(k);
19
+ if (l) {
20
+ if (typeof l.tagPriority === "number")
21
+ t.tagPriority = l.tagPriority;
22
+ t._p = l._p - 1;
23
+ m = true;
24
+ }
25
+ } else if (s.startsWith("after:")) {
26
+ const k = formatKey(s.slice(6));
27
+ const l = ctx.tagMap.get(k);
28
+ if (l) {
29
+ if (typeof l.tagPriority === "number")
30
+ t.tagPriority = l.tagPriority;
31
+ t._p = l._p + 1;
32
+ m = true;
33
+ }
34
+ }
35
+ }
36
+ if (m)
37
+ ctx.tags = ctx.tags.sort(sortTags);
38
+ }
39
+ }
40
+ });
41
+
42
+ const DeprecationsPlugin = /* @__PURE__ */ defineHeadPlugin({
43
+ key: "deprecations",
44
+ hooks: {
45
+ "entries:normalize": ({ tags }) => {
46
+ for (const tag of tags) {
47
+ if (tag.props.children) {
48
+ tag.innerHTML = tag.props.children;
49
+ delete tag.props.children;
50
+ }
51
+ if (tag.props.hid) {
52
+ tag.key = tag.props.hid;
53
+ delete tag.props.hid;
54
+ }
55
+ if (tag.props.vmid) {
56
+ tag.key = tag.props.vmid;
57
+ delete tag.props.vmid;
58
+ }
59
+ if ("body" in tag.props) {
60
+ if (tag.props.body) {
61
+ tag.tagPosition = "bodyClose";
62
+ }
63
+ delete tag.props.body;
64
+ }
65
+ if (tag.props.renderPriority != null) {
66
+ tag.tagPriority = tag.props.renderPriority;
67
+ delete tag.props.renderPriority;
68
+ }
69
+ }
70
+ }
71
+ }
72
+ });
73
+
74
+ function isThenable(v) {
75
+ return typeof v?.then === "function";
76
+ }
77
+ const maxSyncPrefix = 256;
78
+ function walkArrayPromises(v, index) {
79
+ if (index === v.length)
80
+ return;
81
+ if (index === maxSyncPrefix) {
82
+ const values2 = new Array(v.length);
83
+ let hasThenable = false;
84
+ for (; index < v.length; index++) {
85
+ const value2 = walkPromises(v[index]);
86
+ values2[index] = value2;
87
+ hasThenable ||= isThenable(value2);
88
+ }
89
+ return hasThenable ? values2 : void 0;
90
+ }
91
+ const value = walkPromises(v[index]);
92
+ if (isThenable(value)) {
93
+ const values2 = new Array(v.length);
94
+ values2[index] = value;
95
+ for (let rest = index + 1; rest < v.length; rest++)
96
+ values2[rest] = walkPromises(v[rest]);
97
+ return values2;
98
+ }
99
+ const values = walkArrayPromises(v, index + 1);
100
+ if (values)
101
+ values[index] = value;
102
+ return values;
103
+ }
104
+ function walkObjectPromises(v, keys, index) {
105
+ if (index === keys.length)
106
+ return;
107
+ if (index === maxSyncPrefix) {
108
+ const values2 = new Array(keys.length);
109
+ let hasThenable = false;
110
+ for (; index < keys.length; index++) {
111
+ const value2 = walkPromises(v[keys[index]]);
112
+ values2[index] = value2;
113
+ hasThenable ||= isThenable(value2);
114
+ }
115
+ return hasThenable ? values2 : void 0;
116
+ }
117
+ const value = walkPromises(v[keys[index]]);
118
+ if (isThenable(value)) {
119
+ const values2 = new Array(keys.length);
120
+ values2[index] = value;
121
+ for (let rest = index + 1; rest < keys.length; rest++)
122
+ values2[rest] = walkPromises(v[keys[rest]]);
123
+ return values2;
124
+ }
125
+ const values = walkObjectPromises(v, keys, index + 1);
126
+ if (values)
127
+ values[index] = value;
128
+ return values;
129
+ }
130
+ function walkPromises(v) {
131
+ if (typeof v === "function")
132
+ return v;
133
+ if (isThenable(v))
134
+ return Promise.resolve(v).then(walkPromises);
135
+ if (Array.isArray(v)) {
136
+ const values = walkArrayPromises(v, 0);
137
+ return values ? Promise.all(values) : v;
138
+ }
139
+ if (v?.constructor === Object) {
140
+ const keys = Object.keys(v);
141
+ const values = walkObjectPromises(v, keys, 0);
142
+ if (values) {
143
+ return Promise.all(values).then((resolved) => Object.fromEntries(
144
+ keys.map((key, index) => [key, resolved[index]])
145
+ ));
146
+ }
147
+ }
148
+ return v;
149
+ }
150
+ const PromisesPlugin = /* @__PURE__ */ defineHeadPlugin((head) => {
151
+ const pending = /* @__PURE__ */ new WeakMap();
152
+ return {
153
+ key: "promises",
154
+ hooks: {
155
+ "entries:resolve": (ctx) => {
156
+ for (let index = ctx.entries.length - 1; index >= 0; index--) {
157
+ const entry = ctx.entries[index];
158
+ const input = entry.input;
159
+ if (pending.get(entry) === input) {
160
+ ctx.entries.splice(index, 1);
161
+ continue;
162
+ }
163
+ const result = walkPromises(input);
164
+ if (!isThenable(result)) {
165
+ pending.delete(entry);
166
+ continue;
167
+ }
168
+ pending.set(entry, input);
169
+ ctx.entries.splice(index, 1);
170
+ void Promise.resolve(result).then(
171
+ (resolved) => {
172
+ if (pending.get(entry) !== input)
173
+ return;
174
+ pending.delete(entry);
175
+ entry.input = resolved;
176
+ delete entry._tags;
177
+ head.invalidate?.();
178
+ },
179
+ () => {
180
+ if (pending.get(entry) === input)
181
+ pending.delete(entry);
182
+ }
183
+ );
184
+ }
185
+ }
186
+ }
187
+ };
188
+ }, "promises");
189
+
190
+ const SupportedAttrs = {
191
+ meta: "content",
192
+ link: "href",
193
+ htmlAttrs: "lang"
194
+ };
195
+ const contentAttrs = ["innerHTML", "textContent"];
196
+ function processIfNeeded(value, params, separator, isJson = false) {
197
+ return typeof value === "string" && value.includes("%") ? processTemplateParams(value, params, separator, isJson) : value;
198
+ }
199
+ const TemplateParamsPlugin = /* @__PURE__ */ defineHeadPlugin((head) => {
200
+ return {
201
+ key: "template-params",
202
+ hooks: {
203
+ "tags:resolve": ({ tagMap, tags }) => {
204
+ const params = tagMap.get("templateParams")?.props || {};
205
+ const sep = params.separator || "|";
206
+ delete params.separator;
207
+ params.pageTitle = processIfNeeded(
208
+ // find templateParams
209
+ params.pageTitle || head._title || "",
210
+ params,
211
+ sep
212
+ );
213
+ for (const tag of tags) {
214
+ if (tag.processTemplateParams === false) {
215
+ continue;
216
+ }
217
+ const v = SupportedAttrs[tag.tag];
218
+ if (v && typeof tag.props[v] === "string") {
219
+ tag.props[v] = processIfNeeded(tag.props[v], params, sep);
220
+ } else if (tag.processTemplateParams || tag.tag === "titleTemplate" || tag.tag === "title") {
221
+ for (const p of contentAttrs) {
222
+ if (typeof tag[p] === "string")
223
+ tag[p] = processIfNeeded(tag[p], params, sep, tag.tag === "script" && typeof tag.props.type === "string" && tag.props.type.endsWith("json"));
224
+ }
225
+ }
226
+ }
227
+ head._templateParams = params;
228
+ head._separator = sep;
229
+ },
230
+ "tags:afterResolve": ({ tagMap }) => {
231
+ const title = tagMap.get("title");
232
+ if (title?.textContent && title.processTemplateParams !== false) {
233
+ title.textContent = processIfNeeded(title.textContent, head._templateParams, head._separator);
234
+ }
235
+ }
236
+ }
237
+ };
238
+ }, "template-params");
239
+
240
+ export { AliasSortingPlugin as A, DeprecationsPlugin as D, PromisesPlugin as P, TemplateParamsPlugin as T };
@@ -0,0 +1,33 @@
1
+ import { c as createClientHeadAdapter } from '../shared/unhead.C5Bksi2B.mjs';
2
+ import { c as createHooks } from '../shared/unhead.Bm4Y6XQI.mjs';
3
+ import '../shared/unhead.D7HkBzZn.mjs';
4
+ import 'hookable';
5
+
6
+ const DEFAULT_STREAM_KEY = "__unhead__";
7
+ function createStreamableHead(options = {}) {
8
+ const { streamKey = DEFAULT_STREAM_KEY, ...rest } = options;
9
+ const win = typeof window !== "undefined" ? window : void 0;
10
+ const streamQueue = win?.[streamKey];
11
+ const core = streamQueue?._head;
12
+ if (!core)
13
+ return void 0;
14
+ if (core._wrapped) {
15
+ const wrapped = core;
16
+ for (const name in rest.hooks || {})
17
+ wrapped.hooks?.hook(name, rest.hooks[name]);
18
+ (rest.plugins || []).forEach((p) => wrapped.use(p));
19
+ rest.init?.forEach((e) => e && wrapped.push(e));
20
+ return wrapped;
21
+ }
22
+ const coreRender = core.render;
23
+ const hooks = createHooks(rest.hooks);
24
+ const head = createClientHeadAdapter(core, hooks, () => coreRender());
25
+ head._wrapped = true;
26
+ (rest.plugins || []).forEach((p) => head.use(p));
27
+ rest.init?.forEach((e) => e && head.push(e));
28
+ if (streamQueue)
29
+ streamQueue._head = head;
30
+ return head;
31
+ }
32
+
33
+ export { DEFAULT_STREAM_KEY, createStreamableHead };
@@ -0,0 +1,2 @@
1
+ export const streamingIifeCode = "var __unhead_iife__ = (function (exports) { 'use strict'; const DupeableTags = new Set([\"link\", \"style\", \"script\", \"noscript\"]); const TagsWithInnerContent = new Set([\"title\", \"titleTemplate\", \"script\", \"style\", \"noscript\"]); const HasElementTags = new Set([\"base\", \"meta\", \"link\", \"style\", \"script\", \"noscript\"]); const ValidHeadTags = new Set([\"title\", \"base\", \"htmlAttrs\", \"bodyAttrs\", \"meta\", \"link\", \"style\", \"script\", \"noscript\"]); const UniqueTags = new Set([\"base\", \"title\", \"titleTemplate\", \"bodyAttrs\", \"htmlAttrs\", \"templateParams\"]); const TagConfigKeys = new Set([\"key\", \"tagPosition\", \"tagPriority\", \"tagDuplicateStrategy\", \"innerHTML\", \"textContent\", \"\u0070rocessTemplateParams\"]); const UsesMergeStrategy = new Set([\"templateParams\", \"htmlAttrs\", \"bodyAttrs\"]); const MetaTagsArrayable = new Set([ \"theme-color\", \"google-site-verification\", \"author\", \"og:locale:alternate\", \"og:image\", \"og:video\", \"og:audio\", \"article:author\", \"article:tag\", \"book:author\", \"book:tag\", \"twitter:image\" ]); const hasContent = (value) => typeof value === \"number\" ? Number.isFinite(value) : value; function isUnsafeKey(key) { return key === \"__proto__\" || key === \"constructor\" || key === \"prototype\"; } function callHook(head, hook, ctx) { const hooks = head.hooks?._hooks?.[hook]; if (!hooks?.length) return; return head.hooks?.callHook(hook, ctx); } const META_NOREWRITE_RE = /^(?:viewport|description|keywords|robots)$/; const META_KEY_ATTRS = [\"name\", \"property\", \"http-equiv\"]; function isMetaArrayDupeKey(v) { const i = v.indexOf(\":\"); if (i === -1) return false; const key = v.slice(i + 1); return MetaTagsArrayable.has(key) || key.startsWith(\"og:image:\") || key.startsWith(\"og:video:\") || key.startsWith(\"og:audio:\") || key.startsWith(\"twitter:image:\"); } function dedupeKey(tag) { const { props, tag: t, key } = tag; if (UniqueTags.has(t)) return t; if (t === \"link\") { if (props.rel === \"canonical\") return \"canonical\"; if (props.rel === \"alternate\" && props.hreflang) return `alternate:${props.hreflang}`; } if (props.charset) return \"charset\"; if (t === \"meta\") { for (const n of META_KEY_ATTRS) { const v = props[n]; if (v !== void 0) return `meta:${v}${(typeof v !== \"string\" || !v.includes(\":\")) && !META_NOREWRITE_RE.test(v) && key ? `:key:${key}` : \"\"}`; } } if (key) return `${t}:key:${key}`; if (props.id) return `${t}:id:${props.id}`; if (t === \"link\" && props.rel && props.href) return `link:${props.rel}:${props.href}`; return TagsWithInnerContent.has(t) && (tag.textContent || tag.innerHTML) ? `${t}:content:${tag.textContent || tag.innerHTML}` : void 0; } function hashTag(tag) { const identity = tag._h || tag._d || tag.textContent || tag.innerHTML; if (identity) return identity; const keys = Object.keys(tag.props).sort(); let hash = `${tag.tag}:`; let separator = \"\"; for (const key of keys) { hash += `${separator}${key}:${String(tag.props[key])}`; separator = \",\"; } return hash; } function walkResolver(val, resolve, key) { if (key === \"_resolver\") return val; if (typeof val === \"function\" && (!key || key !== \"titleTemplate\" && !key.startsWith(\"on\"))) val = val(); const v = resolve ? resolve(key, val) : val; if (Array.isArray(v)) { let out; for (let i = 0; i < v.length; i++) { const r = walkResolver(v[i], resolve); if (out) { out[i] = r; } else if (r !== v[i]) { out = v.slice(0, i); out[i] = r; } } return out || v; } if (v?.constructor === Object) { let next; for (const k in v) { const unsafe = isUnsafeKey(k); const r = unsafe ? void 0 : walkResolver(v[k], resolve, k); if (!next && (unsafe || r !== v[k])) { next = {}; for (const pk in v) { if (pk === k) break; next[pk] = v[pk]; } } if (next && !unsafe) next[k] = r; } return next || v; } return v; } const INVALID_ATTR_NAME_RE = /[\\s\"'<>/=\\x00-\\x1F\\x7F]/; function normalizeStyleClassProps(key, value) { const isStyle = key === \"style\"; const store = isStyle ? new Map() : new Set(); const add = (v) => { if (!v) return; if (isStyle) { const i = v.indexOf(\":\"); i > 0 && store.set(v.slice(0, i).trim(), v.slice(i + 1).trim()); } else { v.split(\" \").forEach((c) => c && store.add(c)); } }; if (typeof value === \"string\") { (isStyle ? value.split(\";\") : [value]).forEach(add); } else if (Array.isArray(value)) { value.forEach(add); } else if (value && typeof value === \"object\") { for (const k in value) { const v = value[k]; v && v !== \"false\" && (isStyle ? store.set(k.trim(), String(v)) : add(k)); } } return store; } function normalizeProps(tag, input) { tag.props = tag.props || {}; if (!input) return tag; if (tag.tag === \"templateParams\") { tag.props = input; return tag; } const isHtmlTag = HasElementTags.has(tag.tag) || tag.tag === \"htmlAttrs\" || tag.tag === \"bodyAttrs\"; for (const prop in input) { if (isUnsafeKey(prop)) continue; const isData = prop.startsWith(\"data-\"); const isHtmlAttr = isHtmlTag && !TagConfigKeys.has(prop); const key = isHtmlAttr && !isData ? prop.toLowerCase() : prop; if (isHtmlAttr && (!key || INVALID_ATTR_NAME_RE.test(key))) continue; const value = input[prop]; if (value === null) { tag.props[key] = null; } else if (prop === \"class\" || prop === \"style\") { tag.props[prop] = normalizeStyleClassProps(prop, value); } else if (TagConfigKeys.has(prop)) { if ((prop === \"textContent\" || prop === \"innerHTML\") && typeof value === \"object\") { const type = input.type || \"application/json\"; if (type.endsWith(\"json\") || type === \"speculationrules\" || type === \"importmap\") { tag.props.type = type; tag[prop] = JSON.stringify(value); } } else { tag[prop] = value; } } else if (value !== void 0) { const str = String(value); const isMeta = tag.tag === \"meta\" && key === \"content\"; tag.props[key] = str === \"true\" || str === \"\" ? isData || isMeta ? str : true : !value && isData && str === \"false\" ? \"false\" : value; } } return tag; } function resolveHeadInput(input, propResolvers) { let resolve; if (propResolvers.length) { resolve = (key, val) => { for (let i = 0; i < propResolvers.length; i++) val = propResolvers[i](key, val); return val; }; input = resolve(void 0, input); } return walkResolver(input, resolve); } function normalizeTag(tagName, _input) { const input = typeof _input === \"object\" && typeof _input !== \"function\" ? _input : { [tagName === \"script\" || tagName === \"noscript\" || tagName === \"style\" ? \"innerHTML\" : \"textContent\"]: _input }; const tag = normalizeProps({ tag: tagName, props: {} }, input); if (tag.key && DupeableTags.has(tag.tag)) tag.props[\"data-hid\"] = tag._h = tag.key; if (tag.tag === \"script\" && typeof tag.innerHTML === \"object\") { tag.innerHTML = JSON.stringify(tag.innerHTML); tag.props.type = tag.props.type || \"application/json\"; } if (Array.isArray(tag.props.content)) { const tags = []; for (const content of tag.props.content) { tags.push({ ...tag, props: { ...tag.props, content } }); } return tags; } return tag; } function pushNormalizedTag(tags, tag) { if (Array.isArray(tag)) { for (const t of tag) tags.push(t); } else { tags.push(tag); } } function normalizeEntryToTags(input, propResolvers) { if (!input) return []; if (typeof input === \"function\") input = input(); input = resolveHeadInput(input, propResolvers); const tags = []; for (const key in input) { const value = input[key]; if (value !== void 0) { if (Array.isArray(value)) { for (const v of value) pushNormalizedTag(tags, normalizeTag(key, v)); } else { pushNormalizedTag(tags, normalizeTag(key, value)); } } } return tags; } const LT_RE = /</g; const SCRIPT_END_RE = /<\\/script/g; const sortTags = (a, b) => a._w === b._w ? a._p - b._p : a._w - b._w; const DEFAULT_TAG_WEIGHT = () => 100; function isEmptyProps(props) { for (const _ in props) return false; return true; } const TAG_MUTATING_HOOK_RE = /^tags:|:render/; function syncEntryHookCache(head, hooks) { const count = (hooks[\"entries:resolve\"]?.length || 0) + (hooks[\"entries:normalize\"]?.length || 0); if (head._h !== count) { head._h = count; for (const entry of head.entries.values()) delete entry._tags; } } function cloneTagsInPlace(tags) { for (let i = 0; i < tags.length; i++) { const t = tags[i]; const props = { ...t.props }; if (props.class instanceof Set) props.class = new Set(props.class); if (props.style instanceof Map) props.style = new Map(props.style); tags[i] = { ...t, props }; } } function valuesToTags(ctx, sortFlatMeta) { const tags = ctx.tags; let w = 0; for (const value of ctx.tagMap.values()) { if (Array.isArray(value)) { for (const tag of value) tags[w++] = tag; } else { tags[w++] = value; } } tags.length = w; if (sortFlatMeta) tags.sort(sortTags); } function dedupeTags(ctx) { let hasFlatMeta = false; for (const next of ctx.tags.sort(sortTags)) { const k = next._d || hashTag(next); if (!k) continue; const prev = ctx.tagMap.get(k); if (!prev) { ctx.tagMap.set(k, next); continue; } const strategy = next.tagDuplicateStrategy || (UsesMergeStrategy.has(next.tag) ? \"merge\" : null) || (next.key && next.key === prev.key ? \"merge\" : null); if (strategy === \"merge\") { const props = { ...prev.props }; for (const p in next.props) { props[p] = p === \"style\" ? new Map([...prev.props.style || new Map(), ...next.props[p]]) : p === \"class\" ? new Set([...prev.props.class || [], ...next.props[p]]) : next.props[p]; } ctx.tagMap.set(k, { ...next, props }); } else if (next._p >> 10 === prev._p >> 10 && next.tag === \"meta\" && isMetaArrayDupeKey(k)) { ctx.tagMap.set(k, Object.assign([...Array.isArray(prev) ? prev : [prev], next], next)); hasFlatMeta = true; } else if (next._w === prev._w ? next._p > prev._p : next._w < prev._w) { ctx.tagMap.set(k, next); } } return hasFlatMeta; } function resolveTitleTemplate(ctx, head) { const title = ctx.tagMap.get(\"title\"); const tpl = ctx.tagMap.get(\"titleTemplate\"); head._title = title?.textContent; if (!tpl) return; const fn = tpl.textContent; head._titleTemplate = fn; if (!fn) return; let v = typeof fn === \"function\" ? fn(title?.textContent) : fn; if (typeof v === \"string\" && !head.plugins.has(\"template-params\")) v = v.replace(\"%s\", title?.textContent || \"\"); if (title) { v === null ? ctx.tagMap.delete(\"title\") : ctx.tagMap.set(\"title\", { ...title, textContent: v }); } else { ctx.tagMap.set(\"titleTemplate\", { ...tpl, tag: \"title\", textContent: v }); } } function sanitizeTagsInPlace(tags) { let w = 0; for (let t of tags) { const { innerHTML, tag, props } = t; if (!ValidHeadTags.has(tag) || isEmptyProps(props) && !hasContent(innerHTML) && !hasContent(t.textContent)) continue; if (tag === \"meta\") { if (!hasContent(props.content) && !props[\"http-equiv\"] && !props.charset) continue; } if (tag === \"script\" && (innerHTML || t.textContent)) { const type = String(props.type); const isJsonLike = type.endsWith(\"json\") || type === \"importmap\" || type === \"speculationrules\"; const escape = (content) => isJsonLike ? (typeof content === \"string\" ? content : JSON.stringify(content)).replace(LT_RE, \"\\\\u003C\") : typeof content === \"string\" ? content.replace(SCRIPT_END_RE, \"<\\\\/script\") : content; t = { ...t }; if (innerHTML) t.innerHTML = escape(innerHTML); if (t.textContent) t.textContent = escape(t.textContent); t._d = dedupeKey(t); } tags[w++] = t; } tags.length = w; return tags; } function resolveTags(head, options) { const weightFn = options?.tagWeight ?? head.resolvedOptions._tagWeight ?? DEFAULT_TAG_WEIGHT; const ctx = { tagMap: new Map(), tags: [] }; const hooks = head.hooks?._hooks || {}; syncEntryHookCache(head, hooks); for (const e of head.entries.values()) { if (e._pending !== void 0) { e.input = e._pending; delete e._pending; delete e._tags; delete e._precomputedTags; } } let entries; if (hooks[\"entries:resolve\"]?.length || hooks[\"entries:normalize\"]?.length) { entries = [...head.entries.values()]; if (hooks[\"entries:resolve\"]?.length) callHook(head, \"entries:resolve\", { entries, ...ctx }); } syncEntryHookCache(head, hooks); for (const e of entries || head.entries.values()) { let tags = e._tags; if (!tags) { if (e._precomputedTags && weightFn === head.resolvedOptions._tagWeight && !hooks[\"entries:normalize\"]?.length && !hooks[\"entries:resolve\"]?.length && (!e.options || isEmptyProps(e.options))) { tags = e._precomputedTags; } else { tags = normalizeEntryToTags(e.input, head.resolvedOptions.propResolvers || []); if (e.options && !isEmptyProps(e.options)) { for (const t of tags) Object.assign(t, e.options); } if (hooks[\"entries:normalize\"]?.length) { const normalizeCtx = { tags, entry: e }; callHook(head, \"entries:normalize\", normalizeCtx); tags = normalizeCtx.tags; } for (let i = 0; i < tags.length; i++) { const t = tags[i]; t._w = weightFn(t); t._p = (e._i << 10) + i; t._d = dedupeKey(t); if (!t._d) t._h = hashTag(t); } e._tags = tags; } } ctx.tags.push(...tags); } for (const name in hooks) { if (hooks[name]?.length && TAG_MUTATING_HOOK_RE.test(name)) { cloneTagsInPlace(ctx.tags); break; } } const hasFlatMeta = dedupeTags(ctx); resolveTitleTemplate(ctx, head); valuesToTags(ctx, hasFlatMeta); callHook(head, \"tags:beforeResolve\", ctx); callHook(head, \"tags:resolve\", ctx); callHook(head, \"tags:afterResolve\", ctx); return sanitizeTagsInPlace(ctx.tags); } const WHITESPACE_RE = /\\s+/; function createDomRenderer(options = {}) { return (head) => _renderDOMHead(head, options); } function hasPendingEntries(head) { for (const entry of head.entries.values()) { if (entry._pending !== void 0) return true; } return false; } function createDomState(head, dom) { const state = { _d: dom, _t: dom.title, _e: new Map([[\"htmlAttrs\", dom.documentElement], [\"bodyAttrs\", dom.body]]), _p: {}, _s: {}, _l: new Map() }; for (const entry of head.entries.values()) { if (entry._o !== void 0) { const orig = entry._o; for (const t of [\"bodyAttrs\", \"htmlAttrs\"]) { const cls = orig[t]?.class; if (typeof cls === \"string\") { const $el = state._e.get(t); for (const c of cls.split(WHITESPACE_RE)) { if (c) state._p[`${t}:attr:class:${c}`] = () => $el.classList.remove(c); } } } } } return state; } function _renderDOMHead(head, options = {}) { const dom = options.document || head.resolvedOptions.document; const activeState = head._dom; if (!dom || head._du || activeState && activeState._d === dom && !head.dirty && !hasPendingEntries(head)) return false; const defaultView = dom.defaultView; head._du = true; let didRender = false; try { let track = function(key, fn, fresh) { renderState._s[key] = !fresh && previous[key] || fn; delete previous[key]; }, trackEvent = function(id, k, ev, source, $el, target) { const key = `${id}:event:${k}`; const prev = renderState._l.get(key); if (prev && prev[0] === target && prev[1] === ev && prev[2] === source) { track(key, prev[4]); return; } prev?.[4](); const dk = `data-${k}`; const handler = ((e) => source.call($el, e)); const cleanup = () => { target.removeEventListener(ev, handler); if ($el.getAttribute(dk) === \"\") $el.removeAttribute(dk); if (renderState._l.get(key)?.[3] === handler) renderState._l.delete(key); }; target.addEventListener(ev, handler); renderState._l.set(key, [target, ev, source, handler, cleanup]); $el.setAttribute(dk, \"\"); track(key, cleanup, true); }, trackCtx = function({ id, $el, tag }) { renderState._e.set(id, $el); if (!tag.tag.endsWith(\"Attrs\")) { const text = tag.textContent; if (text != null && text !== \"\") { if (text !== $el.textContent) $el.textContent = text; track(`${id}:text`, () => { if ($el.textContent === text) $el.textContent = \"\"; }, true); } const html = tag.innerHTML; if (html != null && html !== \"\") { if (html !== $el.innerHTML) $el.innerHTML = html; track(`${id}:html`, () => { if ($el.innerHTML === html) $el.innerHTML = \"\"; }, true); } const elKey = `${id}:el`; track(elKey, previous[elKey] || (() => { $el?.remove(); renderState._e.delete(id); })); } for (const k in tag.props) { const v = tag.props[k]; if (k[0] === \"o\" && k[1] === \"n\" && typeof v === \"function\") { const ev = k.slice(2); if ($el?.dataset?.[`${k}fired`]) v.call($el, new (defaultView?.Event || Event)(ev)); trackEvent(id, k, ev, v, $el, tag.tag === \"bodyAttrs\" && defaultView ? defaultView : $el); continue; } const ck = `${id}:attr:${k}`; if (k === \"class\" && v) { for (const c of v) { const key = `${ck}:${c}`; track(key, previous[key] || (() => $el.classList.remove(c))); if (!$el.classList.contains(c)) $el.classList.add(c); } } else if (k === \"style\" && v) { for (const [sk, sv] of v) { const key = `${ck}:${sk}`; track(key, previous[key] || (() => $el.style.removeProperty(sk))); $el.style.setProperty(sk, sv); } } else if (v !== false && v !== null) { if ($el.getAttribute(k) !== v) $el.setAttribute(k, v === true ? \"\" : String(v)); track(ck, previous[ck] || (() => $el.removeAttribute(k))); } } }; const beforeRenderCtx = { shouldRender: true, tags: [] }; callHook(head, \"dom:beforeRender\", beforeRenderCtx); if (!beforeRenderCtx.shouldRender) return false; let state = activeState; if (state?._d !== dom) { if (state) { for (const k in state._s) state._s[k](); for (const k in state._p) state._p[k](); state._s = state._p = {}; state._e.clear(); state._l.clear(); } state = void 0; } if (!state) { state = createDomState(head, dom); } else { state._p = state._s; } state._s = {}; const renderState = state; const previous = renderState._p; const pending = []; const frag = {}; head.dirty = false; const rawTags = resolveTags(head, options.tagWeight ? { tagWeight: options.tagWeight } : void 0); const tags = []; const dupeKeyCounter = {}; for (const tag of rawTags) { const count = dupeKeyCounter[tag._d] || 0; const id = (count ? `${tag._d}:${count}` : tag._d) || tag._h; const ctx = { tag, id, shouldRender: true }; if (tag.tag === \"meta\" && tag._d && isMetaArrayDupeKey(tag._d)) dupeKeyCounter[tag._d] = count + 1; tags.push(ctx); if (tag.tag === \"title\") { dom.title = tag.textContent; track(\"title:\", () => dom.title = renderState._t); continue; } ctx.$el = renderState._e.get(id); if (ctx.$el) trackCtx(ctx); else if (HasElementTags.has(tag.tag)) pending.push(ctx); } if (pending.length) { const tracked = new Set(renderState._e.values()); for (const el of [...dom.body.children, ...dom.head.children]) { const elTag = el.tagName.toLowerCase(); if (!HasElementTags.has(elTag) || tracked.has(el)) continue; const props = { innerHTML: el.innerHTML }; for (const n of el.getAttributeNames()) props[n] = el.getAttribute(n); const next = normalizeProps({ tag: elTag, props: {} }, props); next.key = el.getAttribute(\"data-hid\") || void 0; const dedupe = dedupeKey(next) || hashTag(next); let k = dedupe; let c = 1; while (renderState._e.has(k)) k = `${dedupe}:${c++}`; renderState._e.set(k, el); } } for (const ctx of pending) { const found = renderState._e.get(ctx.id); ctx.$el = found || dom.createElement(ctx.tag.tag); trackCtx(ctx); if (!found) (frag[ctx.tag.tagPosition || \"head\"] ??= dom.createDocumentFragment()).appendChild(ctx.$el); } if (frag.head) dom.head.appendChild(frag.head); if (frag.bodyOpen) dom.body.insertBefore(frag.bodyOpen, dom.body.firstChild); if (frag.bodyClose) dom.body.appendChild(frag.bodyClose); for (const k in previous) previous[k](); head._dom = renderState; didRender = true; callHook(head, \"dom:rendered\", { renders: tags }); } catch (e) { head.dirty = true; throw e; } finally { head._du = false; } if (didRender && (head.dirty || hasPendingEntries(head))) _renderDOMHead(head, options); return didRender; } function registerPlugin(head, p) { if (typeof p === \"function\" && p.key && head.plugins.has(p.key)) return; const plugin = typeof p === \"function\" ? p(head) : p; const key = plugin.key || String(head.plugins.size + 1); if (!head.plugins.get(key)) { head.plugins.set(key, plugin); for (const k in plugin.hooks || {}) head.hooks?.hook(k, plugin.hooks[k]); } } function createUnhead(renderer, resolvedOptions = {}) { const ssr = !resolvedOptions.document; const entries = new Map(); const plugins = new Map(); const head = { _entryCount: 1, _h: 0, plugins, resolvedOptions, ssr, entries, hooks: void 0, render: () => renderer(head), use: (p) => registerPlugin(head, p), push(input, _options) { const _i = _options?._index ?? head._entryCount++; const options = _options ? { ..._options } : {}; delete options.head; delete options.onRendered; delete options._index; const entry = { _i, input, options }; entries.set(_i, entry); const active = { _i, dispose() { entries.delete(_i); }, patch(input2) { if (ssr) { entry.input = input2; delete entry._tags; } else { entry._pending = input2; } if (!entries.has(_i)) entries.set(_i, entry); } }; return active; } }; resolvedOptions.init?.forEach((e) => e && head.push(e)); return head; } const DEFAULT_STREAM_KEY = \"__unhead__\"; function init(options = {}) { const { streamKey = DEFAULT_STREAM_KEY } = options; const win = \u0074ypeof window !== \"undefined\" ? window : void 0; if (!win) return; const queue = win[streamKey]; if (queue?._head) return queue._head; const doc = typeof document !== \"undefined\" ? document : void 0; const head = createUnhead(createDomRenderer(), { document: doc }); function pushStreamed(entry) { const active = head.push(entry); const stored = head.entries.get(active._i); if (stored) stored._streamed = true; } function pushBatch(entries) { const nested = head._b; head._b = true; try { for (const entry of entries) { pushStreamed(entry); } } finally { head._b = nested; if (!nested) { head.dirty = true; head.render(); } } } if (queue?._q?.length) { pushBatch(queue._q.flat()); } win[streamKey] = { _q: [], _head: head, push: pushBatch }; return head; } exports.init = init; return exports; })({});__unhead_iife__.init();";
2
+ export const streamingIifeSize = 21323;