@wix/astro 2.26.0 → 2.28.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 (177) hide show
  1. package/build/dependencies/astro-auth/backend-runtime/constants-Dbkf3D5f.mjs +6 -0
  2. package/build/dependencies/astro-auth/backend-runtime/elevatedContextualClient-tJx9dIn_.mjs +41 -0
  3. package/build/dependencies/astro-auth/backend-runtime/host-utils-B2Fs_Z4S.mjs +17 -0
  4. package/build/dependencies/astro-auth/backend-runtime/middleware/auth.d.mts +6 -0
  5. package/build/dependencies/astro-auth/backend-runtime/middleware/auth.mjs +3643 -0
  6. package/build/dependencies/astro-auth/backend-runtime/middleware/localization.d.mts +6 -0
  7. package/build/dependencies/astro-auth/backend-runtime/middleware/localization.mjs +193 -0
  8. package/build/dependencies/astro-auth/backend-runtime/routes/callback.d.mts +6 -0
  9. package/build/dependencies/astro-auth/backend-runtime/routes/callback.mjs +34 -0
  10. package/build/dependencies/astro-auth/backend-runtime/routes/login.d.mts +6 -0
  11. package/build/dependencies/astro-auth/backend-runtime/routes/login.mjs +32 -0
  12. package/build/dependencies/astro-auth/backend-runtime/routes/logout-callback.d.mts +6 -0
  13. package/build/dependencies/astro-auth/backend-runtime/routes/logout-callback.mjs +14 -0
  14. package/build/dependencies/astro-auth/backend-runtime/routes/logout.d.mts +6 -0
  15. package/build/dependencies/astro-auth/backend-runtime/routes/logout.mjs +19 -0
  16. package/build/dependencies/astro-auth/backend-runtime/runtime/backend/setupContextualClient.d.mts +1 -0
  17. package/build/dependencies/astro-auth/backend-runtime/runtime/backend/setupContextualClient.mjs +8 -0
  18. package/build/dependencies/astro-auth/backend-runtime/saveSessionTokensToCookie-DK3xvtzk.mjs +24 -0
  19. package/build/dependencies/astro-auth/backend-runtime/schemas-XrMhpOYn.mjs +2771 -0
  20. package/build/dependencies/astro-auth/browser-runtime/setup.d.ts +4 -3
  21. package/build/dependencies/astro-auth/browser-runtime/setup.js +55 -81
  22. package/build/dependencies/astro-backend-extensions/backend-runtime/routes/extensions.d.mts +6 -0
  23. package/build/dependencies/astro-backend-extensions/backend-runtime/routes/extensions.mjs +37 -0
  24. package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupServicePlugin.d.mts +10 -0
  25. package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupServicePlugin.mjs +22 -0
  26. package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupWebhook.d.mts +9 -0
  27. package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupWebhook.mjs +22 -0
  28. package/build/dependencies/astro-backend-extensions/backend-runtime/utils-DDHGZHjR.mjs +56 -0
  29. package/build/dependencies/astro-backend-extensions/backend-runtime/utils-mYlwmIjd.d.mts +6 -0
  30. package/build/dependencies/astro-backoffice-extensions/browser-runtime/wrapComponent.d.ts +4 -3
  31. package/build/dependencies/astro-backoffice-extensions/browser-runtime/wrapComponent.js +6 -5
  32. package/build/dependencies/astro-context-providers-extensions/browser-runtime/hmr.d.ts +10 -0
  33. package/build/dependencies/astro-context-providers-extensions/browser-runtime/hmr.js +20 -23
  34. package/build/dependencies/astro-context-providers-extensions/browser-runtime/sdk.d.ts +9 -0
  35. package/build/dependencies/astro-context-providers-extensions/browser-runtime/sdk.js +16 -15
  36. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/customElementHmr.d.ts +9 -5
  37. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/customElementHmr.js +23 -40
  38. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.d.ts +10 -1
  39. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.js +20 -23
  40. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/renderSettingsPanel.d.ts +4 -3
  41. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/renderSettingsPanel.js +14 -18
  42. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/wrapCustomElement.d.ts +9 -5
  43. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/wrapCustomElement.js +23 -25
  44. package/build/dependencies/astro-embedded-scripts-extensions/browser-runtime/setupContext.d.ts +8 -4
  45. package/build/dependencies/astro-embedded-scripts-extensions/browser-runtime/setupContext.js +18 -17
  46. package/build/dependencies/astro-function-libraries-extensions/browser-runtime/sdk.d.ts +9 -0
  47. package/build/dependencies/astro-function-libraries-extensions/browser-runtime/sdk.js +16 -15
  48. package/build/dependencies/astro-html-embeds/backend-runtime/html-embeds.d.mts +6 -0
  49. package/build/dependencies/astro-html-embeds/backend-runtime/html-embeds.mjs +53 -0
  50. package/build/dependencies/astro-monitor/backend-runtime/monitor.d.mts +6 -0
  51. package/build/dependencies/astro-monitor/backend-runtime/monitor.mjs +43 -0
  52. package/build/dependencies/astro-payment-links/backend-runtime/elevate-CDDLuCIf.mjs +9 -0
  53. package/build/dependencies/astro-payment-links/backend-runtime/payment-checkout.d.mts +6 -0
  54. package/build/dependencies/astro-payment-links/backend-runtime/payment-checkout.mjs +20 -0
  55. package/build/dependencies/astro-payment-links/backend-runtime/payment-link.d.mts +6 -0
  56. package/build/dependencies/astro-payment-links/backend-runtime/payment-link.mjs +15 -0
  57. package/build/dependencies/astro-payment-links/backend-runtime/proposal.d.mts +6 -0
  58. package/build/dependencies/astro-payment-links/backend-runtime/proposal.mjs +20 -0
  59. package/build/dependencies/astro-robots/backend-runtime/robots.d.mts +6 -0
  60. package/build/dependencies/astro-robots/backend-runtime/robots.mjs +26 -0
  61. package/build/dependencies/astro-site-component-panels-extensions/browser-runtime/hmr.d.ts +10 -0
  62. package/build/dependencies/astro-site-component-panels-extensions/browser-runtime/hmr.js +20 -23
  63. package/build/dependencies/astro-site-component-panels-extensions/browser-runtime/sdk.d.ts +12 -0
  64. package/build/dependencies/astro-site-component-panels-extensions/browser-runtime/sdk.js +10 -10
  65. package/build/dependencies/astro-site-components-extensions/browser-runtime/hmr.d.ts +10 -0
  66. package/build/dependencies/astro-site-components-extensions/browser-runtime/hmr.js +20 -23
  67. package/build/dependencies/astro-site-components-extensions/browser-runtime/sdk.d.ts +9 -0
  68. package/build/dependencies/astro-site-components-extensions/browser-runtime/sdk.js +16 -15
  69. package/build/dependencies/astro-translations/backend-runtime/middleware/static-translations.d.mts +6 -0
  70. package/build/dependencies/astro-translations/backend-runtime/middleware/static-translations.mjs +177 -0
  71. package/build/dependencies/astro-translations/backend-runtime/runtime/{i18n.d.ts → i18n.d.mts} +3 -2
  72. package/build/dependencies/astro-translations/backend-runtime/runtime/i18n.mjs +38 -0
  73. package/build/dependencies/astro-translations/integration/index.d.mts +105 -0
  74. package/build/dependencies/astro-translations/integration/index.mjs +264 -0
  75. package/build/dependencies/astro-trusted-backoffice-extensions/browser-runtime/hmr.d.ts +10 -1
  76. package/build/dependencies/astro-trusted-backoffice-extensions/browser-runtime/hmr.js +20 -23
  77. package/build/dependencies/astro-trusted-backoffice-extensions/browser-runtime/wrapComponent.d.ts +12 -8
  78. package/build/dependencies/astro-trusted-backoffice-extensions/browser-runtime/wrapComponent.js +25 -35
  79. package/build/dependencies/astro-viewer-api/backend-runtime/api.d.mts +6 -0
  80. package/build/dependencies/astro-viewer-api/backend-runtime/api.mjs +27 -0
  81. package/build/dependencies/astro-viewer-services-extensions/browser-runtime/sdk.d.ts +9 -0
  82. package/build/dependencies/astro-viewer-services-extensions/browser-runtime/sdk.js +16 -15
  83. package/build/integration/builders-B9yQdgSz.mjs +76 -0
  84. package/build/integration/builders-DP0350YQ.d.mts +121 -0
  85. package/build/integration/builders-DVfxT6EC.mjs +225 -0
  86. package/build/integration/builders-experimental.d.mts +56 -0
  87. package/build/integration/builders-experimental.mjs +26 -0
  88. package/build/integration/builders-trusted.d.mts +75 -0
  89. package/build/integration/builders-trusted.mjs +46 -0
  90. package/build/integration/builders.d.mts +4 -0
  91. package/build/integration/builders.mjs +4 -0
  92. package/build/integration/index-B3B_5bgh.d.mts +248 -0
  93. package/build/integration/index-D5k6Bmue.d.mts +32 -0
  94. package/build/integration/index.d.mts +35 -0
  95. package/build/integration/index.mjs +29236 -0
  96. package/package.json +12 -12
  97. package/build/dependencies/astro-auth/backend-runtime/chunk-24J7STEA.js +0 -8
  98. package/build/dependencies/astro-auth/backend-runtime/chunk-352W54SQ.js +0 -70
  99. package/build/dependencies/astro-auth/backend-runtime/chunk-BIARYLOZ.js +0 -3267
  100. package/build/dependencies/astro-auth/backend-runtime/chunk-DZHZMKUF.js +0 -26
  101. package/build/dependencies/astro-auth/backend-runtime/chunk-MLKGABMK.js +0 -9
  102. package/build/dependencies/astro-auth/backend-runtime/chunk-USQSPPTM.js +0 -14
  103. package/build/dependencies/astro-auth/backend-runtime/middleware/auth.d.ts +0 -5
  104. package/build/dependencies/astro-auth/backend-runtime/middleware/auth.js +0 -136
  105. package/build/dependencies/astro-auth/backend-runtime/middleware/localization.d.ts +0 -5
  106. package/build/dependencies/astro-auth/backend-runtime/middleware/localization.js +0 -219
  107. package/build/dependencies/astro-auth/backend-runtime/routes/callback.d.ts +0 -5
  108. package/build/dependencies/astro-auth/backend-runtime/routes/callback.js +0 -53
  109. package/build/dependencies/astro-auth/backend-runtime/routes/login.d.ts +0 -5
  110. package/build/dependencies/astro-auth/backend-runtime/routes/login.js +0 -46
  111. package/build/dependencies/astro-auth/backend-runtime/routes/logout-callback.d.ts +0 -5
  112. package/build/dependencies/astro-auth/backend-runtime/routes/logout-callback.js +0 -24
  113. package/build/dependencies/astro-auth/backend-runtime/routes/logout.d.ts +0 -5
  114. package/build/dependencies/astro-auth/backend-runtime/routes/logout.js +0 -33
  115. package/build/dependencies/astro-auth/backend-runtime/runtime/backend/setupContextualClient.d.ts +0 -2
  116. package/build/dependencies/astro-auth/backend-runtime/runtime/backend/setupContextualClient.js +0 -10
  117. package/build/dependencies/astro-backend-extensions/backend-runtime/chunk-CPGTXQVH.js +0 -75
  118. package/build/dependencies/astro-backend-extensions/backend-runtime/routes/extensions.d.ts +0 -5
  119. package/build/dependencies/astro-backend-extensions/backend-runtime/routes/extensions.js +0 -41
  120. package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupServicePlugin.d.ts +0 -10
  121. package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupServicePlugin.js +0 -35
  122. package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupWebhook.d.ts +0 -9
  123. package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupWebhook.js +0 -34
  124. package/build/dependencies/astro-backend-extensions/backend-runtime/utils-B7jr2PES.d.ts +0 -5
  125. package/build/dependencies/astro-backend-extensions/types/index.d.ts +0 -102
  126. package/build/dependencies/astro-backoffice-extensions/types/index.d.ts +0 -68
  127. package/build/dependencies/astro-context-providers-extensions/types/index.d.ts +0 -32
  128. package/build/dependencies/astro-core/types/index.d.ts +0 -109
  129. package/build/dependencies/astro-custom-elements-extensions/types/index.d.ts +0 -45
  130. package/build/dependencies/astro-embedded-scripts-extensions/types/index.d.ts +0 -18
  131. package/build/dependencies/astro-function-libraries-extensions/types/index.d.ts +0 -23
  132. package/build/dependencies/astro-html-embeds/backend-runtime/html-embeds.d.ts +0 -5
  133. package/build/dependencies/astro-html-embeds/backend-runtime/html-embeds.js +0 -66
  134. package/build/dependencies/astro-payment-links/backend-runtime/chunk-656BVIJ3.js +0 -9
  135. package/build/dependencies/astro-payment-links/backend-runtime/payment-checkout.d.ts +0 -5
  136. package/build/dependencies/astro-payment-links/backend-runtime/payment-checkout.js +0 -24
  137. package/build/dependencies/astro-payment-links/backend-runtime/payment-link.d.ts +0 -5
  138. package/build/dependencies/astro-payment-links/backend-runtime/payment-link.js +0 -20
  139. package/build/dependencies/astro-payment-links/backend-runtime/proposal.d.ts +0 -5
  140. package/build/dependencies/astro-payment-links/backend-runtime/proposal.js +0 -24
  141. package/build/dependencies/astro-robots/backend-runtime/robots.d.ts +0 -5
  142. package/build/dependencies/astro-robots/backend-runtime/robots.js +0 -38
  143. package/build/dependencies/astro-site-component-panels-extensions/types/index.d.ts +0 -21
  144. package/build/dependencies/astro-site-components-extensions/types/index.d.ts +0 -48
  145. package/build/dependencies/astro-translations/backend-runtime/middleware/static-translations.d.ts +0 -5
  146. package/build/dependencies/astro-translations/backend-runtime/middleware/static-translations.js +0 -168
  147. package/build/dependencies/astro-translations/backend-runtime/runtime/i18n.js +0 -42
  148. package/build/dependencies/astro-translations/integration/index.d.ts +0 -5
  149. package/build/dependencies/astro-translations/integration/index.js +0 -296
  150. package/build/dependencies/astro-trusted-backoffice-extensions/types/index.d.ts +0 -50
  151. package/build/dependencies/astro-viewer-api/backend-runtime/api.d.ts +0 -5
  152. package/build/dependencies/astro-viewer-api/backend-runtime/api.js +0 -34
  153. package/build/dependencies/astro-viewer-services-extensions/types/index.d.ts +0 -27
  154. package/build/integration/builders-experimental.d.ts +0 -53
  155. package/build/integration/builders-experimental.js +0 -20
  156. package/build/integration/builders-experimental.js.map +0 -1
  157. package/build/integration/builders-trusted.d.ts +0 -69
  158. package/build/integration/builders-trusted.js +0 -52
  159. package/build/integration/builders-trusted.js.map +0 -1
  160. package/build/integration/builders.d.ts +0 -112
  161. package/build/integration/builders.js +0 -14
  162. package/build/integration/builders.js.map +0 -1
  163. package/build/integration/chunk-23MOLCVI.js +0 -1087
  164. package/build/integration/chunk-23MOLCVI.js.map +0 -1
  165. package/build/integration/chunk-CBVCNKLN.js +0 -7458
  166. package/build/integration/chunk-CBVCNKLN.js.map +0 -1
  167. package/build/integration/chunk-E42TF2A2.js +0 -23747
  168. package/build/integration/chunk-E42TF2A2.js.map +0 -1
  169. package/build/integration/chunk-KCOYXYJL.js +0 -386
  170. package/build/integration/chunk-KCOYXYJL.js.map +0 -1
  171. package/build/integration/chunk-MNQWQ2MC.js +0 -809
  172. package/build/integration/chunk-MNQWQ2MC.js.map +0 -1
  173. package/build/integration/index.d-BUVlSCHa.d.ts +0 -211
  174. package/build/integration/index.d-D4c48TR0.d.ts +0 -58
  175. package/build/integration/index.d.ts +0 -34
  176. package/build/integration/index.js +0 -498
  177. package/build/integration/index.js.map +0 -1
@@ -1,1087 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
- get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
11
- }) : x)(function(x) {
12
- if (typeof require !== "undefined") return require.apply(this, arguments);
13
- throw Error('Dynamic require of "' + x + '" is not supported');
14
- });
15
- var __esm = (fn, res) => function __init() {
16
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
17
- };
18
- var __commonJS = (cb, mod) => function __require2() {
19
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
20
- };
21
- var __copyProps = (to, from, except, desc) => {
22
- if (from && typeof from === "object" || typeof from === "function") {
23
- for (let key of __getOwnPropNames(from))
24
- if (!__hasOwnProp.call(to, key) && key !== except)
25
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
- }
27
- return to;
28
- };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
- // If the importer is in node compatibility mode or this is not an ESM
31
- // file that has been converted to a CommonJS file using a Babel-
32
- // compatible transform (i.e. "__esModule" has not been set), then set
33
- // "default" to the CommonJS "module.exports" for node compatibility.
34
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
- mod
36
- ));
37
-
38
- // ../../node_modules/tsup/assets/esm_shims.js
39
- import path from "path";
40
- import { fileURLToPath } from "url";
41
- var init_esm_shims = __esm({
42
- "../../node_modules/tsup/assets/esm_shims.js"() {
43
- "use strict";
44
- }
45
- });
46
-
47
- // ../../node_modules/path-to-regexp/dist/index.js
48
- var require_dist = __commonJS({
49
- "../../node_modules/path-to-regexp/dist/index.js"(exports) {
50
- "use strict";
51
- init_esm_shims();
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.PathError = exports.TokenData = void 0;
54
- exports.parse = parse;
55
- exports.compile = compile;
56
- exports.match = match2;
57
- exports.pathToRegexp = pathToRegexp;
58
- exports.stringify = stringify;
59
- var DEFAULT_DELIMITER = "/";
60
- var NOOP_VALUE = (value) => value;
61
- var ID_START = /^[$_\p{ID_Start}]$/u;
62
- var ID_CONTINUE = /^[$\u200c\u200d\p{ID_Continue}]$/u;
63
- var SIMPLE_TOKENS = {
64
- // Groups.
65
- "{": "{",
66
- "}": "}",
67
- // Reserved.
68
- "(": "(",
69
- ")": ")",
70
- "[": "[",
71
- "]": "]",
72
- "+": "+",
73
- "?": "?",
74
- "!": "!"
75
- };
76
- function escapeText(str) {
77
- return str.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
78
- }
79
- function escape(str) {
80
- return str.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
81
- }
82
- var TokenData = class {
83
- constructor(tokens, originalPath) {
84
- this.tokens = tokens;
85
- this.originalPath = originalPath;
86
- }
87
- };
88
- exports.TokenData = TokenData;
89
- var PathError = class extends TypeError {
90
- constructor(message, originalPath) {
91
- let text = message;
92
- if (originalPath)
93
- text += `: ${originalPath}`;
94
- text += `; visit https://git.new/pathToRegexpError for info`;
95
- super(text);
96
- this.originalPath = originalPath;
97
- }
98
- };
99
- exports.PathError = PathError;
100
- function parse(str, options = {}) {
101
- const { encodePath = NOOP_VALUE } = options;
102
- const chars = [...str];
103
- const tokens = [];
104
- let index = 0;
105
- let pos = 0;
106
- function name() {
107
- let value = "";
108
- if (ID_START.test(chars[index])) {
109
- do {
110
- value += chars[index++];
111
- } while (ID_CONTINUE.test(chars[index]));
112
- } else if (chars[index] === '"') {
113
- let quoteStart = index;
114
- while (index++ < chars.length) {
115
- if (chars[index] === '"') {
116
- index++;
117
- quoteStart = 0;
118
- break;
119
- }
120
- if (chars[index] === "\\")
121
- index++;
122
- value += chars[index];
123
- }
124
- if (quoteStart) {
125
- throw new PathError(`Unterminated quote at index ${quoteStart}`, str);
126
- }
127
- }
128
- if (!value) {
129
- throw new PathError(`Missing parameter name at index ${index}`, str);
130
- }
131
- return value;
132
- }
133
- while (index < chars.length) {
134
- const value = chars[index];
135
- const type = SIMPLE_TOKENS[value];
136
- if (type) {
137
- tokens.push({ type, index: index++, value });
138
- } else if (value === "\\") {
139
- tokens.push({ type: "escape", index: index++, value: chars[index++] });
140
- } else if (value === ":") {
141
- tokens.push({ type: "param", index: index++, value: name() });
142
- } else if (value === "*") {
143
- tokens.push({ type: "wildcard", index: index++, value: name() });
144
- } else {
145
- tokens.push({ type: "char", index: index++, value });
146
- }
147
- }
148
- tokens.push({ type: "end", index, value: "" });
149
- function consumeUntil(endType) {
150
- const output = [];
151
- while (true) {
152
- const token = tokens[pos++];
153
- if (token.type === endType)
154
- break;
155
- if (token.type === "char" || token.type === "escape") {
156
- let path2 = token.value;
157
- let cur = tokens[pos];
158
- while (cur.type === "char" || cur.type === "escape") {
159
- path2 += cur.value;
160
- cur = tokens[++pos];
161
- }
162
- output.push({
163
- type: "text",
164
- value: encodePath(path2)
165
- });
166
- continue;
167
- }
168
- if (token.type === "param" || token.type === "wildcard") {
169
- output.push({
170
- type: token.type,
171
- name: token.value
172
- });
173
- continue;
174
- }
175
- if (token.type === "{") {
176
- output.push({
177
- type: "group",
178
- tokens: consumeUntil("}")
179
- });
180
- continue;
181
- }
182
- throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str);
183
- }
184
- return output;
185
- }
186
- return new TokenData(consumeUntil("end"), str);
187
- }
188
- function compile(path2, options = {}) {
189
- const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
190
- const data = typeof path2 === "object" ? path2 : parse(path2, options);
191
- const fn = tokensToFunction(data.tokens, delimiter, encode);
192
- return function path3(params = {}) {
193
- const [path4, ...missing] = fn(params);
194
- if (missing.length) {
195
- throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
196
- }
197
- return path4;
198
- };
199
- }
200
- function tokensToFunction(tokens, delimiter, encode) {
201
- const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode));
202
- return (data) => {
203
- const result = [""];
204
- for (const encoder of encoders) {
205
- const [value, ...extras] = encoder(data);
206
- result[0] += value;
207
- result.push(...extras);
208
- }
209
- return result;
210
- };
211
- }
212
- function tokenToFunction(token, delimiter, encode) {
213
- if (token.type === "text")
214
- return () => [token.value];
215
- if (token.type === "group") {
216
- const fn = tokensToFunction(token.tokens, delimiter, encode);
217
- return (data) => {
218
- const [value, ...missing] = fn(data);
219
- if (!missing.length)
220
- return [value];
221
- return [""];
222
- };
223
- }
224
- const encodeValue = encode || NOOP_VALUE;
225
- if (token.type === "wildcard" && encode !== false) {
226
- return (data) => {
227
- const value = data[token.name];
228
- if (value == null)
229
- return ["", token.name];
230
- if (!Array.isArray(value) || value.length === 0) {
231
- throw new TypeError(`Expected "${token.name}" to be a non-empty array`);
232
- }
233
- return [
234
- value.map((value2, index) => {
235
- if (typeof value2 !== "string") {
236
- throw new TypeError(`Expected "${token.name}/${index}" to be a string`);
237
- }
238
- return encodeValue(value2);
239
- }).join(delimiter)
240
- ];
241
- };
242
- }
243
- return (data) => {
244
- const value = data[token.name];
245
- if (value == null)
246
- return ["", token.name];
247
- if (typeof value !== "string") {
248
- throw new TypeError(`Expected "${token.name}" to be a string`);
249
- }
250
- return [encodeValue(value)];
251
- };
252
- }
253
- function match2(path2, options = {}) {
254
- const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
255
- const { regexp, keys } = pathToRegexp(path2, options);
256
- const decoders = keys.map((key) => {
257
- if (decode === false)
258
- return NOOP_VALUE;
259
- if (key.type === "param")
260
- return decode;
261
- return (value) => value.split(delimiter).map(decode);
262
- });
263
- return function match3(input) {
264
- const m2 = regexp.exec(input);
265
- if (!m2)
266
- return false;
267
- const path3 = m2[0];
268
- const params = /* @__PURE__ */ Object.create(null);
269
- for (let i = 1; i < m2.length; i++) {
270
- if (m2[i] === void 0)
271
- continue;
272
- const key = keys[i - 1];
273
- const decoder = decoders[i - 1];
274
- params[key.name] = decoder(m2[i]);
275
- }
276
- return { path: path3, params };
277
- };
278
- }
279
- function pathToRegexp(path2, options = {}) {
280
- const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true } = options;
281
- const keys = [];
282
- const flags = sensitive ? "" : "i";
283
- const sources = [];
284
- for (const input of pathsToArray(path2, [])) {
285
- const data = typeof input === "object" ? input : parse(input, options);
286
- for (const tokens of flatten(data.tokens, 0, [])) {
287
- sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));
288
- }
289
- }
290
- let pattern = `^(?:${sources.join("|")})`;
291
- if (trailing)
292
- pattern += `(?:${escape(delimiter)}$)?`;
293
- pattern += end ? "$" : `(?=${escape(delimiter)}|$)`;
294
- const regexp = new RegExp(pattern, flags);
295
- return { regexp, keys };
296
- }
297
- function pathsToArray(paths, init) {
298
- if (Array.isArray(paths)) {
299
- for (const p of paths)
300
- pathsToArray(p, init);
301
- } else {
302
- init.push(paths);
303
- }
304
- return init;
305
- }
306
- function* flatten(tokens, index, init) {
307
- if (index === tokens.length) {
308
- return yield init;
309
- }
310
- const token = tokens[index];
311
- if (token.type === "group") {
312
- for (const seq of flatten(token.tokens, 0, init.slice())) {
313
- yield* flatten(tokens, index + 1, seq);
314
- }
315
- } else {
316
- init.push(token);
317
- }
318
- yield* flatten(tokens, index + 1, init);
319
- }
320
- function toRegExpSource(tokens, delimiter, keys, originalPath) {
321
- let result = "";
322
- let backtrack = "";
323
- let isSafeSegmentParam = true;
324
- for (const token of tokens) {
325
- if (token.type === "text") {
326
- result += escape(token.value);
327
- backtrack += token.value;
328
- isSafeSegmentParam || (isSafeSegmentParam = token.value.includes(delimiter));
329
- continue;
330
- }
331
- if (token.type === "param" || token.type === "wildcard") {
332
- if (!isSafeSegmentParam && !backtrack) {
333
- throw new PathError(`Missing text before "${token.name}" ${token.type}`, originalPath);
334
- }
335
- if (token.type === "param") {
336
- result += `(${negate(delimiter, isSafeSegmentParam ? "" : backtrack)}+)`;
337
- } else {
338
- result += `([\\s\\S]+)`;
339
- }
340
- keys.push(token);
341
- backtrack = "";
342
- isSafeSegmentParam = false;
343
- continue;
344
- }
345
- }
346
- return result;
347
- }
348
- function negate(delimiter, backtrack) {
349
- if (backtrack.length < 2) {
350
- if (delimiter.length < 2)
351
- return `[^${escape(delimiter + backtrack)}]`;
352
- return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`;
353
- }
354
- if (delimiter.length < 2) {
355
- return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`;
356
- }
357
- return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\s\\S])`;
358
- }
359
- function stringifyTokens(tokens) {
360
- let value = "";
361
- let i = 0;
362
- function name(value2) {
363
- const isSafe = isNameSafe(value2) && isNextNameSafe(tokens[i]);
364
- return isSafe ? value2 : JSON.stringify(value2);
365
- }
366
- while (i < tokens.length) {
367
- const token = tokens[i++];
368
- if (token.type === "text") {
369
- value += escapeText(token.value);
370
- continue;
371
- }
372
- if (token.type === "group") {
373
- value += `{${stringifyTokens(token.tokens)}}`;
374
- continue;
375
- }
376
- if (token.type === "param") {
377
- value += `:${name(token.name)}`;
378
- continue;
379
- }
380
- if (token.type === "wildcard") {
381
- value += `*${name(token.name)}`;
382
- continue;
383
- }
384
- throw new TypeError(`Unknown token type: ${token.type}`);
385
- }
386
- return value;
387
- }
388
- function stringify(data) {
389
- return stringifyTokens(data.tokens);
390
- }
391
- function isNameSafe(name) {
392
- const [first, ...rest] = name;
393
- return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char));
394
- }
395
- function isNextNameSafe(token) {
396
- if (token && token.type === "text")
397
- return !ID_CONTINUE.test(token.value[0]);
398
- return true;
399
- }
400
- }
401
- });
402
-
403
- // ../vite-utils/src/index.ts
404
- init_esm_shims();
405
- import { ok } from "assert";
406
- import { join } from "path";
407
- import { fileURLToPath as fileURLToPath2 } from "url";
408
- import {
409
- createServer,
410
- mergeConfig,
411
- build as viteBuild,
412
- normalizePath as viteNormalizePath
413
- } from "vite";
414
- function appendToDevServerUrl(devServerUrl, relativePath) {
415
- const url = new URL(
416
- relativePath.replace(/^[\\/]/, "./"),
417
- devServerUrl.endsWith("/") ? devServerUrl : `${devServerUrl}/`
418
- );
419
- return url.toString();
420
- }
421
- async function build(config) {
422
- const buildOutput = await viteBuild(config);
423
- return viteBuildOutputToRollupOutputs(buildOutput);
424
- }
425
- async function buildAll(configs) {
426
- const buildOutput = [];
427
- for (const config of configs) {
428
- const result = await viteBuild(config);
429
- if (Array.isArray(result)) {
430
- buildOutput.push(...result);
431
- } else if ("output" in result) {
432
- buildOutput.push(result);
433
- }
434
- }
435
- return viteBuildOutputToRollupOutputs(buildOutput);
436
- }
437
- function cacheDir(rootDir, name) {
438
- return join(rootDir, "node_modules", ".vite-wix", name);
439
- }
440
- async function createTemporaryViteServer(viteConfig) {
441
- const server = await createServer(
442
- mergeConfig(
443
- {
444
- logLevel: "silent",
445
- optimizeDeps: { noDiscovery: true },
446
- server: {
447
- middlewareMode: true,
448
- ws: false
449
- }
450
- },
451
- viteConfig
452
- )
453
- );
454
- return server;
455
- }
456
- function getAssetForModuleId({
457
- buildOutput,
458
- moduleId
459
- }) {
460
- const asset = buildOutput.filter((x) => x.type === "asset").find((x) => x.fileName === moduleId);
461
- ok(asset);
462
- return asset;
463
- }
464
- function getAssetForName({
465
- name,
466
- buildOutput
467
- }) {
468
- const asset = buildOutput.filter((x) => x.type === "asset").find((x) => x.names.includes(name));
469
- ok(asset);
470
- return asset;
471
- }
472
- function getAssetUrlForModuleId({
473
- baseUrl,
474
- devServer,
475
- moduleId
476
- }) {
477
- const pathWithBase = join(devServer.config.base, "@id", `${moduleId}?import`);
478
- return appendToDevServerUrl(baseUrl, pathWithBase);
479
- }
480
- function getChunkForEntryName({
481
- buildOutput,
482
- entryName
483
- }) {
484
- const chunk = buildOutput.filter((x) => x.type === "chunk").find((x) => x.isEntry && x.name === entryName);
485
- ok(chunk);
486
- return chunk;
487
- }
488
- function getChunkForModuleId({
489
- buildOutput,
490
- moduleId
491
- }) {
492
- const chunk = buildOutput.filter((x) => x.type === "chunk").find((x) => x.facadeModuleId === moduleId);
493
- ok(chunk);
494
- return chunk;
495
- }
496
- function getCssFileNameFromChunk(chunk) {
497
- return chunk.viteMetadata?.importedCss.values().next().value;
498
- }
499
- function getLocalDevServerUrl(server) {
500
- const [devServerUrl] = server.resolvedUrls?.local ?? [];
501
- ok(devServerUrl != null);
502
- return devServerUrl;
503
- }
504
- function getStyleUrlForFile({
505
- baseUrl,
506
- devServer,
507
- filePath
508
- }) {
509
- const pathWithBase = join(devServer.config.base, "@fs", `${filePath}?direct`);
510
- return appendToDevServerUrl(baseUrl, pathWithBase);
511
- }
512
- async function loadFileWithVite(filename, server) {
513
- const module2 = await server.ssrLoadModule(filename).catch((error) => {
514
- if (error != null && typeof error === "object" && "code" in error && error.code === "ERR_LOAD_URL") {
515
- return null;
516
- }
517
- throw error;
518
- });
519
- return module2;
520
- }
521
- function viteBuildOutputToRollupOutputs(viteBuildOutput) {
522
- const isValidRollupOutput = "output" in viteBuildOutput || Array.isArray(viteBuildOutput);
523
- ok(isValidRollupOutput);
524
- return Array.isArray(viteBuildOutput) ? viteBuildOutput.flatMap((output) => output.output) : viteBuildOutput.output;
525
- }
526
- function normalizePath(id) {
527
- const filePath = typeof id === "string" ? id : fileURLToPath2(id);
528
- return viteNormalizePath(filePath);
529
- }
530
-
531
- // ../../node_modules/es-toolkit/dist/object/cloneDeep.mjs
532
- init_esm_shims();
533
-
534
- // ../../node_modules/es-toolkit/dist/object/cloneDeepWith.mjs
535
- init_esm_shims();
536
-
537
- // ../../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
538
- init_esm_shims();
539
- function getSymbols(object) {
540
- return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
541
- }
542
-
543
- // ../../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
544
- init_esm_shims();
545
- function getTag(value) {
546
- if (value == null) {
547
- return value === void 0 ? "[object Undefined]" : "[object Null]";
548
- }
549
- return Object.prototype.toString.call(value);
550
- }
551
-
552
- // ../../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
553
- init_esm_shims();
554
- var regexpTag = "[object RegExp]";
555
- var stringTag = "[object String]";
556
- var numberTag = "[object Number]";
557
- var booleanTag = "[object Boolean]";
558
- var argumentsTag = "[object Arguments]";
559
- var symbolTag = "[object Symbol]";
560
- var dateTag = "[object Date]";
561
- var mapTag = "[object Map]";
562
- var setTag = "[object Set]";
563
- var arrayTag = "[object Array]";
564
- var arrayBufferTag = "[object ArrayBuffer]";
565
- var objectTag = "[object Object]";
566
- var dataViewTag = "[object DataView]";
567
- var uint8ArrayTag = "[object Uint8Array]";
568
- var uint8ClampedArrayTag = "[object Uint8ClampedArray]";
569
- var uint16ArrayTag = "[object Uint16Array]";
570
- var uint32ArrayTag = "[object Uint32Array]";
571
- var int8ArrayTag = "[object Int8Array]";
572
- var int16ArrayTag = "[object Int16Array]";
573
- var int32ArrayTag = "[object Int32Array]";
574
- var float32ArrayTag = "[object Float32Array]";
575
- var float64ArrayTag = "[object Float64Array]";
576
-
577
- // ../../node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
578
- init_esm_shims();
579
- function isPrimitive(value) {
580
- return value == null || typeof value !== "object" && typeof value !== "function";
581
- }
582
-
583
- // ../../node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
584
- init_esm_shims();
585
- function isTypedArray(x) {
586
- return ArrayBuffer.isView(x) && !(x instanceof DataView);
587
- }
588
-
589
- // ../../node_modules/es-toolkit/dist/object/cloneDeepWith.mjs
590
- function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @__PURE__ */ new Map(), cloneValue = void 0) {
591
- const cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);
592
- if (cloned !== void 0) {
593
- return cloned;
594
- }
595
- if (isPrimitive(valueToClone)) {
596
- return valueToClone;
597
- }
598
- if (stack.has(valueToClone)) {
599
- return stack.get(valueToClone);
600
- }
601
- if (Array.isArray(valueToClone)) {
602
- const result = new Array(valueToClone.length);
603
- stack.set(valueToClone, result);
604
- for (let i = 0; i < valueToClone.length; i++) {
605
- result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
606
- }
607
- if (Object.hasOwn(valueToClone, "index")) {
608
- result.index = valueToClone.index;
609
- }
610
- if (Object.hasOwn(valueToClone, "input")) {
611
- result.input = valueToClone.input;
612
- }
613
- return result;
614
- }
615
- if (valueToClone instanceof Date) {
616
- return new Date(valueToClone.getTime());
617
- }
618
- if (valueToClone instanceof RegExp) {
619
- const result = new RegExp(valueToClone.source, valueToClone.flags);
620
- result.lastIndex = valueToClone.lastIndex;
621
- return result;
622
- }
623
- if (valueToClone instanceof Map) {
624
- const result = /* @__PURE__ */ new Map();
625
- stack.set(valueToClone, result);
626
- for (const [key, value] of valueToClone) {
627
- result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));
628
- }
629
- return result;
630
- }
631
- if (valueToClone instanceof Set) {
632
- const result = /* @__PURE__ */ new Set();
633
- stack.set(valueToClone, result);
634
- for (const value of valueToClone) {
635
- result.add(cloneDeepWithImpl(value, void 0, objectToClone, stack, cloneValue));
636
- }
637
- return result;
638
- }
639
- if (typeof Buffer !== "undefined" && Buffer.isBuffer(valueToClone)) {
640
- return valueToClone.subarray();
641
- }
642
- if (isTypedArray(valueToClone)) {
643
- const result = new (Object.getPrototypeOf(valueToClone)).constructor(valueToClone.length);
644
- stack.set(valueToClone, result);
645
- for (let i = 0; i < valueToClone.length; i++) {
646
- result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
647
- }
648
- return result;
649
- }
650
- if (valueToClone instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && valueToClone instanceof SharedArrayBuffer) {
651
- return valueToClone.slice(0);
652
- }
653
- if (valueToClone instanceof DataView) {
654
- const result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);
655
- stack.set(valueToClone, result);
656
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
657
- return result;
658
- }
659
- if (typeof File !== "undefined" && valueToClone instanceof File) {
660
- const result = new File([valueToClone], valueToClone.name, {
661
- type: valueToClone.type
662
- });
663
- stack.set(valueToClone, result);
664
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
665
- return result;
666
- }
667
- if (typeof Blob !== "undefined" && valueToClone instanceof Blob) {
668
- const result = new Blob([valueToClone], { type: valueToClone.type });
669
- stack.set(valueToClone, result);
670
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
671
- return result;
672
- }
673
- if (valueToClone instanceof Error) {
674
- const result = new valueToClone.constructor();
675
- stack.set(valueToClone, result);
676
- result.message = valueToClone.message;
677
- result.name = valueToClone.name;
678
- result.stack = valueToClone.stack;
679
- result.cause = valueToClone.cause;
680
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
681
- return result;
682
- }
683
- if (valueToClone instanceof Boolean) {
684
- const result = new Boolean(valueToClone.valueOf());
685
- stack.set(valueToClone, result);
686
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
687
- return result;
688
- }
689
- if (valueToClone instanceof Number) {
690
- const result = new Number(valueToClone.valueOf());
691
- stack.set(valueToClone, result);
692
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
693
- return result;
694
- }
695
- if (valueToClone instanceof String) {
696
- const result = new String(valueToClone.valueOf());
697
- stack.set(valueToClone, result);
698
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
699
- return result;
700
- }
701
- if (typeof valueToClone === "object" && isCloneableObject(valueToClone)) {
702
- const result = Object.create(Object.getPrototypeOf(valueToClone));
703
- stack.set(valueToClone, result);
704
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
705
- return result;
706
- }
707
- return valueToClone;
708
- }
709
- function copyProperties(target, source, objectToClone = target, stack, cloneValue) {
710
- const keys = [...Object.keys(source), ...getSymbols(source)];
711
- for (let i = 0; i < keys.length; i++) {
712
- const key = keys[i];
713
- const descriptor = Object.getOwnPropertyDescriptor(target, key);
714
- if (descriptor == null || descriptor.writable) {
715
- target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);
716
- }
717
- }
718
- }
719
- function isCloneableObject(object) {
720
- switch (getTag(object)) {
721
- case argumentsTag:
722
- case arrayTag:
723
- case arrayBufferTag:
724
- case dataViewTag:
725
- case booleanTag:
726
- case dateTag:
727
- case float32ArrayTag:
728
- case float64ArrayTag:
729
- case int8ArrayTag:
730
- case int16ArrayTag:
731
- case int32ArrayTag:
732
- case mapTag:
733
- case numberTag:
734
- case objectTag:
735
- case regexpTag:
736
- case setTag:
737
- case stringTag:
738
- case symbolTag:
739
- case uint8ArrayTag:
740
- case uint8ClampedArrayTag:
741
- case uint16ArrayTag:
742
- case uint32ArrayTag: {
743
- return true;
744
- }
745
- default: {
746
- return false;
747
- }
748
- }
749
- }
750
-
751
- // ../../node_modules/es-toolkit/dist/object/cloneDeep.mjs
752
- function cloneDeep(obj) {
753
- return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), void 0);
754
- }
755
-
756
- // ../../node_modules/es-toolkit/dist/object/merge.mjs
757
- init_esm_shims();
758
-
759
- // ../../node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
760
- init_esm_shims();
761
- function isUnsafeProperty(key) {
762
- return key === "__proto__";
763
- }
764
-
765
- // ../../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
766
- init_esm_shims();
767
- function isPlainObject(value) {
768
- if (!value || typeof value !== "object") {
769
- return false;
770
- }
771
- const proto = Object.getPrototypeOf(value);
772
- const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
773
- if (!hasObjectPrototype) {
774
- return false;
775
- }
776
- return Object.prototype.toString.call(value) === "[object Object]";
777
- }
778
-
779
- // ../../node_modules/es-toolkit/dist/object/merge.mjs
780
- function merge(target, source) {
781
- const sourceKeys = Object.keys(source);
782
- for (let i = 0; i < sourceKeys.length; i++) {
783
- const key = sourceKeys[i];
784
- if (isUnsafeProperty(key)) {
785
- continue;
786
- }
787
- const sourceValue = source[key];
788
- const targetValue = target[key];
789
- if (Array.isArray(sourceValue)) {
790
- if (Array.isArray(targetValue)) {
791
- target[key] = merge(targetValue, sourceValue);
792
- } else {
793
- target[key] = merge([], sourceValue);
794
- }
795
- } else if (isPlainObject(sourceValue)) {
796
- if (isPlainObject(targetValue)) {
797
- target[key] = merge(targetValue, sourceValue);
798
- } else {
799
- target[key] = merge({}, sourceValue);
800
- }
801
- } else if (targetValue === void 0 || sourceValue !== void 0) {
802
- target[key] = sourceValue;
803
- }
804
- }
805
- return target;
806
- }
807
-
808
- // ../../node_modules/es-toolkit/dist/object/index.mjs
809
- init_esm_shims();
810
-
811
- // ../../node_modules/outdent/lib-module/index.js
812
- init_esm_shims();
813
- function noop() {
814
- var args = [];
815
- for (var _i = 0; _i < arguments.length; _i++) {
816
- args[_i] = arguments[_i];
817
- }
818
- }
819
- function createWeakMap() {
820
- if (typeof WeakMap !== "undefined") {
821
- return /* @__PURE__ */ new WeakMap();
822
- } else {
823
- return fakeSetOrMap();
824
- }
825
- }
826
- function fakeSetOrMap() {
827
- return {
828
- add: noop,
829
- delete: noop,
830
- get: noop,
831
- set: noop,
832
- has: function(k) {
833
- return false;
834
- }
835
- };
836
- }
837
- var hop = Object.prototype.hasOwnProperty;
838
- var has = function(obj, prop) {
839
- return hop.call(obj, prop);
840
- };
841
- function extend(target, source) {
842
- for (var prop in source) {
843
- if (has(source, prop)) {
844
- target[prop] = source[prop];
845
- }
846
- }
847
- return target;
848
- }
849
- var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
850
- var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
851
- var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
852
- var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
853
- var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
854
- function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
855
- var indentationLevel = 0;
856
- var match2 = strings[0].match(reDetectIndentation);
857
- if (match2) {
858
- indentationLevel = match2[1].length;
859
- }
860
- var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
861
- var reMatchIndent = new RegExp(reSource, "g");
862
- if (firstInterpolatedValueSetsIndentationLevel) {
863
- strings = strings.slice(1);
864
- }
865
- var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline;
866
- var normalizeNewlines = typeof newline === "string";
867
- var l = strings.length;
868
- var outdentedStrings = strings.map(function(v, i) {
869
- v = v.replace(reMatchIndent, "$1");
870
- if (i === 0 && trimLeadingNewline) {
871
- v = v.replace(reLeadingNewline, "");
872
- }
873
- if (i === l - 1 && trimTrailingNewline) {
874
- v = v.replace(reTrailingNewline, "");
875
- }
876
- if (normalizeNewlines) {
877
- v = v.replace(/\r\n|\n|\r/g, function(_) {
878
- return newline;
879
- });
880
- }
881
- return v;
882
- });
883
- return outdentedStrings;
884
- }
885
- function concatStringsAndValues(strings, values) {
886
- var ret = "";
887
- for (var i = 0, l = strings.length; i < l; i++) {
888
- ret += strings[i];
889
- if (i < l - 1) {
890
- ret += values[i];
891
- }
892
- }
893
- return ret;
894
- }
895
- function isTemplateStringsArray(v) {
896
- return has(v, "raw") && has(v, "length");
897
- }
898
- function createInstance(options) {
899
- var arrayAutoIndentCache = createWeakMap();
900
- var arrayFirstInterpSetsIndentCache = createWeakMap();
901
- function outdent(stringsOrOptions) {
902
- var values = [];
903
- for (var _i = 1; _i < arguments.length; _i++) {
904
- values[_i - 1] = arguments[_i];
905
- }
906
- if (isTemplateStringsArray(stringsOrOptions)) {
907
- var strings = stringsOrOptions;
908
- var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);
909
- var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
910
- var renderedArray = cache.get(strings);
911
- if (!renderedArray) {
912
- renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
913
- cache.set(strings, renderedArray);
914
- }
915
- if (values.length === 0) {
916
- return renderedArray[0];
917
- }
918
- var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
919
- return rendered;
920
- } else {
921
- return createInstance(extend(extend({}, options), stringsOrOptions || {}));
922
- }
923
- }
924
- var fullOutdent = extend(outdent, {
925
- string: function(str) {
926
- return _outdentArray([str], false, options)[0];
927
- }
928
- });
929
- return fullOutdent;
930
- }
931
- var defaultOutdent = createInstance({
932
- trimLeadingNewline: true,
933
- trimTrailingNewline: true
934
- });
935
- if (typeof module !== "undefined") {
936
- try {
937
- module.exports = defaultOutdent;
938
- Object.defineProperty(defaultOutdent, "__esModule", { value: true });
939
- defaultOutdent.default = defaultOutdent;
940
- defaultOutdent.outdent = defaultOutdent;
941
- } catch (e) {
942
- }
943
- }
944
-
945
- // ../../node_modules/vite-plugin-externalize-dependencies/dist/index.js
946
- init_esm_shims();
947
- var r = /* @__PURE__ */ new Set();
948
- var s = (n, e) => e.some((t) => typeof t == "string" ? n === t || n.startsWith(`${t}/`) : t instanceof RegExp ? t.test(n) : typeof t == "function" ? t(n) : false);
949
- var a = (n) => ({
950
- name: "externalize",
951
- setup(e) {
952
- e.onResolve({ filter: /.*/ }, (t) => s(t.path, n) && t.kind === "import-statement" ? (r.add(t.path), {
953
- path: t.path,
954
- external: true
955
- }) : s(t.path, n) && t.kind === "entry-point" ? (r.add(t.path), { path: t.path, namespace: "externalized-modules" }) : null), e.onLoad({ filter: /.*/ }, (t) => s(t.path, n) ? { contents: "" } : null);
956
- }
957
- });
958
- var o = ({
959
- base: n
960
- }) => ({
961
- name: "vite-plugin-remove-prefix",
962
- transform: (e) => {
963
- if (r.size === 0)
964
- return e;
965
- const t = "@id/", u = new RegExp(
966
- `${n}${t}(${[...r].join(
967
- "|"
968
- )})`,
969
- "g"
970
- );
971
- return u.test(e) ? e.replace(
972
- u,
973
- (p, i) => i
974
- ) : e;
975
- }
976
- });
977
- var m = (n) => ({
978
- name: "vite-plugin-externalize",
979
- enforce: "pre",
980
- apply: "serve",
981
- config: (e) => {
982
- var p, i;
983
- e.optimizeDeps ?? (e.optimizeDeps = {}), (p = e.optimizeDeps).esbuildOptions ?? (p.esbuildOptions = {}), (i = e.optimizeDeps.esbuildOptions).plugins ?? (i.plugins = []);
984
- const t = "externalize";
985
- return e.optimizeDeps.esbuildOptions.plugins.some(
986
- (l) => l.name === t
987
- ) || e.optimizeDeps.esbuildOptions.plugins.push(
988
- a(n.externals)
989
- ), null;
990
- },
991
- configResolved: (e) => {
992
- e.plugins.push(
993
- o({ base: e.base ?? "/" })
994
- );
995
- },
996
- // Supresses the following warning:
997
- // Failed to resolve import [dependency] from [sourceFile]. Does the file exist?
998
- resolveId: (e) => r.has(e) ? { id: e, external: true } : s(e, n.externals) ? (r.add(e), { id: e, external: true }) : null,
999
- // Supresses the following warning:
1000
- // The following dependencies are imported but could not be resolved: [dependency] (imported by [sourceFile])
1001
- load: (e) => r.has(e) ? { code: "export default {};" } : null
1002
- });
1003
-
1004
- // ../vite-virtual-router-plugin/src/index.ts
1005
- init_esm_shims();
1006
- var import_path_to_regexp = __toESM(require_dist(), 1);
1007
- import { ok as ok2 } from "assert";
1008
- var RESOLVED_PREFIX = "\0";
1009
- function createVirtualRouter() {
1010
- const routes = [];
1011
- return {
1012
- route(path2, handler) {
1013
- const matcher = (0, import_path_to_regexp.match)(path2);
1014
- routes.push({
1015
- handler,
1016
- matcher
1017
- });
1018
- return this;
1019
- },
1020
- get routes() {
1021
- return routes;
1022
- }
1023
- };
1024
- }
1025
- function viteVirtualRouterPlugin({ name, router }) {
1026
- let config = null;
1027
- return {
1028
- name,
1029
- configResolved(resolvedConfig) {
1030
- config = resolvedConfig;
1031
- },
1032
- load(rawId) {
1033
- if (rawId.startsWith(RESOLVED_PREFIX)) {
1034
- const id = rawId.replace(RESOLVED_PREFIX, "");
1035
- for (const route of router.routes) {
1036
- const result = route.matcher(id);
1037
- if (result !== false) {
1038
- ok2(config);
1039
- return route.handler(result.params, {
1040
- command: config.command,
1041
- resolvedId: id
1042
- });
1043
- }
1044
- }
1045
- }
1046
- return null;
1047
- },
1048
- resolveId(id) {
1049
- for (const route of router.routes) {
1050
- if (route.matcher(id) !== false) {
1051
- return `${RESOLVED_PREFIX}${id}`;
1052
- }
1053
- }
1054
- return null;
1055
- }
1056
- };
1057
- }
1058
-
1059
- export {
1060
- __require,
1061
- __commonJS,
1062
- __toESM,
1063
- init_esm_shims,
1064
- appendToDevServerUrl,
1065
- build,
1066
- buildAll,
1067
- cacheDir,
1068
- createTemporaryViteServer,
1069
- getAssetForModuleId,
1070
- getAssetForName,
1071
- getAssetUrlForModuleId,
1072
- getChunkForEntryName,
1073
- getChunkForModuleId,
1074
- getCssFileNameFromChunk,
1075
- getLocalDevServerUrl,
1076
- getStyleUrlForFile,
1077
- loadFileWithVite,
1078
- normalizePath,
1079
- cloneDeep,
1080
- merge,
1081
- require_dist,
1082
- createVirtualRouter,
1083
- viteVirtualRouterPlugin,
1084
- defaultOutdent,
1085
- m
1086
- };
1087
- //# sourceMappingURL=chunk-23MOLCVI.js.map