@panneau/core 4.0.38 → 4.0.40-alpha.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/contexts.js CHANGED
@@ -1,64 +1,101 @@
1
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
1
+ import { c } from 'react/compiler-runtime';
2
2
  import isString from 'lodash/isString';
3
- import { createContext, useContext, useMemo, useState, use, useEffect, useRef, useCallback } from 'react';
3
+ import { createContext, useContext, useState, use, useEffect, useRef } from 'react';
4
4
  import { ComponentsManager, FieldsManager, Tracking } from '@panneau/core';
5
5
  import { jsx } from 'react/jsx-runtime';
6
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
7
- import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
8
6
  import uniqBy from 'lodash/uniqBy';
9
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
10
7
  import { getJSON } from '@folklore/fetch';
11
8
  import isObject from 'lodash/isObject';
12
9
  import { loadGoogleApi, loadGoogleMaps } from '@folklore/services';
13
10
  import { useIntl } from 'react-intl';
14
11
  import { getDisplayName } from '@panneau/core/utils';
15
- import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
16
12
  import { useUrlGenerator } from '@folklore/routes';
17
13
  export { RoutesContext, RoutesProvider, useRoutes, useUrlGenerator } from '@folklore/routes';
18
- import { TrackingContainer, TrackingContext } from '@folklore/tracking';
14
+ import { TrackingContext, TrackingContainer } from '@folklore/tracking';
19
15
  export { TrackingContext } from '@folklore/tracking';
20
16
  import { useLocation } from 'wouter';
21
17
 
22
- var MODALS_NAMESPACE = 'modals';
23
- var FIELDS_NAMESPACE = 'fields';
24
- var FORMS_NAMESPACE = 'forms';
25
- var FILTERS_NAMESPACE = 'filters';
26
- var LISTS_NAMESPACE = 'lists';
27
- var DISPLAYS_NAMESPACE = 'displays';
28
- var ACTIONS_NAMESPACE = 'actions';
29
- var BUTTONS_NAMESPACE = 'buttons';
30
- var PAGES_NAMESPACE = 'pages';
31
- var PREVIEWS_NAMESPACE = 'previews';
32
- var APP_NAMESPACE = 'app';
33
- var ComponentsContext = /*#__PURE__*/createContext(null);
18
+ const MODALS_NAMESPACE = 'modals';
19
+ const FIELDS_NAMESPACE = 'fields';
20
+ const FORMS_NAMESPACE = 'forms';
21
+ const FILTERS_NAMESPACE = 'filters';
22
+ const LISTS_NAMESPACE = 'lists';
23
+ const DISPLAYS_NAMESPACE = 'displays';
24
+ const ACTIONS_NAMESPACE = 'actions';
25
+ const BUTTONS_NAMESPACE = 'buttons';
26
+ const PAGES_NAMESPACE = 'pages';
27
+ const PREVIEWS_NAMESPACE = 'previews';
28
+ const APP_NAMESPACE = 'app';
29
+ const ComponentsContext = /*#__PURE__*/createContext(null);
34
30
 
35
31
  /**
36
32
  * Hooks
37
33
  */
38
- function useComponentsManager() {
39
- var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
40
- var manager = useContext(ComponentsContext);
41
- var finalManager = useMemo(function () {
42
- return namespace !== null ? new ComponentsManager(manager.getComponents(namespace)) : manager;
43
- }, [manager, namespace]);
34
+ function useComponentsManager(t0) {
35
+ const $ = c(3);
36
+ const namespace = t0 === undefined ? null : t0;
37
+ const manager = useContext(ComponentsContext);
38
+ let t1;
39
+ if ($[0] !== manager || $[1] !== namespace) {
40
+ t1 = namespace !== null ? new ComponentsManager(manager.getComponents(namespace)) : manager;
41
+ $[0] = manager;
42
+ $[1] = namespace;
43
+ $[2] = t1;
44
+ } else {
45
+ t1 = $[2];
46
+ }
47
+ const finalManager = t1;
44
48
  return finalManager;
45
49
  }
46
- function useComponents() {
47
- var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
48
- var defaultComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
49
- var manager = useComponentsManager();
50
- return manager.getComponents(namespace) || defaultComponents;
51
- }
52
- function useComponent(name) {
53
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
54
- var namespace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
55
- var manager = useComponentsManager(namespace);
56
- return useMemo(function () {
50
+ function useComponents(t0, t1) {
51
+ const $ = c(6);
52
+ const namespace = t0 === undefined ? null : t0;
53
+ let t2;
54
+ if ($[0] !== t1) {
55
+ t2 = t1 === undefined ? {} : t1;
56
+ $[0] = t1;
57
+ $[1] = t2;
58
+ } else {
59
+ t2 = $[1];
60
+ }
61
+ const defaultComponents = t2;
62
+ const manager = useComponentsManager();
63
+ let t3;
64
+ if ($[2] !== defaultComponents || $[3] !== manager || $[4] !== namespace) {
65
+ t3 = manager.getComponents(namespace) || defaultComponents;
66
+ $[2] = defaultComponents;
67
+ $[3] = manager;
68
+ $[4] = namespace;
69
+ $[5] = t3;
70
+ } else {
71
+ t3 = $[5];
72
+ }
73
+ return t3;
74
+ }
75
+ function useComponent(name, t0, t1) {
76
+ const $ = c(4);
77
+ const defaultComponent = t0 === undefined ? null : t0;
78
+ const namespace = t1 === undefined ? null : t1;
79
+ const manager = useComponentsManager(namespace);
80
+ let t2;
81
+ bb0: {
57
82
  if (!isString(name)) {
58
- return name || defaultComponent;
83
+ t2 = name || defaultComponent;
84
+ break bb0;
59
85
  }
60
- return manager.getComponent(name) || defaultComponent;
61
- }, [manager, name, defaultComponent]);
86
+ let t3;
87
+ if ($[0] !== defaultComponent || $[1] !== manager || $[2] !== name) {
88
+ t3 = manager.getComponent(name) || defaultComponent;
89
+ $[0] = defaultComponent;
90
+ $[1] = manager;
91
+ $[2] = name;
92
+ $[3] = t3;
93
+ } else {
94
+ t3 = $[3];
95
+ }
96
+ t2 = t3;
97
+ }
98
+ return t2;
62
99
  }
63
100
 
64
101
  /**
@@ -67,12 +104,21 @@ function useComponent(name) {
67
104
  function useFieldsComponentsManager() {
68
105
  return useComponentsManager(FIELDS_NAMESPACE);
69
106
  }
70
- function useFieldsComponents() {
71
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
107
+ function useFieldsComponents(t0) {
108
+ const $ = c(2);
109
+ let t1;
110
+ if ($[0] !== t0) {
111
+ t1 = t0 === undefined ? {} : t0;
112
+ $[0] = t0;
113
+ $[1] = t1;
114
+ } else {
115
+ t1 = $[1];
116
+ }
117
+ const defaultComponents = t1;
72
118
  return useComponents(FIELDS_NAMESPACE, defaultComponents);
73
119
  }
74
- function useFieldComponent(name) {
75
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
120
+ function useFieldComponent(name, t0) {
121
+ const defaultComponent = t0 === undefined ? null : t0;
76
122
  return useComponent(name, defaultComponent, FIELDS_NAMESPACE);
77
123
  }
78
124
 
@@ -82,12 +128,21 @@ function useFieldComponent(name) {
82
128
  function useFormsComponentsManager() {
83
129
  return useComponentsManager(FORMS_NAMESPACE);
84
130
  }
85
- function useFormsComponents() {
86
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
131
+ function useFormsComponents(t0) {
132
+ const $ = c(2);
133
+ let t1;
134
+ if ($[0] !== t0) {
135
+ t1 = t0 === undefined ? {} : t0;
136
+ $[0] = t0;
137
+ $[1] = t1;
138
+ } else {
139
+ t1 = $[1];
140
+ }
141
+ const defaultComponents = t1;
87
142
  return useComponents(FORMS_NAMESPACE, defaultComponents);
88
143
  }
89
- function useFormComponent(name) {
90
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
144
+ function useFormComponent(name, t0) {
145
+ const defaultComponent = t0 === undefined ? null : t0;
91
146
  return useComponent(name, defaultComponent, FORMS_NAMESPACE);
92
147
  }
93
148
 
@@ -97,12 +152,21 @@ function useFormComponent(name) {
97
152
  function useModalsComponentsManager() {
98
153
  return useComponentsManager(MODALS_NAMESPACE);
99
154
  }
100
- function useModalsComponents() {
101
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
155
+ function useModalsComponents(t0) {
156
+ const $ = c(2);
157
+ let t1;
158
+ if ($[0] !== t0) {
159
+ t1 = t0 === undefined ? {} : t0;
160
+ $[0] = t0;
161
+ $[1] = t1;
162
+ } else {
163
+ t1 = $[1];
164
+ }
165
+ const defaultComponents = t1;
102
166
  return useComponents(MODALS_NAMESPACE, defaultComponents);
103
167
  }
104
- function useModalComponent(name) {
105
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
168
+ function useModalComponent(name, t0) {
169
+ const defaultComponent = t0 === undefined ? null : t0;
106
170
  return useComponent(name, defaultComponent, MODALS_NAMESPACE);
107
171
  }
108
172
 
@@ -112,12 +176,21 @@ function useModalComponent(name) {
112
176
  function useFiltersComponentsManager() {
113
177
  return useComponentsManager(FILTERS_NAMESPACE);
114
178
  }
115
- function useFiltersComponents() {
116
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
179
+ function useFiltersComponents(t0) {
180
+ const $ = c(2);
181
+ let t1;
182
+ if ($[0] !== t0) {
183
+ t1 = t0 === undefined ? {} : t0;
184
+ $[0] = t0;
185
+ $[1] = t1;
186
+ } else {
187
+ t1 = $[1];
188
+ }
189
+ const defaultComponents = t1;
117
190
  return useComponents(FILTERS_NAMESPACE, defaultComponents);
118
191
  }
119
- function useFilterComponent(name) {
120
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
192
+ function useFilterComponent(name, t0) {
193
+ const defaultComponent = t0 === undefined ? null : t0;
121
194
  return useComponent(name, defaultComponent, FILTERS_NAMESPACE);
122
195
  }
123
196
 
@@ -127,12 +200,21 @@ function useFilterComponent(name) {
127
200
  function useListsComponentsManager() {
128
201
  return useComponentsManager(LISTS_NAMESPACE);
129
202
  }
130
- function useListsComponents() {
131
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
203
+ function useListsComponents(t0) {
204
+ const $ = c(2);
205
+ let t1;
206
+ if ($[0] !== t0) {
207
+ t1 = t0 === undefined ? {} : t0;
208
+ $[0] = t0;
209
+ $[1] = t1;
210
+ } else {
211
+ t1 = $[1];
212
+ }
213
+ const defaultComponents = t1;
132
214
  return useComponents(LISTS_NAMESPACE, defaultComponents);
133
215
  }
134
- function useListComponent(name) {
135
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
216
+ function useListComponent(name, t0) {
217
+ const defaultComponent = t0 === undefined ? null : t0;
136
218
  return useComponent(name, defaultComponent, LISTS_NAMESPACE);
137
219
  }
138
220
 
@@ -142,12 +224,21 @@ function useListComponent(name) {
142
224
  function useDisplaysComponentsManager() {
143
225
  return useComponentsManager(DISPLAYS_NAMESPACE);
144
226
  }
145
- function useDisplaysComponents() {
146
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
227
+ function useDisplaysComponents(t0) {
228
+ const $ = c(2);
229
+ let t1;
230
+ if ($[0] !== t0) {
231
+ t1 = t0 === undefined ? {} : t0;
232
+ $[0] = t0;
233
+ $[1] = t1;
234
+ } else {
235
+ t1 = $[1];
236
+ }
237
+ const defaultComponents = t1;
147
238
  return useComponents(DISPLAYS_NAMESPACE, defaultComponents);
148
239
  }
149
- function useDisplayComponent(name) {
150
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
240
+ function useDisplayComponent(name, t0) {
241
+ const defaultComponent = t0 === undefined ? null : t0;
151
242
  return useComponent(name, defaultComponent, DISPLAYS_NAMESPACE);
152
243
  }
153
244
 
@@ -157,12 +248,21 @@ function useDisplayComponent(name) {
157
248
  function useActionsComponentsManager() {
158
249
  return useComponentsManager(ACTIONS_NAMESPACE);
159
250
  }
160
- function useActionsComponents() {
161
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
251
+ function useActionsComponents(t0) {
252
+ const $ = c(2);
253
+ let t1;
254
+ if ($[0] !== t0) {
255
+ t1 = t0 === undefined ? {} : t0;
256
+ $[0] = t0;
257
+ $[1] = t1;
258
+ } else {
259
+ t1 = $[1];
260
+ }
261
+ const defaultComponents = t1;
162
262
  return useComponents(ACTIONS_NAMESPACE, defaultComponents);
163
263
  }
164
- function useActionComponent(name) {
165
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
264
+ function useActionComponent(name, t0) {
265
+ const defaultComponent = t0 === undefined ? null : t0;
166
266
  return useComponent(name, defaultComponent, ACTIONS_NAMESPACE);
167
267
  }
168
268
 
@@ -172,12 +272,21 @@ function useActionComponent(name) {
172
272
  function useButtonsComponentsManager() {
173
273
  return useComponentsManager(BUTTONS_NAMESPACE);
174
274
  }
175
- function useButtonsComponents() {
176
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
275
+ function useButtonsComponents(t0) {
276
+ const $ = c(2);
277
+ let t1;
278
+ if ($[0] !== t0) {
279
+ t1 = t0 === undefined ? {} : t0;
280
+ $[0] = t0;
281
+ $[1] = t1;
282
+ } else {
283
+ t1 = $[1];
284
+ }
285
+ const defaultComponents = t1;
177
286
  return useComponents(BUTTONS_NAMESPACE, defaultComponents);
178
287
  }
179
- function useButtonComponent(name) {
180
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
288
+ function useButtonComponent(name, t0) {
289
+ const defaultComponent = t0 === undefined ? null : t0;
181
290
  return useComponent(name, defaultComponent, BUTTONS_NAMESPACE);
182
291
  }
183
292
 
@@ -187,12 +296,21 @@ function useButtonComponent(name) {
187
296
  function usePagesComponentsManager() {
188
297
  return useComponentsManager(PAGES_NAMESPACE);
189
298
  }
190
- function usePagesComponents() {
191
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
299
+ function usePagesComponents(t0) {
300
+ const $ = c(2);
301
+ let t1;
302
+ if ($[0] !== t0) {
303
+ t1 = t0 === undefined ? {} : t0;
304
+ $[0] = t0;
305
+ $[1] = t1;
306
+ } else {
307
+ t1 = $[1];
308
+ }
309
+ const defaultComponents = t1;
192
310
  return useComponents(PAGES_NAMESPACE, defaultComponents);
193
311
  }
194
- function usePageComponent(name) {
195
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
312
+ function usePageComponent(name, t0) {
313
+ const defaultComponent = t0 === undefined ? null : t0;
196
314
  return useComponent(name, defaultComponent, PAGES_NAMESPACE);
197
315
  }
198
316
 
@@ -202,12 +320,21 @@ function usePageComponent(name) {
202
320
  function usePreviewsComponentsManager() {
203
321
  return useComponentsManager(PREVIEWS_NAMESPACE);
204
322
  }
205
- function usePreviewsComponents() {
206
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
323
+ function usePreviewsComponents(t0) {
324
+ const $ = c(2);
325
+ let t1;
326
+ if ($[0] !== t0) {
327
+ t1 = t0 === undefined ? {} : t0;
328
+ $[0] = t0;
329
+ $[1] = t1;
330
+ } else {
331
+ t1 = $[1];
332
+ }
333
+ const defaultComponents = t1;
207
334
  return useComponents(PREVIEWS_NAMESPACE, defaultComponents);
208
335
  }
209
- function usePreviewComponent(name) {
210
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
336
+ function usePreviewComponent(name, t0) {
337
+ const defaultComponent = t0 === undefined ? null : t0;
211
338
  return useComponent(name, defaultComponent, PREVIEWS_NAMESPACE);
212
339
  }
213
340
 
@@ -217,12 +344,21 @@ function usePreviewComponent(name) {
217
344
  function useAppComponentsManager() {
218
345
  return useComponentsManager(APP_NAMESPACE);
219
346
  }
220
- function useAppComponents() {
221
- var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
347
+ function useAppComponents(t0) {
348
+ const $ = c(2);
349
+ let t1;
350
+ if ($[0] !== t0) {
351
+ t1 = t0 === undefined ? {} : t0;
352
+ $[0] = t0;
353
+ $[1] = t1;
354
+ } else {
355
+ t1 = $[1];
356
+ }
357
+ const defaultComponents = t1;
222
358
  return useComponents(APP_NAMESPACE, defaultComponents);
223
359
  }
224
- function useAppComponent(name) {
225
- var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
360
+ function useAppComponent(name, t0) {
361
+ const defaultComponent = t0 === undefined ? null : t0;
226
362
  return useComponent(name, defaultComponent, APP_NAMESPACE);
227
363
  }
228
364
 
@@ -230,714 +366,1289 @@ function useAppComponent(name) {
230
366
  * Provider
231
367
  */
232
368
 
233
- var DEFAULT_COMPONENTS$1 = {};
234
- function ComponentsProvider(_ref) {
235
- var _ref$components = _ref.components,
236
- components = _ref$components === void 0 ? DEFAULT_COMPONENTS$1 : _ref$components,
237
- _ref$manager = _ref.manager,
238
- manager = _ref$manager === void 0 ? null : _ref$manager,
239
- _ref$namespace = _ref.namespace,
240
- namespace = _ref$namespace === void 0 ? null : _ref$namespace,
241
- children = _ref.children;
242
- var previousManager = useComponentsManager() || null;
243
- var finalManager = useMemo(function () {
244
- return new ComponentsManager(_objectSpread(_objectSpread(_objectSpread({}, previousManager !== null ? previousManager.getComponents() : null), manager !== null ? manager.getComponents() : null), new ComponentsManager(components).addNamespace(namespace).getComponents()));
245
- }, [previousManager, manager, components, namespace]);
246
- return /*#__PURE__*/jsx(ComponentsContext, {
247
- value: finalManager,
248
- children: children
249
- });
369
+ const DEFAULT_COMPONENTS$1 = {};
370
+ function ComponentsProvider(t0) {
371
+ const $ = c(8);
372
+ const {
373
+ components: t1,
374
+ manager: t2,
375
+ namespace: t3,
376
+ children
377
+ } = t0;
378
+ const components = t1 === undefined ? DEFAULT_COMPONENTS$1 : t1;
379
+ const manager = t2 === undefined ? null : t2;
380
+ const namespace = t3 === undefined ? null : t3;
381
+ const previousManager = useComponentsManager() || null;
382
+ let t4;
383
+ if ($[0] !== components || $[1] !== manager || $[2] !== namespace || $[3] !== previousManager) {
384
+ t4 = new ComponentsManager({
385
+ ...(previousManager !== null ? previousManager.getComponents() : null),
386
+ ...(manager !== null ? manager.getComponents() : null),
387
+ ...new ComponentsManager(components).addNamespace(namespace).getComponents()
388
+ });
389
+ $[0] = components;
390
+ $[1] = manager;
391
+ $[2] = namespace;
392
+ $[3] = previousManager;
393
+ $[4] = t4;
394
+ } else {
395
+ t4 = $[4];
396
+ }
397
+ const finalManager = t4;
398
+ let t5;
399
+ if ($[5] !== children || $[6] !== finalManager) {
400
+ t5 = /*#__PURE__*/jsx(ComponentsContext, {
401
+ value: finalManager,
402
+ children: children
403
+ });
404
+ $[5] = children;
405
+ $[6] = finalManager;
406
+ $[7] = t5;
407
+ } else {
408
+ t5 = $[7];
409
+ }
410
+ return t5;
250
411
  }
251
412
 
252
- var DefinitionContext = /*#__PURE__*/createContext(null);
413
+ const DefinitionContext = /*#__PURE__*/createContext(null);
253
414
  function useDefinitionContext() {
254
415
  return useContext(DefinitionContext);
255
416
  }
256
417
  function useDefinition() {
257
- var definition = useDefinitionContext();
418
+ const definition = useDefinitionContext();
258
419
  return definition || null;
259
420
  }
260
- function DefinitionProvider(_ref) {
261
- var definition = _ref.definition,
262
- children = _ref.children;
263
- return /*#__PURE__*/jsx(DefinitionContext, {
264
- value: definition,
265
- children: children
266
- });
421
+ function DefinitionProvider(t0) {
422
+ const $ = c(3);
423
+ const {
424
+ definition,
425
+ children
426
+ } = t0;
427
+ let t1;
428
+ if ($[0] !== children || $[1] !== definition) {
429
+ t1 = /*#__PURE__*/jsx(DefinitionContext, {
430
+ value: definition,
431
+ children: children
432
+ });
433
+ $[0] = children;
434
+ $[1] = definition;
435
+ $[2] = t1;
436
+ } else {
437
+ t1 = $[2];
438
+ }
439
+ return t1;
267
440
  }
268
441
 
269
- var FieldsContext = /*#__PURE__*/createContext(null);
442
+ const FieldsContext = /*#__PURE__*/createContext(null);
270
443
  function useFieldsManager() {
271
444
  return useContext(FieldsContext);
272
445
  }
273
446
  function useField(id) {
274
- var manager = useFieldsManager();
275
- return manager.getDefinition(id);
447
+ const $ = c(3);
448
+ const manager = useFieldsManager();
449
+ let t0;
450
+ if ($[0] !== id || $[1] !== manager) {
451
+ t0 = manager.getDefinition(id);
452
+ $[0] = id;
453
+ $[1] = manager;
454
+ $[2] = t0;
455
+ } else {
456
+ t0 = $[2];
457
+ }
458
+ return t0;
276
459
  }
277
460
  function useFields() {
278
- var manager = useFieldsManager();
279
- return manager.getDefinitions();
280
- }
281
- function FieldsProvider(_ref) {
282
- var _ref$fields = _ref.fields,
283
- fields = _ref$fields === void 0 ? null : _ref$fields,
284
- _ref$manager = _ref.manager,
285
- manager = _ref$manager === void 0 ? null : _ref$manager,
286
- children = _ref.children;
287
- var previousManager = useFieldsManager() || null;
288
- var finalManager = useMemo(function () {
289
- var newFields = uniqBy([].concat(_toConsumableArray(fields || []), _toConsumableArray(manager !== null ? manager.getDefinitions() : []), _toConsumableArray(previousManager !== null ? previousManager.getDefinitions() : [])), function (_ref2) {
290
- var id = _ref2.id;
291
- return id;
292
- }).reverse();
293
- return new FieldsManager(newFields);
294
- }, [previousManager, manager, fields]);
295
- var components = useMemo(function () {
296
- var newComponents = finalManager.getComponents();
297
- return Object.keys(newComponents).reduce(function (map, id) {
298
- var component = newComponents[id];
299
- return isString(component) ? map : _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, id, component));
461
+ const $ = c(2);
462
+ const manager = useFieldsManager();
463
+ let t0;
464
+ if ($[0] !== manager) {
465
+ t0 = manager.getDefinitions();
466
+ $[0] = manager;
467
+ $[1] = t0;
468
+ } else {
469
+ t0 = $[1];
470
+ }
471
+ return t0;
472
+ }
473
+ function FieldsProvider(t0) {
474
+ const $ = c(12);
475
+ const {
476
+ fields: t1,
477
+ manager: t2,
478
+ children
479
+ } = t0;
480
+ const fields = t1 === undefined ? null : t1;
481
+ const manager = t2 === undefined ? null : t2;
482
+ const previousManager = useFieldsManager() || null;
483
+ let t3;
484
+ if ($[0] !== fields || $[1] !== manager || $[2] !== previousManager) {
485
+ const newFields = uniqBy([...(fields || []), ...(manager !== null ? manager.getDefinitions() : []), ...(previousManager !== null ? previousManager.getDefinitions() : [])], _temp$1).reverse();
486
+ t3 = new FieldsManager(newFields);
487
+ $[0] = fields;
488
+ $[1] = manager;
489
+ $[2] = previousManager;
490
+ $[3] = t3;
491
+ } else {
492
+ t3 = $[3];
493
+ }
494
+ const finalManager = t3;
495
+ let t4;
496
+ if ($[4] !== finalManager) {
497
+ const newComponents = finalManager.getComponents();
498
+ t4 = Object.keys(newComponents).reduce((map, id_0) => {
499
+ const component = newComponents[id_0];
500
+ return isString(component) ? map : {
501
+ ...map,
502
+ [id_0]: component
503
+ };
300
504
  }, {});
301
- }, [finalManager]);
302
- return /*#__PURE__*/jsx(FieldsContext, {
303
- value: finalManager,
304
- children: /*#__PURE__*/jsx(ComponentsProvider, {
505
+ $[4] = finalManager;
506
+ $[5] = t4;
507
+ } else {
508
+ t4 = $[5];
509
+ }
510
+ const components = t4;
511
+ let t5;
512
+ if ($[6] !== children || $[7] !== components) {
513
+ t5 = /*#__PURE__*/jsx(ComponentsProvider, {
305
514
  namespace: FIELDS_NAMESPACE,
306
515
  components: components,
307
516
  children: children
308
- })
309
- });
517
+ });
518
+ $[6] = children;
519
+ $[7] = components;
520
+ $[8] = t5;
521
+ } else {
522
+ t5 = $[8];
523
+ }
524
+ let t6;
525
+ if ($[9] !== finalManager || $[10] !== t5) {
526
+ t6 = /*#__PURE__*/jsx(FieldsContext, {
527
+ value: finalManager,
528
+ children: t5
529
+ });
530
+ $[9] = finalManager;
531
+ $[10] = t5;
532
+ $[11] = t6;
533
+ } else {
534
+ t6 = $[11];
535
+ }
536
+ return t6;
537
+ }
538
+ function _temp$1(t0) {
539
+ const {
540
+ id
541
+ } = t0;
542
+ return id;
310
543
  }
311
544
 
312
- var GoogleKeysContext = /*#__PURE__*/createContext({
545
+ const GoogleKeysContext = /*#__PURE__*/createContext({
313
546
  apiKey: null
314
547
  });
315
548
  function useGoogleKeys() {
316
549
  return useContext(GoogleKeysContext);
317
550
  }
318
- function GoogleKeysProvider(_ref) {
319
- var children = _ref.children,
320
- _ref$apiKey = _ref.apiKey,
321
- apiKey = _ref$apiKey === void 0 ? null : _ref$apiKey;
322
- var _useGoogleKeys = useGoogleKeys(),
323
- previousApiKey = _useGoogleKeys.apiKey;
324
- var value = useMemo(function () {
325
- return {
326
- apiKey: apiKey || previousApiKey
551
+ function GoogleKeysProvider(t0) {
552
+ const $ = c(5);
553
+ const {
554
+ children,
555
+ apiKey: t1
556
+ } = t0;
557
+ const apiKey = t1 === undefined ? null : t1;
558
+ const {
559
+ apiKey: previousApiKey
560
+ } = useGoogleKeys();
561
+ const t2 = apiKey || previousApiKey;
562
+ let t3;
563
+ if ($[0] !== t2) {
564
+ t3 = {
565
+ apiKey: t2
327
566
  };
328
- }, [previousApiKey, apiKey]);
329
- return /*#__PURE__*/jsx(GoogleKeysContext, {
330
- value: value,
331
- children: children
332
- });
567
+ $[0] = t2;
568
+ $[1] = t3;
569
+ } else {
570
+ t3 = $[1];
571
+ }
572
+ const value = t3;
573
+ let t4;
574
+ if ($[2] !== children || $[3] !== value) {
575
+ t4 = /*#__PURE__*/jsx(GoogleKeysContext, {
576
+ value: value,
577
+ children: children
578
+ });
579
+ $[2] = children;
580
+ $[3] = value;
581
+ $[4] = t4;
582
+ } else {
583
+ t4 = $[4];
584
+ }
585
+ return t4;
333
586
  }
334
587
 
335
- var FontsContext = /*#__PURE__*/createContext({
588
+ const FontsContext = /*#__PURE__*/createContext({
336
589
  systemFonts: null,
337
590
  googleFonts: null,
338
591
  customFonts: null
339
592
  });
340
- function useGoogleFonts() {
341
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
342
- _ref$disabled = _ref.disabled,
343
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
344
- _ref$setFonts = _ref.setFonts,
345
- setFonts = _ref$setFonts === void 0 ? null : _ref$setFonts;
346
- var _useGoogleKeys = useGoogleKeys(),
347
- apiKey = _useGoogleKeys.apiKey;
348
- var _useState = useState(null),
349
- _useState2 = _slicedToArray(_useState, 2),
350
- googleFonts = _useState2[0],
351
- setGoogleFonts = _useState2[1];
352
- useEffect(function () {
353
- var canceled = false;
354
- if (apiKey !== null && !disabled) {
355
- getJSON("https://www.googleapis.com/webfonts/v1/webfonts?key=".concat(apiKey, "&sort=popularity")).then(function (_ref2) {
356
- var _ref2$items = _ref2.items,
357
- items = _ref2$items === void 0 ? [] : _ref2$items;
358
- if (!canceled) {
359
- var newFonts = items.map(function (it) {
360
- return {
361
- type: 'google',
362
- name: it.family,
363
- variants: it.variants
364
- };
365
- });
366
- if (setFonts !== null) {
367
- setFonts(newFonts);
368
- } else {
369
- setGoogleFonts(newFonts);
593
+ function useGoogleFonts(t0) {
594
+ const $ = c(7);
595
+ let t1;
596
+ if ($[0] !== t0) {
597
+ t1 = t0 === undefined ? {} : t0;
598
+ $[0] = t0;
599
+ $[1] = t1;
600
+ } else {
601
+ t1 = $[1];
602
+ }
603
+ const {
604
+ disabled: t2,
605
+ setFonts: t3
606
+ } = t1;
607
+ const disabled = t2 === undefined ? false : t2;
608
+ const setFonts = t3 === undefined ? null : t3;
609
+ const {
610
+ apiKey
611
+ } = useGoogleKeys();
612
+ const [googleFonts, setGoogleFonts] = useState(null);
613
+ let t4;
614
+ let t5;
615
+ if ($[2] !== apiKey || $[3] !== disabled || $[4] !== setFonts) {
616
+ t4 = () => {
617
+ let canceled = false;
618
+ if (apiKey !== null && !disabled) {
619
+ getJSON(`https://www.googleapis.com/webfonts/v1/webfonts?key=${apiKey}&sort=popularity`).then(t6 => {
620
+ const {
621
+ items: t7
622
+ } = t6;
623
+ const items = t7 === undefined ? [] : t7;
624
+ if (!canceled) {
625
+ const newFonts = items.map(_temp);
626
+ if (setFonts !== null) {
627
+ setFonts(newFonts);
628
+ } else {
629
+ setGoogleFonts(newFonts);
630
+ }
370
631
  }
371
- }
372
- });
373
- }
374
- return function () {
375
- canceled = true;
632
+ });
633
+ }
634
+ return () => {
635
+ canceled = true;
636
+ };
376
637
  };
377
- }, [apiKey, disabled, setFonts, setGoogleFonts]);
638
+ t5 = [apiKey, disabled, setFonts, setGoogleFonts];
639
+ $[2] = apiKey;
640
+ $[3] = disabled;
641
+ $[4] = setFonts;
642
+ $[5] = t4;
643
+ $[6] = t5;
644
+ } else {
645
+ t4 = $[5];
646
+ t5 = $[6];
647
+ }
648
+ useEffect(t4, t5);
378
649
  return googleFonts;
379
650
  }
380
- function useFonts() {
381
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
382
- _ref3$withoutGoogleFo = _ref3.withoutGoogleFonts,
383
- withoutGoogleFonts = _ref3$withoutGoogleFo === void 0 ? false : _ref3$withoutGoogleFo;
384
- var _use = use(FontsContext),
385
- _use$setGoogleFonts = _use.setGoogleFonts,
386
- setGoogleFonts = _use$setGoogleFonts === void 0 ? null : _use$setGoogleFonts,
387
- _use$systemFonts = _use.systemFonts,
388
- systemFonts = _use$systemFonts === void 0 ? null : _use$systemFonts,
389
- _use$googleFonts = _use.googleFonts,
390
- googleFonts = _use$googleFonts === void 0 ? null : _use$googleFonts,
391
- _use$customFonts = _use.customFonts,
392
- customFonts = _use$customFonts === void 0 ? null : _use$customFonts;
393
- useGoogleFonts({
394
- disabled: withoutGoogleFonts || googleFonts !== null && googleFonts.length > 0,
395
- setFonts: setGoogleFonts
396
- });
397
- var fonts = useMemo(function () {
398
- return {
399
- systemFonts: systemFonts,
400
- googleFonts: googleFonts,
401
- customFonts: customFonts
651
+ function _temp(it) {
652
+ return {
653
+ type: "google",
654
+ name: it.family,
655
+ variants: it.variants
656
+ };
657
+ }
658
+ function useFonts(t0) {
659
+ const $ = c(9);
660
+ let t1;
661
+ if ($[0] !== t0) {
662
+ t1 = t0 === undefined ? {} : t0;
663
+ $[0] = t0;
664
+ $[1] = t1;
665
+ } else {
666
+ t1 = $[1];
667
+ }
668
+ const {
669
+ withoutGoogleFonts: t2
670
+ } = t1;
671
+ const withoutGoogleFonts = t2 === undefined ? false : t2;
672
+ const {
673
+ setGoogleFonts: t3,
674
+ systemFonts: t4,
675
+ googleFonts: t5,
676
+ customFonts: t6
677
+ } = use(FontsContext);
678
+ const setGoogleFonts = t3 === undefined ? null : t3;
679
+ const systemFonts = t4 === undefined ? null : t4;
680
+ const googleFonts = t5 === undefined ? null : t5;
681
+ const customFonts = t6 === undefined ? null : t6;
682
+ const t7 = withoutGoogleFonts || googleFonts !== null && googleFonts.length > 0;
683
+ let t8;
684
+ if ($[2] !== setGoogleFonts || $[3] !== t7) {
685
+ t8 = {
686
+ disabled: t7,
687
+ setFonts: setGoogleFonts
402
688
  };
403
- }, [systemFonts, googleFonts, customFonts]);
689
+ $[2] = setGoogleFonts;
690
+ $[3] = t7;
691
+ $[4] = t8;
692
+ } else {
693
+ t8 = $[4];
694
+ }
695
+ useGoogleFonts(t8);
696
+ let t9;
697
+ if ($[5] !== customFonts || $[6] !== googleFonts || $[7] !== systemFonts) {
698
+ t9 = {
699
+ systemFonts,
700
+ googleFonts,
701
+ customFonts
702
+ };
703
+ $[5] = customFonts;
704
+ $[6] = googleFonts;
705
+ $[7] = systemFonts;
706
+ $[8] = t9;
707
+ } else {
708
+ t9 = $[8];
709
+ }
710
+ const fonts = t9;
404
711
  return fonts;
405
712
  }
406
- var DEFAULT_SYSTEM_FONTS = ['Arial', 'Courier', 'Georgia', 'Times New Roman', 'Verdana'];
407
- function FontsProvider(_ref4) {
408
- var _ref4$systemFonts = _ref4.systemFonts,
409
- systemFonts = _ref4$systemFonts === void 0 ? DEFAULT_SYSTEM_FONTS : _ref4$systemFonts,
410
- _ref4$customFonts = _ref4.customFonts,
411
- customFonts = _ref4$customFonts === void 0 ? null : _ref4$customFonts,
412
- children = _ref4.children;
413
- var _useFonts = useFonts(),
414
- _useFonts$systemFonts = _useFonts.systemFonts,
415
- previousSystemFonts = _useFonts$systemFonts === void 0 ? null : _useFonts$systemFonts,
416
- _useFonts$googleFonts = _useFonts.googleFonts,
417
- previousGoogleFonts = _useFonts$googleFonts === void 0 ? null : _useFonts$googleFonts,
418
- _useFonts$customFonts = _useFonts.customFonts,
419
- previousCustomFonts = _useFonts$customFonts === void 0 ? null : _useFonts$customFonts;
420
- var _useState3 = useState(null),
421
- _useState4 = _slicedToArray(_useState3, 2),
422
- googleFonts = _useState4[0],
423
- setGoogleFonts = _useState4[1];
424
- var fonts = useMemo(function () {
425
- return {
426
- systemFonts: uniqBy([].concat(_toConsumableArray(previousSystemFonts || []), _toConsumableArray(systemFonts || [])), function (font) {
427
- return isObject(font) ? font.name : font;
428
- }),
429
- googleFonts: uniqBy([].concat(_toConsumableArray(previousGoogleFonts || []), _toConsumableArray(googleFonts || [])), function (font) {
430
- return isObject(font) ? font.name : font;
431
- }),
432
- customFonts: uniqBy([].concat(_toConsumableArray(previousCustomFonts || []), _toConsumableArray(customFonts || [])), function (font) {
433
- return isObject(font) ? font.name : font;
434
- }),
435
- setGoogleFonts: setGoogleFonts
713
+ const DEFAULT_SYSTEM_FONTS = ['Arial', 'Courier', 'Georgia', 'Times New Roman', 'Verdana'];
714
+ function FontsProvider(t0) {
715
+ const $ = c(16);
716
+ const {
717
+ systemFonts: t1,
718
+ customFonts: t2,
719
+ children
720
+ } = t0;
721
+ const systemFonts = t1 === undefined ? DEFAULT_SYSTEM_FONTS : t1;
722
+ const customFonts = t2 === undefined ? null : t2;
723
+ const {
724
+ systemFonts: t3,
725
+ googleFonts: t4,
726
+ customFonts: t5
727
+ } = useFonts();
728
+ const previousSystemFonts = t3 === undefined ? null : t3;
729
+ const previousGoogleFonts = t4 === undefined ? null : t4;
730
+ const previousCustomFonts = t5 === undefined ? null : t5;
731
+ const [googleFonts, setGoogleFonts] = useState(null);
732
+ let t6;
733
+ if ($[0] !== previousSystemFonts || $[1] !== systemFonts) {
734
+ t6 = uniqBy([...(previousSystemFonts || []), ...(systemFonts || [])], _temp2);
735
+ $[0] = previousSystemFonts;
736
+ $[1] = systemFonts;
737
+ $[2] = t6;
738
+ } else {
739
+ t6 = $[2];
740
+ }
741
+ let t7;
742
+ if ($[3] !== googleFonts || $[4] !== previousGoogleFonts) {
743
+ t7 = uniqBy([...(previousGoogleFonts || []), ...(googleFonts || [])], _temp3);
744
+ $[3] = googleFonts;
745
+ $[4] = previousGoogleFonts;
746
+ $[5] = t7;
747
+ } else {
748
+ t7 = $[5];
749
+ }
750
+ let t8;
751
+ if ($[6] !== customFonts || $[7] !== previousCustomFonts) {
752
+ t8 = uniqBy([...(previousCustomFonts || []), ...(customFonts || [])], _temp4);
753
+ $[6] = customFonts;
754
+ $[7] = previousCustomFonts;
755
+ $[8] = t8;
756
+ } else {
757
+ t8 = $[8];
758
+ }
759
+ let t9;
760
+ if ($[9] !== t6 || $[10] !== t7 || $[11] !== t8) {
761
+ t9 = {
762
+ systemFonts: t6,
763
+ googleFonts: t7,
764
+ customFonts: t8,
765
+ setGoogleFonts
436
766
  };
437
- }, [previousSystemFonts, previousGoogleFonts, previousCustomFonts, customFonts, systemFonts, googleFonts, setGoogleFonts]);
438
- return /*#__PURE__*/jsx(FontsContext, {
439
- value: fonts,
440
- children: children
441
- });
767
+ $[9] = t6;
768
+ $[10] = t7;
769
+ $[11] = t8;
770
+ $[12] = t9;
771
+ } else {
772
+ t9 = $[12];
773
+ }
774
+ const fonts = t9;
775
+ let t10;
776
+ if ($[13] !== children || $[14] !== fonts) {
777
+ t10 = /*#__PURE__*/jsx(FontsContext, {
778
+ value: fonts,
779
+ children: children
780
+ });
781
+ $[13] = children;
782
+ $[14] = fonts;
783
+ $[15] = t10;
784
+ } else {
785
+ t10 = $[15];
786
+ }
787
+ return t10;
788
+ }
789
+ function _temp4(font_1) {
790
+ return isObject(font_1) ? font_1.name : font_1;
791
+ }
792
+ function _temp3(font_0) {
793
+ return isObject(font_0) ? font_0.name : font_0;
794
+ }
795
+ function _temp2(font) {
796
+ return isObject(font) ? font.name : font;
442
797
  }
443
798
 
444
- var FormContext = /*#__PURE__*/createContext(null);
799
+ const FormContext = /*#__PURE__*/createContext(null);
445
800
  function useFormContext() {
446
801
  return use(FormContext);
447
802
  }
448
803
  function useFormValue() {
449
- var _useFormContext = useFormContext(),
450
- value = _useFormContext.value;
804
+ const {
805
+ value
806
+ } = useFormContext();
451
807
  return value;
452
808
  }
453
809
  function useFormSetValue() {
454
- var _useFormContext2 = useFormContext(),
455
- setValue = _useFormContext2.setValue;
810
+ const {
811
+ setValue
812
+ } = useFormContext();
456
813
  return setValue;
457
814
  }
458
- function FormProvider(_ref) {
459
- var value = _ref.value,
460
- setValue = _ref.setValue,
461
- children = _ref.children;
462
- var values = useMemo(function () {
463
- return {
464
- value: value,
465
- setValue: setValue
815
+ function FormProvider(t0) {
816
+ const $ = c(6);
817
+ const {
818
+ value,
819
+ setValue,
820
+ children
821
+ } = t0;
822
+ let t1;
823
+ if ($[0] !== setValue || $[1] !== value) {
824
+ t1 = {
825
+ value,
826
+ setValue
466
827
  };
467
- }, [value, setValue]);
468
- return /*#__PURE__*/jsx(FormContext, {
469
- value: values,
470
- children: children
471
- });
828
+ $[0] = setValue;
829
+ $[1] = value;
830
+ $[2] = t1;
831
+ } else {
832
+ t1 = $[2];
833
+ }
834
+ const values = t1;
835
+ let t2;
836
+ if ($[3] !== children || $[4] !== values) {
837
+ t2 = /*#__PURE__*/jsx(FormContext, {
838
+ value: values,
839
+ children: children
840
+ });
841
+ $[3] = children;
842
+ $[4] = values;
843
+ $[5] = t2;
844
+ } else {
845
+ t2 = $[5];
846
+ }
847
+ return t2;
472
848
  }
473
849
 
474
- var GoogleApiClientContext = /*#__PURE__*/createContext(null);
850
+ const GoogleApiClientContext = /*#__PURE__*/createContext(null);
475
851
  function useGoogleApiClient() {
476
852
  return useContext(GoogleApiClientContext);
477
853
  }
478
854
  function withGoogleApiClient(WrappedComponent) {
479
- function getDisplayName(_ref) {
480
- var _ref$displayName = _ref.displayName,
481
- displayName = _ref$displayName === void 0 ? null : _ref$displayName,
482
- _ref$name = _ref.name,
483
- name = _ref$name === void 0 ? null : _ref$name;
855
+ function getDisplayName({
856
+ displayName = null,
857
+ name = null
858
+ }) {
484
859
  return displayName || name || 'Component';
485
860
  }
486
861
  function WithGoogleApiClientComponent(props) {
487
- return /*#__PURE__*/jsx(GoogleApiClientContext.Consumer, {
488
- children: function children(client) {
489
- return /*#__PURE__*/jsx(WrappedComponent, _objectSpread({
490
- googleApiClient: client
491
- }, props));
492
- }
493
- });
862
+ const $ = c(2);
863
+ let t0;
864
+ if ($[0] !== props) {
865
+ t0 = /*#__PURE__*/jsx(GoogleApiClientContext.Consumer, {
866
+ children: client => /*#__PURE__*/jsx(WrappedComponent, {
867
+ googleApiClient: client,
868
+ ...props
869
+ })
870
+ });
871
+ $[0] = props;
872
+ $[1] = t0;
873
+ } else {
874
+ t0 = $[1];
875
+ }
876
+ return t0;
494
877
  }
495
- WithGoogleApiClientComponent.displayName = "WithGoogleApiClient(".concat(getDisplayName(WrappedComponent), ")");
878
+ WithGoogleApiClientComponent.displayName = `WithGoogleApiClient(${getDisplayName(WrappedComponent)})`;
496
879
  return WithGoogleApiClientComponent;
497
880
  }
498
- function GoogleApiClientProvider(_ref2) {
499
- var children = _ref2.children;
500
- var _useGoogleKeys = useGoogleKeys(),
501
- apiKey = _useGoogleKeys.apiKey;
502
- var _useState = useState(null),
503
- _useState2 = _slicedToArray(_useState, 2),
504
- client = _useState2[0],
505
- setClient = _useState2[1];
506
- useEffect(function () {
507
- loadGoogleApi().then(function (gapi) {
508
- return gapi.client.init({
509
- apiKey: apiKey
510
- }).then(function () {
511
- return gapi;
512
- });
513
- }).then(function (gapi) {
514
- return setClient(gapi);
881
+ function GoogleApiClientProvider(t0) {
882
+ const $ = c(6);
883
+ const {
884
+ children
885
+ } = t0;
886
+ const {
887
+ apiKey
888
+ } = useGoogleKeys();
889
+ const [client, setClient] = useState(null);
890
+ let t1;
891
+ let t2;
892
+ if ($[0] !== apiKey) {
893
+ t1 = () => {
894
+ loadGoogleApi().then(gapi => gapi.client.init({
895
+ apiKey
896
+ }).then(() => gapi)).then(gapi_0 => setClient(gapi_0));
897
+ };
898
+ t2 = [apiKey, setClient];
899
+ $[0] = apiKey;
900
+ $[1] = t1;
901
+ $[2] = t2;
902
+ } else {
903
+ t1 = $[1];
904
+ t2 = $[2];
905
+ }
906
+ useEffect(t1, t2);
907
+ let t3;
908
+ if ($[3] !== children || $[4] !== client) {
909
+ t3 = /*#__PURE__*/jsx(GoogleApiClientContext, {
910
+ value: client,
911
+ children: children
515
912
  });
516
- }, [apiKey, setClient]);
517
- return /*#__PURE__*/jsx(GoogleApiClientContext, {
518
- value: client,
519
- children: children
520
- });
913
+ $[3] = children;
914
+ $[4] = client;
915
+ $[5] = t3;
916
+ } else {
917
+ t3 = $[5];
918
+ }
919
+ return t3;
521
920
  }
522
921
 
523
- var GoogleMapsClientContext = /*#__PURE__*/createContext(null);
922
+ const GoogleMapsClientContext = /*#__PURE__*/createContext(null);
524
923
  function useGoogleMapsClient() {
525
924
  return useContext(GoogleMapsClientContext);
526
925
  }
527
926
  function withGoogleMapsClient(WrappedComponent) {
528
- function getDisplayName(_ref) {
529
- var _ref$displayName = _ref.displayName,
530
- displayName = _ref$displayName === void 0 ? null : _ref$displayName,
531
- _ref$name = _ref.name,
532
- name = _ref$name === void 0 ? null : _ref$name;
927
+ function getDisplayName({
928
+ displayName = null,
929
+ name = null
930
+ }) {
533
931
  return displayName || name || 'Component';
534
932
  }
535
933
  function WithGoogleMapsClientComponent(props) {
536
- return /*#__PURE__*/jsx(GoogleMapsClientContext.Consumer, {
537
- children: function children(client) {
538
- return /*#__PURE__*/jsx(WrappedComponent, _objectSpread({
539
- googleApiClient: client
540
- }, props));
541
- }
542
- });
934
+ const $ = c(2);
935
+ let t0;
936
+ if ($[0] !== props) {
937
+ t0 = /*#__PURE__*/jsx(GoogleMapsClientContext.Consumer, {
938
+ children: client => /*#__PURE__*/jsx(WrappedComponent, {
939
+ googleApiClient: client,
940
+ ...props
941
+ })
942
+ });
943
+ $[0] = props;
944
+ $[1] = t0;
945
+ } else {
946
+ t0 = $[1];
947
+ }
948
+ return t0;
543
949
  }
544
- WithGoogleMapsClientComponent.displayName = "WithGoogleMapsClient(".concat(getDisplayName(WrappedComponent), ")");
950
+ WithGoogleMapsClientComponent.displayName = `WithGoogleMapsClient(${getDisplayName(WrappedComponent)})`;
545
951
  return WithGoogleMapsClientComponent;
546
952
  }
547
- function GoogleMapsClientProvider(_ref2) {
548
- var children = _ref2.children,
549
- _ref2$locale = _ref2.locale,
550
- locale = _ref2$locale === void 0 ? 'fr' : _ref2$locale,
551
- _ref2$libraries = _ref2.libraries,
552
- libraries = _ref2$libraries === void 0 ? null : _ref2$libraries;
553
- var _useGoogleKeys = useGoogleKeys(),
554
- apiKey = _useGoogleKeys.apiKey;
555
- var exisitingClient = useGoogleMapsClient();
556
- var _useState = useState(exisitingClient),
557
- _useState2 = _slicedToArray(_useState, 2),
558
- client = _useState2[0],
559
- setClient = _useState2[1];
560
- useEffect(function () {
561
- if (exisitingClient === null) {
562
- loadGoogleMaps({
563
- apiKey: apiKey,
564
- locale: locale,
565
- libraries: libraries
566
- }).then(function (newClient) {
567
- setClient(newClient);
568
- });
569
- }
570
- }, [apiKey, locale, libraries, setClient, exisitingClient]);
571
- return /*#__PURE__*/jsx(GoogleMapsClientContext, {
572
- value: client,
573
- children: children
574
- });
953
+ function GoogleMapsClientProvider(t0) {
954
+ const $ = c(9);
955
+ const {
956
+ children,
957
+ locale: t1,
958
+ libraries: t2
959
+ } = t0;
960
+ const locale = t1 === undefined ? "fr" : t1;
961
+ const libraries = t2 === undefined ? null : t2;
962
+ const {
963
+ apiKey
964
+ } = useGoogleKeys();
965
+ const exisitingClient = useGoogleMapsClient();
966
+ const [client, setClient] = useState(exisitingClient);
967
+ let t3;
968
+ let t4;
969
+ if ($[0] !== apiKey || $[1] !== exisitingClient || $[2] !== libraries || $[3] !== locale) {
970
+ t3 = () => {
971
+ if (exisitingClient === null) {
972
+ loadGoogleMaps({
973
+ apiKey,
974
+ locale,
975
+ libraries
976
+ }).then(newClient => {
977
+ setClient(newClient);
978
+ });
979
+ }
980
+ };
981
+ t4 = [apiKey, locale, libraries, setClient, exisitingClient];
982
+ $[0] = apiKey;
983
+ $[1] = exisitingClient;
984
+ $[2] = libraries;
985
+ $[3] = locale;
986
+ $[4] = t3;
987
+ $[5] = t4;
988
+ } else {
989
+ t3 = $[4];
990
+ t4 = $[5];
991
+ }
992
+ useEffect(t3, t4);
993
+ let t5;
994
+ if ($[6] !== children || $[7] !== client) {
995
+ t5 = /*#__PURE__*/jsx(GoogleMapsClientContext, {
996
+ value: client,
997
+ children: children
998
+ });
999
+ $[6] = children;
1000
+ $[7] = client;
1001
+ $[8] = t5;
1002
+ } else {
1003
+ t5 = $[8];
1004
+ }
1005
+ return t5;
575
1006
  }
576
1007
 
577
- var defaultLocales = ['en', 'fr'];
578
- var LocalesContext = /*#__PURE__*/createContext({
1008
+ const defaultLocales = ['en', 'fr'];
1009
+ const LocalesContext = /*#__PURE__*/createContext({
579
1010
  locales: defaultLocales
580
1011
  });
581
1012
  function useLocalesContext() {
582
- var context = useContext(LocalesContext);
1013
+ const context = useContext(LocalesContext);
583
1014
  return context;
584
1015
  }
585
1016
  function useLocales() {
586
- var _useLocalesContext = useLocalesContext(),
587
- locales = _useLocalesContext.locales;
1017
+ const {
1018
+ locales
1019
+ } = useLocalesContext();
588
1020
  return locales;
589
1021
  }
590
1022
  function useOtherLocales() {
591
- var _useLocalesContext2 = useLocalesContext(),
592
- locales = _useLocalesContext2.locales;
593
- var _useIntl = useIntl(),
594
- locale = _useIntl.locale;
595
- var otherLocales = useMemo(function () {
596
- return locales.filter(function (it) {
597
- return it !== locale;
598
- });
599
- }, [locales, locale]);
1023
+ const $ = c(5);
1024
+ const {
1025
+ locales
1026
+ } = useLocalesContext();
1027
+ const {
1028
+ locale
1029
+ } = useIntl();
1030
+ let t0;
1031
+ if ($[0] !== locale || $[1] !== locales) {
1032
+ let t1;
1033
+ if ($[3] !== locale) {
1034
+ t1 = it => it !== locale;
1035
+ $[3] = locale;
1036
+ $[4] = t1;
1037
+ } else {
1038
+ t1 = $[4];
1039
+ }
1040
+ t0 = locales.filter(t1);
1041
+ $[0] = locale;
1042
+ $[1] = locales;
1043
+ $[2] = t0;
1044
+ } else {
1045
+ t0 = $[2];
1046
+ }
1047
+ const otherLocales = t0;
600
1048
  return otherLocales;
601
1049
  }
602
- var DEFAULT_LOCALES = [];
603
- function LocalesProvider(_ref) {
604
- var _ref$locales = _ref.locales,
605
- locales = _ref$locales === void 0 ? DEFAULT_LOCALES : _ref$locales,
606
- children = _ref.children;
607
- var value = useMemo(function () {
608
- return {
609
- locales: locales
1050
+ const DEFAULT_LOCALES = [];
1051
+ function LocalesProvider(t0) {
1052
+ const $ = c(5);
1053
+ const {
1054
+ locales: t1,
1055
+ children
1056
+ } = t0;
1057
+ const locales = t1 === undefined ? DEFAULT_LOCALES : t1;
1058
+ let t2;
1059
+ if ($[0] !== locales) {
1060
+ t2 = {
1061
+ locales
610
1062
  };
611
- }, [locales]);
612
- return /*#__PURE__*/jsx(LocalesContext, {
613
- value: value,
614
- children: children
615
- });
1063
+ $[0] = locales;
1064
+ $[1] = t2;
1065
+ } else {
1066
+ t2 = $[1];
1067
+ }
1068
+ const value = t2;
1069
+ let t3;
1070
+ if ($[2] !== children || $[3] !== value) {
1071
+ t3 = /*#__PURE__*/jsx(LocalesContext, {
1072
+ value: value,
1073
+ children: children
1074
+ });
1075
+ $[2] = children;
1076
+ $[3] = value;
1077
+ $[4] = t3;
1078
+ } else {
1079
+ t3 = $[4];
1080
+ }
1081
+ return t3;
616
1082
  }
617
1083
 
618
- var ModalContext = /*#__PURE__*/createContext(null);
1084
+ const ModalContext = /*#__PURE__*/createContext(null);
619
1085
  function useModal() {
620
1086
  return useContext(ModalContext) || {};
621
1087
  }
622
- var DEFAULT_MODALS = [];
623
- function ModalProvider(_ref) {
624
- var children = _ref.children,
625
- _ref$container = _ref.container,
626
- initialContainer = _ref$container === void 0 ? null : _ref$container;
627
- var _useState = useState(initialContainer),
628
- _useState2 = _slicedToArray(_useState, 2),
629
- container = _useState2[0],
630
- setContainer = _useState2[1];
631
- var _useState3 = useState(DEFAULT_MODALS),
632
- _useState4 = _slicedToArray(_useState3, 2),
633
- modals = _useState4[0],
634
- setModals = _useState4[1];
635
- var modalsRef = useRef(modals);
636
- var register = useCallback(function (id) {
637
- var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
638
- var _modalsRef$current = modalsRef.current,
639
- currentModals = _modalsRef$current === void 0 ? [] : _modalsRef$current;
640
- var newModals = [].concat(_toConsumableArray(currentModals), [_objectSpread({
641
- id: id
642
- }, data)]);
643
- setModals(newModals);
644
- modalsRef.current = newModals;
645
- }, [setModals]);
646
- var unregister = useCallback(function () {
647
- var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
648
- var _modalsRef$current2 = modalsRef.current,
649
- currentModals = _modalsRef$current2 === void 0 ? [] : _modalsRef$current2;
650
- var foundIndex = currentModals.findIndex(function (_ref2) {
651
- var modalId = _ref2.id;
652
- return modalId === id;
653
- });
654
- if (foundIndex !== -1) {
655
- var newModals = currentModals.filter(function (_ref3) {
656
- var modalId = _ref3.id;
657
- return modalId !== id;
658
- });
1088
+ const DEFAULT_MODALS = [];
1089
+ function ModalProvider(t0) {
1090
+ const $ = c(17);
1091
+ const {
1092
+ children,
1093
+ container: t1
1094
+ } = t0;
1095
+ const initialContainer = t1 === undefined ? null : t1;
1096
+ const [container, setContainer] = useState(initialContainer);
1097
+ const [modals, setModals] = useState(DEFAULT_MODALS);
1098
+ const modalsRef = useRef(modals);
1099
+ let t2;
1100
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1101
+ t2 = (id, t3) => {
1102
+ const data = t3 === undefined ? null : t3;
1103
+ const {
1104
+ current: t4
1105
+ } = modalsRef;
1106
+ const currentModals = t4 === undefined ? [] : t4;
1107
+ const newModals = [...currentModals, {
1108
+ id,
1109
+ ...data
1110
+ }];
659
1111
  setModals(newModals);
660
1112
  modalsRef.current = newModals;
661
- }
662
- }, [setModals]);
663
- var closeLastModal = useCallback(function () {
664
- var lastModal = modals.pop() || null;
665
- if (lastModal !== null) {
666
- var _ref4 = lastModal || {},
667
- _ref4$id = _ref4.id,
668
- lastModalId = _ref4$id === void 0 ? null : _ref4$id,
669
- _ref4$onClose = _ref4.onClose,
670
- onClose = _ref4$onClose === void 0 ? null : _ref4$onClose;
671
- if (onClose !== null) {
672
- onClose();
673
- }
674
- var newModals = modals.filter(function (_ref5) {
675
- var modalId = _ref5.id;
676
- return modalId !== lastModalId;
1113
+ };
1114
+ $[0] = t2;
1115
+ } else {
1116
+ t2 = $[0];
1117
+ }
1118
+ const register = t2;
1119
+ let t3;
1120
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1121
+ t3 = t4 => {
1122
+ const id_0 = t4 === undefined ? null : t4;
1123
+ const {
1124
+ current: t5
1125
+ } = modalsRef;
1126
+ const currentModals_0 = t5 === undefined ? [] : t5;
1127
+ const foundIndex = currentModals_0.findIndex(t6 => {
1128
+ const {
1129
+ id: modalId
1130
+ } = t6;
1131
+ return modalId === id_0;
677
1132
  });
678
- setModals(newModals);
679
- modalsRef.current = newModals;
680
- }
681
- }, [modals, setModals]);
682
- var getModalById = useCallback(function (modalId) {
683
- return (modals || []).find(function (modal) {
684
- return (modal === null || modal === void 0 ? void 0 : modal.id) === modalId;
685
- }) || null;
686
- }, [modals]);
687
- var value = useMemo(function () {
688
- return {
689
- modals: modals,
690
- container: container,
691
- setContainer: setContainer,
692
- register: register,
693
- unregister: unregister,
694
- closeLastModal: closeLastModal,
695
- getModalById: getModalById
1133
+ if (foundIndex !== -1) {
1134
+ const newModals_0 = currentModals_0.filter(t7 => {
1135
+ const {
1136
+ id: modalId_0
1137
+ } = t7;
1138
+ return modalId_0 !== id_0;
1139
+ });
1140
+ setModals(newModals_0);
1141
+ modalsRef.current = newModals_0;
1142
+ }
696
1143
  };
697
- }, [modals, container, setContainer, register, unregister, closeLastModal, getModalById]);
698
- return /*#__PURE__*/jsx(ModalContext, {
699
- value: value,
700
- children: children
701
- });
1144
+ $[1] = t3;
1145
+ } else {
1146
+ t3 = $[1];
1147
+ }
1148
+ const unregister = t3;
1149
+ let t4;
1150
+ if ($[2] !== modals) {
1151
+ t4 = id_1 => {
1152
+ const {
1153
+ requestClose: t6
1154
+ } = modals.find(t5 => {
1155
+ const {
1156
+ id: modalId_1
1157
+ } = t5;
1158
+ return modalId_1 === id_1;
1159
+ }) || {};
1160
+ const requestClose = t6 === undefined ? null : t6;
1161
+ if (requestClose !== null) {
1162
+ requestClose();
1163
+ }
1164
+ };
1165
+ $[2] = modals;
1166
+ $[3] = t4;
1167
+ } else {
1168
+ t4 = $[3];
1169
+ }
1170
+ const closeModal = t4;
1171
+ let t5;
1172
+ if ($[4] !== modals) {
1173
+ t5 = () => {
1174
+ const {
1175
+ requestClose: t6
1176
+ } = modals !== null && modals.length > 0 ? modals[modals.length - 1] || {} : {};
1177
+ const requestClose_0 = t6 === undefined ? null : t6;
1178
+ if (requestClose_0 !== null) {
1179
+ requestClose_0();
1180
+ }
1181
+ };
1182
+ $[4] = modals;
1183
+ $[5] = t5;
1184
+ } else {
1185
+ t5 = $[5];
1186
+ }
1187
+ const closeLastModal = t5;
1188
+ let t6;
1189
+ if ($[6] !== modals) {
1190
+ t6 = modalId_2 => (modals || []).find(modal => modal?.id === modalId_2) || null;
1191
+ $[6] = modals;
1192
+ $[7] = t6;
1193
+ } else {
1194
+ t6 = $[7];
1195
+ }
1196
+ const getModalById = t6;
1197
+ let t7;
1198
+ if ($[8] !== closeLastModal || $[9] !== closeModal || $[10] !== container || $[11] !== getModalById || $[12] !== modals) {
1199
+ t7 = {
1200
+ modals,
1201
+ container,
1202
+ setContainer,
1203
+ register,
1204
+ unregister,
1205
+ closeModal,
1206
+ closeLastModal,
1207
+ getModalById
1208
+ };
1209
+ $[8] = closeLastModal;
1210
+ $[9] = closeModal;
1211
+ $[10] = container;
1212
+ $[11] = getModalById;
1213
+ $[12] = modals;
1214
+ $[13] = t7;
1215
+ } else {
1216
+ t7 = $[13];
1217
+ }
1218
+ const value = t7;
1219
+ let t8;
1220
+ if ($[14] !== children || $[15] !== value) {
1221
+ t8 = /*#__PURE__*/jsx(ModalContext, {
1222
+ value: value,
1223
+ children: children
1224
+ });
1225
+ $[14] = children;
1226
+ $[15] = value;
1227
+ $[16] = t8;
1228
+ } else {
1229
+ t8 = $[16];
1230
+ }
1231
+ return t8;
702
1232
  }
703
1233
 
704
- var PanelsContext = /*#__PURE__*/createContext({
1234
+ const PanelsContext = /*#__PURE__*/createContext({
705
1235
  panels: [],
706
1236
  container: null,
707
- setContainer: function setContainer() {},
708
- register: function register() {},
709
- unregister: function unregister() {}
1237
+ setContainer: () => {},
1238
+ register: () => {},
1239
+ unregister: () => {}
710
1240
  });
711
1241
  function usePanels() {
712
1242
  return useContext(PanelsContext) || {};
713
1243
  }
714
1244
  function withPanels(WrappedComponent) {
715
1245
  function WithPanelsComponent(props) {
716
- return /*#__PURE__*/jsx(PanelsContext.Consumer, {
717
- children: function children(_ref) {
718
- var panels = _ref.panels,
719
- setContainer = _ref.setContainer,
720
- container = _ref.container,
721
- register = _ref.register,
722
- unregister = _ref.unregister;
723
- return /*#__PURE__*/jsx(WrappedComponent, _objectSpread({
724
- panelsContainer: container,
725
- setPanelsContainer: setContainer,
726
- panels: panels,
727
- registerPanel: register,
728
- unregisterPanel: unregister
729
- }, props));
730
- }
731
- });
1246
+ const $ = c(2);
1247
+ let t0;
1248
+ if ($[0] !== props) {
1249
+ t0 = /*#__PURE__*/jsx(PanelsContext.Consumer, {
1250
+ children: t1 => {
1251
+ const {
1252
+ panels,
1253
+ setContainer,
1254
+ container,
1255
+ register,
1256
+ unregister
1257
+ } = t1;
1258
+ return /*#__PURE__*/jsx(WrappedComponent, {
1259
+ panelsContainer: container,
1260
+ setPanelsContainer: setContainer,
1261
+ panels: panels,
1262
+ registerPanel: register,
1263
+ unregisterPanel: unregister,
1264
+ ...props
1265
+ });
1266
+ }
1267
+ });
1268
+ $[0] = props;
1269
+ $[1] = t0;
1270
+ } else {
1271
+ t0 = $[1];
1272
+ }
1273
+ return t0;
732
1274
  }
733
- WithPanelsComponent.displayName = "WithPanels(".concat(getDisplayName(WrappedComponent), ")");
1275
+ WithPanelsComponent.displayName = `WithPanels(${getDisplayName(WrappedComponent)})`;
734
1276
  return WithPanelsComponent;
735
1277
  }
736
- function PanelsProvider(_ref2) {
737
- var children = _ref2.children,
738
- _ref2$container = _ref2.container,
739
- initialContainer = _ref2$container === void 0 ? null : _ref2$container;
740
- var _useState = useState(initialContainer),
741
- _useState2 = _slicedToArray(_useState, 2),
742
- container = _useState2[0],
743
- setContainer = _useState2[1];
744
- var _useState3 = useState([]),
745
- _useState4 = _slicedToArray(_useState3, 2),
746
- panels = _useState4[0],
747
- setPanels = _useState4[1];
748
- var panelsRef = useRef(panels);
749
- var register = useCallback(function (id) {
750
- var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
751
- var currentPanels = panelsRef.current;
752
- var newPanels = [].concat(_toConsumableArray(currentPanels), [_objectSpread({
753
- id: id
754
- }, data)]);
755
- setPanels(newPanels);
756
- panelsRef.current = newPanels;
757
- }, [panels, setPanels]);
758
- var unregister = useCallback(function (id) {
759
- var currentPanels = panelsRef.current;
760
- var foundIndex = currentPanels.findIndex(function (_ref3) {
761
- var modalId = _ref3.id;
762
- return modalId === id;
763
- });
764
- if (foundIndex !== -1) {
765
- var newPanels = currentPanels.filter(function (_ref4) {
766
- var modalId = _ref4.id;
767
- return modalId !== id;
768
- });
1278
+ function PanelsProvider(t0) {
1279
+ const $ = c(9);
1280
+ const {
1281
+ children,
1282
+ container: t1
1283
+ } = t0;
1284
+ const initialContainer = t1 === undefined ? null : t1;
1285
+ const [container, setContainer] = useState(initialContainer);
1286
+ let t2;
1287
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1288
+ t2 = [];
1289
+ $[0] = t2;
1290
+ } else {
1291
+ t2 = $[0];
1292
+ }
1293
+ const [panels, setPanels] = useState(t2);
1294
+ const panelsRef = useRef(panels);
1295
+ let t3;
1296
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1297
+ t3 = (id, t4) => {
1298
+ const data = t4 === undefined ? null : t4;
1299
+ const {
1300
+ current: currentPanels
1301
+ } = panelsRef;
1302
+ const newPanels = [...currentPanels, {
1303
+ id,
1304
+ ...data
1305
+ }];
769
1306
  setPanels(newPanels);
770
1307
  panelsRef.current = newPanels;
771
- }
772
- }, [panels, setPanels]);
773
- var value = useMemo(function () {
774
- return {
775
- panels: panels,
776
- setContainer: setContainer,
777
- container: container,
778
- register: register,
779
- unregister: unregister
780
1308
  };
781
- }, [panels, setContainer, container, register, unregister]);
782
- return /*#__PURE__*/jsx(PanelsContext, {
783
- value: value,
784
- children: children
785
- });
1309
+ $[1] = t3;
1310
+ } else {
1311
+ t3 = $[1];
1312
+ }
1313
+ const register = t3;
1314
+ let t4;
1315
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1316
+ t4 = id_0 => {
1317
+ const {
1318
+ current: currentPanels_0
1319
+ } = panelsRef;
1320
+ const foundIndex = currentPanels_0.findIndex(t5 => {
1321
+ const {
1322
+ id: modalId
1323
+ } = t5;
1324
+ return modalId === id_0;
1325
+ });
1326
+ if (foundIndex !== -1) {
1327
+ const newPanels_0 = currentPanels_0.filter(t6 => {
1328
+ const {
1329
+ id: modalId_0
1330
+ } = t6;
1331
+ return modalId_0 !== id_0;
1332
+ });
1333
+ setPanels(newPanels_0);
1334
+ panelsRef.current = newPanels_0;
1335
+ }
1336
+ };
1337
+ $[2] = t4;
1338
+ } else {
1339
+ t4 = $[2];
1340
+ }
1341
+ const unregister = t4;
1342
+ let t5;
1343
+ if ($[3] !== container || $[4] !== panels) {
1344
+ t5 = {
1345
+ panels,
1346
+ setContainer,
1347
+ container,
1348
+ register,
1349
+ unregister
1350
+ };
1351
+ $[3] = container;
1352
+ $[4] = panels;
1353
+ $[5] = t5;
1354
+ } else {
1355
+ t5 = $[5];
1356
+ }
1357
+ const value = t5;
1358
+ let t6;
1359
+ if ($[6] !== children || $[7] !== value) {
1360
+ t6 = /*#__PURE__*/jsx(PanelsContext, {
1361
+ value: value,
1362
+ children: children
1363
+ });
1364
+ $[6] = children;
1365
+ $[7] = value;
1366
+ $[8] = t6;
1367
+ } else {
1368
+ t6 = $[8];
1369
+ }
1370
+ return t6;
786
1371
  }
787
1372
 
788
- var _excluded = ["component"];
789
- var PanneauContext = /*#__PURE__*/createContext(null);
1373
+ const PanneauContext = /*#__PURE__*/createContext(null);
790
1374
  function usePanneau() {
791
1375
  return useContext(PanneauContext);
792
1376
  }
793
- var DEFAULT_RESOURCES = [];
1377
+ const DEFAULT_RESOURCES = [];
794
1378
  function usePanneauResources() {
795
- var _ref = usePanneau() || {},
796
- _ref$resources = _ref.resources,
797
- resources = _ref$resources === void 0 ? DEFAULT_RESOURCES : _ref$resources;
1379
+ const {
1380
+ resources: t0
1381
+ } = usePanneau() || {};
1382
+ const resources = t0 === undefined ? DEFAULT_RESOURCES : t0;
798
1383
  return resources;
799
1384
  }
800
1385
  function usePanneauResource(id) {
801
- var resources = usePanneauResources();
802
- return resources.find(function (it) {
803
- return it.id === id;
804
- }) || null;
1386
+ const $ = c(3);
1387
+ const resources = usePanneauResources();
1388
+ if (isObject(id)) {
1389
+ return id;
1390
+ }
1391
+ let t0;
1392
+ if ($[0] !== id || $[1] !== resources) {
1393
+ t0 = id !== null ? resources.find(it => it.id === id) || null : null;
1394
+ $[0] = id;
1395
+ $[1] = resources;
1396
+ $[2] = t0;
1397
+ } else {
1398
+ t0 = $[2];
1399
+ }
1400
+ return t0;
805
1401
  }
806
1402
  function usePanneauColorScheme() {
807
- var _ref2 = usePanneau() || {},
808
- _ref2$theme = _ref2.theme,
809
- theme = _ref2$theme === void 0 ? null : _ref2$theme;
810
- var _ref3 = theme || {},
811
- _ref3$colorScheme = _ref3.colorScheme,
812
- colorScheme = _ref3$colorScheme === void 0 ? 'light' : _ref3$colorScheme;
813
- if (colorScheme === null || colorScheme === 'light' || colorScheme === 'dark') {
814
- return colorScheme === 'dark' ? {
815
- theme: 'dark',
816
- background: 'dark',
817
- text: 'light'
818
- } : {
819
- theme: 'light',
820
- background: 'light',
821
- text: 'dark'
1403
+ const $ = c(6);
1404
+ const {
1405
+ theme: t0
1406
+ } = usePanneau() || {};
1407
+ const theme = t0 === undefined ? null : t0;
1408
+ let t1;
1409
+ if ($[0] !== theme) {
1410
+ t1 = theme || {};
1411
+ $[0] = theme;
1412
+ $[1] = t1;
1413
+ } else {
1414
+ t1 = $[1];
1415
+ }
1416
+ const {
1417
+ colorScheme: t2
1418
+ } = t1;
1419
+ const colorScheme = t2 === undefined ? "light" : t2;
1420
+ if (colorScheme === null || colorScheme === "light" || colorScheme === "dark") {
1421
+ let t3;
1422
+ if ($[2] !== colorScheme) {
1423
+ t3 = colorScheme === "dark" ? {
1424
+ theme: "dark",
1425
+ background: "dark",
1426
+ text: "light"
1427
+ } : {
1428
+ theme: "light",
1429
+ background: "light",
1430
+ text: "dark"
1431
+ };
1432
+ $[2] = colorScheme;
1433
+ $[3] = t3;
1434
+ } else {
1435
+ t3 = $[3];
1436
+ }
1437
+ return t3;
1438
+ }
1439
+ let t3;
1440
+ if ($[4] !== colorScheme) {
1441
+ t3 = {
1442
+ theme: colorScheme,
1443
+ background: null,
1444
+ text: null
822
1445
  };
1446
+ $[4] = colorScheme;
1447
+ $[5] = t3;
1448
+ } else {
1449
+ t3 = $[5];
823
1450
  }
824
- return {
825
- theme: colorScheme,
826
- background: null,
827
- text: null
828
- };
1451
+ return t3;
829
1452
  }
830
- var DEFAULT_COMPONENTS = {};
1453
+ const DEFAULT_COMPONENTS = {};
831
1454
  function usePanneauComponents() {
832
- var _ref4 = usePanneau() || {},
833
- _ref4$components = _ref4.components,
834
- components = _ref4$components === void 0 ? DEFAULT_COMPONENTS : _ref4$components;
1455
+ const {
1456
+ components: t0
1457
+ } = usePanneau() || {};
1458
+ const components = t0 === undefined ? DEFAULT_COMPONENTS : t0;
835
1459
  return components;
836
1460
  }
837
1461
  function usePanneauComponent(namespace, name) {
838
- var _ref5 = usePanneau() || {},
839
- _ref5$components = _ref5.components,
840
- components = _ref5$components === void 0 ? {} : _ref5$components;
841
- var path = namespace !== null ? "".concat(namespace, ".").concat(name) : name || null;
842
- var component = path !== null ? components[path] || null : null;
1462
+ const $ = c(2);
1463
+ const {
1464
+ components: t0
1465
+ } = usePanneau() || {};
1466
+ let t1;
1467
+ if ($[0] !== t0) {
1468
+ t1 = t0 === undefined ? {} : t0;
1469
+ $[0] = t0;
1470
+ $[1] = t1;
1471
+ } else {
1472
+ t1 = $[1];
1473
+ }
1474
+ const components = t1;
1475
+ const path = namespace !== null ? `${namespace}.${name}` : name || null;
1476
+ const component = path !== null ? components[path] || null : null;
843
1477
  if (isString(component)) {
844
1478
  return component;
845
1479
  }
846
- if (isObject(component) && isString(component === null || component === void 0 ? void 0 : component.component)) {
847
- component.component;
848
- _objectWithoutProperties(component, _excluded);
1480
+ if (isObject(component) && isString(component?.component)) {
849
1481
  return component.component;
850
1482
  }
851
1483
  return null;
852
1484
  }
853
1485
  function usePanneauAuth() {
854
- var _ref6 = usePanneau() || {},
855
- _ref6$auth = _ref6.auth,
856
- auth = _ref6$auth === void 0 ? {} : _ref6$auth;
1486
+ const $ = c(2);
1487
+ const {
1488
+ auth: t0
1489
+ } = usePanneau() || {};
1490
+ let t1;
1491
+ if ($[0] !== t0) {
1492
+ t1 = t0 === undefined ? {} : t0;
1493
+ $[0] = t0;
1494
+ $[1] = t1;
1495
+ } else {
1496
+ t1 = $[1];
1497
+ }
1498
+ const auth = t1;
857
1499
  return auth;
858
1500
  }
859
1501
  function usePanneauSettings() {
860
- var _ref7 = usePanneau() || {},
861
- _ref7$settings = _ref7.settings,
862
- settings = _ref7$settings === void 0 ? {} : _ref7$settings;
1502
+ const $ = c(2);
1503
+ const {
1504
+ settings: t0
1505
+ } = usePanneau() || {};
1506
+ let t1;
1507
+ if ($[0] !== t0) {
1508
+ t1 = t0 === undefined ? {} : t0;
1509
+ $[0] = t0;
1510
+ $[1] = t1;
1511
+ } else {
1512
+ t1 = $[1];
1513
+ }
1514
+ const settings = t1;
863
1515
  return settings;
864
1516
  }
865
- function PanneauProvider(_ref8) {
866
- var definition = _ref8.definition,
867
- children = _ref8.children;
868
- return /*#__PURE__*/jsx(PanneauContext, {
869
- value: definition,
870
- children: children
871
- });
1517
+ function PanneauProvider(t0) {
1518
+ const $ = c(3);
1519
+ const {
1520
+ definition,
1521
+ children
1522
+ } = t0;
1523
+ let t1;
1524
+ if ($[0] !== children || $[1] !== definition) {
1525
+ t1 = /*#__PURE__*/jsx(PanneauContext, {
1526
+ value: definition,
1527
+ children: children
1528
+ });
1529
+ $[0] = children;
1530
+ $[1] = definition;
1531
+ $[2] = t1;
1532
+ } else {
1533
+ t1 = $[2];
1534
+ }
1535
+ return t1;
872
1536
  }
873
1537
 
874
- var ResourceContext = /*#__PURE__*/createContext(null);
1538
+ const ResourceContext = /*#__PURE__*/createContext(null);
875
1539
  function useResource() {
876
1540
  return use(ResourceContext);
877
1541
  }
878
- function ResourceProvider(_ref) {
879
- var resource = _ref.resource,
880
- children = _ref.children;
881
- return /*#__PURE__*/jsx(ResourceContext, {
882
- value: resource,
883
- children: children
884
- });
1542
+ function ResourceProvider(t0) {
1543
+ const $ = c(3);
1544
+ const {
1545
+ resource,
1546
+ children
1547
+ } = t0;
1548
+ let t1;
1549
+ if ($[0] !== children || $[1] !== resource) {
1550
+ t1 = /*#__PURE__*/jsx(ResourceContext, {
1551
+ value: resource,
1552
+ children: children
1553
+ });
1554
+ $[0] = children;
1555
+ $[1] = resource;
1556
+ $[2] = t1;
1557
+ } else {
1558
+ t1 = $[2];
1559
+ }
1560
+ return t1;
885
1561
  }
886
1562
 
887
1563
  function useRoutePush() {
888
- var url = useUrlGenerator();
889
- var _useLocation = useLocation(),
890
- _useLocation2 = _slicedToArray(_useLocation, 2),
891
- navigate = _useLocation2[1];
892
- var push = useCallback(function (route, data) {
893
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
894
- args[_key - 2] = arguments[_key];
895
- }
896
- if (isString(route)) {
897
- navigate.apply(void 0, [url(route, data)].concat(args));
898
- } else {
899
- var _ref = route || {},
900
- _ref$pathname = _ref.pathname,
901
- pathname = _ref$pathname === void 0 ? null : _ref$pathname,
902
- _ref$search = _ref.search,
903
- search = _ref$search === void 0 ? null : _ref$search;
904
- navigate.apply(void 0, ["".concat(url(pathname, data)).concat(search !== null ? "?".concat(search) : '')].concat(args));
905
- }
906
- }, [navigate, url]);
1564
+ const $ = c(3);
1565
+ const url = useUrlGenerator();
1566
+ const [, navigate] = useLocation();
1567
+ let t0;
1568
+ if ($[0] !== navigate || $[1] !== url) {
1569
+ t0 = (route, data, ...t1) => {
1570
+ const args = t1;
1571
+ if (isString(route)) {
1572
+ navigate(url(route, data), ...args);
1573
+ } else {
1574
+ const {
1575
+ pathname: t2,
1576
+ search: t3
1577
+ } = route || {};
1578
+ const pathname = t2 === undefined ? null : t2;
1579
+ const search = t3 === undefined ? null : t3;
1580
+ navigate(`${url(pathname, data)}${search !== null ? `?${search}` : ""}`, ...args);
1581
+ }
1582
+ };
1583
+ $[0] = navigate;
1584
+ $[1] = url;
1585
+ $[2] = t0;
1586
+ } else {
1587
+ t0 = $[2];
1588
+ }
1589
+ const push = t0;
907
1590
  return push;
908
1591
  }
909
1592
  function useRouteBack() {
910
- var url = useUrlGenerator();
911
- var _useLocation3 = useLocation(),
912
- _useLocation4 = _slicedToArray(_useLocation3, 2),
913
- navigate = _useLocation4[1];
914
- var back = useCallback(function () {
915
- return navigate(-1);
916
- }, [navigate, url]);
1593
+ const $ = c(2);
1594
+ useUrlGenerator();
1595
+ const [, navigate] = useLocation();
1596
+ let t0;
1597
+ if ($[0] !== navigate) {
1598
+ t0 = () => navigate(-1);
1599
+ $[0] = navigate;
1600
+ $[1] = t0;
1601
+ } else {
1602
+ t0 = $[1];
1603
+ }
1604
+ const back = t0;
917
1605
  return back;
918
1606
  }
919
1607
 
920
1608
  function useTracking() {
921
1609
  return useContext(TrackingContext);
922
1610
  }
923
- function TrackingProvider(_ref) {
924
- var _ref$variables = _ref.variables,
925
- variables = _ref$variables === void 0 ? null : _ref$variables,
926
- children = _ref.children;
927
- var contextTracking = useTracking() || null;
928
- var tracking = useMemo(function () {
1611
+ function TrackingProvider(t0) {
1612
+ const $ = c(5);
1613
+ const {
1614
+ variables: t1,
1615
+ children
1616
+ } = t0;
1617
+ const variables = t1 === undefined ? null : t1;
1618
+ const contextTracking = useTracking() || null;
1619
+ let t2;
1620
+ bb0: {
929
1621
  if (contextTracking !== null) {
930
1622
  contextTracking.setVariables(variables);
931
- return contextTracking;
1623
+ t2 = contextTracking;
1624
+ break bb0;
932
1625
  }
933
- return new Tracking({
934
- variables: variables
1626
+ let t3;
1627
+ if ($[0] !== variables) {
1628
+ t3 = new Tracking({
1629
+ variables
1630
+ });
1631
+ $[0] = variables;
1632
+ $[1] = t3;
1633
+ } else {
1634
+ t3 = $[1];
1635
+ }
1636
+ t2 = t3;
1637
+ }
1638
+ const tracking = t2;
1639
+ let t3;
1640
+ if ($[2] !== children || $[3] !== tracking) {
1641
+ t3 = /*#__PURE__*/jsx(TrackingContainer, {
1642
+ tracking: tracking,
1643
+ children: children
935
1644
  });
936
- }, [contextTracking, variables]);
937
- return /*#__PURE__*/jsx(TrackingContainer, {
938
- tracking: tracking,
939
- children: children
940
- });
1645
+ $[2] = children;
1646
+ $[3] = tracking;
1647
+ $[4] = t3;
1648
+ } else {
1649
+ t3 = $[4];
1650
+ }
1651
+ return t3;
941
1652
  }
942
1653
 
943
1654
  export { ACTIONS_NAMESPACE, APP_NAMESPACE, BUTTONS_NAMESPACE, ComponentsContext, ComponentsProvider, DISPLAYS_NAMESPACE, DefinitionProvider, FIELDS_NAMESPACE, FILTERS_NAMESPACE, FORMS_NAMESPACE, FieldsContext, FieldsProvider, FontsContext, FontsProvider, FormProvider, GoogleApiClientContext, GoogleApiClientProvider, GoogleKeysContext, GoogleKeysProvider, GoogleMapsClientContext, GoogleMapsClientProvider, LISTS_NAMESPACE, LocalesContext, LocalesProvider, MODALS_NAMESPACE, ModalContext, ModalProvider, PAGES_NAMESPACE, PREVIEWS_NAMESPACE, PanelsContext, PanelsProvider, PanneauProvider, ResourceProvider, TrackingProvider, useActionComponent, useActionsComponents, useActionsComponentsManager, useAppComponent, useAppComponents, useAppComponentsManager, useButtonComponent, useButtonsComponents, useButtonsComponentsManager, useComponent, useComponents, useComponentsManager, useDefinition, useDefinitionContext, useDisplayComponent, useDisplaysComponents, useDisplaysComponentsManager, useField, useFieldComponent, useFields, useFieldsComponents, useFieldsComponentsManager, useFieldsManager, useFilterComponent, useFiltersComponents, useFiltersComponentsManager, useFonts, useFormComponent, useFormContext, useFormSetValue, useFormValue, useFormsComponents, useFormsComponentsManager, useGoogleApiClient, useGoogleFonts, useGoogleKeys, useGoogleMapsClient, useListComponent, useListsComponents, useListsComponentsManager, useLocales, useLocalesContext, useModal, useModalComponent, useModalsComponents, useModalsComponentsManager, useOtherLocales, usePageComponent, usePagesComponents, usePagesComponentsManager, usePanels, usePanneau, usePanneauAuth, usePanneauColorScheme, usePanneauComponent, usePanneauComponents, usePanneauResource, usePanneauResources, usePanneauSettings, usePreviewComponent, usePreviewsComponents, usePreviewsComponentsManager, useResource, useRouteBack, useRoutePush, useTracking, withGoogleApiClient, withGoogleMapsClient, withPanels };