brew-js-react 0.3.2 → 0.3.4

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,85 +1,86 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe"), require("jQuery"));
4
- else if(typeof define === 'function' && define.amd)
5
- define("brew-js-react", ["brew-js", "react", "react-dom", "react-dom/client", "zeta-dom", "zeta-dom-react", "waterpipe", "jQuery"], factory);
6
- else if(typeof exports === 'object')
7
- exports["brew-js-react"] = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe"), require("jQuery"));
8
- else
9
- root["brew-js-react"] = factory(root["brew"], root["React"], root["ReactDOM"], root["react-dom/client"], root["zeta"], root["zeta-dom-react"], root["waterpipe"], root["jQuery"]);
10
- })(self, function(__WEBPACK_EXTERNAL_MODULE__80__, __WEBPACK_EXTERNAL_MODULE__359__, __WEBPACK_EXTERNAL_MODULE__318__, __WEBPACK_EXTERNAL_MODULE__715__, __WEBPACK_EXTERNAL_MODULE__654__, __WEBPACK_EXTERNAL_MODULE__103__, __WEBPACK_EXTERNAL_MODULE__28__, __WEBPACK_EXTERNAL_MODULE__145__) {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ var __webpack_modules__ = ({
13
-
14
- /***/ 145:
15
- /***/ ((module) => {
16
-
17
- "use strict";
18
- module.exports = __WEBPACK_EXTERNAL_MODULE__145__;
19
-
20
- /***/ }),
21
-
22
- /***/ 715:
23
- /***/ ((module) => {
24
-
25
- "use strict";
26
- if(typeof __WEBPACK_EXTERNAL_MODULE__715__ === 'undefined') { var e = new Error("Cannot find module 'react-dom/client'"); e.code = 'MODULE_NOT_FOUND'; throw e; }
27
-
28
- module.exports = __WEBPACK_EXTERNAL_MODULE__715__;
29
-
30
- /***/ }),
31
-
32
- /***/ 28:
33
- /***/ ((module) => {
34
-
35
- "use strict";
36
- module.exports = __WEBPACK_EXTERNAL_MODULE__28__;
37
-
38
- /***/ }),
39
-
40
- /***/ 103:
41
- /***/ ((module) => {
42
-
43
- "use strict";
44
- module.exports = __WEBPACK_EXTERNAL_MODULE__103__;
45
-
46
- /***/ }),
47
-
48
- /***/ 80:
49
- /***/ ((module) => {
50
-
51
- "use strict";
52
- module.exports = __WEBPACK_EXTERNAL_MODULE__80__;
53
-
54
- /***/ }),
55
-
56
- /***/ 359:
57
- /***/ ((module) => {
58
-
59
- "use strict";
60
- module.exports = __WEBPACK_EXTERNAL_MODULE__359__;
61
-
62
- /***/ }),
63
-
64
- /***/ 318:
65
- /***/ ((module) => {
66
-
67
- "use strict";
68
- module.exports = __WEBPACK_EXTERNAL_MODULE__318__;
69
-
70
- /***/ }),
71
-
72
- /***/ 654:
73
- /***/ ((module) => {
74
-
75
- "use strict";
76
- module.exports = __WEBPACK_EXTERNAL_MODULE__654__;
77
-
78
- /***/ }),
79
-
80
- /***/ 662:
81
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
82
-
1
+ /*! brew-js-react v0.3.4 | (c) misonou | https://hackmd.io/@misonou/brew-js-react */
2
+ (function webpackUniversalModuleDefinition(root, factory) {
3
+ if(typeof exports === 'object' && typeof module === 'object')
4
+ module.exports = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe"), require("jQuery"));
5
+ else if(typeof define === 'function' && define.amd)
6
+ define("brew-js-react", ["brew-js", "react", "react-dom", "react-dom/client", "zeta-dom", "zeta-dom-react", "waterpipe", "jQuery"], factory);
7
+ else if(typeof exports === 'object')
8
+ exports["brew-js-react"] = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe"), require("jQuery"));
9
+ else
10
+ root["brew-js-react"] = factory(root["brew"], root["React"], root["ReactDOM"], root["react-dom/client"], root["zeta"], root["zeta-dom-react"], root["waterpipe"], root["jQuery"]);
11
+ })(self, function(__WEBPACK_EXTERNAL_MODULE__80__, __WEBPACK_EXTERNAL_MODULE__359__, __WEBPACK_EXTERNAL_MODULE__318__, __WEBPACK_EXTERNAL_MODULE__715__, __WEBPACK_EXTERNAL_MODULE__654__, __WEBPACK_EXTERNAL_MODULE__103__, __WEBPACK_EXTERNAL_MODULE__28__, __WEBPACK_EXTERNAL_MODULE__145__) {
12
+ return /******/ (() => { // webpackBootstrap
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 145:
16
+ /***/ ((module) => {
17
+
18
+ "use strict";
19
+ module.exports = __WEBPACK_EXTERNAL_MODULE__145__;
20
+
21
+ /***/ }),
22
+
23
+ /***/ 715:
24
+ /***/ ((module) => {
25
+
26
+ "use strict";
27
+ if(typeof __WEBPACK_EXTERNAL_MODULE__715__ === 'undefined') { var e = new Error("Cannot find module 'react-dom/client'"); e.code = 'MODULE_NOT_FOUND'; throw e; }
28
+
29
+ module.exports = __WEBPACK_EXTERNAL_MODULE__715__;
30
+
31
+ /***/ }),
32
+
33
+ /***/ 28:
34
+ /***/ ((module) => {
35
+
36
+ "use strict";
37
+ module.exports = __WEBPACK_EXTERNAL_MODULE__28__;
38
+
39
+ /***/ }),
40
+
41
+ /***/ 103:
42
+ /***/ ((module) => {
43
+
44
+ "use strict";
45
+ module.exports = __WEBPACK_EXTERNAL_MODULE__103__;
46
+
47
+ /***/ }),
48
+
49
+ /***/ 80:
50
+ /***/ ((module) => {
51
+
52
+ "use strict";
53
+ module.exports = __WEBPACK_EXTERNAL_MODULE__80__;
54
+
55
+ /***/ }),
56
+
57
+ /***/ 359:
58
+ /***/ ((module) => {
59
+
60
+ "use strict";
61
+ module.exports = __WEBPACK_EXTERNAL_MODULE__359__;
62
+
63
+ /***/ }),
64
+
65
+ /***/ 318:
66
+ /***/ ((module) => {
67
+
68
+ "use strict";
69
+ module.exports = __WEBPACK_EXTERNAL_MODULE__318__;
70
+
71
+ /***/ }),
72
+
73
+ /***/ 654:
74
+ /***/ ((module) => {
75
+
76
+ "use strict";
77
+ module.exports = __WEBPACK_EXTERNAL_MODULE__654__;
78
+
79
+ /***/ }),
80
+
81
+ /***/ 662:
82
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
83
+
83
84
  var React = __webpack_require__(318);
84
85
  var ReactDOMClient;
85
86
  try {
@@ -111,1675 +112,1700 @@ try {
111
112
  }
112
113
  /** @type {import("react-dom/client")} */
113
114
  module.exports = ReactDOMClient;
114
-
115
-
116
- /***/ })
117
-
118
- /******/ });
119
- /************************************************************************/
120
- /******/ // The module cache
121
- /******/ var __webpack_module_cache__ = {};
122
- /******/
123
- /******/ // The require function
124
- /******/ function __webpack_require__(moduleId) {
125
- /******/ // Check if module is in cache
126
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
127
- /******/ if (cachedModule !== undefined) {
128
- /******/ return cachedModule.exports;
129
- /******/ }
130
- /******/ // Create a new module (and put it into the cache)
131
- /******/ var module = __webpack_module_cache__[moduleId] = {
132
- /******/ // no module.id needed
133
- /******/ // no module.loaded needed
134
- /******/ exports: {}
135
- /******/ };
136
- /******/
137
- /******/ // Execute the module function
138
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
139
- /******/
140
- /******/ // Return the exports of the module
141
- /******/ return module.exports;
142
- /******/ }
143
- /******/
144
- /************************************************************************/
145
- /******/ /* webpack/runtime/define property getters */
146
- /******/ (() => {
147
- /******/ // define getter functions for harmony exports
148
- /******/ __webpack_require__.d = (exports, definition) => {
149
- /******/ for(var key in definition) {
150
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
151
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
152
- /******/ }
153
- /******/ }
154
- /******/ };
155
- /******/ })();
156
- /******/
157
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
158
- /******/ (() => {
159
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
160
- /******/ })();
161
- /******/
162
- /******/ /* webpack/runtime/make namespace object */
163
- /******/ (() => {
164
- /******/ // define __esModule on exports
165
- /******/ __webpack_require__.r = (exports) => {
166
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
167
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
168
- /******/ }
169
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
170
- /******/ };
171
- /******/ })();
172
- /******/
173
- /************************************************************************/
174
- var __webpack_exports__ = {};
175
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
176
- (() => {
177
- "use strict";
178
-
179
- // EXPORTS
180
- __webpack_require__.d(__webpack_exports__, {
181
- "default": () => (/* binding */ entry)
182
- });
183
-
184
- // NAMESPACE OBJECT: ./src/index.js
185
- var src_namespaceObject = {};
186
- __webpack_require__.r(src_namespaceObject);
187
- __webpack_require__.d(src_namespaceObject, {
188
- "AnimateMixin": () => (AnimateMixin),
189
- "AnimateSequenceItemMixin": () => (AnimateSequenceItemMixin),
190
- "AnimateSequenceMixin": () => (AnimateSequenceMixin),
191
- "ClassNameMixin": () => (ClassNameMixin),
192
- "Dialog": () => (Dialog),
193
- "FlyoutMixin": () => (FlyoutMixin),
194
- "FlyoutToggleMixin": () => (FlyoutToggleMixin),
195
- "FocusStateMixin": () => (FocusStateMixin),
196
- "LoadingStateMixin": () => (LoadingStateMixin),
197
- "Mixin": () => (Mixin),
198
- "ScrollableMixin": () => (ScrollableMixin),
199
- "StatefulMixin": () => (StatefulMixin),
200
- "ViewStateContainer": () => (ViewStateContainer),
201
- "createDialog": () => (createDialog),
202
- "default": () => (src),
203
- "isViewMatched": () => (isViewMatched),
204
- "linkTo": () => (linkTo),
205
- "makeTranslation": () => (makeTranslation),
206
- "matchView": () => (matchView),
207
- "navigateTo": () => (navigateTo),
208
- "redirectTo": () => (redirectTo),
209
- "registerErrorView": () => (registerErrorView),
210
- "registerView": () => (registerView),
211
- "renderView": () => (renderView),
212
- "useAnimateMixin": () => (useAnimateMixin),
213
- "useAnimateSequenceMixin": () => (useAnimateSequenceMixin),
214
- "useAppReady": () => (useAppReady),
215
- "useFlyoutMixin": () => (useFlyoutMixin),
216
- "useFocusStateMixin": () => (useFocusStateMixin),
217
- "useLanguage": () => (useLanguage),
218
- "useLoadingStateMixin": () => (useLoadingStateMixin),
219
- "useMixin": () => (useMixin),
220
- "useMixinRef": () => (useMixinRef),
221
- "useRouteParam": () => (useRouteParam),
222
- "useRouteState": () => (useRouteState),
223
- "useScrollableMixin": () => (useScrollableMixin),
224
- "useViewContainerState": () => (useViewContainerState)
225
- });
226
-
227
- // EXTERNAL MODULE: external {"commonjs":"brew-js","commonjs2":"brew-js","amd":"brew-js","root":"brew"}
228
- var external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_ = __webpack_require__(80);
229
- ;// CONCATENATED MODULE: ./tmp/brew-js/app.js
230
-
231
- var _defaultExport = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_;
232
- /* harmony default export */ const app = (_defaultExport);
233
- var install = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.install,
234
- addExtension = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addExtension,
235
- addDetect = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addDetect,
236
- isElementActive = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.isElementActive;
237
-
238
- ;// CONCATENATED MODULE: ./src/include/brew-js/app.js
239
-
240
-
241
- /* harmony default export */ const brew_js_app = (app);
242
- // EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react","amd":"react","root":"React"}
243
- var external_commonjs_react_commonjs2_react_amd_react_root_React_ = __webpack_require__(359);
244
- // EXTERNAL MODULE: external {"commonjs":"react-dom","commonjs2":"react-dom","amd":"react-dom","root":"ReactDOM"}
245
- var external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_ = __webpack_require__(318);
246
- // EXTERNAL MODULE: ./node_modules/@misonou/react-dom-client/index.js
247
- var react_dom_client = __webpack_require__(662);
248
- ;// CONCATENATED MODULE: ./src/include/external/react-dom-client.js
249
- // @ts-nocheck
250
-
251
- /** @type {import("react-dom/client")} */
252
-
253
- /* harmony default export */ const external_react_dom_client = (react_dom_client);
254
- // EXTERNAL MODULE: external {"commonjs":"zeta-dom","commonjs2":"zeta-dom","amd":"zeta-dom","root":"zeta"}
255
- var external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_ = __webpack_require__(654);
256
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/util.js
257
-
258
- var _lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
259
- noop = _lib$util.noop,
260
- pipe = _lib$util.pipe,
261
- either = _lib$util.either,
262
- is = _lib$util.is,
263
- isUndefinedOrNull = _lib$util.isUndefinedOrNull,
264
- isArray = _lib$util.isArray,
265
- isFunction = _lib$util.isFunction,
266
- isThenable = _lib$util.isThenable,
267
- isPlainObject = _lib$util.isPlainObject,
268
- isArrayLike = _lib$util.isArrayLike,
269
- makeArray = _lib$util.makeArray,
270
- extend = _lib$util.extend,
271
- each = _lib$util.each,
272
- map = _lib$util.map,
273
- grep = _lib$util.grep,
274
- splice = _lib$util.splice,
275
- any = _lib$util.any,
276
- single = _lib$util.single,
277
- kv = _lib$util.kv,
278
- fill = _lib$util.fill,
279
- pick = _lib$util.pick,
280
- exclude = _lib$util.exclude,
281
- mapObject = _lib$util.mapObject,
282
- mapGet = _lib$util.mapGet,
283
- mapRemove = _lib$util.mapRemove,
284
- arrRemove = _lib$util.arrRemove,
285
- setAdd = _lib$util.setAdd,
286
- equal = _lib$util.equal,
287
- combineFn = _lib$util.combineFn,
288
- executeOnce = _lib$util.executeOnce,
289
- createPrivateStore = _lib$util.createPrivateStore,
290
- util_setTimeout = _lib$util.setTimeout,
291
- setTimeoutOnce = _lib$util.setTimeoutOnce,
292
- util_setInterval = _lib$util.setInterval,
293
- setIntervalSafe = _lib$util.setIntervalSafe,
294
- setImmediate = _lib$util.setImmediate,
295
- setImmediateOnce = _lib$util.setImmediateOnce,
296
- _throws = _lib$util["throws"],
297
- throwNotFunction = _lib$util.throwNotFunction,
298
- errorWithCode = _lib$util.errorWithCode,
299
- isErrorWithCode = _lib$util.isErrorWithCode,
300
- util_keys = _lib$util.keys,
301
- values = _lib$util.values,
302
- util_hasOwnProperty = _lib$util.hasOwnProperty,
303
- getOwnPropertyDescriptors = _lib$util.getOwnPropertyDescriptors,
304
- util_define = _lib$util.define,
305
- definePrototype = _lib$util.definePrototype,
306
- defineOwnProperty = _lib$util.defineOwnProperty,
307
- defineGetterProperty = _lib$util.defineGetterProperty,
308
- defineHiddenProperty = _lib$util.defineHiddenProperty,
309
- defineAliasProperty = _lib$util.defineAliasProperty,
310
- defineObservableProperty = _lib$util.defineObservableProperty,
311
- watch = _lib$util.watch,
312
- watchOnce = _lib$util.watchOnce,
313
- watchable = _lib$util.watchable,
314
- inherit = _lib$util.inherit,
315
- freeze = _lib$util.freeze,
316
- deepFreeze = _lib$util.deepFreeze,
317
- iequal = _lib$util.iequal,
318
- randomId = _lib$util.randomId,
319
- repeat = _lib$util.repeat,
320
- camel = _lib$util.camel,
321
- hyphenate = _lib$util.hyphenate,
322
- ucfirst = _lib$util.ucfirst,
323
- lcfirst = _lib$util.lcfirst,
324
- trim = _lib$util.trim,
325
- matchWord = _lib$util.matchWord,
326
- htmlDecode = _lib$util.htmlDecode,
327
- resolve = _lib$util.resolve,
328
- reject = _lib$util.reject,
329
- always = _lib$util.always,
330
- resolveAll = _lib$util.resolveAll,
331
- retryable = _lib$util.retryable,
332
- deferrable = _lib$util.deferrable,
333
- catchAsync = _lib$util.catchAsync,
334
- setPromiseTimeout = _lib$util.setPromiseTimeout,
335
- delay = _lib$util.delay,
336
- makeAsync = _lib$util.makeAsync;
337
-
338
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/util.js
339
-
340
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/domUtil.js
341
-
342
- var domUtil_lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
343
- domReady = domUtil_lib$util.domReady,
344
- tagName = domUtil_lib$util.tagName,
345
- isVisible = domUtil_lib$util.isVisible,
346
- matchSelector = domUtil_lib$util.matchSelector,
347
- comparePosition = domUtil_lib$util.comparePosition,
348
- connected = domUtil_lib$util.connected,
349
- containsOrEquals = domUtil_lib$util.containsOrEquals,
350
- acceptNode = domUtil_lib$util.acceptNode,
351
- combineNodeFilters = domUtil_lib$util.combineNodeFilters,
352
- iterateNode = domUtil_lib$util.iterateNode,
353
- iterateNodeToArray = domUtil_lib$util.iterateNodeToArray,
354
- getCommonAncestor = domUtil_lib$util.getCommonAncestor,
355
- parentsAndSelf = domUtil_lib$util.parentsAndSelf,
356
- selectIncludeSelf = domUtil_lib$util.selectIncludeSelf,
357
- selectClosestRelative = domUtil_lib$util.selectClosestRelative,
358
- createNodeIterator = domUtil_lib$util.createNodeIterator,
359
- createTreeWalker = domUtil_lib$util.createTreeWalker,
360
- bind = domUtil_lib$util.bind,
361
- bindUntil = domUtil_lib$util.bindUntil,
362
- dispatchDOMMouseEvent = domUtil_lib$util.dispatchDOMMouseEvent,
363
- removeNode = domUtil_lib$util.removeNode,
364
- getClass = domUtil_lib$util.getClass,
365
- setClass = domUtil_lib$util.setClass,
366
- getScrollOffset = domUtil_lib$util.getScrollOffset,
367
- getScrollParent = domUtil_lib$util.getScrollParent,
368
- getContentRect = domUtil_lib$util.getContentRect,
369
- scrollBy = domUtil_lib$util.scrollBy,
370
- scrollIntoView = domUtil_lib$util.scrollIntoView,
371
- makeSelection = domUtil_lib$util.makeSelection,
372
- getRect = domUtil_lib$util.getRect,
373
- getRects = domUtil_lib$util.getRects,
374
- toPlainRect = domUtil_lib$util.toPlainRect,
375
- rectEquals = domUtil_lib$util.rectEquals,
376
- rectCovers = domUtil_lib$util.rectCovers,
377
- rectIntersects = domUtil_lib$util.rectIntersects,
378
- pointInRect = domUtil_lib$util.pointInRect,
379
- mergeRect = domUtil_lib$util.mergeRect,
380
- elementFromPoint = domUtil_lib$util.elementFromPoint;
381
-
382
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/domUtil.js
383
-
384
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/dom.js
385
-
386
- var dom_defaultExport = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom;
387
- /* harmony default export */ const dom = (dom_defaultExport);
388
- var _lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
389
- textInputAllowed = _lib$dom.textInputAllowed,
390
- beginDrag = _lib$dom.beginDrag,
391
- beginPinchZoom = _lib$dom.beginPinchZoom,
392
- getShortcut = _lib$dom.getShortcut,
393
- setShortcut = _lib$dom.setShortcut,
394
- focusable = _lib$dom.focusable,
395
- focused = _lib$dom.focused,
396
- setModal = _lib$dom.setModal,
397
- releaseModal = _lib$dom.releaseModal,
398
- retainFocus = _lib$dom.retainFocus,
399
- releaseFocus = _lib$dom.releaseFocus,
400
- iterateFocusPath = _lib$dom.iterateFocusPath,
401
- dom_focus = _lib$dom.focus;
402
-
403
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/dom.js
404
-
405
-
406
- /* harmony default export */ const zeta_dom_dom = (dom);
407
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/domLock.js
408
-
409
- var domLock_lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
410
- lock = domLock_lib$dom.lock,
411
- locked = domLock_lib$dom.locked,
412
- cancelLock = domLock_lib$dom.cancelLock,
413
- subscribeAsync = domLock_lib$dom.subscribeAsync,
414
- notifyAsync = domLock_lib$dom.notifyAsync,
415
- preventLeave = domLock_lib$dom.preventLeave;
416
-
417
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/domLock.js
418
-
419
- ;// CONCATENATED MODULE: ./tmp/brew-js/domAction.js
420
-
421
- var addAsyncAction = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAsyncAction,
422
- closeFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.closeFlyout,
423
- openFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.openFlyout;
424
-
425
- ;// CONCATENATED MODULE: ./src/include/brew-js/domAction.js
426
-
427
- ;// CONCATENATED MODULE: ./src/dialog.js
428
-
429
-
430
-
431
-
432
-
433
-
434
-
435
-
115
+
116
+
117
+ /***/ })
118
+
119
+ /******/ });
120
+ /************************************************************************/
121
+ /******/ // The module cache
122
+ /******/ var __webpack_module_cache__ = {};
123
+ /******/
124
+ /******/ // The require function
125
+ /******/ function __webpack_require__(moduleId) {
126
+ /******/ // Check if module is in cache
127
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
128
+ /******/ if (cachedModule !== undefined) {
129
+ /******/ return cachedModule.exports;
130
+ /******/ }
131
+ /******/ // Create a new module (and put it into the cache)
132
+ /******/ var module = __webpack_module_cache__[moduleId] = {
133
+ /******/ // no module.id needed
134
+ /******/ // no module.loaded needed
135
+ /******/ exports: {}
136
+ /******/ };
137
+ /******/
138
+ /******/ // Execute the module function
139
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
140
+ /******/
141
+ /******/ // Return the exports of the module
142
+ /******/ return module.exports;
143
+ /******/ }
144
+ /******/
145
+ /************************************************************************/
146
+ /******/ /* webpack/runtime/define property getters */
147
+ /******/ (() => {
148
+ /******/ // define getter functions for harmony exports
149
+ /******/ __webpack_require__.d = (exports, definition) => {
150
+ /******/ for(var key in definition) {
151
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
152
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
153
+ /******/ }
154
+ /******/ }
155
+ /******/ };
156
+ /******/ })();
157
+ /******/
158
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
159
+ /******/ (() => {
160
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
161
+ /******/ })();
162
+ /******/
163
+ /******/ /* webpack/runtime/make namespace object */
164
+ /******/ (() => {
165
+ /******/ // define __esModule on exports
166
+ /******/ __webpack_require__.r = (exports) => {
167
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
168
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
169
+ /******/ }
170
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
171
+ /******/ };
172
+ /******/ })();
173
+ /******/
174
+ /************************************************************************/
175
+ var __webpack_exports__ = {};
176
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
177
+ (() => {
178
+ "use strict";
179
+
180
+ // EXPORTS
181
+ __webpack_require__.d(__webpack_exports__, {
182
+ "default": () => (/* binding */ entry)
183
+ });
184
+
185
+ // NAMESPACE OBJECT: ./src/index.js
186
+ var src_namespaceObject = {};
187
+ __webpack_require__.r(src_namespaceObject);
188
+ __webpack_require__.d(src_namespaceObject, {
189
+ "AnimateMixin": () => (AnimateMixin),
190
+ "AnimateSequenceItemMixin": () => (AnimateSequenceItemMixin),
191
+ "AnimateSequenceMixin": () => (AnimateSequenceMixin),
192
+ "ClassNameMixin": () => (ClassNameMixin),
193
+ "Dialog": () => (Dialog),
194
+ "FlyoutMixin": () => (FlyoutMixin),
195
+ "FlyoutToggleMixin": () => (FlyoutToggleMixin),
196
+ "FocusStateMixin": () => (FocusStateMixin),
197
+ "LoadingStateMixin": () => (LoadingStateMixin),
198
+ "Mixin": () => (Mixin),
199
+ "ScrollableMixin": () => (ScrollableMixin),
200
+ "StatefulMixin": () => (StatefulMixin),
201
+ "ViewStateContainer": () => (ViewStateContainer),
202
+ "createDialog": () => (createDialog),
203
+ "default": () => (src),
204
+ "isViewMatched": () => (isViewMatched),
205
+ "linkTo": () => (linkTo),
206
+ "makeTranslation": () => (makeTranslation),
207
+ "matchView": () => (matchView),
208
+ "navigateTo": () => (navigateTo),
209
+ "redirectTo": () => (redirectTo),
210
+ "registerErrorView": () => (registerErrorView),
211
+ "registerView": () => (registerView),
212
+ "renderView": () => (renderView),
213
+ "resolvePath": () => (resolvePath),
214
+ "useAnimateMixin": () => (useAnimateMixin),
215
+ "useAnimateSequenceMixin": () => (useAnimateSequenceMixin),
216
+ "useAppReady": () => (useAppReady),
217
+ "useFlyoutMixin": () => (useFlyoutMixin),
218
+ "useFocusStateMixin": () => (useFocusStateMixin),
219
+ "useLanguage": () => (useLanguage),
220
+ "useLoadingStateMixin": () => (useLoadingStateMixin),
221
+ "useMixin": () => (useMixin),
222
+ "useMixinRef": () => (useMixinRef),
223
+ "useRouteParam": () => (useRouteParam),
224
+ "useRouteState": () => (useRouteState),
225
+ "useScrollableMixin": () => (useScrollableMixin),
226
+ "useViewContainerState": () => (useViewContainerState)
227
+ });
228
+
229
+ // EXTERNAL MODULE: external {"commonjs":"brew-js","commonjs2":"brew-js","amd":"brew-js","root":"brew"}
230
+ var external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_ = __webpack_require__(80);
231
+ ;// CONCATENATED MODULE: ./tmp/brew-js/app.js
232
+
233
+ var _defaultExport = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_;
234
+ /* harmony default export */ const app = (_defaultExport);
235
+ var install = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.install,
236
+ addExtension = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addExtension,
237
+ addDetect = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addDetect,
238
+ isElementActive = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.isElementActive;
239
+
240
+ ;// CONCATENATED MODULE: ./src/include/brew-js/app.js
241
+
242
+
243
+ /* harmony default export */ const brew_js_app = (app);
244
+ // EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react","amd":"react","root":"React"}
245
+ var external_commonjs_react_commonjs2_react_amd_react_root_React_ = __webpack_require__(359);
246
+ // EXTERNAL MODULE: external {"commonjs":"react-dom","commonjs2":"react-dom","amd":"react-dom","root":"ReactDOM"}
247
+ var external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_ = __webpack_require__(318);
248
+ // EXTERNAL MODULE: ./node_modules/@misonou/react-dom-client/index.js
249
+ var react_dom_client = __webpack_require__(662);
250
+ ;// CONCATENATED MODULE: ./src/include/external/react-dom-client.js
251
+ // @ts-nocheck
252
+
253
+ /** @type {import("react-dom/client")} */
254
+
255
+ /* harmony default export */ const external_react_dom_client = (react_dom_client);
256
+ // EXTERNAL MODULE: external {"commonjs":"zeta-dom","commonjs2":"zeta-dom","amd":"zeta-dom","root":"zeta"}
257
+ var external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_ = __webpack_require__(654);
258
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/util.js
259
+
260
+ var _lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
261
+ noop = _lib$util.noop,
262
+ pipe = _lib$util.pipe,
263
+ either = _lib$util.either,
264
+ is = _lib$util.is,
265
+ isUndefinedOrNull = _lib$util.isUndefinedOrNull,
266
+ isArray = _lib$util.isArray,
267
+ isFunction = _lib$util.isFunction,
268
+ isThenable = _lib$util.isThenable,
269
+ isPlainObject = _lib$util.isPlainObject,
270
+ isArrayLike = _lib$util.isArrayLike,
271
+ makeArray = _lib$util.makeArray,
272
+ extend = _lib$util.extend,
273
+ each = _lib$util.each,
274
+ map = _lib$util.map,
275
+ grep = _lib$util.grep,
276
+ splice = _lib$util.splice,
277
+ any = _lib$util.any,
278
+ single = _lib$util.single,
279
+ kv = _lib$util.kv,
280
+ fill = _lib$util.fill,
281
+ pick = _lib$util.pick,
282
+ exclude = _lib$util.exclude,
283
+ mapObject = _lib$util.mapObject,
284
+ mapGet = _lib$util.mapGet,
285
+ mapRemove = _lib$util.mapRemove,
286
+ arrRemove = _lib$util.arrRemove,
287
+ setAdd = _lib$util.setAdd,
288
+ equal = _lib$util.equal,
289
+ combineFn = _lib$util.combineFn,
290
+ executeOnce = _lib$util.executeOnce,
291
+ createPrivateStore = _lib$util.createPrivateStore,
292
+ util_setTimeout = _lib$util.setTimeout,
293
+ setTimeoutOnce = _lib$util.setTimeoutOnce,
294
+ util_setInterval = _lib$util.setInterval,
295
+ setIntervalSafe = _lib$util.setIntervalSafe,
296
+ setImmediate = _lib$util.setImmediate,
297
+ setImmediateOnce = _lib$util.setImmediateOnce,
298
+ _throws = _lib$util["throws"],
299
+ throwNotFunction = _lib$util.throwNotFunction,
300
+ errorWithCode = _lib$util.errorWithCode,
301
+ isErrorWithCode = _lib$util.isErrorWithCode,
302
+ util_keys = _lib$util.keys,
303
+ values = _lib$util.values,
304
+ util_hasOwnProperty = _lib$util.hasOwnProperty,
305
+ getOwnPropertyDescriptors = _lib$util.getOwnPropertyDescriptors,
306
+ util_define = _lib$util.define,
307
+ definePrototype = _lib$util.definePrototype,
308
+ defineOwnProperty = _lib$util.defineOwnProperty,
309
+ defineGetterProperty = _lib$util.defineGetterProperty,
310
+ defineHiddenProperty = _lib$util.defineHiddenProperty,
311
+ defineAliasProperty = _lib$util.defineAliasProperty,
312
+ defineObservableProperty = _lib$util.defineObservableProperty,
313
+ watch = _lib$util.watch,
314
+ watchOnce = _lib$util.watchOnce,
315
+ watchable = _lib$util.watchable,
316
+ inherit = _lib$util.inherit,
317
+ freeze = _lib$util.freeze,
318
+ deepFreeze = _lib$util.deepFreeze,
319
+ iequal = _lib$util.iequal,
320
+ randomId = _lib$util.randomId,
321
+ repeat = _lib$util.repeat,
322
+ camel = _lib$util.camel,
323
+ hyphenate = _lib$util.hyphenate,
324
+ ucfirst = _lib$util.ucfirst,
325
+ lcfirst = _lib$util.lcfirst,
326
+ trim = _lib$util.trim,
327
+ matchWord = _lib$util.matchWord,
328
+ htmlDecode = _lib$util.htmlDecode,
329
+ resolve = _lib$util.resolve,
330
+ reject = _lib$util.reject,
331
+ always = _lib$util.always,
332
+ resolveAll = _lib$util.resolveAll,
333
+ retryable = _lib$util.retryable,
334
+ deferrable = _lib$util.deferrable,
335
+ catchAsync = _lib$util.catchAsync,
336
+ setPromiseTimeout = _lib$util.setPromiseTimeout,
337
+ delay = _lib$util.delay,
338
+ makeAsync = _lib$util.makeAsync;
339
+
340
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/domUtil.js
341
+
342
+ var domUtil_lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
343
+ domReady = domUtil_lib$util.domReady,
344
+ tagName = domUtil_lib$util.tagName,
345
+ isVisible = domUtil_lib$util.isVisible,
346
+ matchSelector = domUtil_lib$util.matchSelector,
347
+ comparePosition = domUtil_lib$util.comparePosition,
348
+ connected = domUtil_lib$util.connected,
349
+ containsOrEquals = domUtil_lib$util.containsOrEquals,
350
+ acceptNode = domUtil_lib$util.acceptNode,
351
+ combineNodeFilters = domUtil_lib$util.combineNodeFilters,
352
+ iterateNode = domUtil_lib$util.iterateNode,
353
+ iterateNodeToArray = domUtil_lib$util.iterateNodeToArray,
354
+ getCommonAncestor = domUtil_lib$util.getCommonAncestor,
355
+ parentsAndSelf = domUtil_lib$util.parentsAndSelf,
356
+ selectIncludeSelf = domUtil_lib$util.selectIncludeSelf,
357
+ selectClosestRelative = domUtil_lib$util.selectClosestRelative,
358
+ createNodeIterator = domUtil_lib$util.createNodeIterator,
359
+ createTreeWalker = domUtil_lib$util.createTreeWalker,
360
+ bind = domUtil_lib$util.bind,
361
+ bindUntil = domUtil_lib$util.bindUntil,
362
+ dispatchDOMMouseEvent = domUtil_lib$util.dispatchDOMMouseEvent,
363
+ removeNode = domUtil_lib$util.removeNode,
364
+ getClass = domUtil_lib$util.getClass,
365
+ setClass = domUtil_lib$util.setClass,
366
+ getScrollOffset = domUtil_lib$util.getScrollOffset,
367
+ getScrollParent = domUtil_lib$util.getScrollParent,
368
+ getContentRect = domUtil_lib$util.getContentRect,
369
+ scrollBy = domUtil_lib$util.scrollBy,
370
+ scrollIntoView = domUtil_lib$util.scrollIntoView,
371
+ makeSelection = domUtil_lib$util.makeSelection,
372
+ getRect = domUtil_lib$util.getRect,
373
+ getRects = domUtil_lib$util.getRects,
374
+ toPlainRect = domUtil_lib$util.toPlainRect,
375
+ rectEquals = domUtil_lib$util.rectEquals,
376
+ rectCovers = domUtil_lib$util.rectCovers,
377
+ rectIntersects = domUtil_lib$util.rectIntersects,
378
+ pointInRect = domUtil_lib$util.pointInRect,
379
+ mergeRect = domUtil_lib$util.mergeRect,
380
+ elementFromPoint = domUtil_lib$util.elementFromPoint;
381
+
382
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/dom.js
383
+
384
+ var dom_defaultExport = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom;
385
+ /* harmony default export */ const dom = (dom_defaultExport);
386
+ var _lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
387
+ textInputAllowed = _lib$dom.textInputAllowed,
388
+ beginDrag = _lib$dom.beginDrag,
389
+ beginPinchZoom = _lib$dom.beginPinchZoom,
390
+ getShortcut = _lib$dom.getShortcut,
391
+ setShortcut = _lib$dom.setShortcut,
392
+ focusable = _lib$dom.focusable,
393
+ focused = _lib$dom.focused,
394
+ setModal = _lib$dom.setModal,
395
+ releaseModal = _lib$dom.releaseModal,
396
+ retainFocus = _lib$dom.retainFocus,
397
+ releaseFocus = _lib$dom.releaseFocus,
398
+ iterateFocusPath = _lib$dom.iterateFocusPath,
399
+ dom_focus = _lib$dom.focus;
400
+
401
+ ;// CONCATENATED MODULE: ./src/include/zeta-dom/dom.js
402
+
403
+
404
+ /* harmony default export */ const zeta_dom_dom = (dom);
405
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/domLock.js
406
+
407
+ var domLock_lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
408
+ lock = domLock_lib$dom.lock,
409
+ locked = domLock_lib$dom.locked,
410
+ cancelLock = domLock_lib$dom.cancelLock,
411
+ subscribeAsync = domLock_lib$dom.subscribeAsync,
412
+ notifyAsync = domLock_lib$dom.notifyAsync,
413
+ preventLeave = domLock_lib$dom.preventLeave;
414
+
415
+ ;// CONCATENATED MODULE: ./tmp/brew-js/domAction.js
416
+
417
+ var addAsyncAction = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAsyncAction,
418
+ closeFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.closeFlyout,
419
+ openFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.openFlyout;
420
+
421
+ ;// CONCATENATED MODULE: ./src/dialog.js
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
436
430
  /**
437
431
  * @param {Partial<import("./dialog").DialogOptions<any>>} props
438
- */
439
-
440
- function createDialog(props) {
441
- var root = document.createElement('div');
442
- var reactRoot = external_react_dom_client.createRoot(root);
443
-
444
- var _closeDialog = closeFlyout.bind(0, root);
445
-
446
- var promise;
447
- zeta_dom_dom.on(root, 'flyouthide', function () {
448
- removeNode(root);
449
- (props.onClose || noop)(root);
450
-
451
- if (props.onRender) {
452
- reactRoot.unmount();
453
- }
454
- });
455
- return {
456
- root: root,
457
- close: _closeDialog,
458
- open: function open() {
459
- if (promise) {
460
- return promise;
461
- }
462
-
463
- root.className = props.className || '';
464
- document.body.appendChild(root);
465
- zeta_dom_dom.retainFocus(zeta_dom_dom.activeElement, root);
466
-
467
- if (props.modal) {
468
- root.setAttribute('is-modal', '');
469
- zeta_dom_dom.setModal(root);
470
- }
471
-
472
- if (props.onRender) {
473
- var dialogProps = extend({}, props, {
474
- closeDialog: function closeDialog(value) {
475
- var promise = makeAsync(props.onCommit || pipe)(value);
476
- catchAsync(lock(zeta_dom_dom.activeElement, promise));
477
- promise.then(_closeDialog, noop);
478
- }
479
- });
480
- var content = /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(props.onRender, dialogProps);
481
-
482
- if (props.wrapper) {
483
- content = /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(props.wrapper, dialogProps, content);
484
- }
485
-
486
- reactRoot.render(content);
487
- }
488
-
489
- promise = openFlyout(root);
490
-
491
- if (props.preventLeave) {
492
- preventLeave(root, promise);
493
- } else if (props.preventNavigation) {
494
- lock(root, promise);
495
- }
496
-
497
- always(promise, function () {
498
- promise = null;
499
- });
500
- (props.onOpen || noop)(root);
501
- return promise;
502
- }
503
- };
504
- }
432
+ */
433
+
434
+ function createDialog(props) {
435
+ var root = document.createElement('div');
436
+ var reactRoot = external_react_dom_client.createRoot(root);
437
+
438
+ var _closeDialog = closeFlyout.bind(0, root);
439
+
440
+ var promise;
441
+ zeta_dom_dom.on(root, 'flyouthide', function () {
442
+ removeNode(root);
443
+ (props.onClose || noop)(root);
444
+
445
+ if (props.onRender) {
446
+ reactRoot.unmount();
447
+ }
448
+ });
449
+ return {
450
+ root: root,
451
+ close: _closeDialog,
452
+ open: function open() {
453
+ if (promise) {
454
+ return promise;
455
+ }
456
+
457
+ root.className = props.className || '';
458
+ document.body.appendChild(root);
459
+ zeta_dom_dom.retainFocus(zeta_dom_dom.activeElement, root);
460
+
461
+ if (props.modal) {
462
+ root.setAttribute('is-modal', '');
463
+ zeta_dom_dom.setModal(root);
464
+ }
465
+
466
+ if (props.onRender) {
467
+ var dialogProps = extend({}, props, {
468
+ closeDialog: function closeDialog(value) {
469
+ var promise = makeAsync(props.onCommit || pipe)(value);
470
+ catchAsync(lock(zeta_dom_dom.activeElement, promise));
471
+ promise.then(_closeDialog, noop);
472
+ }
473
+ });
474
+ var content = /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(props.onRender, dialogProps);
475
+
476
+ if (props.wrapper) {
477
+ content = /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(props.wrapper, dialogProps, content);
478
+ }
479
+
480
+ reactRoot.render(content);
481
+ }
482
+
483
+ promise = openFlyout(root);
484
+
485
+ if (props.preventLeave) {
486
+ preventLeave(root, promise);
487
+ } else if (props.preventNavigation) {
488
+ lock(root, promise);
489
+ }
490
+
491
+ always(promise, function () {
492
+ promise = null;
493
+ });
494
+ (props.onOpen || noop)(root);
495
+ return promise;
496
+ }
497
+ };
498
+ }
505
499
  /**
506
500
  * @param {import("./dialog").DialogProps} props
507
- */
508
-
509
- function Dialog(props) {
510
- var _props = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)({})[0];
511
- var dialog = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
512
- return createDialog(_props);
513
- })[0];
514
- extend(_props, props);
515
- (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
516
- var opened = containsOrEquals(zeta_dom_dom.root, dialog.root);
517
-
518
- if (either(opened, _props.isOpen)) {
519
- if (!opened) {
520
- dialog.open();
521
- } else {
522
- dialog.close();
523
- }
524
- }
525
- }, [_props.isOpen]);
526
- (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
527
- return dialog.close;
528
- }, [dialog]);
529
- return /*#__PURE__*/external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_.createPortal(props.children, dialog.root);
530
- }
531
- // EXTERNAL MODULE: external "zeta-dom-react"
532
- var external_zeta_dom_react_ = __webpack_require__(103);
533
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/events.js
534
-
535
- var ZetaEventContainer = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.EventContainer;
536
-
537
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/events.js
538
-
539
- ;// CONCATENATED MODULE: ./tmp/brew-js/defaults.js
540
-
541
- var defaults_defaultExport = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.defaults;
542
- /* harmony default export */ const defaults = (defaults_defaultExport);
543
- ;// CONCATENATED MODULE: ./src/include/brew-js/defaults.js
544
-
545
- /* harmony default export */ const brew_js_defaults = (defaults);
546
- ;// CONCATENATED MODULE: ./src/app.js
547
-
548
-
549
- /** @type {Brew.AppInstance<Brew.WithRouter & Brew.WithI18n>} */
550
-
551
- var app_app;
552
- install('react', function (app_) {
553
- // @ts-ignore: type inference issue
554
- app_app = app_;
555
- });
556
- brew_js_defaults.react = true;
557
- ;// CONCATENATED MODULE: ./tmp/brew-js/anim.js
558
-
559
- var animateIn = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateIn,
560
- animateOut = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateOut,
561
- addAnimateIn = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAnimateIn,
562
- addAnimateOut = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAnimateOut;
563
-
564
- ;// CONCATENATED MODULE: ./src/include/brew-js/anim.js
565
-
566
- ;// CONCATENATED MODULE: ./tmp/brew-js/util/path.js
567
-
568
- var setBaseUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.setBaseUrl,
569
- combinePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.combinePath,
570
- normalizePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.normalizePath,
571
- removeQueryAndHash = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.removeQueryAndHash,
572
- withBaseUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.withBaseUrl,
573
- toAbsoluteUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toAbsoluteUrl,
574
- toRelativeUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toRelativeUrl,
575
- isSubPathOf = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.isSubPathOf,
576
- toSegments = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toSegments;
577
-
578
- ;// CONCATENATED MODULE: ./src/include/brew-js/util/path.js
579
-
580
- ;// CONCATENATED MODULE: ./src/view.js
581
-
582
-
583
-
584
-
585
-
586
-
587
-
588
-
589
-
590
- var root = zeta_dom_dom.root;
591
- var routeMap = new Map();
592
- var usedParams = {};
593
- var sortedViews = [];
594
- var StateContext = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createContext(Object.freeze({
595
- container: root,
596
- active: true
597
- }));
598
- var errorView;
599
-
600
- function ErrorBoundary() {
601
- external_commonjs_react_commonjs2_react_amd_react_root_React_.Component.apply(this, arguments);
602
- this.state = {};
603
- }
604
-
605
- ErrorBoundary.contextType = StateContext;
606
- definePrototype(ErrorBoundary, external_commonjs_react_commonjs2_react_amd_react_root_React_.Component, {
607
- componentDidCatch: function componentDidCatch(error) {
608
- var self = this;
609
-
610
- if (errorView && !self.state.error) {
611
- self.setState({
612
- error: error
613
- });
614
- } else {
615
- zeta_dom_dom.emit('error', self.context.container, {
616
- error: error
617
- }, true);
618
- }
619
- },
620
- render: function render() {
621
- var self = this;
622
- var props = {
623
- view: self.context.view,
624
- error: self.state.error,
625
- reset: self.reset.bind(self)
626
- };
627
- var onComponentLoaded = self.props.onComponentLoaded;
628
-
629
- if (props.error) {
630
- return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(errorView, {
631
- onComponentLoaded: onComponentLoaded,
632
- viewProps: props
633
- });
634
- }
635
-
636
- return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(props.view, {
637
- onComponentLoaded: onComponentLoaded
638
- });
639
- },
640
- reset: function reset() {
641
- this.setState({
642
- error: null
643
- });
644
- }
645
- });
646
-
647
- function ViewContainer() {
648
- external_commonjs_react_commonjs2_react_amd_react_root_React_.Component.apply(this, arguments);
649
- this.stateId = history.state;
650
- }
651
-
652
- definePrototype(ViewContainer, external_commonjs_react_commonjs2_react_amd_react_root_React_.Component, {
653
- componentDidMount: function componentDidMount() {
654
- /** @type {any} */
655
- var self = this;
656
- self.componentWillUnmount = combineFn(watch(app_app.route, function () {
657
- self.setActive(self.getViewComponent() === self.currentViewComponent);
658
- }), app_app.on('beforepageload', function (e) {
659
- self.waitFor = e.waitFor;
660
- self.stateId = history.state;
661
- self.forceUpdate();
662
- }));
663
- },
664
- render: function render() {
665
- /** @type {any} */
666
- var self = this;
667
-
668
- if (history.state !== self.stateId) {
669
- return self.lastChild || null;
670
- }
671
-
672
- var V = self.getViewComponent();
673
-
674
- if (V) {
675
- // ensure the current path actually corresponds to the matched view
676
- // when some views are not included in the list of allowed views
677
- var targetPath = linkTo(V, getCurrentParams(V, true));
678
-
679
- if (targetPath !== removeQueryAndHash(app_app.path)) {
680
- app_app.navigate(targetPath, true);
681
- }
682
- }
683
-
684
- if (V && V !== self.currentViewComponent) {
685
- var prevElement = self.currentElement;
686
-
687
- if (prevElement) {
688
- self.setActive(false);
689
- self.prevView = self.currentView;
690
- self.currentElement = undefined;
691
- app_app.emit('pageleave', prevElement, {
692
- pathname: self.currentPath
693
- }, true);
694
- animateOut(prevElement, 'show').then(function () {
695
- self.prevView = undefined;
696
- self.forceUpdate();
697
- });
698
- }
699
-
700
- var onComponentLoaded;
701
- var promise = new Promise(function (resolve) {
702
- onComponentLoaded = resolve;
703
- });
704
- var initElement = executeOnce(function (element) {
705
- self.currentElement = element;
706
- state.container = element;
707
- promise.then(function () {
708
- animateIn(element, 'show');
709
- app_app.emit('pageenter', element, {
710
- pathname: app_app.path
711
- }, true);
712
- });
713
- notifyAsync(element, promise);
714
- });
715
- var state = {
716
- view: V
717
- };
718
- var view = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(StateContext.Provider, {
719
- key: routeMap.get(V).id,
720
- value: state
721
- }, /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ViewStateContainer, null, /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement('div', extend({}, self.props.rootProps, {
722
- ref: initElement
723
- }), /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ErrorBoundary, {
724
- onComponentLoaded: onComponentLoaded
725
- }))));
726
- extend(self, {
727
- currentPath: app_app.path,
728
- currentView: view,
729
- currentViewComponent: V,
730
- setActive: defineObservableProperty(state, 'active', true, true)
731
- });
732
- (self.waitFor || noop)(promise);
733
- }
734
-
735
- var child = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment, null, self.prevView, self.currentView);
736
- self.lastChild = child;
737
- return child;
738
- },
739
- getViewComponent: function getViewComponent() {
740
- var props = this.props;
741
- return any(props.views, isViewMatched) || props.defaultView;
742
- }
743
- });
744
-
745
- function getCurrentParams(view, includeAll, params) {
746
- var state = routeMap.get(view);
747
-
748
- if (!state.maxParams) {
749
- var matchers = exclude(state.matchers, ['remainingSegments']);
750
- var matched = map(app_app.routes, function (v) {
751
- var route = app_app.parseRoute(v);
752
- var matched = route.length && !any(matchers, function (v, i) {
753
- var pos = route.params[i];
754
- return (v ? !(pos >= 0) : pos < route.minLength) || !isFunction(v) && !route.match(i, v);
755
- });
756
- return matched ? route : null;
757
- });
758
-
759
- if (matched[1]) {
760
- matched = grep(matched, function (v) {
761
- return !single(v.params, function (v, i) {
762
- return usedParams[i] && !matchers[i];
763
- });
764
- });
765
- }
766
-
767
- if (matched[0]) {
768
- var last = matched.slice(-1)[0];
769
- state.maxParams = util_keys(extend.apply(0, [{
770
- remainingSegments: true
771
- }].concat(matched.map(function (v) {
772
- return v.params;
773
- }))));
774
- state.minParams = map(last.params, function (v, i) {
775
- return state.params[i] || v >= last.minLength ? null : i;
776
- });
777
- }
778
- }
779
-
780
- return pick(params || app_app.route, includeAll ? state.maxParams : state.minParams);
781
- }
782
-
783
- function sortViews(a, b) {
784
- return (routeMap.get(b) || {}).matchCount - (routeMap.get(a) || {}).matchCount;
785
- }
786
-
787
- function matchViewParams(view, route) {
788
- var params = routeMap.get(view);
789
- return !!params && !single(params.matchers, function (v, i) {
790
- var value = route[i] || '';
791
- return isFunction(v) ? !v(value) : (v || '') !== value;
792
- });
793
- }
794
-
795
- function createViewComponent(factory) {
796
- var promise;
797
- throwNotFunction(factory);
798
-
799
- if (factory.prototype instanceof external_commonjs_react_commonjs2_react_amd_react_root_React_.Component) {
800
- factory = external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement.bind(null, factory);
801
- }
802
-
803
- return function (props) {
804
- var viewProps = Object.freeze(props.viewProps || {});
805
- var children = !promise && factory(viewProps);
806
-
807
- if (isThenable(children)) {
808
- promise = children;
809
- children = null;
810
- }
811
-
812
- var state = (0,external_zeta_dom_react_.useAsync)(function () {
813
- return promise.then(function (s) {
814
- return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(s["default"], viewProps);
815
- });
816
- }, !!promise)[1];
817
-
818
- if (!promise || !state.loading) {
819
- props.onComponentLoaded();
820
-
821
- if (state.error) {
822
- throw state.error;
823
- }
824
- }
825
-
826
- return children || state.value || /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment);
827
- };
828
- }
829
-
830
- function useViewContainerState() {
831
- return external_commonjs_react_commonjs2_react_amd_react_root_React_.useContext(StateContext);
832
- }
833
- function isViewMatched(view) {
834
- return matchViewParams(view, app_app.route);
835
- }
836
- function matchView(path, views) {
837
- var route = app_app.route;
838
-
839
- if (typeof path === 'string') {
840
- route = route.parse(path);
841
- } else {
842
- views = path;
843
- }
844
-
845
- views = views ? makeArray(views).sort(sortViews) : sortedViews;
846
- return any(views, function (v) {
847
- return matchViewParams(v, route);
848
- }) || undefined;
849
- }
850
- function registerView(factory, routeParams) {
851
- var Component = createViewComponent(factory);
852
- routeParams = extend({}, routeParams);
853
- each(routeParams, function (i, v) {
854
- usedParams[i] = true;
855
-
856
- if (v instanceof RegExp) {
857
- routeParams[i] = v.test.bind(v);
858
- }
859
- });
860
- routeMap.set(Component, {
861
- id: randomId(),
862
- matchCount: util_keys(routeParams).length,
863
- matchers: routeParams,
864
- params: pick(routeParams, function (v) {
865
- return isUndefinedOrNull(v) || typeof v === 'string';
866
- })
867
- });
868
- sortedViews.push(Component);
869
- sortedViews.sort(sortViews);
870
- return Component;
871
- }
872
- function registerErrorView(factory) {
873
- errorView = createViewComponent(factory);
874
- }
875
- function renderView() {
876
- var views = makeArray(arguments);
877
- var rootProps = isFunction(views[0]) ? {} : views.shift();
878
- var defaultView = views[0];
879
- views.sort(sortViews);
880
- return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ViewContainer, {
881
- rootProps: rootProps,
882
- views: views,
883
- defaultView: defaultView
884
- });
885
- }
886
- function linkTo(view, params) {
887
- var state = routeMap.get(view);
888
-
889
- if (!state) {
890
- return '/';
891
- }
892
-
893
- var newParams = extend(getCurrentParams(view), getCurrentParams(view, true, params || {}), state.params);
894
- return app_app.route.getPath(newParams);
895
- }
896
- function navigateTo(view, params) {
897
- return app_app.navigate(linkTo(view, params));
898
- }
899
- function redirectTo(view, params) {
900
- return app_app.navigate(linkTo(view, params), true);
901
- }
902
- ;// CONCATENATED MODULE: ./src/hooks.js
903
-
904
-
905
-
906
-
907
-
908
-
909
- var emitter = new ZetaEventContainer();
910
- var states = {};
911
-
912
- function getCurrentStates() {
913
- return states[history.state] || (states[history.state] = {});
914
- }
915
-
916
- function ViewState(key, value) {
917
- this.key = key;
918
- this.value = value;
919
- }
920
-
921
- definePrototype(ViewState, {
922
- get: function get() {
923
- return this.value;
924
- },
925
- set: function set(value) {
926
- this.value = value;
927
- },
928
- onPopState: function onPopState(callback) {
929
- throwNotFunction(callback);
930
- return emitter.add(this, 'popstate', function (e) {
931
- callback.call(this, e.newValue);
932
- });
933
- }
934
- });
935
- function useAppReady() {
936
- var sReady = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(false);
937
- var ready = sReady[0],
938
- setReady = sReady[1];
939
- (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
940
- app_app.ready.then(function () {
941
- setReady(true);
942
- });
943
- }, []);
944
- return ready;
945
- }
946
- function useRouteParam(name, defaultValue) {
947
- var container = useViewContainerState();
948
- var route = app_app.route;
949
- var value = route[name] || '';
950
- var ref = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useRef)(value);
951
- var forceUpdate = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)()[1];
952
- (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
953
- var setValue = function setValue() {
954
- var current = route[name] || '';
955
-
956
- if (current !== ref.current) {
957
- if (container.active) {
958
- ref.current = current;
959
- forceUpdate({});
960
- } else {
961
- watch(container, 'active', setValue);
962
- }
963
- }
964
- }; // route parameter might be changed after state initialization and before useEffect hook is called
965
-
966
-
967
- setValue();
968
-
969
- if (name in route) {
970
- return route.watch(name, function () {
971
- setImmediateOnce(setValue);
972
- });
973
- }
974
-
975
- console.error('Route parameter ' + name + ' does not exist');
976
- }, [name, defaultValue]);
977
- ref.current = value;
978
-
979
- if (defaultValue !== undefined && (!value || name === 'remainingSegments' && value === '/')) {
980
- app_app.navigate(route.getPath(extend({}, route, kv(name, defaultValue))), true);
981
- }
982
-
983
- return value;
984
- }
985
- function useRouteState(key, defaultValue) {
986
- var container = useViewContainerState();
987
- var cur = getCurrentStates();
988
- var state = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(key in cur ? cur[key] : defaultValue);
989
-
990
- if (container.active) {
991
- cur[key] = state[0];
992
- }
993
-
994
- return state;
995
- }
996
- function ViewStateContainer(props) {
997
- var container = useViewContainerState();
998
- var provider = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
999
- var cache = {};
1000
- return {
1001
- getState: function getState(uniqueId, key) {
1002
- var cur = getCurrentStates();
1003
- var state = cache[uniqueId] || (cache[uniqueId] = new ViewState(key, cur[key] && cur[key].value));
1004
-
1005
- if (container.active) {
1006
- var stateId = state.stateId;
1007
-
1008
- if (stateId && (stateId !== history.state || key !== state.key)) {
1009
- var newValue = cur[key] && cur[key].value;
1010
- emitter.emit('popstate', state, {
1011
- newValue: newValue
1012
- }); // detach value in previous history state from current one
1013
-
1014
- var previous = new ViewState(state.key, state.value);
1015
- states[stateId][previous.key] = previous;
1016
- state.value = newValue;
1017
- state.key = key;
1018
- }
1019
-
1020
- state.stateId = history.state;
1021
- cur[key] = state;
1022
- }
1023
-
1024
- return state;
1025
- }
1026
- };
1027
- })[0];
1028
- return /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(external_zeta_dom_react_.ViewStateProvider, {
1029
- value: provider
1030
- }, props.children);
1031
- }
1032
- // EXTERNAL MODULE: external "waterpipe"
1033
- var external_waterpipe_ = __webpack_require__(28);
1034
- ;// CONCATENATED MODULE: ./src/include/external/waterpipe.js
1035
- // @ts-nocheck
1036
-
1037
- /* harmony default export */ const waterpipe = (external_waterpipe_);
1038
- ;// CONCATENATED MODULE: ./src/i18n.js
1039
-
1040
-
1041
-
1042
-
1043
- var empty = Object.create(null);
1044
- var toPrimitive = typeof Symbol === 'function' && Symbol.toPrimitive;
1045
-
1046
- function TString(toString) {
1047
- this.toString = toString;
1048
- }
1049
-
1050
- if (toPrimitive) {
1051
- TString.prototype[toPrimitive] = function () {
1052
- return this.toString();
1053
- };
1054
- }
1055
-
1056
- function createCallback(translate) {
1057
- var callback = function callback(key, data) {
1058
- var result = translate(key, data, true);
1059
- return result !== undefined ? result : key;
1060
- };
1061
-
1062
- return extend(callback, {
1063
- html: function html(id, data) {
1064
- return {
1065
- __html: translate(id, data)
1066
- };
1067
- },
1068
- lazy: function lazy(id, data) {
1069
- return new TString(translate.bind(0, id, data, true));
1070
- }
1071
- });
1072
- }
1073
-
1074
- function useLanguage() {
1075
- return (0,external_zeta_dom_react_.useObservableProperty)(app_app, 'language');
1076
- }
1077
- function makeTranslation(resources, defaultLang) {
1078
- var re = new RegExp('^(' + Object.keys(resources[defaultLang]).join('|') + ')\\.');
1079
- var cache = {};
1080
-
1081
- function getTranslation(prefix, name, data, noEncode, lang) {
1082
- var str = ((resources[lang] || empty)[prefix] || empty)[name];
1083
-
1084
- if (typeof str === 'string') {
1085
- if (str && (!noEncode || data !== undefined)) {
1086
- return waterpipe(str, data, {
1087
- noEncode: noEncode
1088
- });
1089
- }
1090
-
1091
- return str;
1092
- }
1093
-
1094
- if (lang !== defaultLang) {
1095
- return getTranslation(prefix, name, data, noEncode, defaultLang);
1096
- }
1097
- }
1098
-
1099
- function translate(key, data, noEncode) {
1100
- var prefix = re.test(key) ? RegExp.$1 : '';
1101
- var name = prefix ? key.slice(RegExp.lastMatch.length) : key;
1102
- return getTranslation(prefix, name, data, noEncode, app_app.language);
1103
- }
1104
-
1105
- function getTranslationCallback() {
1106
- var prefix = makeArray(arguments);
1107
- var key = prefix.join(' ');
1108
- return cache[key] || (cache[key] = createCallback(function (key, data, noEncode) {
1109
- var lang = app_app.language;
1110
- return single(prefix, function (v) {
1111
- return getTranslation(v, key, data, noEncode, lang);
1112
- });
1113
- }));
1114
- }
1115
-
1116
- function useTranslation() {
1117
- var language = useLanguage();
1118
- var t = getTranslationCallback.apply(0, arguments);
1119
- return {
1120
- language: language,
1121
- t: t
1122
- };
1123
- }
1124
-
1125
- cache[''] = createCallback(translate);
1126
- return {
1127
- translate: cache[''],
1128
- getTranslation: getTranslationCallback,
1129
- useTranslation: useTranslation,
1130
- keys: function keys(prefix) {
1131
- return util_keys(resources[defaultLang][prefix] || empty);
1132
- }
1133
- };
1134
- }
1135
- ;// CONCATENATED MODULE: ./src/mixins/StaticAttributeMixin.js
1136
-
1137
-
1138
- function StaticAttributeMixin(attributes) {
1139
- Mixin.call(this);
1140
- this.attributes = attributes || {};
1141
- }
1142
- definePrototype(StaticAttributeMixin, Mixin, {
1143
- getCustomAttributes: function getCustomAttributes() {
1144
- return extend({}, this.attributes);
1145
- }
1146
- });
1147
- ;// CONCATENATED MODULE: ./src/mixins/Mixin.js
1148
-
1149
-
1150
-
1151
- function Mixin() {}
1152
- definePrototype(Mixin, {
1153
- next: function next() {},
1154
- getRef: function getRef() {
1155
- return noop;
1156
- },
1157
- getClassNames: function getClassNames() {
1158
- return [];
1159
- },
1160
- getCustomAttributes: function getCustomAttributes() {
1161
- return {};
1162
- },
1163
- dispose: function dispose() {}
1164
- });
1165
- watchable(Mixin.prototype);
1166
- util_define(Mixin, {
1167
- get scrollableTarget() {
1168
- return new StaticAttributeMixin({
1169
- 'scrollable-target': ''
1170
- });
1171
- },
1172
-
1173
- use: function use() {
1174
- var args = makeArray(arguments);
1175
- var ref = args[0];
1176
- var props = {};
1177
- var mixins = args.filter(function (v) {
1178
- return v instanceof Mixin;
1179
- });
1180
- var refs = mixins.map(function (v) {
1181
- return v.getRef();
1182
- });
1183
-
1184
- if (ref && !(ref instanceof Mixin)) {
1185
- if (typeof ref !== 'function') {
1186
- refs.push(function (v) {
1187
- ref.current = v;
1188
- });
1189
- } else {
1190
- refs.push(ref);
1191
- }
1192
-
1193
- args.shift();
1194
- } else if (!ref) {
1195
- args.shift();
1196
- }
1197
-
1198
- each(mixins, function (i, v) {
1199
- extend(props, v.getCustomAttributes());
1200
- });
1201
- extend(props, {
1202
- ref: combineFn(refs),
1203
- className: external_zeta_dom_react_.classNames.apply(null, args)
1204
- });
1205
- each(mixins, function (i, v) {
1206
- v.next();
1207
- });
1208
- return props;
1209
- }
1210
- });
1211
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/observe.js
1212
-
1213
- var observe_lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
1214
- observe = observe_lib$dom.observe,
1215
- registerCleanup = observe_lib$dom.registerCleanup,
1216
- createAutoCleanupMap = observe_lib$dom.createAutoCleanupMap,
1217
- afterDetached = observe_lib$dom.afterDetached,
1218
- watchElements = observe_lib$dom.watchElements,
1219
- watchAttributes = observe_lib$dom.watchAttributes,
1220
- watchOwnAttributes = observe_lib$dom.watchOwnAttributes;
1221
-
1222
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/observe.js
1223
-
1224
- ;// CONCATENATED MODULE: ./src/mixins/StatefulMixin.js
1225
-
1226
-
1227
-
1228
- var _ = createPrivateStore();
1229
-
1230
- function MixinRefImpl(mixin) {
1231
- this.mixin = mixin;
1232
- }
1233
-
1234
- definePrototype(MixinRefImpl, {
1235
- getMixin: function getMixin() {
1236
- return this.mixin;
1237
- }
1238
- });
1239
- function StatefulMixin() {
1240
- Mixin.call(this);
1241
-
1242
- _(this, {
1243
- elements: new WeakSet(),
1244
- flush: watch(this, false),
1245
- dispose: [],
1246
- states: {},
1247
- prefix: '',
1248
- counter: 0
1249
- });
1250
- }
1251
- definePrototype(StatefulMixin, Mixin, {
1252
- get ref() {
1253
- var self = this;
1254
- var state = self.state;
1255
- self.next();
1256
- return state.ref || (state.ref = new MixinRefImpl(self.clone()));
1257
- },
1258
-
1259
- get state() {
1260
- var obj = _(this);
1261
-
1262
- var key = obj.prefix + obj.counter;
1263
- return obj.states[key] || (obj.states[key] = this.initState());
1264
- },
1265
-
1266
- reset: function reset() {
1267
- _(this).counter = 0;
1268
- return this;
1269
- },
1270
- next: function next() {
1271
- _(this).counter++;
1272
- return this;
1273
- },
1274
- getRef: function getRef() {
1275
- var self = this;
1276
- var state = self.state;
1277
- return function (current) {
1278
- state.element = current;
1279
-
1280
- if (current && setAdd(_(self).elements, current)) {
1281
- self.initElement(current, state);
1282
- }
1283
- };
1284
- },
1285
- elements: function elements() {
1286
- return values(_(this).states).map(function (v) {
1287
- return v.element;
1288
- }).filter(function (v) {
1289
- return v;
1290
- });
1291
- },
1292
- onDispose: function onDispose(callback) {
1293
- _(this).dispose.push(callback);
1294
- },
1295
- initState: function initState() {
1296
- return {
1297
- element: null
1298
- };
1299
- },
1300
- initElement: function initElement(element, state) {},
1301
- clone: function clone() {
1302
- var self = this;
1303
- var clone = inherit(Object.getPrototypeOf(self), self);
1304
-
1305
- _(clone, extend({}, _(self), {
1306
- prefix: randomId() + '.',
1307
- counter: 0
1308
- }));
1309
-
1310
- return clone;
1311
- },
1312
- dispose: function dispose() {
1313
- var state = _(this);
1314
-
1315
- var states = state.states;
1316
- combineFn(state.dispose.splice(0))();
1317
- state.flush();
1318
- each(states, function (i, v) {
1319
- delete states[i];
1320
- });
1321
- }
1322
- });
1323
- ;// CONCATENATED MODULE: ./src/mixins/ClassNameMixin.js
1324
-
1325
-
1326
-
1327
-
1328
-
1329
- var ClassNameMixinSuper = StatefulMixin.prototype;
1330
-
1331
- function checkState(self, element, state, isAsync) {
1332
- var classNames = state.classNames;
1333
- var prev = extend({}, classNames);
1334
- each(self.classNames, function (i, v) {
1335
- classNames[v] = element.classList.contains(v);
1336
- });
1337
-
1338
- if (!equal(prev, classNames)) {
1339
- var cb = self.onClassNameUpdated.bind(self, element, prev, extend({}, classNames));
1340
-
1341
- if (isAsync) {
1342
- setImmediate(cb);
1343
- } else {
1344
- cb();
1345
- }
1346
- }
1347
- }
1348
-
1349
- function ClassNameMixin(classNames) {
1350
- StatefulMixin.call(this);
1351
- this.classNames = classNames || [];
1352
- }
1353
- definePrototype(ClassNameMixin, StatefulMixin, {
1354
- getClassNames: function getClassNames() {
1355
- return [this.state.classNames];
1356
- },
1357
- getRef: function getRef() {
1358
- var self = this;
1359
- var element = self.state.element;
1360
-
1361
- if (element && containsOrEquals(zeta_dom_dom.root, element)) {
1362
- checkState(self, element, self.state, true);
1363
- }
1364
-
1365
- return ClassNameMixinSuper.getRef.call(this);
1366
- },
1367
- initState: function initState() {
1368
- return {
1369
- element: null,
1370
- classNames: {}
1371
- };
1372
- },
1373
- initElement: function initElement(element, state) {
1374
- var self = this;
1375
- watchOwnAttributes(element, 'class', function () {
1376
- checkState(self, element, state);
1377
- });
1378
- },
1379
- onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {}
1380
- });
1381
- ;// CONCATENATED MODULE: ./src/mixins/AnimateMixin.js
1382
-
1383
-
1384
- var AnimateMixinSuper = ClassNameMixin.prototype;
1385
- function AnimateMixin() {
1386
- ClassNameMixin.call(this, ['tweening-in', 'tweening-out']);
1387
- }
1388
- definePrototype(AnimateMixin, ClassNameMixin, {
1389
- next: function next() {
1390
- var self = this;
1391
- self.effects = undefined;
1392
- self.trigger = undefined;
1393
- return AnimateMixinSuper.next.call(self);
1394
- },
1395
- "with": function _with(props) {
1396
- var self = this;
1397
- self.effects = props.effects;
1398
- self.trigger = props.trigger;
1399
- return self;
1400
- },
1401
- withEffects: function withEffects() {
1402
- this.effects = makeArray(arguments);
1403
- return this;
1404
- },
1405
- getCustomAttributes: function getCustomAttributes() {
1406
- var self = this;
1407
- return extend({}, AnimateMixinSuper.getCustomAttributes.call(self), {
1408
- 'animate-in': (self.effects || []).join(' '),
1409
- 'animate-on': self.trigger || 'show'
1410
- });
1411
- }
1412
- });
1413
- ;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceItemMixin.js
1414
-
1415
-
1416
- var AnimateSequenceItemMixinSuper = ClassNameMixin.prototype;
1417
- function AnimateSequenceItemMixin(className) {
1418
- ClassNameMixin.call(this, ['tweening-in', 'tweening-out']);
1419
- this.className = className;
1420
- }
1421
- definePrototype(AnimateSequenceItemMixin, ClassNameMixin, {
1422
- getClassNames: function getClassNames() {
1423
- return [this.className].concat(AnimateSequenceItemMixinSuper.getClassNames.call(this));
1424
- }
1425
- });
1426
- ;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceMixin.js
1427
-
1428
-
1429
-
1430
- var AnimateSequenceMixinSuper = AnimateMixin.prototype;
1431
- var animateSequenceMixinCounter = 0;
1432
- function AnimateSequenceMixin() {
1433
- var self = this;
1434
- AnimateMixin.call(self);
1435
- self.className = 'brew-anim-' + ++animateSequenceMixinCounter;
1436
- self.item = new AnimateSequenceItemMixin(self.className);
1437
- }
1438
- definePrototype(AnimateSequenceMixin, AnimateMixin, {
1439
- reset: function reset() {
1440
- this.item.reset();
1441
- return AnimateSequenceMixinSuper.reset.call(this);
1442
- },
1443
- getCustomAttributes: function getCustomAttributes() {
1444
- return extend({}, AnimateSequenceMixinSuper.getCustomAttributes.call(this), {
1445
- 'animate-sequence': '.' + this.className
1446
- });
1447
- },
1448
- clone: function clone() {
1449
- return extend(AnimateSequenceMixinSuper.clone.call(this), {
1450
- item: this.item.ref.getMixin()
1451
- });
1452
- }
1453
- });
1454
- ;// CONCATENATED MODULE: ./src/mixins/FlyoutToggleMixin.js
1455
-
1456
-
1457
- var FlyoutToggleMixinSuper = ClassNameMixin.prototype;
1458
- function FlyoutToggleMixin(mixin) {
1459
- ClassNameMixin.call(this, ['target-opened']);
1460
- this.flyoutMixin = mixin;
1461
- }
1462
- definePrototype(FlyoutToggleMixin, ClassNameMixin, {
1463
- open: function open(value) {
1464
- return this.flyoutMixin.open(value);
1465
- },
1466
- close: function close(value) {
1467
- return this.flyoutMixin.close(value);
1468
- },
1469
- getCustomAttributes: function getCustomAttributes() {
1470
- var element = this.flyoutMixin.elements()[0];
1471
- return extend({}, FlyoutToggleMixinSuper.getCustomAttributes.call(this), {
1472
- 'toggle': element && '#' + element.id
1473
- });
1474
- }
1475
- });
1476
- ;// CONCATENATED MODULE: ./src/mixins/FlyoutMixin.js
1477
-
1478
-
1479
-
1480
-
1481
-
1482
- var FlyoutMixinSuper = ClassNameMixin.prototype;
1483
- var valueMap = new WeakMap();
1484
- var flyoutMixinCounter = 0;
1485
- function FlyoutMixin() {
1486
- var self = this;
1487
- ClassNameMixin.call(self, ['open', 'closing', 'visible', 'tweening-in', 'tweening-out']);
1488
- self.modal = false;
1489
- self.tabThrough = false;
1490
- self.isFlyoutOpened = false;
1491
- self.animating = false;
1492
- self.visible = false;
1493
- self.toggle = new FlyoutToggleMixin(self);
1494
- self.onDispose(function () {
1495
- self.isFlyoutOpened = false;
1496
- self.visible = false;
1497
- });
1498
- }
1499
- definePrototype(FlyoutMixin, ClassNameMixin, {
1500
- reset: function reset() {
1501
- this.toggle.reset();
1502
- return FlyoutMixinSuper.reset.call(this);
1503
- },
1504
- next: function next() {
1505
- this.effects = undefined;
1506
- return FlyoutMixinSuper.next.call(this);
1507
- },
1508
- withEffects: function withEffects() {
1509
- this.effects = makeArray(arguments);
1510
- return this;
1511
- },
1512
- getCustomAttributes: function getCustomAttributes() {
1513
- var self = this;
1514
- return extend({}, FlyoutMixinSuper.getCustomAttributes.call(self), {
1515
- 'is-flyout': '',
1516
- 'swipe-dismiss': self.swipeToDismiss
1517
- }, self.modal && {
1518
- 'is-modal': ''
1519
- }, self.tabThrough && {
1520
- 'tab-through': ''
1521
- }, self.effects && {
1522
- 'animate-on': 'open',
1523
- 'animate-in': self.effects.join(' '),
1524
- 'animate-out': ''
1525
- });
1526
- },
1527
- open: function open(value) {
1528
- var element = this.elements()[0];
1529
- valueMap.set(element, value);
1530
- return openFlyout(element);
1531
- },
1532
- close: function close(value) {
1533
- return closeFlyout(this.elements()[0], value);
1534
- },
1535
- onOpen: function onOpen(callback) {
1536
- var element = this.elements()[0];
1537
- return this.onToggleState(function (opened) {
1538
- if (opened) {
1539
- return callback(valueMap.get(element));
1540
- }
1541
- });
1542
- },
1543
- onToggleState: function onToggleState(callback) {
1544
- return this.watch('isFlyoutOpened', callback);
1545
- },
1546
- onVisibilityChanged: function onVisibilityChanged(callback) {
1547
- return this.watch('visible', callback);
1548
- },
1549
- initElement: function initElement(element, state) {
1550
- var self = this;
1551
- FlyoutMixinSuper.initElement.call(self, element, state);
1552
-
1553
- if (!element.id) {
1554
- element.id = 'flyout-' + ++flyoutMixinCounter;
1555
- }
1556
-
1557
- app_app.on(element, {
1558
- animationstart: function animationstart() {
1559
- self.animating = true;
1560
- },
1561
- animationcomplete: function animationcomplete() {
1562
- self.animating = false;
1563
- }
1564
- }, true);
1565
- setImmediate(function () {
1566
- each(self.toggle.elements(), function (i, v) {
1567
- v.setAttribute('toggle', '#' + element.id);
1568
- });
1569
- });
1570
- },
1571
- clone: function clone() {
1572
- var self = this;
1573
- var mixin = extend(FlyoutMixinSuper.clone.call(self), {
1574
- toggle: self.toggle.ref.getMixin()
1575
- });
1576
- defineAliasProperty(mixin, 'isFlyoutOpened', self);
1577
- defineAliasProperty(mixin, 'modal', self);
1578
- return mixin;
1579
- },
1580
- onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {
1581
- var self = this;
1582
- self.visible = state.open;
1583
- self.isFlyoutOpened = state.open && !state.closing && !state['tweening-out'];
1584
- }
1585
- });
1586
- ;// CONCATENATED MODULE: ./src/mixins/FocusStateMixin.js
1587
-
1588
-
1589
-
1590
-
1591
- var FocusStateMixinSuper = StatefulMixin.prototype;
1592
- function FocusStateMixin() {
1593
- StatefulMixin.call(this);
1594
- }
1595
- definePrototype(FocusStateMixin, StatefulMixin, {
1596
- initElement: function initElement(element, state) {
1597
- FocusStateMixinSuper.initElement.call(this, element, state);
1598
- zeta_dom_dom.on(element, {
1599
- focusin: function focusin(e) {
1600
- state.focused = true;
1601
- setClass(element, 'focused', e.source);
1602
- },
1603
- focusout: function focusout() {
1604
- state.focused = false;
1605
- setClass(element, 'focused', false);
1606
- }
1607
- });
1608
- },
1609
- getClassNames: function getClassNames() {
1610
- return [{
1611
- focused: !!this.state.focused
1612
- }];
1613
- }
1614
- });
1615
- ;// CONCATENATED MODULE: ./src/mixins/LoadingStateMixin.js
1616
-
1617
-
1618
-
1619
-
1620
-
1621
- var LoadingStateMixinSuper = StatefulMixin.prototype;
1622
- function LoadingStateMixin() {
1623
- StatefulMixin.call(this);
1624
- }
1625
- definePrototype(LoadingStateMixin, StatefulMixin, {
1626
- initElement: function initElement(element, state) {
1627
- LoadingStateMixinSuper.initElement.call(this, element, state);
1628
- lock(element);
1629
- zeta_dom_dom.on(element, {
1630
- asyncStart: function asyncStart() {
1631
- state.loading = true;
1632
- setClass(element, 'loading', true);
1633
- },
1634
- asyncEnd: function asyncEnd() {
1635
- state.loading = false;
1636
- setClass(element, 'loading', false);
1637
- },
1638
- cancelled: function cancelled() {
1639
- state.loading = false;
1640
- setClass(element, 'loading', false);
1641
- }
1642
- });
1643
- },
1644
- getClassNames: function getClassNames() {
1645
- return [{
1646
- loading: !!this.state.loading
1647
- }];
1648
- }
1649
- });
1650
- // EXTERNAL MODULE: external "jQuery"
1651
- var external_jQuery_ = __webpack_require__(145);
1652
- ;// CONCATENATED MODULE: ./src/include/external/jquery.js
1653
- // @ts-nocheck
1654
-
1655
- /* harmony default export */ const jquery = (external_jQuery_);
1656
- ;// CONCATENATED MODULE: ./src/mixins/ScrollableMixin.js
1657
-
1658
-
1659
-
1660
-
1661
-
1662
- var ScrollableMixinSuper = ClassNameMixin.prototype;
1663
- function ScrollableMixin() {
1664
- var self = this;
1665
- ClassNameMixin.call(self, ['scrollable-x', 'scrollable-x-l', 'scrollable-x-r', 'scrollable-y', 'scrollable-y-d', 'scrollable-y-u']);
1666
- self.target = Mixin.scrollableTarget;
1667
- self.pageIndex = 0;
1668
- self.scrolling = false;
1669
- }
1670
- definePrototype(ScrollableMixin, ClassNameMixin, {
1671
- withOptions: function withOptions(options) {
1672
- this.options = options;
1673
- return this;
1674
- },
1675
- getCustomAttributes: function getCustomAttributes() {
1676
- var options = this.options || {};
1677
- return extend({}, ScrollableMixinSuper.getCustomAttributes.call(this), {
1678
- 'scrollable': [options.direction || 'both', options.handle || 'auto'].join(' ')
1679
- }, options.paged && {
1680
- 'var': '{ pageIndex: 0 }',
1681
- 'scroller-snap-page': options.paged,
1682
- 'scroller-page': options.pagedItemSelector,
1683
- 'scroller-state': 'pageIndex'
1684
- });
1685
- },
1686
- onPageIndexChanged: function onPageIndexChanged(callback) {
1687
- return this.watch('pageIndex', callback);
1688
- },
1689
- initElement: function initElement(element, state) {
1690
- var self = this;
1691
- app_app.on(element, {
1692
- statechange: function statechange(e) {
1693
- if ('pageIndex' in e.newValues) {
1694
- extend(self, {
1695
- pageIndex: e.newValues.pageIndex
1696
- });
1697
- }
1698
- },
1699
- scrollStart: function scrollStart() {
1700
- self.scrolling = true;
1701
- },
1702
- scrollStop: function scrollStop() {
1703
- self.scrolling = false;
1704
- }
1705
- }, true);
1706
- },
1707
- clone: function clone() {
1708
- var mixin = ScrollableMixinSuper.clone.call(this);
1709
- defineAliasProperty(mixin, 'pageIndex', this);
1710
- return mixin;
1711
- }
1712
- });
1713
- each('destroy enable disable setOptions refresh scrollPadding stop scrollLeft scrollTop scrollBy scrollTo scrollByPage scrollToPage scrollToElement', function (i, v) {
1714
- defineHiddenProperty(ScrollableMixin.prototype, v, function () {
1715
- var obj = jquery(this.elements());
1716
- return obj.scrollable.apply(obj, [v].concat(makeArray(arguments)));
1717
- });
1718
- });
1719
- ;// CONCATENATED MODULE: ./src/mixin.js
1720
-
1721
-
1722
-
1723
-
1724
-
1725
-
1726
-
1727
-
1728
-
1729
-
1730
-
1731
-
1732
-
1733
-
1734
- function extendSelf(options) {
1735
- extend(this, options);
1736
- }
1737
-
1738
- function createUseFunction(ctor) {
1739
- return function () {
1740
- var mixin = useMixin(ctor);
1741
- (mixin.withOptions || extendSelf).apply(mixin, arguments);
1742
- return mixin;
1743
- };
1744
- }
1745
-
1746
- var useAnimateMixin = createUseFunction(AnimateMixin);
1747
- var useAnimateSequenceMixin = createUseFunction(AnimateSequenceMixin);
1748
- var useFlyoutMixin = createUseFunction(FlyoutMixin);
1749
- var useFocusStateMixin = createUseFunction(FocusStateMixin);
1750
- var useLoadingStateMixin = createUseFunction(LoadingStateMixin);
1751
- var useScrollableMixin = createUseFunction(ScrollableMixin);
1752
- function useMixin(ctor) {
1753
- var mixin = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
1754
- return new ctor();
1755
- })[0].reset();
1756
- (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
1757
- return mixin.dispose.bind(mixin);
1758
- }, []);
1759
- return mixin;
1760
- }
1761
- function useMixinRef(mixin) {
1762
- return mixin && mixin.getMixin().reset();
1763
- }
1764
-
1765
- ;// CONCATENATED MODULE: ./src/index.js
1766
-
1767
- /* harmony default export */ const src = (brew_js_app);
1768
-
1769
-
1770
-
1771
-
1772
-
1773
- ;// CONCATENATED MODULE: ./src/entry.js
1774
-
1775
- /* harmony default export */ const entry = (src_namespaceObject);
1776
-
1777
- brew_js_app.react = src_namespaceObject;
1778
- })();
1779
-
1780
- __webpack_exports__ = __webpack_exports__["default"];
1781
- /******/ return __webpack_exports__;
1782
- /******/ })()
1783
- ;
1784
- });
501
+ */
502
+
503
+ function Dialog(props) {
504
+ var _props = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)({})[0];
505
+ var dialog = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
506
+ return createDialog(_props);
507
+ })[0];
508
+ extend(_props, props);
509
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
510
+ var opened = containsOrEquals(zeta_dom_dom.root, dialog.root);
511
+
512
+ if (either(opened, _props.isOpen)) {
513
+ if (!opened) {
514
+ dialog.open();
515
+ } else {
516
+ dialog.close();
517
+ }
518
+ }
519
+ }, [_props.isOpen]);
520
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
521
+ return dialog.close;
522
+ }, [dialog]);
523
+ return /*#__PURE__*/external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_.createPortal(props.children, dialog.root);
524
+ }
525
+ // EXTERNAL MODULE: external "zeta-dom-react"
526
+ var external_zeta_dom_react_ = __webpack_require__(103);
527
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/events.js
528
+
529
+ var ZetaEventContainer = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.EventContainer;
530
+
531
+ ;// CONCATENATED MODULE: ./tmp/brew-js/defaults.js
532
+
533
+ var defaults_defaultExport = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.defaults;
534
+ /* harmony default export */ const defaults = (defaults_defaultExport);
535
+ ;// CONCATENATED MODULE: ./src/include/brew-js/defaults.js
536
+
537
+ /* harmony default export */ const brew_js_defaults = (defaults);
538
+ ;// CONCATENATED MODULE: ./src/app.js
539
+
540
+
541
+ /** @type {Brew.AppInstance<Brew.WithRouter & Brew.WithI18n>} */
542
+
543
+ var app_app;
544
+ install('react', function (app_) {
545
+ // @ts-ignore: type inference issue
546
+ app_app = app_;
547
+ });
548
+ brew_js_defaults.react = true;
549
+ ;// CONCATENATED MODULE: ./tmp/brew-js/anim.js
550
+
551
+ var animateIn = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateIn,
552
+ animateOut = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateOut,
553
+ addAnimateIn = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAnimateIn,
554
+ addAnimateOut = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAnimateOut;
555
+
556
+ ;// CONCATENATED MODULE: ./tmp/brew-js/util/path.js
557
+
558
+ var setBaseUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.setBaseUrl,
559
+ combinePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.combinePath,
560
+ parsePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.parsePath,
561
+ normalizePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.normalizePath,
562
+ removeQueryAndHash = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.removeQueryAndHash,
563
+ withBaseUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.withBaseUrl,
564
+ toAbsoluteUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toAbsoluteUrl,
565
+ toRelativeUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toRelativeUrl,
566
+ isSubPathOf = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.isSubPathOf,
567
+ toSegments = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toSegments;
568
+
569
+ ;// CONCATENATED MODULE: ./src/view.js
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+ var root = zeta_dom_dom.root;
580
+ var routeMap = new Map();
581
+ var usedParams = {};
582
+ var sortedViews = [];
583
+ var StateContext = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createContext(Object.freeze({
584
+ container: root,
585
+ active: true
586
+ }));
587
+ var errorView;
588
+
589
+ function ErrorBoundary() {
590
+ external_commonjs_react_commonjs2_react_amd_react_root_React_.Component.apply(this, arguments);
591
+ this.state = {};
592
+ }
593
+
594
+ ErrorBoundary.contextType = StateContext;
595
+ definePrototype(ErrorBoundary, external_commonjs_react_commonjs2_react_amd_react_root_React_.Component, {
596
+ componentDidCatch: function componentDidCatch(error) {
597
+ var self = this;
598
+
599
+ if (errorView && !self.state.error) {
600
+ self.setState({
601
+ error: error
602
+ });
603
+ } else {
604
+ // emit error in next tick as ref callback may yet to be invoked
605
+ // if error is thrown synchronously in first render
606
+ setImmediate(function () {
607
+ zeta_dom_dom.emit('error', self.context.container, {
608
+ error: error
609
+ }, true);
610
+ });
611
+ }
612
+ },
613
+ render: function render() {
614
+ var self = this;
615
+ var props = {
616
+ view: self.context.view,
617
+ error: self.state.error,
618
+ reset: self.reset.bind(self)
619
+ };
620
+ var onComponentLoaded = self.props.onComponentLoaded;
621
+
622
+ if (props.error) {
623
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(errorView, {
624
+ onComponentLoaded: onComponentLoaded,
625
+ viewProps: props
626
+ });
627
+ }
628
+
629
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(props.view, {
630
+ onComponentLoaded: onComponentLoaded,
631
+ viewData: self.props.viewData
632
+ });
633
+ },
634
+ reset: function reset() {
635
+ this.setState({
636
+ error: null
637
+ });
638
+ }
639
+ });
640
+
641
+ function ViewContainer() {
642
+ external_commonjs_react_commonjs2_react_amd_react_root_React_.Component.apply(this, arguments);
643
+ this.stateId = history.state;
644
+ }
645
+
646
+ definePrototype(ViewContainer, external_commonjs_react_commonjs2_react_amd_react_root_React_.Component, {
647
+ componentDidMount: function componentDidMount() {
648
+ /** @type {any} */
649
+ var self = this;
650
+ self.componentWillUnmount = combineFn(watch(app_app.route, function () {
651
+ self.setActive(self.getViewComponent() === self.currentViewComponent);
652
+ }), app_app.on('beforepageload', function (e) {
653
+ self.waitFor = e.waitFor;
654
+ self.stateId = history.state;
655
+ self.updateView(e.data);
656
+ self.forceUpdate();
657
+ }));
658
+ },
659
+ render: function render() {
660
+ /** @type {any} */
661
+ var self = this;
662
+
663
+ if (history.state === self.stateId) {
664
+ self.updateView();
665
+ }
666
+
667
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment, null, self.prevView, self.currentView);
668
+ },
669
+ updateView: function updateView(viewData) {
670
+ var self = this;
671
+ var V = self.getViewComponent();
672
+
673
+ if (V) {
674
+ // ensure the current path actually corresponds to the matched view
675
+ // when some views are not included in the list of allowed views
676
+ var targetPath = resolvePath(V, getCurrentParams(V, true));
677
+
678
+ if (targetPath !== removeQueryAndHash(app_app.path)) {
679
+ app_app.navigate(targetPath, true);
680
+ }
681
+ }
682
+
683
+ if (V && V !== self.currentViewComponent) {
684
+ var prevElement = self.currentElement;
685
+
686
+ if (prevElement) {
687
+ self.setActive(false);
688
+ self.prevView = self.currentView;
689
+ self.currentElement = undefined;
690
+ app_app.emit('pageleave', prevElement, {
691
+ pathname: self.currentPath
692
+ }, true);
693
+ animateOut(prevElement, 'show').then(function () {
694
+ self.prevView = undefined;
695
+ self.forceUpdate();
696
+ });
697
+ }
698
+
699
+ var onComponentLoaded;
700
+ var promise = new Promise(function (resolve) {
701
+ onComponentLoaded = resolve;
702
+ });
703
+ var initElement = executeOnce(function (element) {
704
+ self.currentElement = element;
705
+ state.container = element;
706
+ promise.then(function () {
707
+ animateIn(element, 'show');
708
+ app_app.emit('pageenter', element, {
709
+ pathname: app_app.path
710
+ }, true);
711
+ });
712
+ notifyAsync(element, promise);
713
+ });
714
+ var state = {
715
+ view: V
716
+ };
717
+ var view = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(StateContext.Provider, {
718
+ key: routeMap.get(V).id,
719
+ value: state
720
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ViewStateContainer, null, /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement('div', extend({}, self.props.rootProps, {
721
+ ref: initElement
722
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ErrorBoundary, {
723
+ onComponentLoaded: onComponentLoaded,
724
+ viewData: viewData
725
+ }))));
726
+ extend(self, {
727
+ currentPath: app_app.path,
728
+ currentView: view,
729
+ currentViewComponent: V,
730
+ setActive: defineObservableProperty(state, 'active', true, true)
731
+ });
732
+ (self.waitFor || noop)(promise);
733
+ }
734
+ },
735
+ getViewComponent: function getViewComponent() {
736
+ var props = this.props;
737
+ return any(props.views, isViewMatched) || props.defaultView;
738
+ }
739
+ });
740
+
741
+ function getCurrentParams(view, includeAll, params) {
742
+ var state = routeMap.get(view);
743
+
744
+ if (!state.maxParams) {
745
+ var matchers = exclude(state.matchers, ['remainingSegments']);
746
+ var matched = map(app_app.routes, function (v) {
747
+ var route = app_app.parseRoute(v);
748
+ var matched = route.length && !any(matchers, function (v, i) {
749
+ var pos = route.params[i];
750
+ return (v ? !(pos >= 0) : pos < route.minLength) || !isFunction(v) && !route.match(i, v);
751
+ });
752
+ return matched ? route : null;
753
+ });
754
+
755
+ if (matched[1]) {
756
+ matched = grep(matched, function (v) {
757
+ return !single(v.params, function (v, i) {
758
+ return usedParams[i] && !matchers[i];
759
+ });
760
+ });
761
+ }
762
+
763
+ if (matched[0]) {
764
+ var last = matched.slice(-1)[0];
765
+ state.maxParams = util_keys(extend.apply(0, [{
766
+ remainingSegments: true
767
+ }].concat(matched.map(function (v) {
768
+ return v.params;
769
+ }))));
770
+ state.minParams = map(last.params, function (v, i) {
771
+ return state.params[i] || v >= last.minLength ? null : i;
772
+ });
773
+ }
774
+ }
775
+
776
+ return pick(params || app_app.route, includeAll ? state.maxParams : state.minParams);
777
+ }
778
+
779
+ function sortViews(a, b) {
780
+ return (routeMap.get(b) || {}).matchCount - (routeMap.get(a) || {}).matchCount;
781
+ }
782
+
783
+ function matchViewParams(view, route) {
784
+ var params = routeMap.get(view);
785
+ return !!params && !single(params.matchers, function (v, i) {
786
+ var value = route[i] || '';
787
+ return isFunction(v) ? !v(value) : (v || '') !== value;
788
+ });
789
+ }
790
+
791
+ function createViewComponent(factory) {
792
+ var promise;
793
+ throwNotFunction(factory);
794
+
795
+ if (factory.prototype instanceof external_commonjs_react_commonjs2_react_amd_react_root_React_.Component) {
796
+ factory = external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement.bind(null, factory);
797
+ }
798
+
799
+ return function fn(props) {
800
+ var viewProps = props.viewProps || {
801
+ viewData: useRouteState('_d_' + routeMap.get(fn).id, props.viewData || {})[0]
802
+ };
803
+ var children = !promise && factory(viewProps);
804
+
805
+ if (isThenable(children)) {
806
+ promise = children;
807
+ children = null;
808
+ }
809
+
810
+ var state = (0,external_zeta_dom_react_.useAsync)(function () {
811
+ return promise.then(function (s) {
812
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(s["default"], viewProps);
813
+ });
814
+ }, !!promise)[1];
815
+
816
+ if (!promise || !state.loading) {
817
+ props.onComponentLoaded();
818
+
819
+ if (state.error) {
820
+ throw state.error;
821
+ }
822
+ }
823
+
824
+ return children || state.value || /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment);
825
+ };
826
+ }
827
+
828
+ function useViewContainerState() {
829
+ return external_commonjs_react_commonjs2_react_amd_react_root_React_.useContext(StateContext);
830
+ }
831
+ function isViewMatched(view) {
832
+ return matchViewParams(view, app_app.route);
833
+ }
834
+ function matchView(path, views) {
835
+ var route = app_app.route;
836
+
837
+ if (typeof path === 'string') {
838
+ route = route.parse(path);
839
+ } else {
840
+ views = path;
841
+ }
842
+
843
+ views = views ? makeArray(views).sort(sortViews) : sortedViews;
844
+ return any(views, function (v) {
845
+ return matchViewParams(v, route);
846
+ }) || undefined;
847
+ }
848
+ function registerView(factory, routeParams) {
849
+ var Component = createViewComponent(factory);
850
+ routeParams = extend({}, routeParams);
851
+ each(routeParams, function (i, v) {
852
+ usedParams[i] = true;
853
+
854
+ if (v instanceof RegExp) {
855
+ routeParams[i] = v.test.bind(v);
856
+ }
857
+ });
858
+ routeMap.set(Component, {
859
+ id: randomId(),
860
+ matchCount: util_keys(routeParams).length,
861
+ matchers: routeParams,
862
+ params: pick(routeParams, function (v) {
863
+ return isUndefinedOrNull(v) || typeof v === 'string';
864
+ })
865
+ });
866
+ sortedViews.push(Component);
867
+ sortedViews.sort(sortViews);
868
+ return Component;
869
+ }
870
+ function registerErrorView(factory) {
871
+ errorView = createViewComponent(factory);
872
+ }
873
+ function renderView() {
874
+ var views = makeArray(arguments);
875
+ var rootProps = isFunction(views[0]) ? {} : views.shift();
876
+ var defaultView = views[0];
877
+ views.sort(sortViews);
878
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ViewContainer, {
879
+ rootProps: rootProps,
880
+ views: views,
881
+ defaultView: defaultView
882
+ });
883
+ }
884
+ function resolvePath(view, params) {
885
+ var state = routeMap.get(view);
886
+
887
+ if (!state) {
888
+ return '/';
889
+ }
890
+
891
+ var newParams = extend(getCurrentParams(view), getCurrentParams(view, true, params || {}), state.params);
892
+ return app_app.route.getPath(newParams);
893
+ }
894
+ function linkTo(view, params) {
895
+ return app_app.toHref(resolvePath(view, params));
896
+ }
897
+ function navigateTo(view, params, data, replace) {
898
+ return app_app.navigate(resolvePath(view, params), replace, data && freeze(extend({}, data)));
899
+ }
900
+ function redirectTo(view, params, data) {
901
+ return navigateTo(view, params, data, true);
902
+ }
903
+ ;// CONCATENATED MODULE: ./src/hooks.js
904
+
905
+
906
+
907
+
908
+
909
+
910
+
911
+ var emitter = new ZetaEventContainer();
912
+ var states = {};
913
+
914
+ function getCurrentStates() {
915
+ return states[history.state] || (states[history.state] = {});
916
+ }
917
+
918
+ function ViewState(key, value) {
919
+ this.key = key;
920
+ this.value = value;
921
+ }
922
+
923
+ definePrototype(ViewState, {
924
+ get: function get() {
925
+ return this.value;
926
+ },
927
+ set: function set(value) {
928
+ this.value = value;
929
+ },
930
+ onPopState: function onPopState(callback) {
931
+ throwNotFunction(callback);
932
+ return emitter.add(this, 'popstate', function (e) {
933
+ callback.call(this, e.newValue);
934
+ });
935
+ }
936
+ });
937
+ function useAppReady() {
938
+ var sReady = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(false);
939
+ var ready = sReady[0],
940
+ setReady = sReady[1];
941
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
942
+ app_app.ready.then(function () {
943
+ setReady(true);
944
+ });
945
+ }, []);
946
+ return ready;
947
+ }
948
+ function useRouteParam(name, defaultValue) {
949
+ var container = useViewContainerState();
950
+ var route = app_app.route;
951
+ var value = route[name] || '';
952
+ var ref = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useRef)(value);
953
+ var forceUpdate = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)()[1];
954
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
955
+ var setValue = function setValue() {
956
+ var current = route[name] || '';
957
+
958
+ if (current !== ref.current) {
959
+ if (container.active) {
960
+ ref.current = current;
961
+ forceUpdate({});
962
+ } else {
963
+ watch(container, 'active', setValue);
964
+ }
965
+ }
966
+ }; // route parameter might be changed after state initialization and before useEffect hook is called
967
+
968
+
969
+ setValue();
970
+
971
+ if (name in route) {
972
+ return route.watch(name, function () {
973
+ setImmediateOnce(setValue);
974
+ });
975
+ }
976
+
977
+ console.error('Route parameter ' + name + ' does not exist');
978
+ }, [name, defaultValue]);
979
+ ref.current = value;
980
+
981
+ if (defaultValue !== undefined && (!value || name === 'remainingSegments' && value === '/')) {
982
+ app_app.navigate(route.getPath(extend({}, route, kv(name, defaultValue))), true);
983
+ }
984
+
985
+ return value;
986
+ }
987
+ function useRouteState(key, defaultValue, snapshotOnUpdate) {
988
+ var container = useViewContainerState();
989
+ var cur = getCurrentStates();
990
+ var state = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(key in cur ? cur[key] : defaultValue);
991
+
992
+ if (container.active && cur[key] !== state[0]) {
993
+ if (snapshotOnUpdate && key in cur) {
994
+ app_app.snapshot();
995
+ cur = getCurrentStates();
996
+ }
997
+
998
+ cur[key] = state[0];
999
+ }
1000
+
1001
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
1002
+ if (snapshotOnUpdate) {
1003
+ return bind(window, 'popstate', function () {
1004
+ if (container.active) {
1005
+ var cur = getCurrentStates();
1006
+ state[1](key in cur ? cur[key] : defaultValue);
1007
+ }
1008
+ });
1009
+ }
1010
+ }, [container, snapshotOnUpdate]);
1011
+ return state;
1012
+ }
1013
+ function ViewStateContainer(props) {
1014
+ var container = useViewContainerState();
1015
+ var provider = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
1016
+ var cache = {};
1017
+ return {
1018
+ getState: function getState(uniqueId, key) {
1019
+ var cur = getCurrentStates();
1020
+ var state = cache[uniqueId] || (cache[uniqueId] = new ViewState(key, cur[key] && cur[key].value));
1021
+
1022
+ if (container.active) {
1023
+ var stateId = state.stateId;
1024
+
1025
+ if (stateId && (stateId !== history.state || key !== state.key)) {
1026
+ var newValue = cur[key] && cur[key].value;
1027
+ emitter.emit('popstate', state, {
1028
+ newValue: newValue
1029
+ }); // detach value in previous history state from current one
1030
+
1031
+ var previous = new ViewState(state.key, state.value);
1032
+ states[stateId][previous.key] = previous;
1033
+ state.value = newValue;
1034
+ state.key = key;
1035
+ }
1036
+
1037
+ state.stateId = history.state;
1038
+ cur[key] = state;
1039
+ }
1040
+
1041
+ return state;
1042
+ }
1043
+ };
1044
+ })[0];
1045
+ return /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(external_zeta_dom_react_.ViewStateProvider, {
1046
+ value: provider
1047
+ }, props.children);
1048
+ }
1049
+ // EXTERNAL MODULE: external "waterpipe"
1050
+ var external_waterpipe_ = __webpack_require__(28);
1051
+ ;// CONCATENATED MODULE: ./src/include/external/waterpipe.js
1052
+ // @ts-nocheck
1053
+
1054
+ /* harmony default export */ const waterpipe = (external_waterpipe_);
1055
+ ;// CONCATENATED MODULE: ./src/i18n.js
1056
+
1057
+
1058
+
1059
+
1060
+ var empty = Object.create(null);
1061
+ var toPrimitive = typeof Symbol === 'function' && Symbol.toPrimitive;
1062
+
1063
+ function TString(toString) {
1064
+ this.toString = toString;
1065
+ }
1066
+
1067
+ if (toPrimitive) {
1068
+ TString.prototype[toPrimitive] = function () {
1069
+ return this.toString();
1070
+ };
1071
+ }
1072
+
1073
+ function createCallback(translate) {
1074
+ var callback = function callback(key, data) {
1075
+ var result = translate(key, data, true);
1076
+ return result !== undefined ? result : key;
1077
+ };
1078
+
1079
+ return extend(callback, {
1080
+ html: function html(id, data) {
1081
+ return {
1082
+ __html: translate(id, data)
1083
+ };
1084
+ },
1085
+ lazy: function lazy(id, data) {
1086
+ return new TString(translate.bind(0, id, data, true));
1087
+ }
1088
+ });
1089
+ }
1090
+
1091
+ function useLanguage() {
1092
+ return (0,external_zeta_dom_react_.useObservableProperty)(app_app, 'language');
1093
+ }
1094
+ function makeTranslation(resources, defaultLang) {
1095
+ var re = new RegExp('^(' + Object.keys(resources[defaultLang]).join('|') + ')\\.');
1096
+ var cache = {};
1097
+
1098
+ function getTranslation(prefix, name, data, noEncode, lang) {
1099
+ var str = ((resources[lang] || empty)[prefix] || empty)[name];
1100
+
1101
+ if (typeof str === 'string') {
1102
+ if (str && (!noEncode || data !== undefined)) {
1103
+ return waterpipe(str, data, {
1104
+ noEncode: noEncode
1105
+ });
1106
+ }
1107
+
1108
+ return str;
1109
+ }
1110
+
1111
+ if (lang !== defaultLang) {
1112
+ return getTranslation(prefix, name, data, noEncode, defaultLang);
1113
+ }
1114
+ }
1115
+
1116
+ function translate(key, data, noEncode) {
1117
+ var prefix = re.test(key) ? RegExp.$1 : '';
1118
+ var name = prefix ? key.slice(RegExp.lastMatch.length) : key;
1119
+ return getTranslation(prefix, name, data, noEncode, app_app.language);
1120
+ }
1121
+
1122
+ function getTranslationCallback() {
1123
+ var prefix = makeArray(arguments);
1124
+ var key = prefix.join(' ');
1125
+ return cache[key] || (cache[key] = createCallback(function (key, data, noEncode) {
1126
+ var lang = app_app.language;
1127
+ return single(prefix, function (v) {
1128
+ return getTranslation(v, key, data, noEncode, lang);
1129
+ });
1130
+ }));
1131
+ }
1132
+
1133
+ function useTranslation() {
1134
+ var language = useLanguage();
1135
+ var t = getTranslationCallback.apply(0, arguments);
1136
+ return {
1137
+ language: language,
1138
+ t: t
1139
+ };
1140
+ }
1141
+
1142
+ cache[''] = createCallback(translate);
1143
+ return {
1144
+ translate: cache[''],
1145
+ getTranslation: getTranslationCallback,
1146
+ useTranslation: useTranslation,
1147
+ keys: function keys(prefix) {
1148
+ return util_keys(resources[defaultLang][prefix] || empty);
1149
+ }
1150
+ };
1151
+ }
1152
+ ;// CONCATENATED MODULE: ./src/mixins/StaticAttributeMixin.js
1153
+
1154
+
1155
+ function StaticAttributeMixin(attributes) {
1156
+ Mixin.call(this);
1157
+ this.attributes = attributes || {};
1158
+ }
1159
+ definePrototype(StaticAttributeMixin, Mixin, {
1160
+ getCustomAttributes: function getCustomAttributes() {
1161
+ return extend({}, this.attributes);
1162
+ }
1163
+ });
1164
+ ;// CONCATENATED MODULE: ./src/mixins/Mixin.js
1165
+
1166
+
1167
+
1168
+ function Mixin() {}
1169
+ definePrototype(Mixin, {
1170
+ next: function next() {},
1171
+ getRef: function getRef() {
1172
+ return noop;
1173
+ },
1174
+ getClassNames: function getClassNames() {
1175
+ return [];
1176
+ },
1177
+ getCustomAttributes: function getCustomAttributes() {
1178
+ return {};
1179
+ },
1180
+ dispose: function dispose() {}
1181
+ });
1182
+ watchable(Mixin.prototype);
1183
+ util_define(Mixin, {
1184
+ get scrollableTarget() {
1185
+ return new StaticAttributeMixin({
1186
+ 'scrollable-target': ''
1187
+ });
1188
+ },
1189
+
1190
+ use: function use() {
1191
+ var args = makeArray(arguments);
1192
+ var ref = args[0];
1193
+ var props = {};
1194
+ var mixins = args.filter(function (v) {
1195
+ return v instanceof Mixin;
1196
+ });
1197
+ var refs = mixins.map(function (v) {
1198
+ return v.getRef();
1199
+ });
1200
+
1201
+ if (ref && !(ref instanceof Mixin)) {
1202
+ if (typeof ref !== 'function') {
1203
+ refs.push(function (v) {
1204
+ ref.current = v;
1205
+ });
1206
+ } else {
1207
+ refs.push(ref);
1208
+ }
1209
+
1210
+ args.shift();
1211
+ } else if (!ref) {
1212
+ args.shift();
1213
+ }
1214
+
1215
+ each(mixins, function (i, v) {
1216
+ extend(props, v.getCustomAttributes());
1217
+ });
1218
+ extend(props, {
1219
+ ref: combineFn(refs),
1220
+ className: external_zeta_dom_react_.classNames.apply(null, args)
1221
+ });
1222
+ each(mixins, function (i, v) {
1223
+ v.next();
1224
+ });
1225
+ return props;
1226
+ }
1227
+ });
1228
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/observe.js
1229
+
1230
+ var observe_lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
1231
+ observe = observe_lib$dom.observe,
1232
+ registerCleanup = observe_lib$dom.registerCleanup,
1233
+ createAutoCleanupMap = observe_lib$dom.createAutoCleanupMap,
1234
+ afterDetached = observe_lib$dom.afterDetached,
1235
+ watchElements = observe_lib$dom.watchElements,
1236
+ watchAttributes = observe_lib$dom.watchAttributes,
1237
+ watchOwnAttributes = observe_lib$dom.watchOwnAttributes;
1238
+
1239
+ ;// CONCATENATED MODULE: ./src/mixins/StatefulMixin.js
1240
+
1241
+
1242
+
1243
+ var _ = createPrivateStore();
1244
+
1245
+ function MixinRefImpl(mixin) {
1246
+ this.mixin = mixin;
1247
+ }
1248
+
1249
+ definePrototype(MixinRefImpl, {
1250
+ getMixin: function getMixin() {
1251
+ return this.mixin;
1252
+ }
1253
+ });
1254
+ function StatefulMixin() {
1255
+ Mixin.call(this);
1256
+
1257
+ _(this, {
1258
+ elements: new Set(),
1259
+ flush: watch(this, false),
1260
+ dispose: [],
1261
+ states: {},
1262
+ prefix: '',
1263
+ counter: 0
1264
+ });
1265
+ }
1266
+ definePrototype(StatefulMixin, Mixin, {
1267
+ get ref() {
1268
+ var self = this;
1269
+ var state = self.state;
1270
+ self.next();
1271
+ return state.ref || (state.ref = new MixinRefImpl(self.clone()));
1272
+ },
1273
+
1274
+ get state() {
1275
+ var obj = _(this);
1276
+
1277
+ var key = obj.prefix + obj.counter;
1278
+ return obj.states[key] || (obj.states[key] = this.initState());
1279
+ },
1280
+
1281
+ reset: function reset() {
1282
+ _(this).counter = 0;
1283
+ return this;
1284
+ },
1285
+ next: function next() {
1286
+ _(this).counter++;
1287
+ return this;
1288
+ },
1289
+ getRef: function getRef() {
1290
+ var self = this;
1291
+ var state = self.state;
1292
+ return function (current) {
1293
+ state.element = current;
1294
+
1295
+ if (current && setAdd(_(self).elements, current)) {
1296
+ self.initElement(current, state);
1297
+ }
1298
+ };
1299
+ },
1300
+ elements: function elements() {
1301
+ return values(_(this).states).map(function (v) {
1302
+ return v.element;
1303
+ }).filter(function (v) {
1304
+ return v;
1305
+ });
1306
+ },
1307
+ onDispose: function onDispose(callback) {
1308
+ _(this).dispose.push(callback);
1309
+ },
1310
+ initState: function initState() {
1311
+ return {
1312
+ element: null
1313
+ };
1314
+ },
1315
+ initElement: function initElement(element, state) {},
1316
+ clone: function clone() {
1317
+ var self = this;
1318
+ var clone = inherit(Object.getPrototypeOf(self), self);
1319
+
1320
+ _(clone, extend({}, _(self), {
1321
+ prefix: randomId() + '.',
1322
+ counter: 0
1323
+ }));
1324
+
1325
+ return clone;
1326
+ },
1327
+ dispose: function dispose() {
1328
+ var state = _(this);
1329
+
1330
+ var states = state.states;
1331
+ combineFn(state.dispose.splice(0))();
1332
+ state.flush();
1333
+ state.elements.clear();
1334
+ each(states, function (i, v) {
1335
+ delete states[i];
1336
+ });
1337
+ }
1338
+ });
1339
+ ;// CONCATENATED MODULE: ./src/mixins/ClassNameMixin.js
1340
+
1341
+
1342
+
1343
+
1344
+
1345
+ var ClassNameMixinSuper = StatefulMixin.prototype;
1346
+
1347
+ function checkState(self, element, state, isAsync) {
1348
+ var classNames = state.classNames;
1349
+ var prev = extend({}, classNames);
1350
+ each(self.classNames, function (i, v) {
1351
+ classNames[v] = element.classList.contains(v);
1352
+ });
1353
+
1354
+ if (!equal(prev, classNames)) {
1355
+ var cb = self.onClassNameUpdated.bind(self, element, prev, extend({}, classNames));
1356
+
1357
+ if (isAsync) {
1358
+ setImmediate(cb);
1359
+ } else {
1360
+ cb();
1361
+ }
1362
+ }
1363
+ }
1364
+
1365
+ function ClassNameMixin(classNames) {
1366
+ StatefulMixin.call(this);
1367
+ this.classNames = classNames || [];
1368
+ }
1369
+ definePrototype(ClassNameMixin, StatefulMixin, {
1370
+ getClassNames: function getClassNames() {
1371
+ return [this.state.classNames];
1372
+ },
1373
+ getRef: function getRef() {
1374
+ var self = this;
1375
+ var element = self.state.element;
1376
+
1377
+ if (element && containsOrEquals(zeta_dom_dom.root, element)) {
1378
+ checkState(self, element, self.state, true);
1379
+ }
1380
+
1381
+ return ClassNameMixinSuper.getRef.call(this);
1382
+ },
1383
+ initState: function initState() {
1384
+ return {
1385
+ element: null,
1386
+ classNames: {}
1387
+ };
1388
+ },
1389
+ initElement: function initElement(element, state) {
1390
+ var self = this;
1391
+ watchOwnAttributes(element, 'class', function () {
1392
+ checkState(self, element, state);
1393
+ });
1394
+ },
1395
+ onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {}
1396
+ });
1397
+ ;// CONCATENATED MODULE: ./src/mixins/AnimateMixin.js
1398
+
1399
+
1400
+ var AnimateMixinSuper = ClassNameMixin.prototype;
1401
+ function AnimateMixin() {
1402
+ ClassNameMixin.call(this, ['tweening-in', 'tweening-out']);
1403
+ }
1404
+ definePrototype(AnimateMixin, ClassNameMixin, {
1405
+ next: function next() {
1406
+ var self = this;
1407
+ self.effects = undefined;
1408
+ self.trigger = undefined;
1409
+ return AnimateMixinSuper.next.call(self);
1410
+ },
1411
+ "with": function _with(props) {
1412
+ var self = this;
1413
+ self.effects = props.effects;
1414
+ self.trigger = props.trigger;
1415
+ return self;
1416
+ },
1417
+ withEffects: function withEffects() {
1418
+ this.effects = makeArray(arguments);
1419
+ return this;
1420
+ },
1421
+ getCustomAttributes: function getCustomAttributes() {
1422
+ var self = this;
1423
+ return extend({}, AnimateMixinSuper.getCustomAttributes.call(self), {
1424
+ 'animate-in': (self.effects || []).join(' '),
1425
+ 'animate-on': self.trigger || 'show'
1426
+ });
1427
+ }
1428
+ });
1429
+ ;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceItemMixin.js
1430
+
1431
+
1432
+ var AnimateSequenceItemMixinSuper = ClassNameMixin.prototype;
1433
+ function AnimateSequenceItemMixin(className) {
1434
+ ClassNameMixin.call(this, ['tweening-in', 'tweening-out']);
1435
+ this.className = className;
1436
+ }
1437
+ definePrototype(AnimateSequenceItemMixin, ClassNameMixin, {
1438
+ getClassNames: function getClassNames() {
1439
+ return [this.className].concat(AnimateSequenceItemMixinSuper.getClassNames.call(this));
1440
+ }
1441
+ });
1442
+ ;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceMixin.js
1443
+
1444
+
1445
+
1446
+ var AnimateSequenceMixinSuper = AnimateMixin.prototype;
1447
+ var animateSequenceMixinCounter = 0;
1448
+ function AnimateSequenceMixin() {
1449
+ var self = this;
1450
+ AnimateMixin.call(self);
1451
+ self.className = 'brew-anim-' + ++animateSequenceMixinCounter;
1452
+ self.item = new AnimateSequenceItemMixin(self.className);
1453
+ }
1454
+ definePrototype(AnimateSequenceMixin, AnimateMixin, {
1455
+ reset: function reset() {
1456
+ this.item.reset();
1457
+ return AnimateSequenceMixinSuper.reset.call(this);
1458
+ },
1459
+ getCustomAttributes: function getCustomAttributes() {
1460
+ return extend({}, AnimateSequenceMixinSuper.getCustomAttributes.call(this), {
1461
+ 'animate-sequence': '.' + this.className
1462
+ });
1463
+ },
1464
+ clone: function clone() {
1465
+ return extend(AnimateSequenceMixinSuper.clone.call(this), {
1466
+ item: this.item.ref.getMixin()
1467
+ });
1468
+ }
1469
+ });
1470
+ ;// CONCATENATED MODULE: ./src/mixins/FlyoutToggleMixin.js
1471
+
1472
+
1473
+ var FlyoutToggleMixinSuper = ClassNameMixin.prototype;
1474
+ function FlyoutToggleMixin(mixin) {
1475
+ ClassNameMixin.call(this, ['target-opened']);
1476
+ this.flyoutMixin = mixin;
1477
+ }
1478
+ definePrototype(FlyoutToggleMixin, ClassNameMixin, {
1479
+ open: function open(value) {
1480
+ return this.flyoutMixin.open(value);
1481
+ },
1482
+ close: function close(value) {
1483
+ return this.flyoutMixin.close(value);
1484
+ },
1485
+ getCustomAttributes: function getCustomAttributes() {
1486
+ var element = this.flyoutMixin.elements()[0];
1487
+ return extend({}, FlyoutToggleMixinSuper.getCustomAttributes.call(this), {
1488
+ 'toggle': element && '#' + element.id
1489
+ });
1490
+ }
1491
+ });
1492
+ ;// CONCATENATED MODULE: ./src/mixins/FlyoutMixin.js
1493
+
1494
+
1495
+
1496
+
1497
+
1498
+ var FlyoutMixinSuper = ClassNameMixin.prototype;
1499
+ var valueMap = new WeakMap();
1500
+ var flyoutMixinCounter = 0;
1501
+ function FlyoutMixin() {
1502
+ var self = this;
1503
+ ClassNameMixin.call(self, ['open', 'closing', 'visible', 'tweening-in', 'tweening-out']);
1504
+ self.modal = false;
1505
+ self.tabThrough = false;
1506
+ self.isFlyoutOpened = false;
1507
+ self.animating = false;
1508
+ self.visible = false;
1509
+ self.toggle = new FlyoutToggleMixin(self);
1510
+ self.onDispose(function () {
1511
+ self.isFlyoutOpened = false;
1512
+ self.visible = false;
1513
+ });
1514
+ }
1515
+ definePrototype(FlyoutMixin, ClassNameMixin, {
1516
+ reset: function reset() {
1517
+ this.toggle.reset();
1518
+ return FlyoutMixinSuper.reset.call(this);
1519
+ },
1520
+ next: function next() {
1521
+ this.effects = undefined;
1522
+ return FlyoutMixinSuper.next.call(this);
1523
+ },
1524
+ withEffects: function withEffects() {
1525
+ this.effects = makeArray(arguments);
1526
+ return this;
1527
+ },
1528
+ getCustomAttributes: function getCustomAttributes() {
1529
+ var self = this;
1530
+ return extend({}, FlyoutMixinSuper.getCustomAttributes.call(self), {
1531
+ 'is-flyout': '',
1532
+ 'swipe-dismiss': self.swipeToDismiss
1533
+ }, self.modal && {
1534
+ 'is-modal': ''
1535
+ }, self.tabThrough && {
1536
+ 'tab-through': ''
1537
+ }, self.effects && {
1538
+ 'animate-on': 'open',
1539
+ 'animate-in': self.effects.join(' '),
1540
+ 'animate-out': ''
1541
+ });
1542
+ },
1543
+ open: function open(value) {
1544
+ var element = this.elements()[0];
1545
+ valueMap.set(element, value);
1546
+ return openFlyout(element);
1547
+ },
1548
+ close: function close(value) {
1549
+ return closeFlyout(this.elements()[0], value);
1550
+ },
1551
+ onOpen: function onOpen(callback) {
1552
+ var element = this.elements()[0];
1553
+ return this.onToggleState(function (opened) {
1554
+ if (opened) {
1555
+ return callback(valueMap.get(element));
1556
+ }
1557
+ });
1558
+ },
1559
+ onToggleState: function onToggleState(callback) {
1560
+ return this.watch('isFlyoutOpened', callback);
1561
+ },
1562
+ onVisibilityChanged: function onVisibilityChanged(callback) {
1563
+ return this.watch('visible', callback);
1564
+ },
1565
+ initElement: function initElement(element, state) {
1566
+ var self = this;
1567
+ FlyoutMixinSuper.initElement.call(self, element, state);
1568
+
1569
+ if (!element.id) {
1570
+ element.id = 'flyout-' + ++flyoutMixinCounter;
1571
+ }
1572
+
1573
+ self.onDispose(app_app.on(element, {
1574
+ animationstart: function animationstart() {
1575
+ self.animating = true;
1576
+ },
1577
+ animationcomplete: function animationcomplete() {
1578
+ self.animating = false;
1579
+ }
1580
+ }, true));
1581
+ setImmediate(function () {
1582
+ each(self.toggle.elements(), function (i, v) {
1583
+ v.setAttribute('toggle', '#' + element.id);
1584
+ });
1585
+ });
1586
+ },
1587
+ clone: function clone() {
1588
+ var self = this;
1589
+ var mixin = extend(FlyoutMixinSuper.clone.call(self), {
1590
+ toggle: self.toggle.ref.getMixin()
1591
+ });
1592
+ defineAliasProperty(mixin, 'isFlyoutOpened', self);
1593
+ defineAliasProperty(mixin, 'modal', self);
1594
+ return mixin;
1595
+ },
1596
+ onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {
1597
+ var self = this;
1598
+ self.visible = state.open;
1599
+ self.isFlyoutOpened = state.open && !state.closing && !state['tweening-out'];
1600
+ }
1601
+ });
1602
+ ;// CONCATENATED MODULE: ./src/mixins/FocusStateMixin.js
1603
+
1604
+
1605
+
1606
+
1607
+ var FocusStateMixinSuper = StatefulMixin.prototype;
1608
+ function FocusStateMixin() {
1609
+ StatefulMixin.call(this);
1610
+ }
1611
+ definePrototype(FocusStateMixin, StatefulMixin, {
1612
+ initElement: function initElement(element, state) {
1613
+ FocusStateMixinSuper.initElement.call(this, element, state);
1614
+ this.onDispose(zeta_dom_dom.on(element, {
1615
+ focusin: function focusin(e) {
1616
+ state.focused = true;
1617
+ setClass(element, 'focused', e.source);
1618
+ },
1619
+ focusout: function focusout() {
1620
+ state.focused = false;
1621
+ setClass(element, 'focused', false);
1622
+ }
1623
+ }));
1624
+ },
1625
+ getClassNames: function getClassNames() {
1626
+ return [{
1627
+ focused: !!this.state.focused
1628
+ }];
1629
+ }
1630
+ });
1631
+ ;// CONCATENATED MODULE: ./src/mixins/LoadingStateMixin.js
1632
+
1633
+
1634
+
1635
+
1636
+
1637
+ var LoadingStateMixinSuper = StatefulMixin.prototype;
1638
+ function LoadingStateMixin() {
1639
+ StatefulMixin.call(this);
1640
+ }
1641
+ definePrototype(LoadingStateMixin, StatefulMixin, {
1642
+ initElement: function initElement(element, state) {
1643
+ LoadingStateMixinSuper.initElement.call(this, element, state);
1644
+ lock(element);
1645
+ this.onDispose(zeta_dom_dom.on(element, {
1646
+ asyncStart: function asyncStart() {
1647
+ state.loading = true;
1648
+ setClass(element, 'loading', true);
1649
+ },
1650
+ asyncEnd: function asyncEnd() {
1651
+ state.loading = false;
1652
+ setClass(element, 'loading', false);
1653
+ },
1654
+ cancelled: function cancelled() {
1655
+ state.loading = false;
1656
+ setClass(element, 'loading', false);
1657
+ }
1658
+ }));
1659
+ },
1660
+ getClassNames: function getClassNames() {
1661
+ return [{
1662
+ loading: !!this.state.loading
1663
+ }];
1664
+ }
1665
+ });
1666
+ // EXTERNAL MODULE: external "jQuery"
1667
+ var external_jQuery_ = __webpack_require__(145);
1668
+ ;// CONCATENATED MODULE: ./src/include/external/jquery.js
1669
+ // @ts-nocheck
1670
+
1671
+ /* harmony default export */ const jquery = (external_jQuery_);
1672
+ ;// CONCATENATED MODULE: ./src/mixins/ScrollableMixin.js
1673
+
1674
+
1675
+
1676
+
1677
+
1678
+ var ScrollableMixinSuper = ClassNameMixin.prototype;
1679
+ function ScrollableMixin() {
1680
+ var self = this;
1681
+ ClassNameMixin.call(self, ['scrollable-x', 'scrollable-x-l', 'scrollable-x-r', 'scrollable-y', 'scrollable-y-d', 'scrollable-y-u']);
1682
+ self.target = Mixin.scrollableTarget;
1683
+ self.pageIndex = 0;
1684
+ self.scrolling = false;
1685
+ }
1686
+ definePrototype(ScrollableMixin, ClassNameMixin, {
1687
+ withOptions: function withOptions(options) {
1688
+ this.options = options;
1689
+ return this;
1690
+ },
1691
+ getCustomAttributes: function getCustomAttributes() {
1692
+ var options = this.options || {};
1693
+ return extend({}, ScrollableMixinSuper.getCustomAttributes.call(this), {
1694
+ 'scrollable': [options.direction || 'both', options.handle || 'auto'].join(' ')
1695
+ }, options.paged && {
1696
+ 'var': '{ pageIndex: 0 }',
1697
+ 'scroller-snap-page': options.paged,
1698
+ 'scroller-page': options.pagedItemSelector,
1699
+ 'scroller-state': 'pageIndex'
1700
+ });
1701
+ },
1702
+ onPageIndexChanged: function onPageIndexChanged(callback) {
1703
+ return this.watch('pageIndex', callback);
1704
+ },
1705
+ initElement: function initElement(element, state) {
1706
+ var self = this;
1707
+ self.onDispose(app_app.on(element, {
1708
+ statechange: function statechange(e) {
1709
+ if ('pageIndex' in e.newValues) {
1710
+ extend(self, {
1711
+ pageIndex: e.newValues.pageIndex
1712
+ });
1713
+ }
1714
+ },
1715
+ scrollStart: function scrollStart() {
1716
+ self.scrolling = true;
1717
+ },
1718
+ scrollStop: function scrollStop() {
1719
+ self.scrolling = false;
1720
+ }
1721
+ }, true));
1722
+ },
1723
+ clone: function clone() {
1724
+ var mixin = ScrollableMixinSuper.clone.call(this);
1725
+ defineAliasProperty(mixin, 'pageIndex', this);
1726
+ return mixin;
1727
+ }
1728
+ });
1729
+ each('destroy enable disable setOptions refresh scrollPadding stop scrollLeft scrollTop scrollBy scrollTo scrollByPage scrollToPage scrollToElement', function (i, v) {
1730
+ defineHiddenProperty(ScrollableMixin.prototype, v, function () {
1731
+ var obj = jquery(this.elements());
1732
+ return obj.scrollable.apply(obj, [v].concat(makeArray(arguments)));
1733
+ });
1734
+ });
1735
+ ;// CONCATENATED MODULE: ./src/mixin.js
1736
+
1737
+
1738
+
1739
+
1740
+
1741
+
1742
+
1743
+
1744
+
1745
+
1746
+
1747
+
1748
+
1749
+
1750
+ function extendSelf(options) {
1751
+ extend(this, options);
1752
+ }
1753
+
1754
+ function createUseFunction(ctor) {
1755
+ return function () {
1756
+ var mixin = useMixin(ctor);
1757
+ (mixin.withOptions || extendSelf).apply(mixin, arguments);
1758
+ return mixin;
1759
+ };
1760
+ }
1761
+
1762
+ function disposeMixin(mixin) {
1763
+ mixin.disposed = true;
1764
+ setImmediate(function () {
1765
+ if (mixin.disposed) {
1766
+ mixin.dispose();
1767
+ }
1768
+ });
1769
+ }
1770
+
1771
+ var useAnimateMixin = createUseFunction(AnimateMixin);
1772
+ var useAnimateSequenceMixin = createUseFunction(AnimateSequenceMixin);
1773
+ var useFlyoutMixin = createUseFunction(FlyoutMixin);
1774
+ var useFocusStateMixin = createUseFunction(FocusStateMixin);
1775
+ var useLoadingStateMixin = createUseFunction(LoadingStateMixin);
1776
+ var useScrollableMixin = createUseFunction(ScrollableMixin);
1777
+ function useMixin(ctor) {
1778
+ var mixin = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
1779
+ return new ctor();
1780
+ })[0].reset();
1781
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
1782
+ mixin.disposed = false;
1783
+ return disposeMixin.bind(0, mixin);
1784
+ }, []);
1785
+ return mixin;
1786
+ }
1787
+ function useMixinRef(mixin) {
1788
+ return mixin && mixin.getMixin().reset();
1789
+ }
1790
+
1791
+ ;// CONCATENATED MODULE: ./src/index.js
1792
+
1793
+ /* harmony default export */ const src = (brew_js_app);
1794
+
1795
+
1796
+
1797
+
1798
+
1799
+ ;// CONCATENATED MODULE: ./src/entry.js
1800
+
1801
+ /* harmony default export */ const entry = (src_namespaceObject);
1802
+
1803
+ brew_js_app.react = src_namespaceObject;
1804
+ })();
1805
+
1806
+ __webpack_exports__ = __webpack_exports__["default"];
1807
+ /******/ return __webpack_exports__;
1808
+ /******/ })()
1809
+ ;
1810
+ });
1785
1811
  //# sourceMappingURL=brew-js-react.js.map