@arcgis/lumina 4.33.0-next.124 → 4.33.0-next.126

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.
@@ -1,50 +1,23 @@
1
1
  import { isEsriInternalEnv, safeCall, Deferred, safeAsyncCall } from "@arcgis/components-utils";
2
2
  import { nothing } from "lit";
3
3
  const controllerSymbol = Symbol.for("controller");
4
- const name = "@arcgis/lumina";
4
+ const queueMicroTask = queueMicrotask;
5
5
  const isController = (value) => typeof value === "object" && value !== null && (controllerSymbol in value || "hostConnected" in value || "hostDisconnected" in value || "hostUpdate" in value || "hostUpdated" in value);
6
- const devOnlySetPersistentControllerData = process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? (controller, data) => {
7
- const controllers = controller.component._controllers;
8
- const index = Array.from(controllers).indexOf(controller);
9
- if (index === -1) {
10
- return;
11
- }
12
- const devOnlyControllerData = Symbol.for(`${name}: devOnlyControllerData`);
13
- const el = controller.component.el;
14
- el[devOnlyControllerData] ??= {};
15
- el[devOnlyControllerData][index] = data;
16
- } : void 0;
17
- const devOnlyGetPersistentControllerData = process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? (controller) => {
18
- const manager = controller.component.manager;
19
- const controllers = "_controllers" in manager ? manager._controllers : void 0;
20
- if (controllers === void 0) {
21
- return void 0;
22
- }
23
- const index = Array.from(controllers).indexOf(controller);
24
- const devOnlyControllerData = Symbol.for(`${name}: devOnlyControllerData`);
25
- const el = controller.component.el;
26
- return el[devOnlyControllerData]?.[index];
27
- } : void 0;
28
- function isPromise(arg) {
29
- return typeof arg?.then === "function";
30
- }
6
+ const isPromise = (arg) => typeof arg?.then === "function";
7
+ const getControllersCount = (component) => component.M.length;
31
8
  let ambientComponent;
32
- function setAmbientComponent(component) {
9
+ const setAmbientComponent = (component) => {
33
10
  if (ambientComponent === component) {
34
11
  return;
35
12
  }
36
13
  ambientComponent = component;
37
- queueMicrotask(() => {
38
- if (ambientComponent === component) {
39
- ambientComponent = void 0;
40
- }
41
- });
42
- }
43
- function retrieveComponent(name2) {
14
+ queueMicroTask(() => ambientComponent === component ? ambientComponent = void 0 : 0);
15
+ };
16
+ const retrieveComponent = (name) => {
44
17
  if (process.env.NODE_ENV !== "production" && ambientComponent === void 0) {
45
18
  throw new Error(
46
19
  [
47
- `Unable to find out which component ${name2 || "this"} controller `,
20
+ `Unable to find out which component ${name || "this"} controller `,
48
21
  "belongs to. Possible causes:\n",
49
22
  "- You might have multiple versions of ",
50
23
  "@arcgis/lumina package installed\n",
@@ -63,39 +36,31 @@ function retrieveComponent(name2) {
63
36
  );
64
37
  }
65
38
  return ambientComponent;
66
- }
39
+ };
67
40
  let ambientControllers = [];
68
- function setParentController(controller) {
41
+ const setParentController = (controller) => {
69
42
  if (controller === void 0) {
70
43
  ambientControllers = [];
71
44
  return;
72
45
  }
73
46
  const index = ambientControllers.indexOf(controller);
74
47
  ambientControllers = index === -1 ? [...ambientControllers, controller] : ambientControllers.slice(0, index + 1);
75
- queueMicrotask(() => {
76
- ambientControllers = [];
77
- });
78
- }
79
- function retrieveParentControllers() {
80
- return ambientControllers;
81
- }
48
+ queueMicroTask(() => ambientControllers = []);
49
+ };
50
+ const retrieveParentControllers = () => ambientControllers;
82
51
  let ambientChildController;
83
- function setAmbientChildController(controller) {
52
+ const setAmbientChildController = (controller) => {
84
53
  if (ambientChildController === controller) {
85
54
  return;
86
55
  }
87
56
  ambientChildController = controller;
88
- queueMicrotask(() => {
89
- if (ambientChildController === controller) {
90
- ambientChildController = void 0;
91
- }
92
- });
93
- }
94
- function retrieveAmbientChildController() {
57
+ queueMicroTask(() => ambientChildController === controller ? ambientChildController = void 0 : 0);
58
+ };
59
+ const retrieveAmbientChildController = () => {
95
60
  const controller = ambientChildController;
96
61
  ambientChildController = void 0;
97
62
  return controller;
98
- }
63
+ };
99
64
  const use = async (value, watchExports) => {
100
65
  const controller = useRefSync(value);
101
66
  if (controller === void 0) {
@@ -129,7 +94,7 @@ const useRef = async (value) => {
129
94
  };
130
95
  const useRefSync = (value) => {
131
96
  const component = retrieveComponent();
132
- const controller = component.manager._resolveExports(value);
97
+ const controller = component.manager.X(value);
133
98
  if (controller !== void 0) {
134
99
  return controller;
135
100
  }
@@ -142,30 +107,21 @@ const useRefSync = (value) => {
142
107
  }
143
108
  return void 0;
144
109
  };
145
- let shouldBypassGetter = false;
146
110
  let shouldBypassReadOnly = false;
147
- function bypassReadOnly(callback) {
111
+ const bypassReadOnly = (callback) => {
148
112
  shouldBypassReadOnly = true;
149
113
  try {
150
114
  return callback();
151
115
  } finally {
152
116
  shouldBypassReadOnly = false;
153
117
  }
154
- }
118
+ };
155
119
  const bypassSetter = bypassReadOnly;
156
- function bypassGetter(callback) {
157
- shouldBypassGetter = true;
158
- try {
159
- return callback();
160
- } finally {
161
- shouldBypassGetter = false;
162
- }
163
- }
164
- function trackPropertyKey(object, onResolved, defaultValue) {
120
+ const trackPropertyKey = (object, onResolved, defaultValue) => {
165
121
  const keys = Object.keys(object);
166
122
  const keyCount = keys.length;
167
123
  if (keyTrackMap === void 0) {
168
- queueMicrotask(keyTrackResolve);
124
+ queueMicroTask(keyTrackResolve);
169
125
  }
170
126
  keyTrackMap ??= /* @__PURE__ */ new Map();
171
127
  let pendingTrackers = keyTrackMap.get(object);
@@ -190,31 +146,31 @@ function trackPropertyKey(object, onResolved, defaultValue) {
190
146
  }
191
147
  });
192
148
  return defaultValue;
193
- }
149
+ };
194
150
  let keyTrackMap = void 0;
195
- function keyTrackResolve() {
151
+ const keyTrackResolve = () => {
196
152
  keyTrackMap?.forEach(({ callbacks }, object) => {
197
153
  const keys = Object.keys(object);
198
154
  callbacks.forEach((commit) => commit(keys));
199
155
  });
200
156
  keyTrackMap = void 0;
201
- }
202
- function trackPropKey(component, onResolved, defaultValue) {
157
+ };
158
+ const trackPropKey = (component, onResolved, defaultValue) => {
203
159
  const manager = component.manager;
204
- if (manager._trackedValue !== nothing && manager._trackedValue !== defaultValue) {
205
- manager._firePropTrackers(void 0, void 0);
160
+ if (manager.V !== nothing && manager.V !== defaultValue) {
161
+ manager.S(void 0, void 0);
206
162
  }
207
- if (manager._keyTrackers.length === 0) {
208
- queueMicrotask(() => manager._firePropTrackers(void 0, void 0));
163
+ if (manager.T.length === 0) {
164
+ queueMicroTask(() => manager.S(void 0, void 0));
209
165
  }
210
- manager._trackedValue = defaultValue;
211
- manager._keyTrackers.push((key, value) => safeCall(onResolved, void 0, defaultValue === value ? key : void 0));
166
+ manager.V = defaultValue;
167
+ manager.T.push((key, value) => safeCall(onResolved, void 0, defaultValue === value ? key : void 0));
212
168
  return defaultValue;
213
- }
214
- function trackKey(hostsCandidates = [
169
+ };
170
+ const trackKey = (hostsCandidates = [
215
171
  retrieveComponent(),
216
172
  ...retrieveParentControllers()
217
- ], onResolved, defaultValue) {
173
+ ], onResolved, defaultValue) => {
218
174
  const candidateHosts = Array.isArray(hostsCandidates) ? hostsCandidates : [hostsCandidates];
219
175
  let leftToResolve = candidateHosts.length + 1;
220
176
  const resolved = (resolution) => {
@@ -234,7 +190,7 @@ function trackKey(hostsCandidates = [
234
190
  )
235
191
  );
236
192
  for (const host of candidateHosts) {
237
- if ("manager" in host && typeof host.manager === "object" && host.manager.component === host) {
193
+ if ("manager" in host && host.manager.component === host) {
238
194
  trackPropKey(
239
195
  host,
240
196
  (key) => resolved(key === void 0 ? void 0 : { key, host, isReactive: true }),
@@ -244,7 +200,7 @@ function trackKey(hostsCandidates = [
244
200
  }
245
201
  }
246
202
  return defaultValue;
247
- }
203
+ };
248
204
  const createEventFactory = (eventName = "", options = {}, component = retrieveComponent()) => {
249
205
  const emitter = {
250
206
  emit: (payload) => {
@@ -271,12 +227,12 @@ const createEventFactory = (eventName = "", options = {}, component = retrieveCo
271
227
  if (eventName === "") {
272
228
  trackKey(
273
229
  void 0,
274
- (resolution) => {
275
- if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && resolution === void 0) {
230
+ process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? (resolution) => {
231
+ if (resolution === void 0) {
276
232
  throw new Error(`createEvent must be called in property default value only`);
277
233
  }
278
234
  eventName = resolution.key;
279
- },
235
+ } : (resolution) => eventName = resolution.key,
280
236
  emitter
281
237
  );
282
238
  }
@@ -287,26 +243,26 @@ var _a;
287
243
  _a = controllerSymbol;
288
244
  class Controller {
289
245
  constructor(component) {
290
- this._callbacks = {
291
- hostConnected: [],
292
- hostDisconnected: [],
293
- hostLoad: [],
294
- hostLoaded: [],
295
- hostUpdate: [],
296
- hostUpdated: [],
297
- hostDestroy: [],
298
- hostLifecycle: []
299
- };
300
- this._ready = new Deferred();
301
- this._lifecycleCleanups = [];
246
+ this.#hostConnected = [];
247
+ this.#hostDisconnected = [];
248
+ this.#hostLoad = [];
249
+ this.#hostLoaded = [];
250
+ this.#hostUpdate = [];
251
+ this.#hostUpdated = [];
252
+ this.#hostDestroy = [];
253
+ this.#hostLifecycle = [];
254
+ this.#lifecycleCleanups = [];
255
+ this.#loadCalled = false;
256
+ this.P = new Deferred();
302
257
  this.connectedCalled = false;
303
- this._loadCalled = false;
304
258
  this.loadedCalled = false;
305
259
  this[_a] = true;
306
- this.ready = this._ready.promise;
307
- this._exports = makeProvisionalValue(this);
308
- this._exportWatchers = /* @__PURE__ */ new Set();
260
+ this.#exportWatchers = [];
261
+ const that = this;
309
262
  const resolvedComponent = component ?? retrieveComponent(new.target.name);
263
+ that.#component = resolvedComponent;
264
+ that.ready = that.P.promise;
265
+ that.#exports = makeProvisionalValue(that);
310
266
  if (process.env.NODE_ENV !== "production") {
311
267
  Object.defineProperty(this, "component", {
312
268
  writable: false,
@@ -315,43 +271,54 @@ class Controller {
315
271
  value: resolvedComponent
316
272
  });
317
273
  if ("hostDestroy" in this) {
318
- this.component.manager._ensureHasDestroy?.();
274
+ that.#component.manager.devOnly$ensureHasDestroy?.();
319
275
  }
320
276
  } else {
321
- this.component = resolvedComponent;
277
+ that.component = resolvedComponent;
322
278
  }
323
- this.component.addController(this);
324
- const manager = this.component.manager;
279
+ that.#component.addController(that);
280
+ const manager = that.#component.manager;
325
281
  const isInControllerManager = manager === void 0;
326
282
  if (!isInControllerManager) {
327
- setParentController(this);
328
- queueMicrotask(() => this.catchUpLifecycle());
283
+ setParentController(that);
284
+ queueMicroTask(() => that.catchUpLifecycle());
329
285
  }
330
286
  }
287
+ #hostConnected;
288
+ #hostDisconnected;
289
+ #hostLoad;
290
+ #hostLoaded;
291
+ #hostUpdate;
292
+ #hostUpdated;
293
+ #hostDestroy;
294
+ #hostLifecycle;
295
+ #lifecycleCleanups;
296
+ #loadCalled;
297
+ #component;
331
298
  /**
332
299
  * If controller is being added dynamically, after the component
333
300
  * construction, then trigger connected and load right away
334
301
  */
335
302
  catchUpLifecycle() {
336
- const { manager } = this.component;
303
+ const { manager } = this.#component;
337
304
  const connectedWillStillHappen = !manager.connectedCalled;
338
305
  if (!connectedWillStillHappen && !this.connectedCalled) {
339
306
  this.triggerConnected();
340
307
  }
341
- const loadWillStillHappen = !manager._loadCalled;
308
+ const loadWillStillHappen = !manager.#loadCalled;
342
309
  if (loadWillStillHappen) {
343
310
  return;
344
311
  }
345
- this.triggerLoad().then(() => {
346
- const loadedWillStillHappen = !manager.loadedCalled;
347
- if (loadedWillStillHappen) {
348
- return;
349
- }
350
- this.triggerLoaded();
351
- }).catch(console.error);
352
- }
312
+ this.triggerLoad().then(
313
+ () => (
314
+ // Call loaded ourself, unless manager is going to do it
315
+ manager.loadedCalled && this.triggerLoaded()
316
+ )
317
+ ).catch(console.error);
318
+ }
319
+ #exports;
353
320
  get exports() {
354
- return this._exports;
321
+ return this.#exports;
355
322
  }
356
323
  /**
357
324
  * Set controller's exports property (for usage with proxyExports()) and mark
@@ -359,24 +326,25 @@ class Controller {
359
326
  * re-render of the component
360
327
  */
361
328
  set exports(exports) {
362
- const oldExports = this._exports;
329
+ const oldExports = this.#exports;
363
330
  if (oldExports !== exports) {
364
- this._exports = exports;
365
- this._exportWatchers.forEach(safeCall);
366
- if (this.connectedCalled && this.assignedProperty !== false) {
367
- this.component.requestUpdate(this.assignedProperty, oldExports);
331
+ this.#exports = exports;
332
+ this.#exportWatchers.forEach(safeCall);
333
+ if (this.connectedCalled && this.O !== false) {
334
+ this.#component.requestUpdate(this.O, oldExports);
368
335
  }
369
336
  }
370
- this._ready.resolve(exports);
337
+ this.P.resolve(exports);
371
338
  }
372
339
  setProvisionalExports(exports, proxy = true) {
373
- this._exports = proxy ? makeProvisionalValue(exports) : exports;
374
- this._exportWatchers.forEach(safeCall);
340
+ this.#exports = proxy ? makeProvisionalValue(exports) : exports;
341
+ this.#exportWatchers.forEach(safeCall);
375
342
  }
343
+ #exportWatchers;
376
344
  watchExports(callback) {
377
- const safeCallback = () => callback(this._exports);
378
- this._exportWatchers.add(safeCallback);
379
- return () => void this._exportWatchers.delete(safeCallback);
345
+ const safeCallback = () => callback(this.#exports);
346
+ this.#exportWatchers.push(safeCallback);
347
+ return () => void this.#exportWatchers.splice(this.#exportWatchers.indexOf(safeCallback), 1);
380
348
  }
381
349
  /**
382
350
  * A flexible utility for making sure a controller is loaded before it's used,
@@ -399,7 +367,7 @@ class Controller {
399
367
  * require awaiting them as they are guaranteed to be loaded by then.
400
368
  */
401
369
  get use() {
402
- setAmbientComponent(this.component);
370
+ setAmbientComponent(this.#component);
403
371
  return use;
404
372
  }
405
373
  /**
@@ -416,7 +384,7 @@ class Controller {
416
384
  * some other method on the controller
417
385
  */
418
386
  get useRef() {
419
- setAmbientComponent(this.component);
387
+ setAmbientComponent(this.#component);
420
388
  return useRef;
421
389
  }
422
390
  /**
@@ -425,135 +393,130 @@ class Controller {
425
393
  * @private
426
394
  */
427
395
  get useRefSync() {
428
- setAmbientComponent(this.component);
396
+ setAmbientComponent(this.#component);
429
397
  return useRefSync;
430
398
  }
431
399
  controllerRemoved() {
432
- if (this.component.el.isConnected) {
400
+ if (this.#component.el.isConnected) {
433
401
  this.triggerDisconnected();
434
402
  }
435
403
  this.triggerDestroy();
436
404
  }
437
405
  // Register a lifecycle callback
438
406
  onConnected(callback) {
439
- this._callbacks.hostConnected.push(callback);
407
+ this.#hostConnected.push(callback);
440
408
  }
441
409
  onDisconnected(callback) {
442
- this._callbacks.hostDisconnected.push(callback);
410
+ this.#hostDisconnected.push(callback);
443
411
  }
444
412
  onLoad(callback) {
445
- this._callbacks.hostLoad.push(callback);
413
+ this.#hostLoad.push(callback);
446
414
  }
447
415
  onLoaded(callback) {
448
- this._callbacks.hostLoaded.push(callback);
416
+ this.#hostLoaded.push(callback);
449
417
  }
450
418
  onUpdate(callback) {
451
- this._callbacks.hostUpdate.push(callback);
419
+ this.#hostUpdate.push(callback);
452
420
  }
453
421
  onUpdated(callback) {
454
- this._callbacks.hostUpdated.push(callback);
422
+ this.#hostUpdated.push(callback);
455
423
  }
456
424
  onDestroy(callback) {
457
425
  if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
458
- this.component.manager._ensureHasDestroy?.();
426
+ this.#component.manager.devOnly$ensureHasDestroy?.();
459
427
  }
460
- this._callbacks.hostDestroy.push(callback);
428
+ this.#hostDestroy.push(callback);
461
429
  }
462
430
  onLifecycle(callback) {
463
- this._callbacks.hostLifecycle.push(callback);
464
- if (this.connectedCalled && this.component.el.isConnected) {
465
- this._callLifecycle(callback);
431
+ this.#hostLifecycle.push(callback);
432
+ if (this.connectedCalled && this.#component.el.isConnected) {
433
+ this.#callLifecycle(callback);
466
434
  }
467
435
  }
468
436
  // Call each lifecycle hook
469
437
  /** @private */
470
438
  triggerConnected() {
471
- const genericController = this;
472
- if (genericController.hostConnected) {
473
- safeCall(genericController.hostConnected, genericController);
439
+ const that = this;
440
+ if (that.hostConnected) {
441
+ safeCall(that.hostConnected, that);
474
442
  }
475
- this._callbacks.hostConnected.forEach(safeCall);
476
- this.triggerLifecycle();
477
- this.connectedCalled = true;
443
+ that.#hostConnected.forEach(safeCall);
444
+ that.triggerLifecycle();
445
+ that.connectedCalled = true;
478
446
  }
479
447
  /** @private */
480
448
  triggerDisconnected() {
481
- const genericController = this;
482
- if (genericController.hostDisconnected) {
483
- safeCall(genericController.hostDisconnected, genericController);
449
+ const that = this;
450
+ if (that.hostDisconnected) {
451
+ safeCall(that.hostDisconnected, that);
484
452
  }
485
- this._callbacks.hostDisconnected.forEach(safeCall);
486
- this._lifecycleCleanups.forEach(safeCall);
487
- this._lifecycleCleanups = [];
453
+ that.#hostDisconnected.forEach(safeCall);
454
+ that.#lifecycleCleanups.forEach(safeCall);
455
+ that.#lifecycleCleanups = [];
488
456
  }
489
457
  /** @private */
490
458
  async triggerLoad() {
491
- if (this._loadCalled) {
459
+ if (this.#loadCalled) {
492
460
  return;
493
461
  }
494
- this._loadCalled = true;
462
+ this.#loadCalled = true;
495
463
  const genericController = this;
496
464
  if (genericController.hostLoad) {
497
465
  await safeAsyncCall(genericController.hostLoad, genericController);
498
466
  }
499
- if (this._callbacks.hostLoad.length > 0) {
500
- await Promise.allSettled(this._callbacks.hostLoad.map(safeAsyncCall));
467
+ if (this.#hostLoad.length > 0) {
468
+ await Promise.allSettled(this.#hostLoad.map(safeAsyncCall));
501
469
  }
502
- this._ready.resolve(this._exports);
470
+ this.P.resolve(this.#exports);
503
471
  }
504
472
  /** @private */
505
473
  triggerLoaded() {
506
474
  if (this.loadedCalled) {
507
475
  return;
508
476
  }
509
- const genericController = this;
510
- if (genericController.hostLoaded) {
511
- safeCall(genericController.hostLoaded, genericController);
477
+ if (this.hostLoaded) {
478
+ safeCall(this.hostLoaded, this);
512
479
  }
513
- this._callbacks.hostLoaded.forEach(safeCall);
480
+ this.#hostLoaded.forEach(safeCall);
514
481
  this.loadedCalled = true;
515
482
  }
516
483
  /** @private */
517
484
  triggerUpdate(changes) {
518
- const genericController = this;
519
- if (genericController.hostUpdate) {
520
- safeCall(genericController.hostUpdate, genericController, changes);
485
+ if (this.hostUpdate) {
486
+ safeCall(this.hostUpdate, this, changes);
521
487
  }
522
- this._callbacks.hostUpdate.forEach(callUpdate, changes);
488
+ this.#hostUpdate.forEach(callUpdate, changes);
523
489
  }
524
490
  /** @private */
525
491
  triggerUpdated(changes) {
526
- const genericController = this;
527
- if (genericController.hostUpdated) {
528
- safeCall(genericController.hostUpdated, genericController, changes);
492
+ if (this.hostUpdated) {
493
+ safeCall(this.hostUpdated, this, changes);
529
494
  }
530
- this._callbacks.hostUpdated.forEach(callUpdate, changes);
495
+ this.#hostUpdated.forEach(callUpdate, changes);
531
496
  }
532
497
  /** @private */
533
498
  triggerDestroy() {
534
- const genericController = this;
535
- if (genericController.hostDestroy) {
536
- safeCall(genericController.hostDestroy, genericController);
499
+ if (this.hostDestroy) {
500
+ safeCall(this.hostDestroy, this);
537
501
  }
538
- this._callbacks.hostDestroy.forEach(safeCall);
502
+ this.#hostDestroy.forEach(safeCall);
539
503
  }
540
504
  /** @private */
541
505
  triggerLifecycle() {
542
- const genericController = this;
543
- if (genericController.hostLifecycle) {
544
- this._callLifecycle(() => genericController.hostLifecycle());
506
+ if (this.hostLifecycle) {
507
+ this.#callLifecycle(() => this.hostLifecycle());
545
508
  }
546
- this._callbacks.hostLifecycle.forEach(this._callLifecycle, this);
509
+ this.#hostLifecycle.forEach(this.#callLifecycle, this);
547
510
  }
548
- _callLifecycle(callback) {
549
- setAmbientComponent(this.component);
511
+ #callLifecycle(callback) {
512
+ setAmbientComponent(this.#component);
550
513
  const cleanupRaw = safeCall(callback);
551
514
  const cleanup = Array.isArray(cleanupRaw) ? cleanupRaw : [cleanupRaw];
552
515
  cleanup.forEach((cleanup2) => {
553
516
  if (typeof cleanup2 === "function") {
554
- this._lifecycleCleanups.push(cleanup2);
517
+ this.#lifecycleCleanups.push(cleanup2);
555
518
  } else if (typeof cleanup2 === "object" && typeof cleanup2.remove === "function") {
556
- this._lifecycleCleanups.push(cleanup2.remove);
519
+ this.#lifecycleCleanups.push(cleanup2.remove);
557
520
  }
558
521
  });
559
522
  }
@@ -562,11 +525,11 @@ function callUpdate(callback) {
562
525
  safeCall(callback, void 0, this);
563
526
  }
564
527
  const GenericController = Controller;
565
- function makeProvisionalValue(base) {
528
+ const makeProvisionalValue = (base) => {
566
529
  if (typeof base !== "object" && typeof base !== "function" || base === null) {
567
530
  return base;
568
531
  }
569
- const proxy = new Proxy(base, {
532
+ const proxyDefinition = {
570
533
  get(target, prop, receiver) {
571
534
  if ((prop === "exports" || prop === "_exports") && prop in target && target[prop] === proxy) {
572
535
  return void 0;
@@ -583,16 +546,17 @@ function makeProvisionalValue(base) {
583
546
  );
584
547
  }
585
548
  return void 0;
586
- },
587
- set: (target, prop, newValue, receiver) => {
588
- if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
589
- console.error(`Trying to set "${prop.toString()}" on the controller before it's loaded. ${accessBeforeLoad}`);
590
- }
591
- return Reflect.set(target, prop, newValue, receiver);
592
549
  }
593
- });
550
+ };
551
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
552
+ proxyDefinition.set = (target, prop, newValue, receiver) => {
553
+ console.error(`Trying to set "${prop.toString()}" on the controller before it's loaded. ${accessBeforeLoad}`);
554
+ return Reflect.set(target, prop, newValue, receiver);
555
+ };
556
+ }
557
+ const proxy = new Proxy(base, proxyDefinition);
594
558
  return proxy;
595
- }
559
+ };
596
560
  const accessBeforeLoad = process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? [
597
561
  "This might be the case if you are trying to access an async controller in ",
598
562
  "connectedCallback(). Or, if you are using it inside of ",
@@ -603,25 +567,23 @@ const accessBeforeLoad = process.env.NODE_ENV !== "production" && isEsriInternal
603
567
  export {
604
568
  Controller as C,
605
569
  GenericController as G,
606
- shouldBypassGetter as a,
607
- shouldBypassReadOnly as b,
570
+ shouldBypassReadOnly as a,
571
+ createEvent as b,
608
572
  controllerSymbol as c,
609
- createEvent as d,
610
- setParentController as e,
611
- retrieveParentControllers as f,
612
- createEventFactory as g,
613
- bypassGetter as h,
573
+ setParentController as d,
574
+ retrieveParentControllers as e,
575
+ createEventFactory as f,
576
+ bypassSetter as g,
577
+ bypassReadOnly as h,
614
578
  isPromise as i,
615
- bypassSetter as j,
579
+ trackPropertyKey as j,
616
580
  keyTrackResolve as k,
617
- bypassReadOnly as l,
618
- trackPropertyKey as m,
619
- trackPropKey as n,
620
- isController as o,
621
- devOnlySetPersistentControllerData as p,
622
- devOnlyGetPersistentControllerData as q,
581
+ trackPropKey as l,
582
+ isController as m,
583
+ getControllersCount as n,
584
+ setAmbientChildController as o,
585
+ queueMicroTask as q,
623
586
  retrieveComponent as r,
624
587
  setAmbientComponent as s,
625
- trackKey as t,
626
- setAmbientChildController as u
588
+ trackKey as t
627
589
  };