@tomsher/cms-theme-kit 0.0.0-stage → 0.1.1
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.
- package/dist/bin.js +1078 -0
- package/dist/bin.js.map +1 -0
- package/dist/chunk-EUR46QER.js +128 -0
- package/dist/chunk-EUR46QER.js.map +1 -0
- package/dist/chunk-TN3DQWJE.js +439 -0
- package/dist/chunk-TN3DQWJE.js.map +1 -0
- package/dist/chunk-WSX3MAFK.js +1842 -0
- package/dist/chunk-WSX3MAFK.js.map +1 -0
- package/dist/chunk-WTBGO3HG.js +5651 -0
- package/dist/chunk-WTBGO3HG.js.map +1 -0
- package/dist/chunk-YAYCHT4W.js +56 -0
- package/dist/chunk-YAYCHT4W.js.map +1 -0
- package/dist/data-source-63RC4O5W.js +16 -0
- package/dist/data-source-63RC4O5W.js.map +1 -0
- package/dist/server-GITJIQTE.js +177 -0
- package/dist/server-GITJIQTE.js.map +1 -0
- package/dist/static-server-WWP7CW4C.js +132 -0
- package/dist/static-server-WWP7CW4C.js.map +1 -0
- package/package.json +35 -5
- package/README.md +0 -3
|
@@ -0,0 +1,1842 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
__commonJS,
|
|
4
|
+
__toESM,
|
|
5
|
+
customFieldTypeConstants,
|
|
6
|
+
entityKinds,
|
|
7
|
+
liquidThemeConfigFilePaths,
|
|
8
|
+
liquidThemeFolderNames,
|
|
9
|
+
liquidThemeTemplatePaths,
|
|
10
|
+
queryKeys,
|
|
11
|
+
themeAssetUrlPatterns,
|
|
12
|
+
themeCustomizerLocaleNamespace,
|
|
13
|
+
themeCustomizerLocalizedSettingTypes,
|
|
14
|
+
themeFileExtensions,
|
|
15
|
+
themeLinkTargetKinds
|
|
16
|
+
} from "./chunk-TN3DQWJE.js";
|
|
17
|
+
|
|
18
|
+
// ../node_modules/lodash/isArray.js
|
|
19
|
+
var require_isArray = __commonJS({
|
|
20
|
+
"../node_modules/lodash/isArray.js"(exports, module) {
|
|
21
|
+
"use strict";
|
|
22
|
+
var isArray = Array.isArray;
|
|
23
|
+
module.exports = isArray;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// ../node_modules/lodash/_freeGlobal.js
|
|
28
|
+
var require_freeGlobal = __commonJS({
|
|
29
|
+
"../node_modules/lodash/_freeGlobal.js"(exports, module) {
|
|
30
|
+
"use strict";
|
|
31
|
+
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
32
|
+
module.exports = freeGlobal;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// ../node_modules/lodash/_root.js
|
|
37
|
+
var require_root = __commonJS({
|
|
38
|
+
"../node_modules/lodash/_root.js"(exports, module) {
|
|
39
|
+
"use strict";
|
|
40
|
+
var freeGlobal = require_freeGlobal();
|
|
41
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
42
|
+
var root = freeGlobal || freeSelf || Function("return this")();
|
|
43
|
+
module.exports = root;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// ../node_modules/lodash/_Symbol.js
|
|
48
|
+
var require_Symbol = __commonJS({
|
|
49
|
+
"../node_modules/lodash/_Symbol.js"(exports, module) {
|
|
50
|
+
"use strict";
|
|
51
|
+
var root = require_root();
|
|
52
|
+
var Symbol = root.Symbol;
|
|
53
|
+
module.exports = Symbol;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// ../node_modules/lodash/_getRawTag.js
|
|
58
|
+
var require_getRawTag = __commonJS({
|
|
59
|
+
"../node_modules/lodash/_getRawTag.js"(exports, module) {
|
|
60
|
+
"use strict";
|
|
61
|
+
var Symbol = require_Symbol();
|
|
62
|
+
var objectProto = Object.prototype;
|
|
63
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
64
|
+
var nativeObjectToString = objectProto.toString;
|
|
65
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
|
|
66
|
+
function getRawTag(value) {
|
|
67
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
68
|
+
try {
|
|
69
|
+
value[symToStringTag] = void 0;
|
|
70
|
+
var unmasked = true;
|
|
71
|
+
} catch (e) {
|
|
72
|
+
}
|
|
73
|
+
var result = nativeObjectToString.call(value);
|
|
74
|
+
if (unmasked) {
|
|
75
|
+
if (isOwn) {
|
|
76
|
+
value[symToStringTag] = tag;
|
|
77
|
+
} else {
|
|
78
|
+
delete value[symToStringTag];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
module.exports = getRawTag;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// ../node_modules/lodash/_objectToString.js
|
|
88
|
+
var require_objectToString = __commonJS({
|
|
89
|
+
"../node_modules/lodash/_objectToString.js"(exports, module) {
|
|
90
|
+
"use strict";
|
|
91
|
+
var objectProto = Object.prototype;
|
|
92
|
+
var nativeObjectToString = objectProto.toString;
|
|
93
|
+
function objectToString(value) {
|
|
94
|
+
return nativeObjectToString.call(value);
|
|
95
|
+
}
|
|
96
|
+
module.exports = objectToString;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// ../node_modules/lodash/_baseGetTag.js
|
|
101
|
+
var require_baseGetTag = __commonJS({
|
|
102
|
+
"../node_modules/lodash/_baseGetTag.js"(exports, module) {
|
|
103
|
+
"use strict";
|
|
104
|
+
var Symbol = require_Symbol();
|
|
105
|
+
var getRawTag = require_getRawTag();
|
|
106
|
+
var objectToString = require_objectToString();
|
|
107
|
+
var nullTag = "[object Null]";
|
|
108
|
+
var undefinedTag = "[object Undefined]";
|
|
109
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
|
|
110
|
+
function baseGetTag(value) {
|
|
111
|
+
if (value == null) {
|
|
112
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
113
|
+
}
|
|
114
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
115
|
+
}
|
|
116
|
+
module.exports = baseGetTag;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// ../node_modules/lodash/isObjectLike.js
|
|
121
|
+
var require_isObjectLike = __commonJS({
|
|
122
|
+
"../node_modules/lodash/isObjectLike.js"(exports, module) {
|
|
123
|
+
"use strict";
|
|
124
|
+
function isObjectLike(value) {
|
|
125
|
+
return value != null && typeof value == "object";
|
|
126
|
+
}
|
|
127
|
+
module.exports = isObjectLike;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// ../node_modules/lodash/isSymbol.js
|
|
132
|
+
var require_isSymbol = __commonJS({
|
|
133
|
+
"../node_modules/lodash/isSymbol.js"(exports, module) {
|
|
134
|
+
"use strict";
|
|
135
|
+
var baseGetTag = require_baseGetTag();
|
|
136
|
+
var isObjectLike = require_isObjectLike();
|
|
137
|
+
var symbolTag = "[object Symbol]";
|
|
138
|
+
function isSymbol(value) {
|
|
139
|
+
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
140
|
+
}
|
|
141
|
+
module.exports = isSymbol;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// ../node_modules/lodash/_isKey.js
|
|
146
|
+
var require_isKey = __commonJS({
|
|
147
|
+
"../node_modules/lodash/_isKey.js"(exports, module) {
|
|
148
|
+
"use strict";
|
|
149
|
+
var isArray = require_isArray();
|
|
150
|
+
var isSymbol = require_isSymbol();
|
|
151
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
152
|
+
var reIsPlainProp = /^\w*$/;
|
|
153
|
+
function isKey(value, object) {
|
|
154
|
+
if (isArray(value)) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
var type = typeof value;
|
|
158
|
+
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
162
|
+
}
|
|
163
|
+
module.exports = isKey;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// ../node_modules/lodash/isObject.js
|
|
168
|
+
var require_isObject = __commonJS({
|
|
169
|
+
"../node_modules/lodash/isObject.js"(exports, module) {
|
|
170
|
+
"use strict";
|
|
171
|
+
function isObject(value) {
|
|
172
|
+
var type = typeof value;
|
|
173
|
+
return value != null && (type == "object" || type == "function");
|
|
174
|
+
}
|
|
175
|
+
module.exports = isObject;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// ../node_modules/lodash/isFunction.js
|
|
180
|
+
var require_isFunction = __commonJS({
|
|
181
|
+
"../node_modules/lodash/isFunction.js"(exports, module) {
|
|
182
|
+
"use strict";
|
|
183
|
+
var baseGetTag = require_baseGetTag();
|
|
184
|
+
var isObject = require_isObject();
|
|
185
|
+
var asyncTag = "[object AsyncFunction]";
|
|
186
|
+
var funcTag = "[object Function]";
|
|
187
|
+
var genTag = "[object GeneratorFunction]";
|
|
188
|
+
var proxyTag = "[object Proxy]";
|
|
189
|
+
function isFunction(value) {
|
|
190
|
+
if (!isObject(value)) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
var tag = baseGetTag(value);
|
|
194
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
195
|
+
}
|
|
196
|
+
module.exports = isFunction;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
// ../node_modules/lodash/_coreJsData.js
|
|
201
|
+
var require_coreJsData = __commonJS({
|
|
202
|
+
"../node_modules/lodash/_coreJsData.js"(exports, module) {
|
|
203
|
+
"use strict";
|
|
204
|
+
var root = require_root();
|
|
205
|
+
var coreJsData = root["__core-js_shared__"];
|
|
206
|
+
module.exports = coreJsData;
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// ../node_modules/lodash/_isMasked.js
|
|
211
|
+
var require_isMasked = __commonJS({
|
|
212
|
+
"../node_modules/lodash/_isMasked.js"(exports, module) {
|
|
213
|
+
"use strict";
|
|
214
|
+
var coreJsData = require_coreJsData();
|
|
215
|
+
var maskSrcKey = (function() {
|
|
216
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
217
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
218
|
+
})();
|
|
219
|
+
function isMasked(func) {
|
|
220
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
221
|
+
}
|
|
222
|
+
module.exports = isMasked;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// ../node_modules/lodash/_toSource.js
|
|
227
|
+
var require_toSource = __commonJS({
|
|
228
|
+
"../node_modules/lodash/_toSource.js"(exports, module) {
|
|
229
|
+
"use strict";
|
|
230
|
+
var funcProto = Function.prototype;
|
|
231
|
+
var funcToString = funcProto.toString;
|
|
232
|
+
function toSource(func) {
|
|
233
|
+
if (func != null) {
|
|
234
|
+
try {
|
|
235
|
+
return funcToString.call(func);
|
|
236
|
+
} catch (e) {
|
|
237
|
+
}
|
|
238
|
+
try {
|
|
239
|
+
return func + "";
|
|
240
|
+
} catch (e) {
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return "";
|
|
244
|
+
}
|
|
245
|
+
module.exports = toSource;
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
// ../node_modules/lodash/_baseIsNative.js
|
|
250
|
+
var require_baseIsNative = __commonJS({
|
|
251
|
+
"../node_modules/lodash/_baseIsNative.js"(exports, module) {
|
|
252
|
+
"use strict";
|
|
253
|
+
var isFunction = require_isFunction();
|
|
254
|
+
var isMasked = require_isMasked();
|
|
255
|
+
var isObject = require_isObject();
|
|
256
|
+
var toSource = require_toSource();
|
|
257
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
258
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
259
|
+
var funcProto = Function.prototype;
|
|
260
|
+
var objectProto = Object.prototype;
|
|
261
|
+
var funcToString = funcProto.toString;
|
|
262
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
263
|
+
var reIsNative = RegExp(
|
|
264
|
+
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
265
|
+
);
|
|
266
|
+
function baseIsNative(value) {
|
|
267
|
+
if (!isObject(value) || isMasked(value)) {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
271
|
+
return pattern.test(toSource(value));
|
|
272
|
+
}
|
|
273
|
+
module.exports = baseIsNative;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
// ../node_modules/lodash/_getValue.js
|
|
278
|
+
var require_getValue = __commonJS({
|
|
279
|
+
"../node_modules/lodash/_getValue.js"(exports, module) {
|
|
280
|
+
"use strict";
|
|
281
|
+
function getValue(object, key) {
|
|
282
|
+
return object == null ? void 0 : object[key];
|
|
283
|
+
}
|
|
284
|
+
module.exports = getValue;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
// ../node_modules/lodash/_getNative.js
|
|
289
|
+
var require_getNative = __commonJS({
|
|
290
|
+
"../node_modules/lodash/_getNative.js"(exports, module) {
|
|
291
|
+
"use strict";
|
|
292
|
+
var baseIsNative = require_baseIsNative();
|
|
293
|
+
var getValue = require_getValue();
|
|
294
|
+
function getNative(object, key) {
|
|
295
|
+
var value = getValue(object, key);
|
|
296
|
+
return baseIsNative(value) ? value : void 0;
|
|
297
|
+
}
|
|
298
|
+
module.exports = getNative;
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// ../node_modules/lodash/_nativeCreate.js
|
|
303
|
+
var require_nativeCreate = __commonJS({
|
|
304
|
+
"../node_modules/lodash/_nativeCreate.js"(exports, module) {
|
|
305
|
+
"use strict";
|
|
306
|
+
var getNative = require_getNative();
|
|
307
|
+
var nativeCreate = getNative(Object, "create");
|
|
308
|
+
module.exports = nativeCreate;
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
// ../node_modules/lodash/_hashClear.js
|
|
313
|
+
var require_hashClear = __commonJS({
|
|
314
|
+
"../node_modules/lodash/_hashClear.js"(exports, module) {
|
|
315
|
+
"use strict";
|
|
316
|
+
var nativeCreate = require_nativeCreate();
|
|
317
|
+
function hashClear() {
|
|
318
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
319
|
+
this.size = 0;
|
|
320
|
+
}
|
|
321
|
+
module.exports = hashClear;
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
// ../node_modules/lodash/_hashDelete.js
|
|
326
|
+
var require_hashDelete = __commonJS({
|
|
327
|
+
"../node_modules/lodash/_hashDelete.js"(exports, module) {
|
|
328
|
+
"use strict";
|
|
329
|
+
function hashDelete(key) {
|
|
330
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
331
|
+
this.size -= result ? 1 : 0;
|
|
332
|
+
return result;
|
|
333
|
+
}
|
|
334
|
+
module.exports = hashDelete;
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
// ../node_modules/lodash/_hashGet.js
|
|
339
|
+
var require_hashGet = __commonJS({
|
|
340
|
+
"../node_modules/lodash/_hashGet.js"(exports, module) {
|
|
341
|
+
"use strict";
|
|
342
|
+
var nativeCreate = require_nativeCreate();
|
|
343
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
344
|
+
var objectProto = Object.prototype;
|
|
345
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
346
|
+
function hashGet(key) {
|
|
347
|
+
var data = this.__data__;
|
|
348
|
+
if (nativeCreate) {
|
|
349
|
+
var result = data[key];
|
|
350
|
+
return result === HASH_UNDEFINED ? void 0 : result;
|
|
351
|
+
}
|
|
352
|
+
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
353
|
+
}
|
|
354
|
+
module.exports = hashGet;
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
// ../node_modules/lodash/_hashHas.js
|
|
359
|
+
var require_hashHas = __commonJS({
|
|
360
|
+
"../node_modules/lodash/_hashHas.js"(exports, module) {
|
|
361
|
+
"use strict";
|
|
362
|
+
var nativeCreate = require_nativeCreate();
|
|
363
|
+
var objectProto = Object.prototype;
|
|
364
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
365
|
+
function hashHas(key) {
|
|
366
|
+
var data = this.__data__;
|
|
367
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
368
|
+
}
|
|
369
|
+
module.exports = hashHas;
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
// ../node_modules/lodash/_hashSet.js
|
|
374
|
+
var require_hashSet = __commonJS({
|
|
375
|
+
"../node_modules/lodash/_hashSet.js"(exports, module) {
|
|
376
|
+
"use strict";
|
|
377
|
+
var nativeCreate = require_nativeCreate();
|
|
378
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
379
|
+
function hashSet(key, value) {
|
|
380
|
+
var data = this.__data__;
|
|
381
|
+
this.size += this.has(key) ? 0 : 1;
|
|
382
|
+
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
383
|
+
return this;
|
|
384
|
+
}
|
|
385
|
+
module.exports = hashSet;
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
// ../node_modules/lodash/_Hash.js
|
|
390
|
+
var require_Hash = __commonJS({
|
|
391
|
+
"../node_modules/lodash/_Hash.js"(exports, module) {
|
|
392
|
+
"use strict";
|
|
393
|
+
var hashClear = require_hashClear();
|
|
394
|
+
var hashDelete = require_hashDelete();
|
|
395
|
+
var hashGet = require_hashGet();
|
|
396
|
+
var hashHas = require_hashHas();
|
|
397
|
+
var hashSet = require_hashSet();
|
|
398
|
+
function Hash(entries) {
|
|
399
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
400
|
+
this.clear();
|
|
401
|
+
while (++index < length) {
|
|
402
|
+
var entry = entries[index];
|
|
403
|
+
this.set(entry[0], entry[1]);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
Hash.prototype.clear = hashClear;
|
|
407
|
+
Hash.prototype["delete"] = hashDelete;
|
|
408
|
+
Hash.prototype.get = hashGet;
|
|
409
|
+
Hash.prototype.has = hashHas;
|
|
410
|
+
Hash.prototype.set = hashSet;
|
|
411
|
+
module.exports = Hash;
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
// ../node_modules/lodash/_listCacheClear.js
|
|
416
|
+
var require_listCacheClear = __commonJS({
|
|
417
|
+
"../node_modules/lodash/_listCacheClear.js"(exports, module) {
|
|
418
|
+
"use strict";
|
|
419
|
+
function listCacheClear() {
|
|
420
|
+
this.__data__ = [];
|
|
421
|
+
this.size = 0;
|
|
422
|
+
}
|
|
423
|
+
module.exports = listCacheClear;
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
// ../node_modules/lodash/eq.js
|
|
428
|
+
var require_eq = __commonJS({
|
|
429
|
+
"../node_modules/lodash/eq.js"(exports, module) {
|
|
430
|
+
"use strict";
|
|
431
|
+
function eq(value, other) {
|
|
432
|
+
return value === other || value !== value && other !== other;
|
|
433
|
+
}
|
|
434
|
+
module.exports = eq;
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
// ../node_modules/lodash/_assocIndexOf.js
|
|
439
|
+
var require_assocIndexOf = __commonJS({
|
|
440
|
+
"../node_modules/lodash/_assocIndexOf.js"(exports, module) {
|
|
441
|
+
"use strict";
|
|
442
|
+
var eq = require_eq();
|
|
443
|
+
function assocIndexOf(array, key) {
|
|
444
|
+
var length = array.length;
|
|
445
|
+
while (length--) {
|
|
446
|
+
if (eq(array[length][0], key)) {
|
|
447
|
+
return length;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
return -1;
|
|
451
|
+
}
|
|
452
|
+
module.exports = assocIndexOf;
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
// ../node_modules/lodash/_listCacheDelete.js
|
|
457
|
+
var require_listCacheDelete = __commonJS({
|
|
458
|
+
"../node_modules/lodash/_listCacheDelete.js"(exports, module) {
|
|
459
|
+
"use strict";
|
|
460
|
+
var assocIndexOf = require_assocIndexOf();
|
|
461
|
+
var arrayProto = Array.prototype;
|
|
462
|
+
var splice = arrayProto.splice;
|
|
463
|
+
function listCacheDelete(key) {
|
|
464
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
465
|
+
if (index < 0) {
|
|
466
|
+
return false;
|
|
467
|
+
}
|
|
468
|
+
var lastIndex = data.length - 1;
|
|
469
|
+
if (index == lastIndex) {
|
|
470
|
+
data.pop();
|
|
471
|
+
} else {
|
|
472
|
+
splice.call(data, index, 1);
|
|
473
|
+
}
|
|
474
|
+
--this.size;
|
|
475
|
+
return true;
|
|
476
|
+
}
|
|
477
|
+
module.exports = listCacheDelete;
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
// ../node_modules/lodash/_listCacheGet.js
|
|
482
|
+
var require_listCacheGet = __commonJS({
|
|
483
|
+
"../node_modules/lodash/_listCacheGet.js"(exports, module) {
|
|
484
|
+
"use strict";
|
|
485
|
+
var assocIndexOf = require_assocIndexOf();
|
|
486
|
+
function listCacheGet(key) {
|
|
487
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
488
|
+
return index < 0 ? void 0 : data[index][1];
|
|
489
|
+
}
|
|
490
|
+
module.exports = listCacheGet;
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
// ../node_modules/lodash/_listCacheHas.js
|
|
495
|
+
var require_listCacheHas = __commonJS({
|
|
496
|
+
"../node_modules/lodash/_listCacheHas.js"(exports, module) {
|
|
497
|
+
"use strict";
|
|
498
|
+
var assocIndexOf = require_assocIndexOf();
|
|
499
|
+
function listCacheHas(key) {
|
|
500
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
501
|
+
}
|
|
502
|
+
module.exports = listCacheHas;
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
// ../node_modules/lodash/_listCacheSet.js
|
|
507
|
+
var require_listCacheSet = __commonJS({
|
|
508
|
+
"../node_modules/lodash/_listCacheSet.js"(exports, module) {
|
|
509
|
+
"use strict";
|
|
510
|
+
var assocIndexOf = require_assocIndexOf();
|
|
511
|
+
function listCacheSet(key, value) {
|
|
512
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
513
|
+
if (index < 0) {
|
|
514
|
+
++this.size;
|
|
515
|
+
data.push([key, value]);
|
|
516
|
+
} else {
|
|
517
|
+
data[index][1] = value;
|
|
518
|
+
}
|
|
519
|
+
return this;
|
|
520
|
+
}
|
|
521
|
+
module.exports = listCacheSet;
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
// ../node_modules/lodash/_ListCache.js
|
|
526
|
+
var require_ListCache = __commonJS({
|
|
527
|
+
"../node_modules/lodash/_ListCache.js"(exports, module) {
|
|
528
|
+
"use strict";
|
|
529
|
+
var listCacheClear = require_listCacheClear();
|
|
530
|
+
var listCacheDelete = require_listCacheDelete();
|
|
531
|
+
var listCacheGet = require_listCacheGet();
|
|
532
|
+
var listCacheHas = require_listCacheHas();
|
|
533
|
+
var listCacheSet = require_listCacheSet();
|
|
534
|
+
function ListCache(entries) {
|
|
535
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
536
|
+
this.clear();
|
|
537
|
+
while (++index < length) {
|
|
538
|
+
var entry = entries[index];
|
|
539
|
+
this.set(entry[0], entry[1]);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
ListCache.prototype.clear = listCacheClear;
|
|
543
|
+
ListCache.prototype["delete"] = listCacheDelete;
|
|
544
|
+
ListCache.prototype.get = listCacheGet;
|
|
545
|
+
ListCache.prototype.has = listCacheHas;
|
|
546
|
+
ListCache.prototype.set = listCacheSet;
|
|
547
|
+
module.exports = ListCache;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
// ../node_modules/lodash/_Map.js
|
|
552
|
+
var require_Map = __commonJS({
|
|
553
|
+
"../node_modules/lodash/_Map.js"(exports, module) {
|
|
554
|
+
"use strict";
|
|
555
|
+
var getNative = require_getNative();
|
|
556
|
+
var root = require_root();
|
|
557
|
+
var Map2 = getNative(root, "Map");
|
|
558
|
+
module.exports = Map2;
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
// ../node_modules/lodash/_mapCacheClear.js
|
|
563
|
+
var require_mapCacheClear = __commonJS({
|
|
564
|
+
"../node_modules/lodash/_mapCacheClear.js"(exports, module) {
|
|
565
|
+
"use strict";
|
|
566
|
+
var Hash = require_Hash();
|
|
567
|
+
var ListCache = require_ListCache();
|
|
568
|
+
var Map2 = require_Map();
|
|
569
|
+
function mapCacheClear() {
|
|
570
|
+
this.size = 0;
|
|
571
|
+
this.__data__ = {
|
|
572
|
+
"hash": new Hash(),
|
|
573
|
+
"map": new (Map2 || ListCache)(),
|
|
574
|
+
"string": new Hash()
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
module.exports = mapCacheClear;
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
// ../node_modules/lodash/_isKeyable.js
|
|
582
|
+
var require_isKeyable = __commonJS({
|
|
583
|
+
"../node_modules/lodash/_isKeyable.js"(exports, module) {
|
|
584
|
+
"use strict";
|
|
585
|
+
function isKeyable(value) {
|
|
586
|
+
var type = typeof value;
|
|
587
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
588
|
+
}
|
|
589
|
+
module.exports = isKeyable;
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
// ../node_modules/lodash/_getMapData.js
|
|
594
|
+
var require_getMapData = __commonJS({
|
|
595
|
+
"../node_modules/lodash/_getMapData.js"(exports, module) {
|
|
596
|
+
"use strict";
|
|
597
|
+
var isKeyable = require_isKeyable();
|
|
598
|
+
function getMapData(map, key) {
|
|
599
|
+
var data = map.__data__;
|
|
600
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
601
|
+
}
|
|
602
|
+
module.exports = getMapData;
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
// ../node_modules/lodash/_mapCacheDelete.js
|
|
607
|
+
var require_mapCacheDelete = __commonJS({
|
|
608
|
+
"../node_modules/lodash/_mapCacheDelete.js"(exports, module) {
|
|
609
|
+
"use strict";
|
|
610
|
+
var getMapData = require_getMapData();
|
|
611
|
+
function mapCacheDelete(key) {
|
|
612
|
+
var result = getMapData(this, key)["delete"](key);
|
|
613
|
+
this.size -= result ? 1 : 0;
|
|
614
|
+
return result;
|
|
615
|
+
}
|
|
616
|
+
module.exports = mapCacheDelete;
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
// ../node_modules/lodash/_mapCacheGet.js
|
|
621
|
+
var require_mapCacheGet = __commonJS({
|
|
622
|
+
"../node_modules/lodash/_mapCacheGet.js"(exports, module) {
|
|
623
|
+
"use strict";
|
|
624
|
+
var getMapData = require_getMapData();
|
|
625
|
+
function mapCacheGet(key) {
|
|
626
|
+
return getMapData(this, key).get(key);
|
|
627
|
+
}
|
|
628
|
+
module.exports = mapCacheGet;
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
// ../node_modules/lodash/_mapCacheHas.js
|
|
633
|
+
var require_mapCacheHas = __commonJS({
|
|
634
|
+
"../node_modules/lodash/_mapCacheHas.js"(exports, module) {
|
|
635
|
+
"use strict";
|
|
636
|
+
var getMapData = require_getMapData();
|
|
637
|
+
function mapCacheHas(key) {
|
|
638
|
+
return getMapData(this, key).has(key);
|
|
639
|
+
}
|
|
640
|
+
module.exports = mapCacheHas;
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
// ../node_modules/lodash/_mapCacheSet.js
|
|
645
|
+
var require_mapCacheSet = __commonJS({
|
|
646
|
+
"../node_modules/lodash/_mapCacheSet.js"(exports, module) {
|
|
647
|
+
"use strict";
|
|
648
|
+
var getMapData = require_getMapData();
|
|
649
|
+
function mapCacheSet(key, value) {
|
|
650
|
+
var data = getMapData(this, key), size = data.size;
|
|
651
|
+
data.set(key, value);
|
|
652
|
+
this.size += data.size == size ? 0 : 1;
|
|
653
|
+
return this;
|
|
654
|
+
}
|
|
655
|
+
module.exports = mapCacheSet;
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
// ../node_modules/lodash/_MapCache.js
|
|
660
|
+
var require_MapCache = __commonJS({
|
|
661
|
+
"../node_modules/lodash/_MapCache.js"(exports, module) {
|
|
662
|
+
"use strict";
|
|
663
|
+
var mapCacheClear = require_mapCacheClear();
|
|
664
|
+
var mapCacheDelete = require_mapCacheDelete();
|
|
665
|
+
var mapCacheGet = require_mapCacheGet();
|
|
666
|
+
var mapCacheHas = require_mapCacheHas();
|
|
667
|
+
var mapCacheSet = require_mapCacheSet();
|
|
668
|
+
function MapCache(entries) {
|
|
669
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
670
|
+
this.clear();
|
|
671
|
+
while (++index < length) {
|
|
672
|
+
var entry = entries[index];
|
|
673
|
+
this.set(entry[0], entry[1]);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
677
|
+
MapCache.prototype["delete"] = mapCacheDelete;
|
|
678
|
+
MapCache.prototype.get = mapCacheGet;
|
|
679
|
+
MapCache.prototype.has = mapCacheHas;
|
|
680
|
+
MapCache.prototype.set = mapCacheSet;
|
|
681
|
+
module.exports = MapCache;
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
// ../node_modules/lodash/memoize.js
|
|
686
|
+
var require_memoize = __commonJS({
|
|
687
|
+
"../node_modules/lodash/memoize.js"(exports, module) {
|
|
688
|
+
"use strict";
|
|
689
|
+
var MapCache = require_MapCache();
|
|
690
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
691
|
+
function memoize(func, resolver) {
|
|
692
|
+
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
693
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
694
|
+
}
|
|
695
|
+
var memoized = function() {
|
|
696
|
+
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
697
|
+
if (cache.has(key)) {
|
|
698
|
+
return cache.get(key);
|
|
699
|
+
}
|
|
700
|
+
var result = func.apply(this, args);
|
|
701
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
702
|
+
return result;
|
|
703
|
+
};
|
|
704
|
+
memoized.cache = new (memoize.Cache || MapCache)();
|
|
705
|
+
return memoized;
|
|
706
|
+
}
|
|
707
|
+
memoize.Cache = MapCache;
|
|
708
|
+
module.exports = memoize;
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
// ../node_modules/lodash/_memoizeCapped.js
|
|
713
|
+
var require_memoizeCapped = __commonJS({
|
|
714
|
+
"../node_modules/lodash/_memoizeCapped.js"(exports, module) {
|
|
715
|
+
"use strict";
|
|
716
|
+
var memoize = require_memoize();
|
|
717
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
718
|
+
function memoizeCapped(func) {
|
|
719
|
+
var result = memoize(func, function(key) {
|
|
720
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
721
|
+
cache.clear();
|
|
722
|
+
}
|
|
723
|
+
return key;
|
|
724
|
+
});
|
|
725
|
+
var cache = result.cache;
|
|
726
|
+
return result;
|
|
727
|
+
}
|
|
728
|
+
module.exports = memoizeCapped;
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
// ../node_modules/lodash/_stringToPath.js
|
|
733
|
+
var require_stringToPath = __commonJS({
|
|
734
|
+
"../node_modules/lodash/_stringToPath.js"(exports, module) {
|
|
735
|
+
"use strict";
|
|
736
|
+
var memoizeCapped = require_memoizeCapped();
|
|
737
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
738
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
739
|
+
var stringToPath = memoizeCapped(function(string) {
|
|
740
|
+
var result = [];
|
|
741
|
+
if (string.charCodeAt(0) === 46) {
|
|
742
|
+
result.push("");
|
|
743
|
+
}
|
|
744
|
+
string.replace(rePropName, function(match, number, quote, subString) {
|
|
745
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
746
|
+
});
|
|
747
|
+
return result;
|
|
748
|
+
});
|
|
749
|
+
module.exports = stringToPath;
|
|
750
|
+
}
|
|
751
|
+
});
|
|
752
|
+
|
|
753
|
+
// ../node_modules/lodash/_arrayMap.js
|
|
754
|
+
var require_arrayMap = __commonJS({
|
|
755
|
+
"../node_modules/lodash/_arrayMap.js"(exports, module) {
|
|
756
|
+
"use strict";
|
|
757
|
+
function arrayMap(array, iteratee) {
|
|
758
|
+
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
759
|
+
while (++index < length) {
|
|
760
|
+
result[index] = iteratee(array[index], index, array);
|
|
761
|
+
}
|
|
762
|
+
return result;
|
|
763
|
+
}
|
|
764
|
+
module.exports = arrayMap;
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
|
|
768
|
+
// ../node_modules/lodash/_baseToString.js
|
|
769
|
+
var require_baseToString = __commonJS({
|
|
770
|
+
"../node_modules/lodash/_baseToString.js"(exports, module) {
|
|
771
|
+
"use strict";
|
|
772
|
+
var Symbol = require_Symbol();
|
|
773
|
+
var arrayMap = require_arrayMap();
|
|
774
|
+
var isArray = require_isArray();
|
|
775
|
+
var isSymbol = require_isSymbol();
|
|
776
|
+
var INFINITY = 1 / 0;
|
|
777
|
+
var symbolProto = Symbol ? Symbol.prototype : void 0;
|
|
778
|
+
var symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
779
|
+
function baseToString(value) {
|
|
780
|
+
if (typeof value == "string") {
|
|
781
|
+
return value;
|
|
782
|
+
}
|
|
783
|
+
if (isArray(value)) {
|
|
784
|
+
return arrayMap(value, baseToString) + "";
|
|
785
|
+
}
|
|
786
|
+
if (isSymbol(value)) {
|
|
787
|
+
return symbolToString ? symbolToString.call(value) : "";
|
|
788
|
+
}
|
|
789
|
+
var result = value + "";
|
|
790
|
+
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
791
|
+
}
|
|
792
|
+
module.exports = baseToString;
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
|
|
796
|
+
// ../node_modules/lodash/toString.js
|
|
797
|
+
var require_toString = __commonJS({
|
|
798
|
+
"../node_modules/lodash/toString.js"(exports, module) {
|
|
799
|
+
"use strict";
|
|
800
|
+
var baseToString = require_baseToString();
|
|
801
|
+
function toString(value) {
|
|
802
|
+
return value == null ? "" : baseToString(value);
|
|
803
|
+
}
|
|
804
|
+
module.exports = toString;
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
|
|
808
|
+
// ../node_modules/lodash/_castPath.js
|
|
809
|
+
var require_castPath = __commonJS({
|
|
810
|
+
"../node_modules/lodash/_castPath.js"(exports, module) {
|
|
811
|
+
"use strict";
|
|
812
|
+
var isArray = require_isArray();
|
|
813
|
+
var isKey = require_isKey();
|
|
814
|
+
var stringToPath = require_stringToPath();
|
|
815
|
+
var toString = require_toString();
|
|
816
|
+
function castPath(value, object) {
|
|
817
|
+
if (isArray(value)) {
|
|
818
|
+
return value;
|
|
819
|
+
}
|
|
820
|
+
return isKey(value, object) ? [value] : stringToPath(toString(value));
|
|
821
|
+
}
|
|
822
|
+
module.exports = castPath;
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
|
|
826
|
+
// ../node_modules/lodash/_toKey.js
|
|
827
|
+
var require_toKey = __commonJS({
|
|
828
|
+
"../node_modules/lodash/_toKey.js"(exports, module) {
|
|
829
|
+
"use strict";
|
|
830
|
+
var isSymbol = require_isSymbol();
|
|
831
|
+
var INFINITY = 1 / 0;
|
|
832
|
+
function toKey(value) {
|
|
833
|
+
if (typeof value == "string" || isSymbol(value)) {
|
|
834
|
+
return value;
|
|
835
|
+
}
|
|
836
|
+
var result = value + "";
|
|
837
|
+
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
838
|
+
}
|
|
839
|
+
module.exports = toKey;
|
|
840
|
+
}
|
|
841
|
+
});
|
|
842
|
+
|
|
843
|
+
// ../node_modules/lodash/_baseGet.js
|
|
844
|
+
var require_baseGet = __commonJS({
|
|
845
|
+
"../node_modules/lodash/_baseGet.js"(exports, module) {
|
|
846
|
+
"use strict";
|
|
847
|
+
var castPath = require_castPath();
|
|
848
|
+
var toKey = require_toKey();
|
|
849
|
+
function baseGet(object, path) {
|
|
850
|
+
path = castPath(path, object);
|
|
851
|
+
var index = 0, length = path.length;
|
|
852
|
+
while (object != null && index < length) {
|
|
853
|
+
object = object[toKey(path[index++])];
|
|
854
|
+
}
|
|
855
|
+
return index && index == length ? object : void 0;
|
|
856
|
+
}
|
|
857
|
+
module.exports = baseGet;
|
|
858
|
+
}
|
|
859
|
+
});
|
|
860
|
+
|
|
861
|
+
// ../node_modules/lodash/get.js
|
|
862
|
+
var require_get = __commonJS({
|
|
863
|
+
"../node_modules/lodash/get.js"(exports, module) {
|
|
864
|
+
"use strict";
|
|
865
|
+
var baseGet = require_baseGet();
|
|
866
|
+
function get3(object, path, defaultValue) {
|
|
867
|
+
var result = object == null ? void 0 : baseGet(object, path);
|
|
868
|
+
return result === void 0 ? defaultValue : result;
|
|
869
|
+
}
|
|
870
|
+
module.exports = get3;
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
|
|
874
|
+
// ../cms-theme-engines/dist/chunk-C52D7ZTE.js
|
|
875
|
+
var liquidAssetUrlPatterns = {
|
|
876
|
+
themeAssetPrefix: /^assets\//i
|
|
877
|
+
};
|
|
878
|
+
var maxRenderMs = 3e3;
|
|
879
|
+
var maxOutputBytes = 1024 * 1024;
|
|
880
|
+
var maxTemplateChars = 128 * 1024;
|
|
881
|
+
var maxPackageChars = 4 * 1024 * 1024;
|
|
882
|
+
var maxIterations = 1e6;
|
|
883
|
+
var maxIncludeDepth = 8;
|
|
884
|
+
var maxContextDepth = 12;
|
|
885
|
+
var maxContextArray = 1e3;
|
|
886
|
+
var maxContextKeys = 500;
|
|
887
|
+
var publicContextKeys = /* @__PURE__ */ new Set(["shop", "settings", "routes", "page", "collection", "contentCollections", "linkTargets", "localization", "search", "entities", "forms", "contentLoading", "contentError", "pageTitle", "section", "item"]);
|
|
888
|
+
var privateField = /^(?:__proto__|prototype|constructor|password|secret|token|access[_-]?token|refresh[_-]?token|api[_-]?key|private[_-]?key|notification[_-]?emails|internal[_-]?notes)$/i;
|
|
889
|
+
var allowedTags = /* @__PURE__ */ new Set(["assign", "for", "capture", "case", "comment", "cycle", "if", "unless", "break", "continue", "echo", "raw", "liquid", "#", "tablerow", "increment", "decrement", "render", "section"]);
|
|
890
|
+
var allowedFilters = /* @__PURE__ */ new Set([
|
|
891
|
+
"abs",
|
|
892
|
+
"append",
|
|
893
|
+
"at_least",
|
|
894
|
+
"at_most",
|
|
895
|
+
"capitalize",
|
|
896
|
+
"ceil",
|
|
897
|
+
"compact",
|
|
898
|
+
"concat",
|
|
899
|
+
"date",
|
|
900
|
+
"default",
|
|
901
|
+
"divided_by",
|
|
902
|
+
"downcase",
|
|
903
|
+
"escape",
|
|
904
|
+
"escape_once",
|
|
905
|
+
"first",
|
|
906
|
+
"floor",
|
|
907
|
+
"join",
|
|
908
|
+
"last",
|
|
909
|
+
"lstrip",
|
|
910
|
+
"map",
|
|
911
|
+
"minus",
|
|
912
|
+
"modulo",
|
|
913
|
+
"newline_to_br",
|
|
914
|
+
"plus",
|
|
915
|
+
"prepend",
|
|
916
|
+
"remove",
|
|
917
|
+
"remove_first",
|
|
918
|
+
"replace",
|
|
919
|
+
"replace_first",
|
|
920
|
+
"reverse",
|
|
921
|
+
"round",
|
|
922
|
+
"rstrip",
|
|
923
|
+
"size",
|
|
924
|
+
"slice",
|
|
925
|
+
"sort",
|
|
926
|
+
"sort_natural",
|
|
927
|
+
"split",
|
|
928
|
+
"strip",
|
|
929
|
+
"strip_html",
|
|
930
|
+
"strip_newlines",
|
|
931
|
+
"times",
|
|
932
|
+
"truncate",
|
|
933
|
+
"truncatewords",
|
|
934
|
+
"uniq",
|
|
935
|
+
"upcase",
|
|
936
|
+
"url_encode",
|
|
937
|
+
"where",
|
|
938
|
+
"assetUrl",
|
|
939
|
+
"stylesheetTag",
|
|
940
|
+
"scriptTag",
|
|
941
|
+
"t",
|
|
942
|
+
"json",
|
|
943
|
+
"imageUrl",
|
|
944
|
+
"richtext",
|
|
945
|
+
"localizeUrl"
|
|
946
|
+
]);
|
|
947
|
+
var defaultTemplate = liquidThemeTemplatePaths.index;
|
|
948
|
+
var defaultLayout = "theme";
|
|
949
|
+
var isSafePartialName = (name) => /^[a-zA-Z0-9][a-zA-Z0-9/_-]{0,127}(?:\.liquid|\.html)?$/.test(name) && !name.includes("//");
|
|
950
|
+
var blockTagPatterns = [
|
|
951
|
+
/\{%\s*schema\s*%\}[\s\S]*?\{%\s*endschema\s*%\}/gi,
|
|
952
|
+
/\{%\s*stylesheet\s*%\}[\s\S]*?\{%\s*endstylesheet\s*%\}/gi,
|
|
953
|
+
/\{%\s*javascript\s*%\}[\s\S]*?\{%\s*endjavascript\s*%\}/gi,
|
|
954
|
+
/\{%\s*entityQuery\b[^%]*%\}/gi
|
|
955
|
+
];
|
|
956
|
+
var themeSettingTypeConstants = {
|
|
957
|
+
entity: "entity",
|
|
958
|
+
collection: "collection"
|
|
959
|
+
};
|
|
960
|
+
var themePostMessageEvents = {
|
|
961
|
+
select: "THEME_CUSTOMIZER_SELECT"
|
|
962
|
+
};
|
|
963
|
+
var customCssKey = "customCss";
|
|
964
|
+
var themeEntityBindingSource = "entity";
|
|
965
|
+
var themeEntityQueryTag = "entityQuery";
|
|
966
|
+
|
|
967
|
+
// ../cms-theme-engines/dist/chunk-LKQOV7DG.js
|
|
968
|
+
import sanitizeHtml from "sanitize-html";
|
|
969
|
+
|
|
970
|
+
// ../cms-core/dist/utils/index.js
|
|
971
|
+
var setTranslatableArrayFieldPathValue = (target, schemaFields, fieldPath, value, isTranslatable) => {
|
|
972
|
+
const path = fieldPath.split(".");
|
|
973
|
+
const rootField = schemaFields.find((field) => field.type === customFieldTypeConstants.array && String(field.id ?? field.key ?? field.name) === path[0]);
|
|
974
|
+
if (!rootField || path.length < 3 || path.length % 2 !== 1) return false;
|
|
975
|
+
let targetValue = target[rootField.id ?? rootField.key ?? rootField.name ?? ""];
|
|
976
|
+
let nestedFields = rootField.settings?.fields || rootField.fields || [];
|
|
977
|
+
for (let index = 1; index < path.length; index += 2) {
|
|
978
|
+
const arrayIndex = Number(path[index]);
|
|
979
|
+
const fieldId = path[index + 1];
|
|
980
|
+
const nestedField = nestedFields.find((field) => String(field.name ?? field.key ?? field.id) === fieldId);
|
|
981
|
+
if (!Number.isInteger(arrayIndex) || !nestedField || !Array.isArray(targetValue) || !targetValue[arrayIndex]) return false;
|
|
982
|
+
if (index === path.length - 2) {
|
|
983
|
+
if (!isTranslatable(nestedField)) return false;
|
|
984
|
+
targetValue[arrayIndex][fieldId] = value;
|
|
985
|
+
return true;
|
|
986
|
+
}
|
|
987
|
+
if (nestedField.type !== customFieldTypeConstants.array) return false;
|
|
988
|
+
targetValue = targetValue[arrayIndex][fieldId];
|
|
989
|
+
nestedFields = nestedField.settings?.fields || nestedField.fields || [];
|
|
990
|
+
}
|
|
991
|
+
return false;
|
|
992
|
+
};
|
|
993
|
+
var hasTranslatableFields = (schemaFields, componentsMap = {}, isFieldTranslatable = (field) => Boolean(field.settings?.isTranslatable)) => {
|
|
994
|
+
if (!Array.isArray(schemaFields)) return false;
|
|
995
|
+
return schemaFields.some((f) => {
|
|
996
|
+
if (isFieldTranslatable(f)) return true;
|
|
997
|
+
const nestedFields = f.settings?.fields || f.fields;
|
|
998
|
+
if (Array.isArray(nestedFields)) {
|
|
999
|
+
return hasTranslatableFields(nestedFields, componentsMap, isFieldTranslatable);
|
|
1000
|
+
}
|
|
1001
|
+
if (f.type === customFieldTypeConstants.component) {
|
|
1002
|
+
const nestedCompId = f.settings?.componentId || f.validations?.componentId;
|
|
1003
|
+
const nestedComp = componentsMap[nestedCompId];
|
|
1004
|
+
if (nestedComp?.schema) {
|
|
1005
|
+
return hasTranslatableFields(nestedComp.schema, componentsMap, isFieldTranslatable);
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
return false;
|
|
1009
|
+
});
|
|
1010
|
+
};
|
|
1011
|
+
var buildStorefrontLocalePrefix = ({ countryCode, languageCode, includeCountry, includeLanguage }) => [
|
|
1012
|
+
...includeCountry && countryCode ? [countryCode.toLowerCase()] : [],
|
|
1013
|
+
...includeLanguage && languageCode ? [languageCode.toLowerCase()] : []
|
|
1014
|
+
];
|
|
1015
|
+
var findStorefrontLanguage = (languages, languageCode) => {
|
|
1016
|
+
if (!languageCode) return void 0;
|
|
1017
|
+
const normalizedCode = languageCode.toLowerCase();
|
|
1018
|
+
return languages.find((language) => language.languageCode.toLowerCase() === normalizedCode);
|
|
1019
|
+
};
|
|
1020
|
+
var getStorefrontLocalePrefix = (localization) => {
|
|
1021
|
+
if (!localization) return [];
|
|
1022
|
+
return buildStorefrontLocalePrefix({
|
|
1023
|
+
countryCode: localization.country?.countryCode,
|
|
1024
|
+
languageCode: localization.language?.languageCode,
|
|
1025
|
+
includeCountry: localization.availableCountries.length > 1,
|
|
1026
|
+
includeLanguage: localization.availableLanguages.length > 1
|
|
1027
|
+
});
|
|
1028
|
+
};
|
|
1029
|
+
var localizeStorefrontUrl = (url, localization) => {
|
|
1030
|
+
const value = String(url || "/");
|
|
1031
|
+
if (/^(?:[a-z]+:)?\/\//i.test(value) || value.startsWith("mailto:") || value.startsWith("tel:") || value.startsWith("#") || value.startsWith("?")) return value;
|
|
1032
|
+
const prefix = getStorefrontLocalePrefix(localization);
|
|
1033
|
+
if (!prefix.length) return value;
|
|
1034
|
+
const match = value.match(/^([^?#]*)([?#].*)?$/);
|
|
1035
|
+
const path = match?.[1] || "/";
|
|
1036
|
+
const suffix = match?.[2] || "";
|
|
1037
|
+
const segments = path.split("/").filter(Boolean);
|
|
1038
|
+
const alreadyLocalized = prefix.every((segment, index) => segments[index]?.toLowerCase() === segment);
|
|
1039
|
+
if (alreadyLocalized) return value;
|
|
1040
|
+
const targetCountry = localization?.availableCountries.find((country) => country.countryCode.toLowerCase() === segments[0]?.toLowerCase());
|
|
1041
|
+
if (targetCountry) {
|
|
1042
|
+
const targetLanguages = targetCountry.languages || [];
|
|
1043
|
+
if (targetLanguages.length <= 1 || findStorefrontLanguage(targetLanguages, segments[1])) return value;
|
|
1044
|
+
} else if (localization?.availableCountries.length === 1 && findStorefrontLanguage(localization.availableLanguages, segments[0])) {
|
|
1045
|
+
return value;
|
|
1046
|
+
}
|
|
1047
|
+
return `/${[...prefix, ...segments].join("/")}${suffix}` || "/";
|
|
1048
|
+
};
|
|
1049
|
+
var localizeStorefrontRoutes = (routes, localization) => Object.fromEntries(Object.entries(routes).map(([key, value]) => [key, typeof value === "string" ? localizeStorefrontUrl(value, localization) : value]));
|
|
1050
|
+
var getThemeEntityQueryKey = (query) => `${query.type}:${query.handle}:${query.as || ""}`;
|
|
1051
|
+
var hasNonEmptyString = (value) => typeof value === "string" && value.trim().length > 0;
|
|
1052
|
+
var isSafeExternalThemeUrl = (value) => {
|
|
1053
|
+
if (typeof value !== "string") return false;
|
|
1054
|
+
try {
|
|
1055
|
+
const url = new URL(value);
|
|
1056
|
+
return url.protocol === "https:" && Boolean(url.hostname) && !url.username && !url.password;
|
|
1057
|
+
} catch {
|
|
1058
|
+
return false;
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
var isThemeLinkTargetReference = (value) => {
|
|
1062
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
1063
|
+
const reference = value;
|
|
1064
|
+
if (reference.kind === themeLinkTargetKinds.external) return isSafeExternalThemeUrl(reference.url);
|
|
1065
|
+
if (!hasNonEmptyString(reference.provider)) return false;
|
|
1066
|
+
if (!hasNonEmptyString(reference.entityId)) return false;
|
|
1067
|
+
if (reference.kind === themeLinkTargetKinds.single || reference.kind === themeLinkTargetKinds.listing) return true;
|
|
1068
|
+
return reference.kind === themeLinkTargetKinds.entry && hasNonEmptyString(reference.entryId);
|
|
1069
|
+
};
|
|
1070
|
+
var normalizeThemeLinkTargetReference = (value) => {
|
|
1071
|
+
if (!isThemeLinkTargetReference(value)) return null;
|
|
1072
|
+
if (value.kind === themeLinkTargetKinds.external) {
|
|
1073
|
+
return {
|
|
1074
|
+
kind: value.kind,
|
|
1075
|
+
url: value.url.trim()
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
if (value.kind === themeLinkTargetKinds.entry) {
|
|
1079
|
+
return {
|
|
1080
|
+
kind: value.kind,
|
|
1081
|
+
provider: value.provider.trim(),
|
|
1082
|
+
entityId: value.entityId.trim(),
|
|
1083
|
+
entryId: value.entryId.trim()
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
return {
|
|
1087
|
+
kind: value.kind,
|
|
1088
|
+
provider: value.provider.trim(),
|
|
1089
|
+
entityId: value.entityId.trim()
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
var getThemeLinkTargetReferenceKey = (value) => {
|
|
1093
|
+
const reference = normalizeThemeLinkTargetReference(value);
|
|
1094
|
+
return reference ? JSON.stringify(reference) : null;
|
|
1095
|
+
};
|
|
1096
|
+
var safeDecodeAssetPath = (path) => {
|
|
1097
|
+
try {
|
|
1098
|
+
return decodeURIComponent(path);
|
|
1099
|
+
} catch {
|
|
1100
|
+
return path;
|
|
1101
|
+
}
|
|
1102
|
+
};
|
|
1103
|
+
var findThemeAssetUrl = (assetUrls, assetPath) => {
|
|
1104
|
+
const candidates = [.../* @__PURE__ */ new Set([assetPath, safeDecodeAssetPath(assetPath)])];
|
|
1105
|
+
for (const candidate of candidates) {
|
|
1106
|
+
if (assetUrls[candidate]) return assetUrls[candidate];
|
|
1107
|
+
}
|
|
1108
|
+
return void 0;
|
|
1109
|
+
};
|
|
1110
|
+
var findThemeAssetUrlBySuffix = (assetUrls, assetPath) => {
|
|
1111
|
+
const candidates = [.../* @__PURE__ */ new Set([assetPath, safeDecodeAssetPath(assetPath)])].map((candidate) => candidate.toLowerCase());
|
|
1112
|
+
return Object.entries(assetUrls).find(([path]) => {
|
|
1113
|
+
const lowerPath = path.toLowerCase();
|
|
1114
|
+
return candidates.some((candidate) => lowerPath.endsWith(`/${candidate}`));
|
|
1115
|
+
})?.[1];
|
|
1116
|
+
};
|
|
1117
|
+
var rewriteThemeCssAssetUrls = (content, assetUrls) => content.replace(/url\(\s*(['"]?)(?!data:|https?:|blob:|\/)([^'"\)]+)\1\s*\)/gi, (match, quote, assetPath) => {
|
|
1118
|
+
const normalizedPath = assetPath.trim().replace(/^\.\//, "");
|
|
1119
|
+
const assetUrl = findThemeAssetUrl(assetUrls, normalizedPath) || findThemeAssetUrlBySuffix(assetUrls, normalizedPath);
|
|
1120
|
+
return assetUrl ? `url(${quote}${assetUrl}${quote})` : match;
|
|
1121
|
+
});
|
|
1122
|
+
var rewriteThemeHtmlAssetUrls = (content, assetUrls) => content.replace(/\b(src|href|poster)=(['"])(\.\/)?assets\/([^'"]+)\2/gi, (match, attribute, quote, _relativePrefix, assetPath) => {
|
|
1123
|
+
const normalizedPath = assetPath.split(/[?#]/, 1)[0];
|
|
1124
|
+
const assetUrl = findThemeAssetUrl(assetUrls, normalizedPath);
|
|
1125
|
+
return assetUrl ? `${attribute}=${quote}${assetUrl}${assetPath.slice(normalizedPath.length)}${quote}` : match;
|
|
1126
|
+
});
|
|
1127
|
+
var isThemeMarkupFile = (filename) => filename.startsWith(`${liquidThemeFolderNames.layout}/`) || filename.startsWith(`${liquidThemeFolderNames.sections}/`) || filename.startsWith(`${liquidThemeFolderNames.snippets}/`);
|
|
1128
|
+
var rewriteLiquidThemeAssetBuffers = (buffers, assetUrls) => {
|
|
1129
|
+
const rewrittenBuffers = { ...buffers };
|
|
1130
|
+
for (const [filename, content] of Object.entries(buffers)) {
|
|
1131
|
+
if (!content) continue;
|
|
1132
|
+
if (filename.endsWith(".css")) rewrittenBuffers[filename] = rewriteThemeCssAssetUrls(content, assetUrls);
|
|
1133
|
+
if (isThemeMarkupFile(filename)) rewrittenBuffers[filename] = rewriteThemeHtmlAssetUrls(content, assetUrls);
|
|
1134
|
+
}
|
|
1135
|
+
return rewrittenBuffers;
|
|
1136
|
+
};
|
|
1137
|
+
var unsafeAssetPathCharacterPattern = /%(?![0-9a-f]{2})|[^a-z0-9._~:/@!$*+,;=%-]/giu;
|
|
1138
|
+
var encodeAssetPathCharacters = (path) => path.replace(unsafeAssetPathCharacterPattern, (character) => encodeURIComponent(character));
|
|
1139
|
+
var encodeThemeAssetUrl = (url) => {
|
|
1140
|
+
if (/^(?:data|blob):/i.test(url)) return url;
|
|
1141
|
+
const suffixStart = url.search(/[?#]/);
|
|
1142
|
+
if (suffixStart === -1) return encodeAssetPathCharacters(url);
|
|
1143
|
+
return `${encodeAssetPathCharacters(url.slice(0, suffixStart))}${url.slice(suffixStart).replace(/ /g, "%20")}`;
|
|
1144
|
+
};
|
|
1145
|
+
var getThemeAssetUrls = (files, rootDirectory, resolveMediaUrl) => Object.fromEntries(files.flatMap((file) => {
|
|
1146
|
+
const filename = file.path || file.filename;
|
|
1147
|
+
if (!filename || !file.fileUrl || !filename.startsWith(`${rootDirectory}/`)) return [];
|
|
1148
|
+
const paths = [filename, filename.slice(rootDirectory.length + 1)];
|
|
1149
|
+
const url = encodeThemeAssetUrl(resolveMediaUrl(file.fileUrl));
|
|
1150
|
+
return paths.map((path) => [path, url]);
|
|
1151
|
+
}));
|
|
1152
|
+
var decodeHtmlAttribute = (value) => value.replace(/"/g, '"').replace(/�*39;/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
1153
|
+
var extractThemeStylesheets = (html) => {
|
|
1154
|
+
const stylesheets = /* @__PURE__ */ new Set();
|
|
1155
|
+
const content = html.replace(/<link\b[^>]*\brel=(['"])stylesheet\1[^>]*>/gi, (link) => {
|
|
1156
|
+
const href = link.match(/\bhref=(['"])(.*?)\1/i)?.[2];
|
|
1157
|
+
if (href) stylesheets.add(decodeHtmlAttribute(href));
|
|
1158
|
+
return "";
|
|
1159
|
+
});
|
|
1160
|
+
return { html: content, stylesheets: [...stylesheets] };
|
|
1161
|
+
};
|
|
1162
|
+
var renderThemeHtmlWithStylesheets = ({ html, stylesheets }) => {
|
|
1163
|
+
if (!stylesheets.length) return html;
|
|
1164
|
+
const links = stylesheets.map((href) => `<link rel="stylesheet" href="${href.replace(/&/g, "&").replace(/"/g, """)}">`).join("");
|
|
1165
|
+
return /<head\b[^>]*>/i.test(html) ? html.replace(/<head\b[^>]*>/i, (head) => `${head}${links}`) : `${links}${html}`;
|
|
1166
|
+
};
|
|
1167
|
+
var ensureThemeStylesheetsBeforeContent = (html) => renderThemeHtmlWithStylesheets(extractThemeStylesheets(html));
|
|
1168
|
+
|
|
1169
|
+
// ../cms-theme-engines/dist/chunk-LKQOV7DG.js
|
|
1170
|
+
var import_get = __toESM(require_get(), 1);
|
|
1171
|
+
var import_get2 = __toESM(require_get(), 1);
|
|
1172
|
+
var formatImageUrl = (url) => {
|
|
1173
|
+
if (!url) return "";
|
|
1174
|
+
if (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("blob:") || url.startsWith("data:")) return url;
|
|
1175
|
+
const baseUrl = process.env.NEXT_PUBLIC_IMAGE_URL || process.env.NEXT_PUBLIC_API_BASE_URL || "http://localhost:5000";
|
|
1176
|
+
const cleanBaseUrl = baseUrl.replace(/\/$/, "");
|
|
1177
|
+
const cleanPath = url.startsWith("/") ? url : `/${url}`;
|
|
1178
|
+
return `${cleanBaseUrl}${cleanPath}`;
|
|
1179
|
+
};
|
|
1180
|
+
var resolveThemeMediaUrl = (value) => {
|
|
1181
|
+
const normalized = String(value || "").trim();
|
|
1182
|
+
if (!normalized || themeAssetUrlPatterns.safeExternalUrl.test(normalized) || themeAssetUrlPatterns.safeDataUrl.test(normalized)) return normalized;
|
|
1183
|
+
return formatImageUrl(normalized);
|
|
1184
|
+
};
|
|
1185
|
+
var normalizeAssetName = (value) => value.replace(/^\/+/, "").replace(liquidAssetUrlPatterns.themeAssetPrefix, "");
|
|
1186
|
+
var normalizeLiquidAssetValue = (value) => String(value || "").trim();
|
|
1187
|
+
var isExternalLiquidAssetUrl = (value) => themeAssetUrlPatterns.safeExternalUrl.test(value) || themeAssetUrlPatterns.safeDataUrl.test(value);
|
|
1188
|
+
var isGalleryLiquidAssetUrl = (value) => {
|
|
1189
|
+
const normalized = normalizeLiquidAssetValue(value);
|
|
1190
|
+
return normalized.startsWith("/uploads/") || normalized.startsWith("uploads/");
|
|
1191
|
+
};
|
|
1192
|
+
var resolveLiquidMediaUrl = resolveThemeMediaUrl;
|
|
1193
|
+
var resolveLiquidAssetUrl = (value, options = {}) => {
|
|
1194
|
+
const normalized = normalizeLiquidAssetValue(value);
|
|
1195
|
+
if (!normalized) return "";
|
|
1196
|
+
if (isExternalLiquidAssetUrl(normalized)) return normalized;
|
|
1197
|
+
if (normalized.startsWith("/") || isGalleryLiquidAssetUrl(normalized)) return formatImageUrl(normalized);
|
|
1198
|
+
const assetName = normalizeAssetName(normalized);
|
|
1199
|
+
const mappedUrl = options.themeAssetUrls?.get(assetName);
|
|
1200
|
+
return mappedUrl || "";
|
|
1201
|
+
};
|
|
1202
|
+
var trustedHtml = /* @__PURE__ */ new WeakSet();
|
|
1203
|
+
var asTrustedHtml = (html) => {
|
|
1204
|
+
const value = { toString: () => html };
|
|
1205
|
+
trustedHtml.add(value);
|
|
1206
|
+
return value;
|
|
1207
|
+
};
|
|
1208
|
+
var publicValue = (value, depth = 0, seen = /* @__PURE__ */ new WeakSet()) => {
|
|
1209
|
+
if (value && typeof value === "object" && trustedHtml.has(value)) return value;
|
|
1210
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return value;
|
|
1211
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : null;
|
|
1212
|
+
if (!value || typeof value !== "object" || depth >= maxContextDepth || seen.has(value)) return null;
|
|
1213
|
+
seen.add(value);
|
|
1214
|
+
try {
|
|
1215
|
+
if (Array.isArray(value)) return value.slice(0, maxContextArray).map((child) => publicValue(child, depth + 1, seen));
|
|
1216
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) return null;
|
|
1217
|
+
return Object.fromEntries(Object.entries(value).slice(0, maxContextKeys).filter(([key]) => !privateField.test(key)).map(([key, child]) => [key, publicValue(child, depth + 1, seen)]));
|
|
1218
|
+
} finally {
|
|
1219
|
+
seen.delete(value);
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1222
|
+
var publicContext = (context = {}) => Object.fromEntries(
|
|
1223
|
+
Object.entries(context).filter(([key]) => publicContextKeys.has(key)).map(([key, value]) => [key, publicValue(value)])
|
|
1224
|
+
);
|
|
1225
|
+
var escapeHtml = (value) => String(value ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1226
|
+
var richtextAllowedTags = [
|
|
1227
|
+
"p",
|
|
1228
|
+
"br",
|
|
1229
|
+
"strong",
|
|
1230
|
+
"b",
|
|
1231
|
+
"em",
|
|
1232
|
+
"i",
|
|
1233
|
+
"u",
|
|
1234
|
+
"a",
|
|
1235
|
+
"ul",
|
|
1236
|
+
"ol",
|
|
1237
|
+
"li",
|
|
1238
|
+
"h1",
|
|
1239
|
+
"h2",
|
|
1240
|
+
"h3",
|
|
1241
|
+
"h4",
|
|
1242
|
+
"h5",
|
|
1243
|
+
"h6",
|
|
1244
|
+
"blockquote",
|
|
1245
|
+
"img",
|
|
1246
|
+
"figure",
|
|
1247
|
+
"figcaption",
|
|
1248
|
+
"span",
|
|
1249
|
+
"div",
|
|
1250
|
+
"hr"
|
|
1251
|
+
];
|
|
1252
|
+
var richtextSanitizeOptions = {
|
|
1253
|
+
allowedTags: richtextAllowedTags,
|
|
1254
|
+
allowedAttributes: {
|
|
1255
|
+
a: ["href", "rel", "target"],
|
|
1256
|
+
img: ["src", "alt"]
|
|
1257
|
+
},
|
|
1258
|
+
allowedSchemes: ["http", "https", "mailto"],
|
|
1259
|
+
allowedSchemesAppliedToAttributes: ["href", "src"],
|
|
1260
|
+
allowProtocolRelative: false,
|
|
1261
|
+
nonTextTags: ["script", "style", "iframe", "textarea", "option"]
|
|
1262
|
+
};
|
|
1263
|
+
var sanitizeRichtext = (html) => {
|
|
1264
|
+
if (html === null || html === void 0) return "";
|
|
1265
|
+
return sanitizeHtml(String(html), richtextSanitizeOptions);
|
|
1266
|
+
};
|
|
1267
|
+
var sanitizeContent = (value, key = "") => {
|
|
1268
|
+
if (Array.isArray(value)) return value.map((item) => sanitizeContent(item, key));
|
|
1269
|
+
if (value && typeof value === "object") {
|
|
1270
|
+
return Object.fromEntries(Object.entries(value).map(([childKey, childValue]) => [childKey, sanitizeContent(childValue, childKey)]));
|
|
1271
|
+
}
|
|
1272
|
+
if (typeof value !== "string") return value;
|
|
1273
|
+
if (/^(url|href|src|action|link)$/i.test(key) && /^\s*javascript:/i.test(value)) return "#";
|
|
1274
|
+
return value.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "").replace(/\son\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/javascript\s*:/gi, "");
|
|
1275
|
+
};
|
|
1276
|
+
var localizeLinkTargets = (targets, localization) => targets && Object.fromEntries(
|
|
1277
|
+
targets && Object.entries(targets)?.map(([key, target]) => [
|
|
1278
|
+
key,
|
|
1279
|
+
target.external || !target.available ? target : { ...target, url: localizeStorefrontUrl(target.url, localization) }
|
|
1280
|
+
])
|
|
1281
|
+
);
|
|
1282
|
+
function buildStorefrontDropsContext(rawCmsData) {
|
|
1283
|
+
const { entities = {}, forms = {}, settings = {}, routes = {}, page, collection, contentCollections = {}, linkTargets = {}, localization, search = { results: [], terms: "", performed: false }, contentLoading = false, contentError } = rawCmsData;
|
|
1284
|
+
const safeEntities = sanitizeContent(entities);
|
|
1285
|
+
const safeForms = sanitizeContent(forms);
|
|
1286
|
+
const formsProxy = new Proxy(safeForms, {
|
|
1287
|
+
get(target, prop) {
|
|
1288
|
+
if (typeof prop !== "string") return void 0;
|
|
1289
|
+
return target[prop] || { handle: prop, name: prop };
|
|
1290
|
+
}
|
|
1291
|
+
});
|
|
1292
|
+
return {
|
|
1293
|
+
settings: sanitizeContent(settings),
|
|
1294
|
+
routes: localizeStorefrontRoutes(routes, localization),
|
|
1295
|
+
...page ? { page: sanitizeContent(page) } : {},
|
|
1296
|
+
...collection ? { collection: sanitizeContent(collection) } : {},
|
|
1297
|
+
contentCollections: sanitizeContent(contentCollections),
|
|
1298
|
+
linkTargets: localizeLinkTargets(linkTargets, localization),
|
|
1299
|
+
...localization ? { localization: sanitizeContent(localization) } : {},
|
|
1300
|
+
search: sanitizeContent(search),
|
|
1301
|
+
entities: safeEntities,
|
|
1302
|
+
forms: formsProxy,
|
|
1303
|
+
contentLoading,
|
|
1304
|
+
contentError
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
var resolveMarkupKey = (fileBuffers, directory, name) => {
|
|
1308
|
+
const baseName = [themeFileExtensions.liquid, themeFileExtensions.html].reduce((value, extension) => value.toLowerCase().endsWith(extension) ? value.slice(0, -extension.length) : value, name);
|
|
1309
|
+
const liquidPath = `${directory}/${baseName}${themeFileExtensions.liquid}`;
|
|
1310
|
+
const htmlPath = `${directory}/${baseName}${themeFileExtensions.html}`;
|
|
1311
|
+
return fileBuffers[liquidPath] !== void 0 ? liquidPath : fileBuffers[htmlPath] !== void 0 ? htmlPath : liquidPath;
|
|
1312
|
+
};
|
|
1313
|
+
var sectionKey = (fileBuffers, name) => resolveMarkupKey(fileBuffers, "sections", name);
|
|
1314
|
+
var layoutKey = (fileBuffers, name) => resolveMarkupKey(fileBuffers, "layout", name);
|
|
1315
|
+
var stripAssetsPrefix = (path) => path.replace(/^assets\//, "");
|
|
1316
|
+
var assetKey = (path) => {
|
|
1317
|
+
const value = String(path || "").split("?")[0];
|
|
1318
|
+
const marker = value.indexOf("/assets/");
|
|
1319
|
+
const assetPath = marker >= 0 ? value.slice(marker + 1) : value;
|
|
1320
|
+
return `assets/${stripAssetsPrefix(assetPath)}`;
|
|
1321
|
+
};
|
|
1322
|
+
var parseJson = (raw, fallback) => {
|
|
1323
|
+
if (!raw) return fallback;
|
|
1324
|
+
try {
|
|
1325
|
+
return JSON.parse(raw);
|
|
1326
|
+
} catch {
|
|
1327
|
+
return fallback;
|
|
1328
|
+
}
|
|
1329
|
+
};
|
|
1330
|
+
var resolveTemplatePath = (fileBuffers, templatePath) => {
|
|
1331
|
+
if (fileBuffers[templatePath]) return templatePath;
|
|
1332
|
+
const keys = Object.keys(fileBuffers);
|
|
1333
|
+
return keys.find((k) => k === defaultTemplate) || keys.find((k) => k.startsWith("templates/")) || keys.find((k) => k.startsWith("sections/")) || templatePath;
|
|
1334
|
+
};
|
|
1335
|
+
function extractSectionSchema(liquidSource) {
|
|
1336
|
+
if (!liquidSource) return null;
|
|
1337
|
+
const match = liquidSource.match(/\{%\s*schema\s*%\}([\s\S]*?)\{%\s*endschema\s*%\}/i);
|
|
1338
|
+
if (!match || !match[1]) return null;
|
|
1339
|
+
try {
|
|
1340
|
+
const parsed = JSON.parse(match[1].trim());
|
|
1341
|
+
return parsed;
|
|
1342
|
+
} catch (err) {
|
|
1343
|
+
console.error("Failed to parse Liquid section schema JSON:", err);
|
|
1344
|
+
return null;
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
var collectDefaults = (items) => Object.fromEntries(
|
|
1348
|
+
items.map((setting) => ({
|
|
1349
|
+
id: setting?.id || setting?.key || setting?.name,
|
|
1350
|
+
value: setting?.default !== void 0 ? setting.default : setting?.settings?.defaultValue
|
|
1351
|
+
})).filter((setting) => setting.id && setting.value !== void 0).map((setting) => [setting.id, setting.value])
|
|
1352
|
+
);
|
|
1353
|
+
function preprocessLiquidTemplate(content) {
|
|
1354
|
+
if (!content) return "";
|
|
1355
|
+
return content.replace(
|
|
1356
|
+
/\{\{\s*([^|{}]+?)\s*\?\s*([^|{}]+?)\s*:\s*([^|{}]+?)\s*\}\}/g,
|
|
1357
|
+
(_, cond, trueVal, falseVal) => `{% if ${cond.trim()} %}{{ ${trueVal.trim()} }}{% else %}{{ ${falseVal.trim()} }}{% endif %}`
|
|
1358
|
+
);
|
|
1359
|
+
}
|
|
1360
|
+
function stripSectionSchema(content) {
|
|
1361
|
+
if (!content) return "";
|
|
1362
|
+
return blockTagPatterns.reduce((result, pattern) => result.replace(pattern, ""), preprocessLiquidTemplate(content));
|
|
1363
|
+
}
|
|
1364
|
+
var getSchemaDefaults = (rawSectionCode) => {
|
|
1365
|
+
const schema = extractSectionSchema(rawSectionCode);
|
|
1366
|
+
return collectDefaults(Array.isArray(schema?.settings) ? schema.settings : []);
|
|
1367
|
+
};
|
|
1368
|
+
var getSavedSectionSettings = (fileBuffers, sectionName) => {
|
|
1369
|
+
const data = parseJson(fileBuffers[liquidThemeConfigFilePaths.settingsData], {});
|
|
1370
|
+
return (0, import_get.default)(data, `current.sections.${sectionName}.settings`, {});
|
|
1371
|
+
};
|
|
1372
|
+
var resolveSectionSettings = (fileBuffers, sectionName, rawSectionCode, activeSettings = {}) => ({
|
|
1373
|
+
...getSchemaDefaults(rawSectionCode),
|
|
1374
|
+
...getSavedSectionSettings(fileBuffers, sectionName),
|
|
1375
|
+
...activeSettings
|
|
1376
|
+
});
|
|
1377
|
+
var buildSectionScope = (context, sectionName, settings) => {
|
|
1378
|
+
const active = context.section || {};
|
|
1379
|
+
return {
|
|
1380
|
+
...context,
|
|
1381
|
+
section: {
|
|
1382
|
+
id: active.id || sectionName,
|
|
1383
|
+
type: active.type || sectionName,
|
|
1384
|
+
settings: resolveEntityBindings(settings, context),
|
|
1385
|
+
blocks: active.blocks || []
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
};
|
|
1389
|
+
var getSettingsSchemaDefaults = (fileBuffers) => {
|
|
1390
|
+
const groups = parseJson(fileBuffers[liquidThemeConfigFilePaths.settingsSchema], []);
|
|
1391
|
+
if (!Array.isArray(groups)) return {};
|
|
1392
|
+
return collectDefaults(groups.flatMap((g) => Array.isArray(g?.settings) ? g.settings : []));
|
|
1393
|
+
};
|
|
1394
|
+
var loadGlobalSettings = (fileBuffers, contextSettings = {}) => {
|
|
1395
|
+
const saved = parseJson(fileBuffers[liquidThemeConfigFilePaths.settingsData], {});
|
|
1396
|
+
return {
|
|
1397
|
+
...getSettingsSchemaDefaults(fileBuffers),
|
|
1398
|
+
...contextSettings,
|
|
1399
|
+
...saved.current || {}
|
|
1400
|
+
};
|
|
1401
|
+
};
|
|
1402
|
+
var resolveEntityBindings = (value, context) => {
|
|
1403
|
+
if (Array.isArray(value)) return value.map((item) => resolveEntityBindings(item, context));
|
|
1404
|
+
if (!value || typeof value !== "object") return value;
|
|
1405
|
+
const linkTargetKey = getThemeLinkTargetReferenceKey(value);
|
|
1406
|
+
if (linkTargetKey) {
|
|
1407
|
+
return context.linkTargets?.[linkTargetKey] ?? {
|
|
1408
|
+
url: "",
|
|
1409
|
+
title: "",
|
|
1410
|
+
external: false,
|
|
1411
|
+
available: false
|
|
1412
|
+
};
|
|
1413
|
+
}
|
|
1414
|
+
if (value.source === themeEntityBindingSource && value.entityType && value.handle) {
|
|
1415
|
+
const entity = context.entities?.[value.entityType]?.[value.handle];
|
|
1416
|
+
const resolvedEntity = entity?.kind === entityKinds.collection ? entity.items : entity?.item;
|
|
1417
|
+
if (!value.field) return resolvedEntity;
|
|
1418
|
+
if (typeof value.field !== "string" || value.field.split(".").some((segment) => privateField.test(segment))) return "";
|
|
1419
|
+
if (Array.isArray(entity?.items)) return entity.items.map((item) => (0, import_get.default)(item, value.field, ""));
|
|
1420
|
+
return (0, import_get.default)(resolvedEntity, value.field, "");
|
|
1421
|
+
}
|
|
1422
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, resolveEntityBindings(child, context)]));
|
|
1423
|
+
};
|
|
1424
|
+
var inlineAssets = (fileBuffers, extension, wrap) => Object.entries(fileBuffers).filter(([path]) => path.startsWith("assets/") && path.endsWith(extension)).map(([path, content]) => wrap(path, content)).join("\n");
|
|
1425
|
+
var buildPreviewHeader = (settings, fileBuffers) => {
|
|
1426
|
+
const styles = inlineAssets(fileBuffers, ".css", (path, css) => `
|
|
1427
|
+
<!-- Inlined ${path} for srcdoc preview -->
|
|
1428
|
+
<style data-inlined-asset="${path}">
|
|
1429
|
+
${css}
|
|
1430
|
+
</style>`);
|
|
1431
|
+
const scripts = inlineAssets(fileBuffers, ".js", (path, js) => `
|
|
1432
|
+
<!-- Inlined ${path} for srcdoc preview -->
|
|
1433
|
+
<script data-inlined-asset="${path}">
|
|
1434
|
+
${js}
|
|
1435
|
+
</script>`);
|
|
1436
|
+
return `
|
|
1437
|
+
<!-- Tailwind CSS CDN -->
|
|
1438
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
1439
|
+
<script>
|
|
1440
|
+
tailwind.config = {
|
|
1441
|
+
darkMode: 'class',
|
|
1442
|
+
theme: {
|
|
1443
|
+
extend: {
|
|
1444
|
+
colors: {
|
|
1445
|
+
primary: ${JSON.stringify(settings.primaryColor || "#2563eb").replace(/</g, "\\u003c")},
|
|
1446
|
+
secondary: ${JSON.stringify(settings.secondaryColor || "#4f46e5").replace(/</g, "\\u003c")},
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1451
|
+
</script>
|
|
1452
|
+
${styles}
|
|
1453
|
+
${scripts}
|
|
1454
|
+
<style>
|
|
1455
|
+
[data-section-id] {
|
|
1456
|
+
position: relative;
|
|
1457
|
+
transition: outline 0.15s ease-in-out;
|
|
1458
|
+
}
|
|
1459
|
+
[data-section-id]:hover {
|
|
1460
|
+
outline: 2px dashed #005bd3 !important;
|
|
1461
|
+
outline-offset: -2px;
|
|
1462
|
+
cursor: pointer;
|
|
1463
|
+
}
|
|
1464
|
+
[data-editor-block]:hover {
|
|
1465
|
+
outline: 2px dotted #008060 !important;
|
|
1466
|
+
outline-offset: -1px;
|
|
1467
|
+
}
|
|
1468
|
+
</style>
|
|
1469
|
+
<script>
|
|
1470
|
+
window.cms = window.cms || { theme: { name: 'Theme' } };
|
|
1471
|
+
|
|
1472
|
+
document.addEventListener('click', function(e) {
|
|
1473
|
+
var blockEl = e.target.closest('[data-editor-block]');
|
|
1474
|
+
var sectionEl = e.target.closest('[data-section-id]');
|
|
1475
|
+
|
|
1476
|
+
if (sectionEl) {
|
|
1477
|
+
var sectionId = sectionEl.getAttribute('data-section-id');
|
|
1478
|
+
var blockId = blockEl ? blockEl.getAttribute('data-editor-block') : null;
|
|
1479
|
+
|
|
1480
|
+
window.parent.postMessage({
|
|
1481
|
+
type: '${themePostMessageEvents.select}',
|
|
1482
|
+
sectionId: sectionId,
|
|
1483
|
+
blockId: blockId
|
|
1484
|
+
}, '*');
|
|
1485
|
+
}
|
|
1486
|
+
}, true);
|
|
1487
|
+
</script>
|
|
1488
|
+
`;
|
|
1489
|
+
};
|
|
1490
|
+
var inlinePreviewAssets = (html, fileBuffers) => {
|
|
1491
|
+
const scriptPattern = /<script\b([^>]*)\bsrc=["'](?:\.?\/?assets\/([^"']+))["']([^>]*)><\/script>/gi;
|
|
1492
|
+
const linkPattern = /<link\b([^>]*)\bhref=["'](?:\.?\/?assets\/([^"']+))["']([^>]*)\/?>/gi;
|
|
1493
|
+
const imagePattern = /((?:src|href)=["'])(?:\.?\/?assets\/([^"']+))(["'])/gi;
|
|
1494
|
+
return html.replace(scriptPattern, (_match, before, file, after) => {
|
|
1495
|
+
const key = assetKey(file);
|
|
1496
|
+
return fileBuffers[key] ? `<script ${before} ${after} data-inlined-asset="${key}">
|
|
1497
|
+
${fileBuffers[key]}
|
|
1498
|
+
</script>` : `<!-- [CMS Preview] Asset script ${key} already handled or empty -->`;
|
|
1499
|
+
}).replace(linkPattern, (match, _before, file) => {
|
|
1500
|
+
const key = assetKey(file);
|
|
1501
|
+
return fileBuffers[key] ? `<style data-inlined-asset="${key}">
|
|
1502
|
+
${fileBuffers[key]}
|
|
1503
|
+
</style>` : match;
|
|
1504
|
+
}).replace(imagePattern, (match, prefix, file, suffix) => {
|
|
1505
|
+
const key = assetKey(file);
|
|
1506
|
+
const content = fileBuffers[key];
|
|
1507
|
+
return content?.startsWith("data:") ? `${prefix}${content}${suffix}` : match;
|
|
1508
|
+
});
|
|
1509
|
+
};
|
|
1510
|
+
var FORBIDDEN_CSS_PATTERNS = [/<\/style/gi, /@import[^;]*;?/gi];
|
|
1511
|
+
var sanitizeCustomCss = (css) => {
|
|
1512
|
+
if (!css) return "";
|
|
1513
|
+
let sanitized = css;
|
|
1514
|
+
let previous = "";
|
|
1515
|
+
while (sanitized !== previous) {
|
|
1516
|
+
previous = sanitized;
|
|
1517
|
+
FORBIDDEN_CSS_PATTERNS.forEach((pattern) => {
|
|
1518
|
+
sanitized = sanitized.replace(pattern, "");
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
return sanitized;
|
|
1522
|
+
};
|
|
1523
|
+
var containsLiquidExpression = (value) => /\{[{%]/.test(value);
|
|
1524
|
+
var buildBlockList = (sectionBlocks, blockOrder) => blockOrder.filter((id) => !(0, import_get2.default)(sectionBlocks, `${id}.disabled`)).map((id) => ({
|
|
1525
|
+
id,
|
|
1526
|
+
type: (0, import_get2.default)(sectionBlocks, `${id}.type`, "block"),
|
|
1527
|
+
settings: (0, import_get2.default)(sectionBlocks, `${id}.settings`, {}),
|
|
1528
|
+
attributes: `data-editor-block="${id}"`
|
|
1529
|
+
}));
|
|
1530
|
+
var buildCustomCssBlock = (sectionId, customCss) => {
|
|
1531
|
+
if (typeof customCss !== "string") return "";
|
|
1532
|
+
const css = sanitizeCustomCss(customCss);
|
|
1533
|
+
if (!css.trim()) return "";
|
|
1534
|
+
return `
|
|
1535
|
+
<style data-section-custom-css="${sectionId}">
|
|
1536
|
+
#cms-section-${sectionId} {
|
|
1537
|
+
${css}
|
|
1538
|
+
}
|
|
1539
|
+
</style>`;
|
|
1540
|
+
};
|
|
1541
|
+
var templateErrorHtml = (path) => `<div style="padding: 24px; color: #dc2626; font-family: sans-serif;"><h3>Template Error</h3><p>Could not parse template: <code>${escapeHtml(path)}</code></p></div>`;
|
|
1542
|
+
var queryPattern = new RegExp(
|
|
1543
|
+
`\\{%\\s*${themeEntityQueryTag}\\s+["']([a-zA-Z0-9_-]+)["']\\s*,\\s*["']([a-zA-Z0-9_-]+)["']\\s*((?:,\\s*[a-zA-Z][a-zA-Z0-9]*\\s*:\\s*(?:"[^"]*"|'[^']*'|[^,\\s]+)\\s*)*)%\\}`,
|
|
1544
|
+
"g"
|
|
1545
|
+
);
|
|
1546
|
+
var optionPattern = /([a-zA-Z][a-zA-Z0-9]*)\s*:\s*(?:"([^"]*)"|'([^']*)'|([^,\s]+))/g;
|
|
1547
|
+
var getLiquidThemeEntitySources = (fileBuffers = {}, selectedTemplate) => Object.entries(fileBuffers).filter(([path]) => path === selectedTemplate || path === liquidThemeConfigFilePaths.settingsData || path.startsWith(`${liquidThemeFolderNames.sections}/`) || path.startsWith(`${liquidThemeFolderNames.snippets}/`)).map(([, content]) => content);
|
|
1548
|
+
var markupReferencePattern = /\{%\s*(render|include|section)\s+['"]([^'"]+)['"]/gi;
|
|
1549
|
+
var hasFile = (fileBuffers, path) => Object.prototype.hasOwnProperty.call(fileBuffers, path);
|
|
1550
|
+
var resolveMarkupPath = (fileBuffers, directory, name) => {
|
|
1551
|
+
const baseName = name.replace(/\.(?:liquid|html)$/i, "");
|
|
1552
|
+
const liquidPath = `${directory}/${baseName}.liquid`;
|
|
1553
|
+
return hasFile(fileBuffers, liquidPath) ? liquidPath : `${directory}/${baseName}.html`;
|
|
1554
|
+
};
|
|
1555
|
+
var getLiquidThemeReachableBuffers = (fileBuffers = {}, selectedTemplate) => {
|
|
1556
|
+
const reachable = {};
|
|
1557
|
+
if (!selectedTemplate || !hasFile(fileBuffers, selectedTemplate)) return reachable;
|
|
1558
|
+
let template = {};
|
|
1559
|
+
try {
|
|
1560
|
+
template = JSON.parse(fileBuffers[selectedTemplate] || "{}");
|
|
1561
|
+
} catch {
|
|
1562
|
+
template = {};
|
|
1563
|
+
}
|
|
1564
|
+
const layoutName = typeof template.layout === "string" && template.layout !== "none" ? template.layout : "theme";
|
|
1565
|
+
const pending = [
|
|
1566
|
+
selectedTemplate,
|
|
1567
|
+
liquidThemeConfigFilePaths.settingsData,
|
|
1568
|
+
resolveMarkupPath(fileBuffers, liquidThemeFolderNames.layout, layoutName)
|
|
1569
|
+
];
|
|
1570
|
+
for (const section of Object.values(template.sections || {})) {
|
|
1571
|
+
if (typeof section?.type === "string") pending.push(resolveMarkupPath(fileBuffers, liquidThemeFolderNames.sections, section.type));
|
|
1572
|
+
}
|
|
1573
|
+
while (pending.length) {
|
|
1574
|
+
const path = pending.pop();
|
|
1575
|
+
if (path in reachable || !hasFile(fileBuffers, path)) continue;
|
|
1576
|
+
const content = fileBuffers[path] || "";
|
|
1577
|
+
reachable[path] = content;
|
|
1578
|
+
for (const match of content.matchAll(markupReferencePattern)) {
|
|
1579
|
+
const directory = match[1].toLowerCase() === "section" ? liquidThemeFolderNames.sections : liquidThemeFolderNames.snippets;
|
|
1580
|
+
pending.push(resolveMarkupPath(fileBuffers, directory, match[2]));
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
return reachable;
|
|
1584
|
+
};
|
|
1585
|
+
var requiresCurrentEntry = (query) => query.relationTarget === "current" || query.excludeCurrent === true;
|
|
1586
|
+
var getLiquidThemeEntityQueries = (fileBuffers = {}, selectedTemplate) => {
|
|
1587
|
+
const source = getLiquidThemeEntitySources(fileBuffers, selectedTemplate).join("\n");
|
|
1588
|
+
const queries = /* @__PURE__ */ new Map();
|
|
1589
|
+
for (const match of source.matchAll(queryPattern)) {
|
|
1590
|
+
const query = { type: match[1], handle: match[2] };
|
|
1591
|
+
for (const option of match[3].matchAll(optionPattern)) {
|
|
1592
|
+
const key2 = option[1];
|
|
1593
|
+
const value = option[2] ?? option[3] ?? option[4];
|
|
1594
|
+
if (key2 === "as") {
|
|
1595
|
+
query.as = value;
|
|
1596
|
+
} else if (key2 === queryKeys.page || key2 === queryKeys.limit) {
|
|
1597
|
+
const numberValue = Number(value);
|
|
1598
|
+
if (!Number.isInteger(numberValue) || numberValue <= 0) throw new Error(`Invalid entityQuery declaration: ${key2} must be a positive integer.`);
|
|
1599
|
+
query[key2] = numberValue;
|
|
1600
|
+
} else if (key2 === queryKeys.populate) {
|
|
1601
|
+
query.populate = value === "true" || value === "false" ? value === "true" : value;
|
|
1602
|
+
} else if (key2 === queryKeys.fields) {
|
|
1603
|
+
if (value.length > 1024 || !/^[a-zA-Z][a-zA-Z0-9]*(,[a-zA-Z][a-zA-Z0-9]*)*$/.test(value)) {
|
|
1604
|
+
throw new Error(`Invalid entityQuery declaration: ${key2} is invalid.`);
|
|
1605
|
+
}
|
|
1606
|
+
query.fields = value;
|
|
1607
|
+
} else if (key2 === queryKeys.themeSortBy) {
|
|
1608
|
+
query.sortBy = value;
|
|
1609
|
+
} else if (key2 === queryKeys.themeSortOrder && (value === "asc" || value === "desc")) {
|
|
1610
|
+
query.sortOrder = value;
|
|
1611
|
+
} else if (key2 === queryKeys.relationField) {
|
|
1612
|
+
query.relationField = value;
|
|
1613
|
+
} else if (key2 === queryKeys.relationTarget && value === "current") {
|
|
1614
|
+
query.relationTarget = "current";
|
|
1615
|
+
} else if (key2 === queryKeys.excludeCurrent && (value === "true" || value === "false")) {
|
|
1616
|
+
query.excludeCurrent = value === "true";
|
|
1617
|
+
} else {
|
|
1618
|
+
throw new Error(`Invalid entityQuery declaration: unsupported option '${key2}'.`);
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(query.type) || !/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(query.handle)) {
|
|
1622
|
+
throw new Error("Invalid entityQuery declaration: type and handle are invalid.");
|
|
1623
|
+
}
|
|
1624
|
+
if (query.as !== void 0 && !/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(query.as)) {
|
|
1625
|
+
throw new Error("Invalid entityQuery declaration: alias is invalid.");
|
|
1626
|
+
}
|
|
1627
|
+
if (query.sortOrder !== void 0 && !["asc", "desc"].includes(query.sortOrder)) {
|
|
1628
|
+
throw new Error("Invalid entityQuery declaration: sortOrder must be asc or desc.");
|
|
1629
|
+
}
|
|
1630
|
+
if (query.relationField === void 0 !== (query.relationTarget === void 0)) {
|
|
1631
|
+
throw new Error("Invalid entityQuery declaration: relationField and relationTarget must be provided together.");
|
|
1632
|
+
}
|
|
1633
|
+
if (query.relationField !== void 0 && !/^[a-z][a-zA-Z0-9]*$/.test(query.relationField)) {
|
|
1634
|
+
throw new Error("Invalid entityQuery declaration: relationField is invalid.");
|
|
1635
|
+
}
|
|
1636
|
+
const key = getThemeEntityQueryKey(query);
|
|
1637
|
+
const existing = queries.get(key);
|
|
1638
|
+
const canonicalQuery = (value) => JSON.stringify(
|
|
1639
|
+
Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right)))
|
|
1640
|
+
);
|
|
1641
|
+
if (existing && canonicalQuery(existing) !== canonicalQuery(query)) {
|
|
1642
|
+
throw new Error(`Multiple entityQuery declarations target '${query.type}.${query.handle}' with the same result key. Add distinct 'as' aliases.`);
|
|
1643
|
+
}
|
|
1644
|
+
queries.set(key, query);
|
|
1645
|
+
}
|
|
1646
|
+
const addBindingQueries = (value) => {
|
|
1647
|
+
if (!value || typeof value !== "object") return;
|
|
1648
|
+
const binding = value;
|
|
1649
|
+
if (binding.source === themeEntityBindingSource && typeof binding.entityType === "string" && typeof binding.handle === "string") {
|
|
1650
|
+
const query = { type: binding.entityType, handle: binding.handle };
|
|
1651
|
+
const key = getThemeEntityQueryKey(query);
|
|
1652
|
+
if (!queries.has(key)) queries.set(key, query);
|
|
1653
|
+
}
|
|
1654
|
+
Object.values(binding).forEach(addBindingQueries);
|
|
1655
|
+
};
|
|
1656
|
+
try {
|
|
1657
|
+
addBindingQueries(JSON.parse(fileBuffers[selectedTemplate || ""] || "{}"));
|
|
1658
|
+
addBindingQueries(JSON.parse(fileBuffers[liquidThemeConfigFilePaths.settingsData] || "{}"));
|
|
1659
|
+
} catch {
|
|
1660
|
+
}
|
|
1661
|
+
return [...queries.values()];
|
|
1662
|
+
};
|
|
1663
|
+
var getLiquidThemeCollectionHandles = (fileBuffers = {}, selectedTemplate) => {
|
|
1664
|
+
let template;
|
|
1665
|
+
try {
|
|
1666
|
+
template = JSON.parse(fileBuffers[selectedTemplate || ""] || "{}");
|
|
1667
|
+
} catch {
|
|
1668
|
+
return [];
|
|
1669
|
+
}
|
|
1670
|
+
const handles = /* @__PURE__ */ new Set();
|
|
1671
|
+
for (const section of Object.values(template.sections || {})) {
|
|
1672
|
+
const sectionSchema = extractSectionSchema(fileBuffers[`sections/${section?.type || ""}${themeFileExtensions.liquid}`] || "");
|
|
1673
|
+
for (const setting of sectionSchema?.settings || []) {
|
|
1674
|
+
if (setting.type !== themeSettingTypeConstants.collection) continue;
|
|
1675
|
+
const handle = section.settings?.[setting.id];
|
|
1676
|
+
if (typeof handle === "string" && handle.trim()) handles.add(handle.trim());
|
|
1677
|
+
}
|
|
1678
|
+
for (const blockSchema of sectionSchema?.blocks || []) {
|
|
1679
|
+
for (const setting of blockSchema.settings || []) {
|
|
1680
|
+
if (setting.type !== themeSettingTypeConstants.collection) continue;
|
|
1681
|
+
for (const block of Object.values(section.blocks || {})) {
|
|
1682
|
+
if (block?.type !== blockSchema.type) continue;
|
|
1683
|
+
const handle = block.settings?.[setting.id];
|
|
1684
|
+
if (typeof handle === "string" && handle.trim()) handles.add(handle.trim());
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
return [...handles].slice(0, 20);
|
|
1690
|
+
};
|
|
1691
|
+
var localizedSettingTypes = new Set(Object.values(themeCustomizerLocalizedSettingTypes));
|
|
1692
|
+
var isThemeCustomizerSettingLocalized = (setting) => {
|
|
1693
|
+
return hasTranslatableFields([setting], {}, (field) => Boolean(field.settings?.isTranslatable) && localizedSettingTypes.has(String(field.type)));
|
|
1694
|
+
};
|
|
1695
|
+
var getLocalePath = (languageCode) => `${liquidThemeFolderNames.locales}/${languageCode.toLowerCase()}.json`;
|
|
1696
|
+
var parseObject = (raw) => {
|
|
1697
|
+
if (!raw) return {};
|
|
1698
|
+
const parsed = JSON.parse(raw);
|
|
1699
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("Locale file must contain a JSON object");
|
|
1700
|
+
return parsed;
|
|
1701
|
+
};
|
|
1702
|
+
var mergeAllowedSettings = (target, translated, schemaSettings = []) => {
|
|
1703
|
+
const allowedSettings = new Set(
|
|
1704
|
+
schemaSettings.filter(isThemeCustomizerSettingLocalized).filter((setting) => setting.type !== "array").map((setting) => String(setting.id))
|
|
1705
|
+
);
|
|
1706
|
+
for (const [settingId, value] of Object.entries(translated)) {
|
|
1707
|
+
if (allowedSettings.has(settingId)) {
|
|
1708
|
+
target[settingId] = value;
|
|
1709
|
+
continue;
|
|
1710
|
+
}
|
|
1711
|
+
setTranslatableArrayFieldPathValue(target, schemaSettings, settingId, value, isThemeCustomizerSettingLocalized);
|
|
1712
|
+
}
|
|
1713
|
+
};
|
|
1714
|
+
var parseTemplate = (raw) => {
|
|
1715
|
+
try {
|
|
1716
|
+
const parsed = JSON.parse(raw);
|
|
1717
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
1718
|
+
} catch {
|
|
1719
|
+
return null;
|
|
1720
|
+
}
|
|
1721
|
+
};
|
|
1722
|
+
var applyTemplateOverrides = (buffers, templatePath, templateOverrides) => {
|
|
1723
|
+
const template = parseTemplate(buffers[templatePath] || "");
|
|
1724
|
+
if (!template || !templateOverrides || typeof templateOverrides !== "object") return;
|
|
1725
|
+
for (const [sectionKey2, sectionOverride] of Object.entries(templateOverrides.sections || {})) {
|
|
1726
|
+
const section = template.sections?.[sectionKey2];
|
|
1727
|
+
if (!section || !sectionOverride || typeof sectionOverride !== "object") continue;
|
|
1728
|
+
const sectionType = String(section.type || sectionKey2);
|
|
1729
|
+
const schema = extractSectionSchema(buffers[`${liquidThemeFolderNames.sections}/${sectionType}${themeFileExtensions.liquid}`] || "");
|
|
1730
|
+
if (!schema) continue;
|
|
1731
|
+
const sectionSettings = sectionOverride.settings;
|
|
1732
|
+
if (sectionSettings && typeof sectionSettings === "object") {
|
|
1733
|
+
section.settings ||= {};
|
|
1734
|
+
mergeAllowedSettings(section.settings, sectionSettings, schema.settings);
|
|
1735
|
+
}
|
|
1736
|
+
for (const [blockId, blockOverride] of Object.entries(sectionOverride.blocks || {})) {
|
|
1737
|
+
const block = section.blocks?.[blockId];
|
|
1738
|
+
if (!block || !blockOverride || typeof blockOverride !== "object") continue;
|
|
1739
|
+
const blockSchema = schema.blocks?.find((item) => item.type === block.type);
|
|
1740
|
+
if (blockSchema && blockOverride.settings && typeof blockOverride.settings === "object") {
|
|
1741
|
+
block.settings ||= {};
|
|
1742
|
+
mergeAllowedSettings(block.settings, blockOverride.settings, blockSchema.settings);
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
buffers[templatePath] = JSON.stringify(template, null, 2);
|
|
1747
|
+
};
|
|
1748
|
+
var applyGlobalOverrides = (buffers, overrides) => {
|
|
1749
|
+
const settingsPath = liquidThemeConfigFilePaths.settingsData;
|
|
1750
|
+
const data = parseTemplate(buffers[settingsPath] || "");
|
|
1751
|
+
if (!data || !data.current || typeof data.current !== "object") return;
|
|
1752
|
+
let schema = [];
|
|
1753
|
+
try {
|
|
1754
|
+
const parsed = JSON.parse(buffers[liquidThemeConfigFilePaths.settingsSchema] || "[]");
|
|
1755
|
+
schema = Array.isArray(parsed) ? parsed : [];
|
|
1756
|
+
} catch {
|
|
1757
|
+
return;
|
|
1758
|
+
}
|
|
1759
|
+
const settings = schema.flatMap((group) => group.settings || []);
|
|
1760
|
+
mergeAllowedSettings(data.current, overrides, settings);
|
|
1761
|
+
buffers[settingsPath] = JSON.stringify(data, null, 2);
|
|
1762
|
+
};
|
|
1763
|
+
var applyThemeCustomizerLocaleOverrides = (fileBuffers, languageCode, defaultLanguageCode) => {
|
|
1764
|
+
if (!languageCode || languageCode.toLowerCase() === defaultLanguageCode.toLowerCase()) return fileBuffers;
|
|
1765
|
+
const localePath = getLocalePath(languageCode);
|
|
1766
|
+
let locale;
|
|
1767
|
+
try {
|
|
1768
|
+
locale = parseObject(fileBuffers[localePath]);
|
|
1769
|
+
} catch {
|
|
1770
|
+
return fileBuffers;
|
|
1771
|
+
}
|
|
1772
|
+
const customizer = locale[themeCustomizerLocaleNamespace];
|
|
1773
|
+
if (!customizer || typeof customizer !== "object" || Array.isArray(customizer)) return fileBuffers;
|
|
1774
|
+
const result = { ...fileBuffers };
|
|
1775
|
+
const templates = customizer.templates;
|
|
1776
|
+
if (templates && typeof templates === "object" && !Array.isArray(templates)) {
|
|
1777
|
+
for (const [templatePath, templateOverrides] of Object.entries(templates)) {
|
|
1778
|
+
applyTemplateOverrides(result, templatePath, templateOverrides);
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
if (customizer.global && typeof customizer.global === "object" && !Array.isArray(customizer.global)) {
|
|
1782
|
+
applyGlobalOverrides(result, customizer.global);
|
|
1783
|
+
}
|
|
1784
|
+
return result;
|
|
1785
|
+
};
|
|
1786
|
+
|
|
1787
|
+
export {
|
|
1788
|
+
maxRenderMs,
|
|
1789
|
+
maxOutputBytes,
|
|
1790
|
+
maxTemplateChars,
|
|
1791
|
+
maxPackageChars,
|
|
1792
|
+
maxIterations,
|
|
1793
|
+
maxIncludeDepth,
|
|
1794
|
+
allowedTags,
|
|
1795
|
+
allowedFilters,
|
|
1796
|
+
defaultTemplate,
|
|
1797
|
+
defaultLayout,
|
|
1798
|
+
isSafePartialName,
|
|
1799
|
+
customCssKey,
|
|
1800
|
+
localizeStorefrontUrl,
|
|
1801
|
+
rewriteLiquidThemeAssetBuffers,
|
|
1802
|
+
getThemeAssetUrls,
|
|
1803
|
+
extractThemeStylesheets,
|
|
1804
|
+
ensureThemeStylesheetsBeforeContent,
|
|
1805
|
+
require_get,
|
|
1806
|
+
resolveThemeMediaUrl,
|
|
1807
|
+
normalizeLiquidAssetValue,
|
|
1808
|
+
isExternalLiquidAssetUrl,
|
|
1809
|
+
isGalleryLiquidAssetUrl,
|
|
1810
|
+
resolveLiquidMediaUrl,
|
|
1811
|
+
resolveLiquidAssetUrl,
|
|
1812
|
+
trustedHtml,
|
|
1813
|
+
asTrustedHtml,
|
|
1814
|
+
publicValue,
|
|
1815
|
+
publicContext,
|
|
1816
|
+
escapeHtml,
|
|
1817
|
+
sanitizeRichtext,
|
|
1818
|
+
buildStorefrontDropsContext,
|
|
1819
|
+
resolveMarkupKey,
|
|
1820
|
+
sectionKey,
|
|
1821
|
+
layoutKey,
|
|
1822
|
+
parseJson,
|
|
1823
|
+
resolveTemplatePath,
|
|
1824
|
+
stripSectionSchema,
|
|
1825
|
+
resolveSectionSettings,
|
|
1826
|
+
buildSectionScope,
|
|
1827
|
+
loadGlobalSettings,
|
|
1828
|
+
resolveEntityBindings,
|
|
1829
|
+
buildPreviewHeader,
|
|
1830
|
+
inlinePreviewAssets,
|
|
1831
|
+
containsLiquidExpression,
|
|
1832
|
+
buildBlockList,
|
|
1833
|
+
buildCustomCssBlock,
|
|
1834
|
+
templateErrorHtml,
|
|
1835
|
+
getLiquidThemeEntitySources,
|
|
1836
|
+
getLiquidThemeReachableBuffers,
|
|
1837
|
+
requiresCurrentEntry,
|
|
1838
|
+
getLiquidThemeEntityQueries,
|
|
1839
|
+
getLiquidThemeCollectionHandles,
|
|
1840
|
+
applyThemeCustomizerLocaleOverrides
|
|
1841
|
+
};
|
|
1842
|
+
//# sourceMappingURL=chunk-WSX3MAFK.js.map
|