@tachybase/requirejs 0.23.8

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.
@@ -0,0 +1,1366 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var requirejs_exports = {};
20
+ __export(requirejs_exports, {
21
+ getRequireJs: () => getRequireJs
22
+ });
23
+ module.exports = __toCommonJS(requirejs_exports);
24
+ function getRequireJs() {
25
+ var requirejs, require, define;
26
+ var req, s, head, baseElement, dataMain, src, interactiveScript, currentlyAddingScript, mainScript, subPath, version = "2.3.6", commentRegExp = /\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm, cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, jsSuffixRegExp = /\.js$/, currDirRegExp = /^\.\//, op = Object.prototype, ostring = op.toString, hasOwn = op.hasOwnProperty, isBrowser = !!(typeof window !== "undefined" && typeof navigator !== "undefined" && window.document), isWebWorker = !isBrowser && typeof importScripts !== "undefined", readyRegExp = isBrowser && navigator.platform === "PLAYSTATION 3" ? /^complete$/ : /^(complete|loaded)$/, defContextName = "_", isOpera = typeof opera !== "undefined" && opera.toString() === "[object Opera]", contexts = {}, cfg = {}, globalDefQueue = [], useInteractive = false;
27
+ function commentReplace(match, singlePrefix) {
28
+ return singlePrefix || "";
29
+ }
30
+ __name(commentReplace, "commentReplace");
31
+ function isFunction(it) {
32
+ return ostring.call(it) === "[object Function]";
33
+ }
34
+ __name(isFunction, "isFunction");
35
+ function isArray(it) {
36
+ return ostring.call(it) === "[object Array]";
37
+ }
38
+ __name(isArray, "isArray");
39
+ function each(ary, func) {
40
+ if (ary) {
41
+ var i;
42
+ for (i = 0; i < ary.length; i += 1) {
43
+ if (ary[i] && func(ary[i], i, ary)) {
44
+ break;
45
+ }
46
+ }
47
+ }
48
+ }
49
+ __name(each, "each");
50
+ function eachReverse(ary, func) {
51
+ if (ary) {
52
+ var i;
53
+ for (i = ary.length - 1; i > -1; i -= 1) {
54
+ if (ary[i] && func(ary[i], i, ary)) {
55
+ break;
56
+ }
57
+ }
58
+ }
59
+ }
60
+ __name(eachReverse, "eachReverse");
61
+ function hasProp(obj, prop) {
62
+ return hasOwn.call(obj, prop);
63
+ }
64
+ __name(hasProp, "hasProp");
65
+ function getOwn(obj, prop) {
66
+ return hasProp(obj, prop) && obj[prop];
67
+ }
68
+ __name(getOwn, "getOwn");
69
+ function eachProp(obj, func) {
70
+ var prop;
71
+ for (prop in obj) {
72
+ if (hasProp(obj, prop)) {
73
+ if (func(obj[prop], prop)) {
74
+ break;
75
+ }
76
+ }
77
+ }
78
+ }
79
+ __name(eachProp, "eachProp");
80
+ function mixin(target, source, force, deepStringMixin) {
81
+ if (source) {
82
+ eachProp(source, function(value, prop) {
83
+ if (force || !hasProp(target, prop)) {
84
+ if (deepStringMixin && typeof value === "object" && value && !isArray(value) && !isFunction(value) && !(value instanceof RegExp)) {
85
+ if (!target[prop]) {
86
+ target[prop] = {};
87
+ }
88
+ mixin(target[prop], value, force, deepStringMixin);
89
+ } else {
90
+ target[prop] = value;
91
+ }
92
+ }
93
+ });
94
+ }
95
+ return target;
96
+ }
97
+ __name(mixin, "mixin");
98
+ function bind(obj, fn) {
99
+ return function() {
100
+ return fn.apply(obj, arguments);
101
+ };
102
+ }
103
+ __name(bind, "bind");
104
+ function scripts() {
105
+ return document.getElementsByTagName("script");
106
+ }
107
+ __name(scripts, "scripts");
108
+ function defaultOnError(err) {
109
+ throw err;
110
+ }
111
+ __name(defaultOnError, "defaultOnError");
112
+ function getGlobal(value) {
113
+ if (!value) {
114
+ return value;
115
+ }
116
+ var g = global;
117
+ each(value.split("."), function(part) {
118
+ g = g[part];
119
+ });
120
+ return g;
121
+ }
122
+ __name(getGlobal, "getGlobal");
123
+ function makeError(id, msg, err, requireModules) {
124
+ var e = new Error(msg + "\nhttps://requirejs.org/docs/errors.html#" + id);
125
+ e.requireType = id;
126
+ e.requireModules = requireModules;
127
+ if (err) {
128
+ e.originalError = err;
129
+ }
130
+ return e;
131
+ }
132
+ __name(makeError, "makeError");
133
+ if (typeof define !== "undefined") {
134
+ return;
135
+ }
136
+ if (typeof requirejs !== "undefined") {
137
+ if (isFunction(requirejs)) {
138
+ return;
139
+ }
140
+ cfg = requirejs;
141
+ requirejs = void 0;
142
+ }
143
+ if (typeof require !== "undefined" && !isFunction(require)) {
144
+ cfg = require;
145
+ require = void 0;
146
+ }
147
+ function newContext(contextName) {
148
+ var inCheckLoaded, Module, context, handlers, checkLoadedTimeoutId, config = {
149
+ //Defaults. Do not set a default for map
150
+ //config to speed up normalize(), which
151
+ //will run faster if there is no default.
152
+ waitSeconds: 7,
153
+ baseUrl: "./",
154
+ paths: {},
155
+ bundles: {},
156
+ pkgs: {},
157
+ shim: {},
158
+ config: {}
159
+ }, registry = {}, enabledRegistry = {}, undefEvents = {}, defQueue = [], defined = {}, urlFetched = {}, bundlesMap = {}, requireCounter = 1, unnormalizedCounter = 1;
160
+ function trimDots(ary) {
161
+ var i, part;
162
+ for (i = 0; i < ary.length; i++) {
163
+ part = ary[i];
164
+ if (part === ".") {
165
+ ary.splice(i, 1);
166
+ i -= 1;
167
+ } else if (part === "..") {
168
+ if (i === 0 || i === 1 && ary[2] === ".." || ary[i - 1] === "..") {
169
+ continue;
170
+ } else if (i > 0) {
171
+ ary.splice(i - 1, 2);
172
+ i -= 2;
173
+ }
174
+ }
175
+ }
176
+ }
177
+ __name(trimDots, "trimDots");
178
+ function normalize(name, baseName, applyMap) {
179
+ var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex, foundMap, foundI, foundStarMap, starI, normalizedBaseParts, baseParts = baseName && baseName.split("/"), map = config.map, starMap = map && map["*"];
180
+ if (name) {
181
+ name = name.split("/");
182
+ lastIndex = name.length - 1;
183
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
184
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, "");
185
+ }
186
+ if (name[0].charAt(0) === "." && baseParts) {
187
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
188
+ name = normalizedBaseParts.concat(name);
189
+ }
190
+ trimDots(name);
191
+ name = name.join("/");
192
+ }
193
+ if (applyMap && map && (baseParts || starMap)) {
194
+ nameParts = name.split("/");
195
+ outerLoop: for (i = nameParts.length; i > 0; i -= 1) {
196
+ nameSegment = nameParts.slice(0, i).join("/");
197
+ if (baseParts) {
198
+ for (j = baseParts.length; j > 0; j -= 1) {
199
+ mapValue = getOwn(map, baseParts.slice(0, j).join("/"));
200
+ if (mapValue) {
201
+ mapValue = getOwn(mapValue, nameSegment);
202
+ if (mapValue) {
203
+ foundMap = mapValue;
204
+ foundI = i;
205
+ break outerLoop;
206
+ }
207
+ }
208
+ }
209
+ }
210
+ if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
211
+ foundStarMap = getOwn(starMap, nameSegment);
212
+ starI = i;
213
+ }
214
+ }
215
+ if (!foundMap && foundStarMap) {
216
+ foundMap = foundStarMap;
217
+ foundI = starI;
218
+ }
219
+ if (foundMap) {
220
+ nameParts.splice(0, foundI, foundMap);
221
+ name = nameParts.join("/");
222
+ }
223
+ }
224
+ pkgMain = getOwn(config.pkgs, name);
225
+ return pkgMain ? pkgMain : name;
226
+ }
227
+ __name(normalize, "normalize");
228
+ function removeScript(name) {
229
+ if (isBrowser) {
230
+ each(scripts(), function(scriptNode) {
231
+ if (scriptNode.getAttribute("data-requiremodule") === name && scriptNode.getAttribute("data-requirecontext") === context.contextName) {
232
+ scriptNode.parentNode.removeChild(scriptNode);
233
+ return true;
234
+ }
235
+ });
236
+ }
237
+ }
238
+ __name(removeScript, "removeScript");
239
+ function hasPathFallback(id) {
240
+ var pathConfig = getOwn(config.paths, id);
241
+ if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
242
+ pathConfig.shift();
243
+ context.require.undef(id);
244
+ context.makeRequire(null, {
245
+ skipMap: true
246
+ })([id]);
247
+ return true;
248
+ }
249
+ }
250
+ __name(hasPathFallback, "hasPathFallback");
251
+ function splitPrefix(name) {
252
+ var prefix, index = name ? name.indexOf("!") : -1;
253
+ if (index > -1) {
254
+ prefix = name.substring(0, index);
255
+ name = name.substring(index + 1, name.length);
256
+ }
257
+ return [prefix, name];
258
+ }
259
+ __name(splitPrefix, "splitPrefix");
260
+ function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
261
+ var url, pluginModule, suffix, nameParts, prefix = null, parentName = parentModuleMap ? parentModuleMap.name : null, originalName = name, isDefine = true, normalizedName = "";
262
+ if (!name) {
263
+ isDefine = false;
264
+ name = "_@r" + (requireCounter += 1);
265
+ }
266
+ nameParts = splitPrefix(name);
267
+ prefix = nameParts[0];
268
+ name = nameParts[1];
269
+ if (prefix) {
270
+ prefix = normalize(prefix, parentName, applyMap);
271
+ pluginModule = getOwn(defined, prefix);
272
+ }
273
+ if (name) {
274
+ if (prefix) {
275
+ if (isNormalized) {
276
+ normalizedName = name;
277
+ } else if (pluginModule && pluginModule.normalize) {
278
+ normalizedName = pluginModule.normalize(name, function(name2) {
279
+ return normalize(name2, parentName, applyMap);
280
+ });
281
+ } else {
282
+ normalizedName = name.indexOf("!") === -1 ? normalize(name, parentName, applyMap) : name;
283
+ }
284
+ } else {
285
+ normalizedName = normalize(name, parentName, applyMap);
286
+ nameParts = splitPrefix(normalizedName);
287
+ prefix = nameParts[0];
288
+ normalizedName = nameParts[1];
289
+ isNormalized = true;
290
+ url = context.nameToUrl(normalizedName);
291
+ }
292
+ }
293
+ suffix = prefix && !pluginModule && !isNormalized ? "_unnormalized" + (unnormalizedCounter += 1) : "";
294
+ return {
295
+ prefix,
296
+ name: normalizedName,
297
+ parentMap: parentModuleMap,
298
+ unnormalized: !!suffix,
299
+ url,
300
+ originalName,
301
+ isDefine,
302
+ id: (prefix ? prefix + "!" + normalizedName : normalizedName) + suffix
303
+ };
304
+ }
305
+ __name(makeModuleMap, "makeModuleMap");
306
+ function getModule(depMap) {
307
+ var id = depMap.id, mod = getOwn(registry, id);
308
+ if (!mod) {
309
+ mod = registry[id] = new context.Module(depMap);
310
+ }
311
+ return mod;
312
+ }
313
+ __name(getModule, "getModule");
314
+ function on(depMap, name, fn) {
315
+ var id = depMap.id, mod = getOwn(registry, id);
316
+ if (hasProp(defined, id) && (!mod || mod.defineEmitComplete)) {
317
+ if (name === "defined") {
318
+ fn(defined[id]);
319
+ }
320
+ } else {
321
+ mod = getModule(depMap);
322
+ if (mod.error && name === "error") {
323
+ fn(mod.error);
324
+ } else {
325
+ mod.on(name, fn);
326
+ }
327
+ }
328
+ }
329
+ __name(on, "on");
330
+ function onError(err, errback) {
331
+ var ids = err.requireModules, notified = false;
332
+ if (errback) {
333
+ errback(err);
334
+ } else {
335
+ each(ids, function(id) {
336
+ var mod = getOwn(registry, id);
337
+ if (mod) {
338
+ mod.error = err;
339
+ if (mod.events.error) {
340
+ notified = true;
341
+ mod.emit("error", err);
342
+ }
343
+ }
344
+ });
345
+ if (!notified) {
346
+ req.onError(err);
347
+ }
348
+ }
349
+ }
350
+ __name(onError, "onError");
351
+ function takeGlobalQueue() {
352
+ if (globalDefQueue.length) {
353
+ each(globalDefQueue, function(queueItem) {
354
+ var id = queueItem[0];
355
+ if (typeof id === "string") {
356
+ context.defQueueMap[id] = true;
357
+ }
358
+ defQueue.push(queueItem);
359
+ });
360
+ globalDefQueue = [];
361
+ }
362
+ }
363
+ __name(takeGlobalQueue, "takeGlobalQueue");
364
+ handlers = {
365
+ require: /* @__PURE__ */ __name(function(mod) {
366
+ if (mod.require) {
367
+ return mod.require;
368
+ } else {
369
+ return mod.require = context.makeRequire(mod.map);
370
+ }
371
+ }, "require"),
372
+ exports: /* @__PURE__ */ __name(function(mod) {
373
+ mod.usingExports = true;
374
+ if (mod.map.isDefine) {
375
+ if (mod.exports) {
376
+ return defined[mod.map.id] = mod.exports;
377
+ } else {
378
+ return mod.exports = defined[mod.map.id] = {};
379
+ }
380
+ }
381
+ }, "exports"),
382
+ module: /* @__PURE__ */ __name(function(mod) {
383
+ if (mod.module) {
384
+ return mod.module;
385
+ } else {
386
+ return mod.module = {
387
+ id: mod.map.id,
388
+ uri: mod.map.url,
389
+ config: /* @__PURE__ */ __name(function() {
390
+ return getOwn(config.config, mod.map.id) || {};
391
+ }, "config"),
392
+ exports: mod.exports || (mod.exports = {})
393
+ };
394
+ }
395
+ }, "module")
396
+ };
397
+ function cleanRegistry(id) {
398
+ delete registry[id];
399
+ delete enabledRegistry[id];
400
+ }
401
+ __name(cleanRegistry, "cleanRegistry");
402
+ function breakCycle(mod, traced, processed) {
403
+ var id = mod.map.id;
404
+ if (mod.error) {
405
+ mod.emit("error", mod.error);
406
+ } else {
407
+ traced[id] = true;
408
+ each(mod.depMaps, function(depMap, i) {
409
+ var depId = depMap.id, dep = getOwn(registry, depId);
410
+ if (dep && !mod.depMatched[i] && !processed[depId]) {
411
+ if (getOwn(traced, depId)) {
412
+ mod.defineDep(i, defined[depId]);
413
+ mod.check();
414
+ } else {
415
+ breakCycle(dep, traced, processed);
416
+ }
417
+ }
418
+ });
419
+ processed[id] = true;
420
+ }
421
+ }
422
+ __name(breakCycle, "breakCycle");
423
+ function checkLoaded() {
424
+ var err, usingPathFallback, waitInterval = config.waitSeconds * 1e3, expired = waitInterval && context.startTime + waitInterval < (/* @__PURE__ */ new Date()).getTime(), noLoads = [], reqCalls = [], stillLoading = false, needCycleCheck = true;
425
+ if (inCheckLoaded) {
426
+ return;
427
+ }
428
+ inCheckLoaded = true;
429
+ eachProp(enabledRegistry, function(mod) {
430
+ var map = mod.map, modId = map.id;
431
+ if (!mod.enabled) {
432
+ return;
433
+ }
434
+ if (!map.isDefine) {
435
+ reqCalls.push(mod);
436
+ }
437
+ if (!mod.error) {
438
+ if (!mod.inited && expired) {
439
+ if (hasPathFallback(modId)) {
440
+ usingPathFallback = true;
441
+ stillLoading = true;
442
+ } else {
443
+ noLoads.push(modId);
444
+ removeScript(modId);
445
+ }
446
+ } else if (!mod.inited && mod.fetched && map.isDefine) {
447
+ stillLoading = true;
448
+ if (!map.prefix) {
449
+ return needCycleCheck = false;
450
+ }
451
+ }
452
+ }
453
+ });
454
+ if (expired && noLoads.length) {
455
+ err = makeError("timeout", "Load timeout for modules: " + noLoads, null, noLoads);
456
+ err.contextName = context.contextName;
457
+ return onError(err);
458
+ }
459
+ if (needCycleCheck) {
460
+ each(reqCalls, function(mod) {
461
+ breakCycle(mod, {}, {});
462
+ });
463
+ }
464
+ if ((!expired || usingPathFallback) && stillLoading) {
465
+ if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
466
+ checkLoadedTimeoutId = setTimeout(function() {
467
+ checkLoadedTimeoutId = 0;
468
+ checkLoaded();
469
+ }, 50);
470
+ }
471
+ }
472
+ inCheckLoaded = false;
473
+ }
474
+ __name(checkLoaded, "checkLoaded");
475
+ Module = /* @__PURE__ */ __name(function(map) {
476
+ this.events = getOwn(undefEvents, map.id) || {};
477
+ this.map = map;
478
+ this.shim = getOwn(config.shim, map.id);
479
+ this.depExports = [];
480
+ this.depMaps = [];
481
+ this.depMatched = [];
482
+ this.pluginMaps = {};
483
+ this.depCount = 0;
484
+ }, "Module");
485
+ Module.prototype = {
486
+ init: /* @__PURE__ */ __name(function(depMaps, factory, errback, options) {
487
+ options = options || {};
488
+ if (this.inited) {
489
+ return;
490
+ }
491
+ this.factory = factory;
492
+ if (errback) {
493
+ this.on("error", errback);
494
+ } else if (this.events.error) {
495
+ errback = bind(this, function(err) {
496
+ this.emit("error", err);
497
+ });
498
+ }
499
+ this.depMaps = depMaps && depMaps.slice(0);
500
+ this.errback = errback;
501
+ this.inited = true;
502
+ this.ignore = options.ignore;
503
+ if (options.enabled || this.enabled) {
504
+ this.enable();
505
+ } else {
506
+ this.check();
507
+ }
508
+ }, "init"),
509
+ defineDep: /* @__PURE__ */ __name(function(i, depExports) {
510
+ if (!this.depMatched[i]) {
511
+ this.depMatched[i] = true;
512
+ this.depCount -= 1;
513
+ this.depExports[i] = depExports;
514
+ }
515
+ }, "defineDep"),
516
+ fetch: /* @__PURE__ */ __name(function() {
517
+ if (this.fetched) {
518
+ return;
519
+ }
520
+ this.fetched = true;
521
+ context.startTime = (/* @__PURE__ */ new Date()).getTime();
522
+ var map = this.map;
523
+ if (this.shim) {
524
+ context.makeRequire(this.map, {
525
+ enableBuildCallback: true
526
+ })(
527
+ this.shim.deps || [],
528
+ bind(this, function() {
529
+ return map.prefix ? this.callPlugin() : this.load();
530
+ })
531
+ );
532
+ } else {
533
+ return map.prefix ? this.callPlugin() : this.load();
534
+ }
535
+ }, "fetch"),
536
+ load: /* @__PURE__ */ __name(function() {
537
+ var url = this.map.url;
538
+ if (!urlFetched[url]) {
539
+ urlFetched[url] = true;
540
+ context.load(this.map.id, url);
541
+ }
542
+ }, "load"),
543
+ /**
544
+ * Checks if the module is ready to define itself, and if so,
545
+ * define it.
546
+ */
547
+ check: /* @__PURE__ */ __name(function() {
548
+ if (!this.enabled || this.enabling) {
549
+ return;
550
+ }
551
+ var err, cjsModule, id = this.map.id, depExports = this.depExports, exports2 = this.exports, factory = this.factory;
552
+ if (!this.inited) {
553
+ if (!hasProp(context.defQueueMap, id)) {
554
+ this.fetch();
555
+ }
556
+ } else if (this.error) {
557
+ this.emit("error", this.error);
558
+ } else if (!this.defining) {
559
+ this.defining = true;
560
+ if (this.depCount < 1 && !this.defined) {
561
+ if (isFunction(factory)) {
562
+ if (this.events.error && this.map.isDefine || req.onError !== defaultOnError) {
563
+ try {
564
+ exports2 = context.execCb(id, factory, depExports, exports2);
565
+ } catch (e) {
566
+ err = e;
567
+ }
568
+ } else {
569
+ exports2 = context.execCb(id, factory, depExports, exports2);
570
+ }
571
+ if (this.map.isDefine && exports2 === void 0) {
572
+ cjsModule = this.module;
573
+ if (cjsModule) {
574
+ exports2 = cjsModule.exports;
575
+ } else if (this.usingExports) {
576
+ exports2 = this.exports;
577
+ }
578
+ }
579
+ if (err) {
580
+ err.requireMap = this.map;
581
+ err.requireModules = this.map.isDefine ? [this.map.id] : null;
582
+ err.requireType = this.map.isDefine ? "define" : "require";
583
+ return onError(this.error = err);
584
+ }
585
+ } else {
586
+ exports2 = factory;
587
+ }
588
+ this.exports = exports2;
589
+ if (this.map.isDefine && !this.ignore) {
590
+ defined[id] = exports2;
591
+ if (req.onResourceLoad) {
592
+ var resLoadMaps = [];
593
+ each(this.depMaps, function(depMap) {
594
+ resLoadMaps.push(depMap.normalizedMap || depMap);
595
+ });
596
+ req.onResourceLoad(context, this.map, resLoadMaps);
597
+ }
598
+ }
599
+ cleanRegistry(id);
600
+ this.defined = true;
601
+ }
602
+ this.defining = false;
603
+ if (this.defined && !this.defineEmitted) {
604
+ this.defineEmitted = true;
605
+ this.emit("defined", this.exports);
606
+ this.defineEmitComplete = true;
607
+ }
608
+ }
609
+ }, "check"),
610
+ callPlugin: /* @__PURE__ */ __name(function() {
611
+ var map = this.map, id = map.id, pluginMap = makeModuleMap(map.prefix);
612
+ this.depMaps.push(pluginMap);
613
+ on(
614
+ pluginMap,
615
+ "defined",
616
+ bind(this, function(plugin) {
617
+ var load, normalizedMap, normalizedMod, bundleId = getOwn(bundlesMap, this.map.id), name = this.map.name, parentName = this.map.parentMap ? this.map.parentMap.name : null, localRequire = context.makeRequire(map.parentMap, {
618
+ enableBuildCallback: true
619
+ });
620
+ if (this.map.unnormalized) {
621
+ if (plugin.normalize) {
622
+ name = plugin.normalize(name, function(name2) {
623
+ return normalize(name2, parentName, true);
624
+ }) || "";
625
+ }
626
+ normalizedMap = makeModuleMap(map.prefix + "!" + name, this.map.parentMap, true);
627
+ on(
628
+ normalizedMap,
629
+ "defined",
630
+ bind(this, function(value) {
631
+ this.map.normalizedMap = normalizedMap;
632
+ this.init(
633
+ [],
634
+ function() {
635
+ return value;
636
+ },
637
+ null,
638
+ {
639
+ enabled: true,
640
+ ignore: true
641
+ }
642
+ );
643
+ })
644
+ );
645
+ normalizedMod = getOwn(registry, normalizedMap.id);
646
+ if (normalizedMod) {
647
+ this.depMaps.push(normalizedMap);
648
+ if (this.events.error) {
649
+ normalizedMod.on(
650
+ "error",
651
+ bind(this, function(err) {
652
+ this.emit("error", err);
653
+ })
654
+ );
655
+ }
656
+ normalizedMod.enable();
657
+ }
658
+ return;
659
+ }
660
+ if (bundleId) {
661
+ this.map.url = context.nameToUrl(bundleId);
662
+ this.load();
663
+ return;
664
+ }
665
+ load = bind(this, function(value) {
666
+ this.init(
667
+ [],
668
+ function() {
669
+ return value;
670
+ },
671
+ null,
672
+ {
673
+ enabled: true
674
+ }
675
+ );
676
+ });
677
+ load.error = bind(this, function(err) {
678
+ this.inited = true;
679
+ this.error = err;
680
+ err.requireModules = [id];
681
+ eachProp(registry, function(mod) {
682
+ if (mod.map.id.indexOf(id + "_unnormalized") === 0) {
683
+ cleanRegistry(mod.map.id);
684
+ }
685
+ });
686
+ onError(err);
687
+ });
688
+ load.fromText = bind(this, function(text2, textAlt) {
689
+ var moduleName = map.name, moduleMap = makeModuleMap(moduleName), hasInteractive = useInteractive;
690
+ if (textAlt) {
691
+ text2 = textAlt;
692
+ }
693
+ if (hasInteractive) {
694
+ useInteractive = false;
695
+ }
696
+ getModule(moduleMap);
697
+ if (hasProp(config.config, id)) {
698
+ config.config[moduleName] = config.config[id];
699
+ }
700
+ try {
701
+ req.exec(text2);
702
+ } catch (e) {
703
+ return onError(makeError("fromtexteval", "fromText eval for " + id + " failed: " + e, e, [id]));
704
+ }
705
+ if (hasInteractive) {
706
+ useInteractive = true;
707
+ }
708
+ this.depMaps.push(moduleMap);
709
+ context.completeLoad(moduleName);
710
+ localRequire([moduleName], load);
711
+ });
712
+ plugin.load(map.name, localRequire, load, config);
713
+ })
714
+ );
715
+ context.enable(pluginMap, this);
716
+ this.pluginMaps[pluginMap.id] = pluginMap;
717
+ }, "callPlugin"),
718
+ enable: /* @__PURE__ */ __name(function() {
719
+ enabledRegistry[this.map.id] = this;
720
+ this.enabled = true;
721
+ this.enabling = true;
722
+ each(
723
+ this.depMaps,
724
+ bind(this, function(depMap, i) {
725
+ var id, mod, handler;
726
+ if (typeof depMap === "string") {
727
+ depMap = makeModuleMap(depMap, this.map.isDefine ? this.map : this.map.parentMap, false, !this.skipMap);
728
+ this.depMaps[i] = depMap;
729
+ handler = getOwn(handlers, depMap.id);
730
+ if (handler) {
731
+ this.depExports[i] = handler(this);
732
+ return;
733
+ }
734
+ this.depCount += 1;
735
+ on(
736
+ depMap,
737
+ "defined",
738
+ bind(this, function(depExports) {
739
+ if (this.undefed) {
740
+ return;
741
+ }
742
+ this.defineDep(i, depExports);
743
+ this.check();
744
+ })
745
+ );
746
+ if (this.errback) {
747
+ on(depMap, "error", bind(this, this.errback));
748
+ } else if (this.events.error) {
749
+ on(
750
+ depMap,
751
+ "error",
752
+ bind(this, function(err) {
753
+ this.emit("error", err);
754
+ })
755
+ );
756
+ }
757
+ }
758
+ id = depMap.id;
759
+ mod = registry[id];
760
+ if (!hasProp(handlers, id) && mod && !mod.enabled) {
761
+ context.enable(depMap, this);
762
+ }
763
+ })
764
+ );
765
+ eachProp(
766
+ this.pluginMaps,
767
+ bind(this, function(pluginMap) {
768
+ var mod = getOwn(registry, pluginMap.id);
769
+ if (mod && !mod.enabled) {
770
+ context.enable(pluginMap, this);
771
+ }
772
+ })
773
+ );
774
+ this.enabling = false;
775
+ this.check();
776
+ }, "enable"),
777
+ on: /* @__PURE__ */ __name(function(name, cb) {
778
+ var cbs = this.events[name];
779
+ if (!cbs) {
780
+ cbs = this.events[name] = [];
781
+ }
782
+ cbs.push(cb);
783
+ }, "on"),
784
+ emit: /* @__PURE__ */ __name(function(name, evt) {
785
+ each(this.events[name], function(cb) {
786
+ cb(evt);
787
+ });
788
+ if (name === "error") {
789
+ delete this.events[name];
790
+ }
791
+ }, "emit")
792
+ };
793
+ function callGetModule(args) {
794
+ if (!hasProp(defined, args[0])) {
795
+ getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
796
+ }
797
+ }
798
+ __name(callGetModule, "callGetModule");
799
+ function removeListener(node, func, name, ieName) {
800
+ if (node.detachEvent && !isOpera) {
801
+ if (ieName) {
802
+ node.detachEvent(ieName, func);
803
+ }
804
+ } else {
805
+ node.removeEventListener(name, func, false);
806
+ }
807
+ }
808
+ __name(removeListener, "removeListener");
809
+ function getScriptData(evt) {
810
+ var node = evt.currentTarget || evt.srcElement;
811
+ removeListener(node, context.onScriptLoad, "load", "onreadystatechange");
812
+ removeListener(node, context.onScriptError, "error");
813
+ return {
814
+ node,
815
+ id: node && node.getAttribute("data-requiremodule")
816
+ };
817
+ }
818
+ __name(getScriptData, "getScriptData");
819
+ function intakeDefines() {
820
+ var args;
821
+ takeGlobalQueue();
822
+ while (defQueue.length) {
823
+ args = defQueue.shift();
824
+ if (args[0] === null) {
825
+ console.warn(args, "Mismatched anonymous define() module: " + args[args.length - 1]);
826
+ } else {
827
+ callGetModule(args);
828
+ }
829
+ }
830
+ context.defQueueMap = {};
831
+ }
832
+ __name(intakeDefines, "intakeDefines");
833
+ context = {
834
+ config,
835
+ contextName,
836
+ registry,
837
+ defined,
838
+ urlFetched,
839
+ defQueue,
840
+ defQueueMap: {},
841
+ Module,
842
+ makeModuleMap,
843
+ nextTick: req.nextTick,
844
+ onError,
845
+ /**
846
+ * Set a configuration for the context.
847
+ * @param {Object} cfg config object to integrate.
848
+ */
849
+ configure: /* @__PURE__ */ __name(function(cfg2) {
850
+ if (cfg2.baseUrl) {
851
+ if (cfg2.baseUrl.charAt(cfg2.baseUrl.length - 1) !== "/") {
852
+ cfg2.baseUrl += "/";
853
+ }
854
+ }
855
+ if (typeof cfg2.urlArgs === "string") {
856
+ var urlArgs = cfg2.urlArgs;
857
+ cfg2.urlArgs = function(id, url) {
858
+ return (url.indexOf("?") === -1 ? "?" : "&") + urlArgs;
859
+ };
860
+ }
861
+ var shim = config.shim, objs = {
862
+ paths: true,
863
+ bundles: true,
864
+ config: true,
865
+ map: true
866
+ };
867
+ eachProp(cfg2, function(value, prop) {
868
+ if (objs[prop]) {
869
+ if (!config[prop]) {
870
+ config[prop] = {};
871
+ }
872
+ mixin(config[prop], value, true, true);
873
+ } else {
874
+ config[prop] = value;
875
+ }
876
+ });
877
+ if (cfg2.bundles) {
878
+ eachProp(cfg2.bundles, function(value, prop) {
879
+ each(value, function(v) {
880
+ if (v !== prop) {
881
+ bundlesMap[v] = prop;
882
+ }
883
+ });
884
+ });
885
+ }
886
+ if (cfg2.shim) {
887
+ eachProp(cfg2.shim, function(value, id) {
888
+ if (isArray(value)) {
889
+ value = {
890
+ deps: value
891
+ };
892
+ }
893
+ if ((value.exports || value.init) && !value.exportsFn) {
894
+ value.exportsFn = context.makeShimExports(value);
895
+ }
896
+ shim[id] = value;
897
+ });
898
+ config.shim = shim;
899
+ }
900
+ if (cfg2.packages) {
901
+ each(cfg2.packages, function(pkgObj) {
902
+ var location, name;
903
+ pkgObj = typeof pkgObj === "string" ? { name: pkgObj } : pkgObj;
904
+ name = pkgObj.name;
905
+ location = pkgObj.location;
906
+ if (location) {
907
+ config.paths[name] = pkgObj.location;
908
+ }
909
+ config.pkgs[name] = pkgObj.name + "/" + (pkgObj.main || "main").replace(currDirRegExp, "").replace(jsSuffixRegExp, "");
910
+ });
911
+ }
912
+ eachProp(registry, function(mod, id) {
913
+ if (!mod.inited && !mod.map.unnormalized) {
914
+ mod.map = makeModuleMap(id, null, true);
915
+ }
916
+ });
917
+ if (cfg2.deps || cfg2.callback) {
918
+ context.require(cfg2.deps || [], cfg2.callback);
919
+ }
920
+ }, "configure"),
921
+ makeShimExports: /* @__PURE__ */ __name(function(value) {
922
+ function fn() {
923
+ var ret;
924
+ if (value.init) {
925
+ ret = value.init.apply(global, arguments);
926
+ }
927
+ return ret || value.exports && getGlobal(value.exports);
928
+ }
929
+ __name(fn, "fn");
930
+ return fn;
931
+ }, "makeShimExports"),
932
+ makeRequire: /* @__PURE__ */ __name(function(relMap, options) {
933
+ options = options || {};
934
+ function localRequire(deps, callback, errback) {
935
+ var id, map, requireMod;
936
+ if (options.enableBuildCallback && callback && isFunction(callback)) {
937
+ callback.__requireJsBuild = true;
938
+ }
939
+ if (typeof deps === "string") {
940
+ if (isFunction(callback)) {
941
+ return onError(makeError("requireargs", "Invalid require call"), errback);
942
+ }
943
+ if (relMap && hasProp(handlers, deps)) {
944
+ return handlers[deps](registry[relMap.id]);
945
+ }
946
+ if (req.get) {
947
+ return req.get(context, deps, relMap, localRequire);
948
+ }
949
+ map = makeModuleMap(deps, relMap, false, true);
950
+ id = map.id;
951
+ if (!hasProp(defined, id)) {
952
+ return onError(
953
+ makeError(
954
+ "notloaded",
955
+ 'Module name "' + id + '" has not been loaded yet for context: ' + contextName + (relMap ? "" : ". Use require([])")
956
+ )
957
+ );
958
+ }
959
+ return defined[id];
960
+ }
961
+ intakeDefines();
962
+ context.nextTick(function() {
963
+ intakeDefines();
964
+ requireMod = getModule(makeModuleMap(null, relMap));
965
+ requireMod.skipMap = options.skipMap;
966
+ requireMod.init(deps, callback, errback, {
967
+ enabled: true
968
+ });
969
+ checkLoaded();
970
+ });
971
+ return localRequire;
972
+ }
973
+ __name(localRequire, "localRequire");
974
+ mixin(localRequire, {
975
+ isBrowser,
976
+ /**
977
+ * Converts a module name + .extension into an URL path.
978
+ * *Requires* the use of a module name. It does not support using
979
+ * plain URLs like nameToUrl.
980
+ */
981
+ toUrl: /* @__PURE__ */ __name(function(moduleNamePlusExt) {
982
+ var ext, index = moduleNamePlusExt.lastIndexOf("."), segment = moduleNamePlusExt.split("/")[0], isRelative = segment === "." || segment === "..";
983
+ if (index !== -1 && (!isRelative || index > 1)) {
984
+ ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
985
+ moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
986
+ }
987
+ return context.nameToUrl(normalize(moduleNamePlusExt, relMap && relMap.id, true), ext, true);
988
+ }, "toUrl"),
989
+ defined: /* @__PURE__ */ __name(function(id) {
990
+ return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
991
+ }, "defined"),
992
+ specified: /* @__PURE__ */ __name(function(id) {
993
+ id = makeModuleMap(id, relMap, false, true).id;
994
+ return hasProp(defined, id) || hasProp(registry, id);
995
+ }, "specified")
996
+ });
997
+ if (!relMap) {
998
+ localRequire.undef = function(id) {
999
+ takeGlobalQueue();
1000
+ var map = makeModuleMap(id, relMap, true), mod = getOwn(registry, id);
1001
+ mod.undefed = true;
1002
+ removeScript(id);
1003
+ delete defined[id];
1004
+ delete urlFetched[map.url];
1005
+ delete undefEvents[id];
1006
+ eachReverse(defQueue, function(args, i) {
1007
+ if (args[0] === id) {
1008
+ defQueue.splice(i, 1);
1009
+ }
1010
+ });
1011
+ delete context.defQueueMap[id];
1012
+ if (mod) {
1013
+ if (mod.events.defined) {
1014
+ undefEvents[id] = mod.events;
1015
+ }
1016
+ cleanRegistry(id);
1017
+ }
1018
+ };
1019
+ }
1020
+ return localRequire;
1021
+ }, "makeRequire"),
1022
+ /**
1023
+ * Called to enable a module if it is still in the registry
1024
+ * awaiting enablement. A second arg, parent, the parent module,
1025
+ * is passed in for context, when this method is overridden by
1026
+ * the optimizer. Not shown here to keep code compact.
1027
+ */
1028
+ enable: /* @__PURE__ */ __name(function(depMap) {
1029
+ var mod = getOwn(registry, depMap.id);
1030
+ if (mod) {
1031
+ getModule(depMap).enable();
1032
+ }
1033
+ }, "enable"),
1034
+ /**
1035
+ * Internal method used by environment adapters to complete a load event.
1036
+ * A load event could be a script load or just a load pass from a synchronous
1037
+ * load call.
1038
+ * @param {String} moduleName the name of the module to potentially complete.
1039
+ */
1040
+ completeLoad: /* @__PURE__ */ __name(function(moduleName) {
1041
+ var found, args, mod, shim = getOwn(config.shim, moduleName) || {}, shExports = shim.exports;
1042
+ takeGlobalQueue();
1043
+ while (defQueue.length) {
1044
+ args = defQueue.shift();
1045
+ if (args[0] === null) {
1046
+ args[0] = moduleName;
1047
+ if (found) {
1048
+ break;
1049
+ }
1050
+ found = true;
1051
+ } else if (args[0] === moduleName) {
1052
+ found = true;
1053
+ }
1054
+ callGetModule(args);
1055
+ }
1056
+ context.defQueueMap = {};
1057
+ mod = getOwn(registry, moduleName);
1058
+ if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
1059
+ if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
1060
+ if (hasPathFallback(moduleName)) {
1061
+ return;
1062
+ } else {
1063
+ return onError(makeError("nodefine", "No define call for " + moduleName, null, [moduleName]));
1064
+ }
1065
+ } else {
1066
+ callGetModule([moduleName, shim.deps || [], shim.exportsFn]);
1067
+ }
1068
+ }
1069
+ checkLoaded();
1070
+ }, "completeLoad"),
1071
+ /**
1072
+ * Converts a module name to a file path. Supports cases where
1073
+ * moduleName may actually be just an URL.
1074
+ * Note that it **does not** call normalize on the moduleName,
1075
+ * it is assumed to have already been normalized. This is an
1076
+ * internal API, not a public one. Use toUrl for the public API.
1077
+ */
1078
+ nameToUrl: /* @__PURE__ */ __name(function(moduleName, ext, skipExt) {
1079
+ var paths, syms, i, parentModule, url, parentPath, bundleId, pkgMain = getOwn(config.pkgs, moduleName);
1080
+ if (pkgMain) {
1081
+ moduleName = pkgMain;
1082
+ }
1083
+ bundleId = getOwn(bundlesMap, moduleName);
1084
+ if (bundleId) {
1085
+ return context.nameToUrl(bundleId, ext, skipExt);
1086
+ }
1087
+ if (req.jsExtRegExp.test(moduleName)) {
1088
+ url = moduleName + (ext || "");
1089
+ } else {
1090
+ paths = config.paths;
1091
+ syms = moduleName.split("/");
1092
+ for (i = syms.length; i > 0; i -= 1) {
1093
+ parentModule = syms.slice(0, i).join("/");
1094
+ parentPath = getOwn(paths, parentModule);
1095
+ if (parentPath) {
1096
+ if (isArray(parentPath)) {
1097
+ parentPath = parentPath[0];
1098
+ }
1099
+ syms.splice(0, i, parentPath);
1100
+ break;
1101
+ }
1102
+ }
1103
+ url = syms.join("/");
1104
+ url += ext || (/^data\:|^blob\:|\?/.test(url) || skipExt ? "" : ".js");
1105
+ url = (url.charAt(0) === "/" || url.match(/^[\w\+\.\-]+:/) ? "" : config.baseUrl) + url;
1106
+ }
1107
+ return config.urlArgs && !/^blob\:/.test(url) ? url + config.urlArgs(moduleName, url) : url;
1108
+ }, "nameToUrl"),
1109
+ //Delegates to req.load. Broken out as a separate function to
1110
+ //allow overriding in the optimizer.
1111
+ load: /* @__PURE__ */ __name(function(id, url) {
1112
+ req.load(context, id, url);
1113
+ }, "load"),
1114
+ /**
1115
+ * Executes a module callback function. Broken out as a separate function
1116
+ * solely to allow the build system to sequence the files in the built
1117
+ * layer in the right sequence.
1118
+ *
1119
+ * @private
1120
+ */
1121
+ execCb: /* @__PURE__ */ __name(function(name, callback, args, exports2) {
1122
+ return callback.apply(exports2, args);
1123
+ }, "execCb"),
1124
+ /**
1125
+ * callback for script loads, used to check status of loading.
1126
+ *
1127
+ * @param {Event} evt the event from the browser for the script
1128
+ * that was loaded.
1129
+ */
1130
+ onScriptLoad: /* @__PURE__ */ __name(function(evt) {
1131
+ if (evt.type === "load" || readyRegExp.test((evt.currentTarget || evt.srcElement).readyState)) {
1132
+ interactiveScript = null;
1133
+ var data = getScriptData(evt);
1134
+ context.completeLoad(data.id);
1135
+ }
1136
+ }, "onScriptLoad"),
1137
+ /**
1138
+ * Callback for script errors.
1139
+ */
1140
+ onScriptError: /* @__PURE__ */ __name(function(evt) {
1141
+ var data = getScriptData(evt);
1142
+ if (!hasPathFallback(data.id)) {
1143
+ var parents = [];
1144
+ eachProp(registry, function(value, key) {
1145
+ if (key.indexOf("_@r") !== 0) {
1146
+ each(value.depMaps, function(depMap) {
1147
+ if (depMap.id === data.id) {
1148
+ parents.push(key);
1149
+ return true;
1150
+ }
1151
+ });
1152
+ }
1153
+ });
1154
+ return onError(
1155
+ makeError(
1156
+ "scripterror",
1157
+ 'Script error for "' + data.id + (parents.length ? '", needed by: ' + parents.join(", ") : '"'),
1158
+ evt,
1159
+ [data.id]
1160
+ )
1161
+ );
1162
+ }
1163
+ }, "onScriptError")
1164
+ };
1165
+ context.require = context.makeRequire();
1166
+ return context;
1167
+ }
1168
+ __name(newContext, "newContext");
1169
+ req = requirejs = /* @__PURE__ */ __name(function(deps, callback, errback, optional) {
1170
+ var context, config, contextName = defContextName;
1171
+ if (!isArray(deps) && typeof deps !== "string") {
1172
+ config = deps;
1173
+ if (isArray(callback)) {
1174
+ deps = callback;
1175
+ callback = errback;
1176
+ errback = optional;
1177
+ } else {
1178
+ deps = [];
1179
+ }
1180
+ }
1181
+ if (config && config.context) {
1182
+ contextName = config.context;
1183
+ }
1184
+ context = getOwn(contexts, contextName);
1185
+ if (!context) {
1186
+ context = contexts[contextName] = req.s.newContext(contextName);
1187
+ }
1188
+ if (config) {
1189
+ context.configure(config);
1190
+ }
1191
+ return context.require(deps, callback, errback);
1192
+ }, "requirejs");
1193
+ req.config = function(config) {
1194
+ return req(config);
1195
+ };
1196
+ req.nextTick = typeof setTimeout !== "undefined" ? function(fn) {
1197
+ setTimeout(fn, 4);
1198
+ } : function(fn) {
1199
+ fn();
1200
+ };
1201
+ if (!require) {
1202
+ require = req;
1203
+ }
1204
+ req.version = version;
1205
+ req.jsExtRegExp = /^\/|:|\?|\.js$/;
1206
+ req.isBrowser = isBrowser;
1207
+ s = req.s = {
1208
+ contexts,
1209
+ newContext
1210
+ };
1211
+ req({});
1212
+ each(["toUrl", "undef", "defined", "specified"], function(prop) {
1213
+ req[prop] = function() {
1214
+ var ctx = contexts[defContextName];
1215
+ return ctx.require[prop].apply(ctx, arguments);
1216
+ };
1217
+ });
1218
+ if (isBrowser) {
1219
+ head = s.head = document.getElementsByTagName("head")[0];
1220
+ baseElement = document.getElementsByTagName("base")[0];
1221
+ if (baseElement) {
1222
+ head = s.head = baseElement.parentNode;
1223
+ }
1224
+ }
1225
+ req.onError = defaultOnError;
1226
+ req.createNode = function(config, moduleName, url) {
1227
+ var node = config.xhtml ? document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") : document.createElement("script");
1228
+ node.type = config.scriptType || "text/javascript";
1229
+ node.charset = "utf-8";
1230
+ node.async = true;
1231
+ return node;
1232
+ };
1233
+ req.load = function(context, moduleName, url) {
1234
+ var config = context && context.config || {}, node;
1235
+ if (isBrowser) {
1236
+ node = req.createNode(config, moduleName, url);
1237
+ node.setAttribute("data-requirecontext", context.contextName);
1238
+ node.setAttribute("data-requiremodule", moduleName);
1239
+ if (node.attachEvent && //Check if node.attachEvent is artificially added by custom script or
1240
+ //natively supported by browser
1241
+ //read https://github.com/requirejs/requirejs/issues/187
1242
+ //if we can NOT find [native code] then it must NOT natively supported.
1243
+ //in IE8, node.attachEvent does not have toString()
1244
+ //Note the test for "[native code" with no closing brace, see:
1245
+ //https://github.com/requirejs/requirejs/issues/273
1246
+ !(node.attachEvent.toString && node.attachEvent.toString().indexOf("[native code") < 0) && !isOpera) {
1247
+ useInteractive = true;
1248
+ node.attachEvent("onreadystatechange", context.onScriptLoad);
1249
+ } else {
1250
+ node.addEventListener("load", context.onScriptLoad, false);
1251
+ node.addEventListener("error", context.onScriptError, false);
1252
+ }
1253
+ node.src = url;
1254
+ if (config.onNodeCreated) {
1255
+ config.onNodeCreated(node, config, moduleName, url);
1256
+ }
1257
+ currentlyAddingScript = node;
1258
+ if (baseElement) {
1259
+ head.insertBefore(node, baseElement);
1260
+ } else {
1261
+ head.appendChild(node);
1262
+ }
1263
+ currentlyAddingScript = null;
1264
+ return node;
1265
+ } else if (isWebWorker) {
1266
+ try {
1267
+ setTimeout(function() {
1268
+ }, 0);
1269
+ importScripts(url);
1270
+ context.completeLoad(moduleName);
1271
+ } catch (e) {
1272
+ context.onError(
1273
+ makeError("importscripts", "importScripts failed for " + moduleName + " at " + url, e, [moduleName])
1274
+ );
1275
+ }
1276
+ }
1277
+ };
1278
+ function getInteractiveScript() {
1279
+ if (interactiveScript && interactiveScript.readyState === "interactive") {
1280
+ return interactiveScript;
1281
+ }
1282
+ eachReverse(scripts(), function(script) {
1283
+ if (script.readyState === "interactive") {
1284
+ return interactiveScript = script;
1285
+ }
1286
+ });
1287
+ return interactiveScript;
1288
+ }
1289
+ __name(getInteractiveScript, "getInteractiveScript");
1290
+ if (isBrowser && !cfg.skipDataMain) {
1291
+ eachReverse(scripts(), function(script) {
1292
+ if (!head) {
1293
+ head = script.parentNode;
1294
+ }
1295
+ dataMain = script.getAttribute("data-main");
1296
+ if (dataMain) {
1297
+ mainScript = dataMain;
1298
+ if (!cfg.baseUrl && mainScript.indexOf("!") === -1) {
1299
+ src = mainScript.split("/");
1300
+ mainScript = src.pop();
1301
+ subPath = src.length ? src.join("/") + "/" : "./";
1302
+ cfg.baseUrl = subPath;
1303
+ }
1304
+ mainScript = mainScript.replace(jsSuffixRegExp, "");
1305
+ if (req.jsExtRegExp.test(mainScript)) {
1306
+ mainScript = dataMain;
1307
+ }
1308
+ cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];
1309
+ return true;
1310
+ }
1311
+ });
1312
+ }
1313
+ define = /* @__PURE__ */ __name(function(name, deps, callback) {
1314
+ var node, context;
1315
+ if (typeof name !== "string") {
1316
+ callback = deps;
1317
+ deps = name;
1318
+ name = null;
1319
+ }
1320
+ if (!isArray(deps)) {
1321
+ callback = deps;
1322
+ deps = null;
1323
+ }
1324
+ if (!deps && isFunction(callback)) {
1325
+ deps = [];
1326
+ if (callback.length) {
1327
+ callback.toString().replace(commentRegExp, commentReplace).replace(cjsRequireRegExp, function(match, dep) {
1328
+ deps.push(dep);
1329
+ });
1330
+ deps = (callback.length === 1 ? ["require"] : ["require", "exports", "module"]).concat(deps);
1331
+ }
1332
+ }
1333
+ if (useInteractive) {
1334
+ node = currentlyAddingScript || getInteractiveScript();
1335
+ if (node) {
1336
+ if (!name) {
1337
+ name = node.getAttribute("data-requiremodule");
1338
+ }
1339
+ context = contexts[node.getAttribute("data-requirecontext")];
1340
+ }
1341
+ }
1342
+ if (context) {
1343
+ context.defQueue.push([name, deps, callback]);
1344
+ context.defQueueMap[name] = true;
1345
+ } else {
1346
+ globalDefQueue.push([name, deps, callback]);
1347
+ }
1348
+ }, "define");
1349
+ define.amd = {
1350
+ jQuery: true
1351
+ };
1352
+ req.exec = function(text) {
1353
+ return eval(text);
1354
+ };
1355
+ req(cfg);
1356
+ return {
1357
+ requirejs,
1358
+ require,
1359
+ define
1360
+ };
1361
+ }
1362
+ __name(getRequireJs, "getRequireJs");
1363
+ // Annotate the CommonJS export names for ESM import in node:
1364
+ 0 && (module.exports = {
1365
+ getRequireJs
1366
+ });