@pixui-dev/pxw 0.1.16

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.
Files changed (128) hide show
  1. package/bin/pxw.js +217 -0
  2. package/bin/wpbuild.js +10 -0
  3. package/config/default.conf +21 -0
  4. package/config/devops.js +358 -0
  5. package/config/h5es.js +10 -0
  6. package/config/index.html +181 -0
  7. package/config/pfbs.js +207 -0
  8. package/config/testhelp.js +0 -0
  9. package/config/util.js +140 -0
  10. package/config/webpack.js +291 -0
  11. package/lib/assets/border.png +0 -0
  12. package/lib/assets/check.html +62 -0
  13. package/lib/assets/pixui.png +0 -0
  14. package/lib/assets/preact.js +4354 -0
  15. package/lib/assets/preact.png +0 -0
  16. package/lib/check/main.less +63 -0
  17. package/lib/check/main.tsx +41 -0
  18. package/lib/check/tool.js +3 -0
  19. package/lib/check/util.tsx +110 -0
  20. package/lib/grpc-web/dist/ChunkParser.js +117 -0
  21. package/lib/grpc-web/dist/ChunkParser.js.map +1 -0
  22. package/lib/grpc-web/dist/Code.js +58 -0
  23. package/lib/grpc-web/dist/Code.js.map +1 -0
  24. package/lib/grpc-web/dist/client.js +299 -0
  25. package/lib/grpc-web/dist/client.js.map +1 -0
  26. package/lib/grpc-web/dist/debug.js +16 -0
  27. package/lib/grpc-web/dist/debug.js.map +1 -0
  28. package/lib/grpc-web/dist/detach.js +7 -0
  29. package/lib/grpc-web/dist/detach.js.map +1 -0
  30. package/lib/grpc-web/dist/index.js +29 -0
  31. package/lib/grpc-web/dist/index.js.map +1 -0
  32. package/lib/grpc-web/dist/invoke.js +32 -0
  33. package/lib/grpc-web/dist/invoke.js.map +1 -0
  34. package/lib/grpc-web/dist/message.js +3 -0
  35. package/lib/grpc-web/dist/message.js.map +1 -0
  36. package/lib/grpc-web/dist/metadata.js +5 -0
  37. package/lib/grpc-web/dist/metadata.js.map +1 -0
  38. package/lib/grpc-web/dist/service.js +3 -0
  39. package/lib/grpc-web/dist/service.js.map +1 -0
  40. package/lib/grpc-web/dist/transports/Transport.js +15 -0
  41. package/lib/grpc-web/dist/transports/Transport.js.map +1 -0
  42. package/lib/grpc-web/dist/transports/http/fetch.js +117 -0
  43. package/lib/grpc-web/dist/transports/http/fetch.js.map +1 -0
  44. package/lib/grpc-web/dist/transports/http/http.js +15 -0
  45. package/lib/grpc-web/dist/transports/http/http.js.map +1 -0
  46. package/lib/grpc-web/dist/transports/http/xhr.js +136 -0
  47. package/lib/grpc-web/dist/transports/http/xhr.js.map +1 -0
  48. package/lib/grpc-web/dist/transports/http/xhrUtil.js +36 -0
  49. package/lib/grpc-web/dist/transports/http/xhrUtil.js.map +1 -0
  50. package/lib/grpc-web/dist/transports/websocket/websocket.js +95 -0
  51. package/lib/grpc-web/dist/transports/websocket/websocket.js.map +1 -0
  52. package/lib/grpc-web/dist/typings/ChunkParser.d.ts +17 -0
  53. package/lib/grpc-web/dist/typings/Code.d.ts +20 -0
  54. package/lib/grpc-web/dist/typings/client.d.ts +25 -0
  55. package/lib/grpc-web/dist/typings/debug.d.ts +1 -0
  56. package/lib/grpc-web/dist/typings/detach.d.ts +1 -0
  57. package/lib/grpc-web/dist/typings/index.d.ts +45 -0
  58. package/lib/grpc-web/dist/typings/invoke.d.ts +20 -0
  59. package/lib/grpc-web/dist/typings/message.d.ts +8 -0
  60. package/lib/grpc-web/dist/typings/metadata.d.ts +2 -0
  61. package/lib/grpc-web/dist/typings/service.d.ts +16 -0
  62. package/lib/grpc-web/dist/typings/transports/Transport.d.ts +22 -0
  63. package/lib/grpc-web/dist/typings/transports/http/fetch.d.ts +6 -0
  64. package/lib/grpc-web/dist/typings/transports/http/http.d.ts +5 -0
  65. package/lib/grpc-web/dist/typings/transports/http/xhr.d.ts +27 -0
  66. package/lib/grpc-web/dist/typings/transports/http/xhrUtil.d.ts +3 -0
  67. package/lib/grpc-web/dist/typings/transports/websocket/websocket.d.ts +2 -0
  68. package/lib/grpc-web/dist/typings/unary.d.ts +23 -0
  69. package/lib/grpc-web/dist/typings/util.d.ts +2 -0
  70. package/lib/grpc-web/dist/unary.js +44 -0
  71. package/lib/grpc-web/dist/unary.js.map +1 -0
  72. package/lib/grpc-web/dist/util.js +11 -0
  73. package/lib/grpc-web/dist/util.js.map +1 -0
  74. package/lib/grpcTransport/PixHttp2Transport.ts +107 -0
  75. package/lib/grpcTransport/PixLuaTransport.ts +82 -0
  76. package/lib/h5es-types/v1.9.2/h5es.d.ts +1698 -0
  77. package/lib/h5es-types/v3.5.0/h5es.d.ts +1788 -0
  78. package/lib/pi_component/tinyList/tinyList.js +483 -0
  79. package/lib/pi_component/tinyList/tinyList.tsx +517 -0
  80. package/lib/pika-svelte/compiler.js +29829 -0
  81. package/lib/pika-svelte/easing/index.js +158 -0
  82. package/lib/pika-svelte/index.js +72 -0
  83. package/lib/pika-svelte/internal/index.js +1926 -0
  84. package/lib/pika-svelte/motion/index.js +210 -0
  85. package/lib/pika-svelte/package.json +145 -0
  86. package/lib/pika-svelte/register.js +57 -0
  87. package/lib/pika-svelte/rollup.config.js +126 -0
  88. package/lib/pika-svelte/store/index.js +123 -0
  89. package/lib/pika-svelte/transition/index.js +185 -0
  90. package/lib/preact-router.js +395 -0
  91. package/lib/preact.js +4355 -0
  92. package/lib/preact.tq.js +4385 -0
  93. package/lib/react-window/src/FixedSizeGrid.js +172 -0
  94. package/lib/react-window/src/FixedSizeList.js +91 -0
  95. package/lib/react-window/src/VariableSizeGrid.js +329 -0
  96. package/lib/react-window/src/VariableSizeList.js +231 -0
  97. package/lib/react-window/src/__tests__/FixedSizeGrid.js +942 -0
  98. package/lib/react-window/src/__tests__/FixedSizeList.js +749 -0
  99. package/lib/react-window/src/__tests__/VariableSizeGrid.js +598 -0
  100. package/lib/react-window/src/__tests__/VariableSizeList.js +345 -0
  101. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeGrid.js.snap +912 -0
  102. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeList.js.snap +568 -0
  103. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeGrid.js.snap +542 -0
  104. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeList.js.snap +331 -0
  105. package/lib/react-window/src/__tests__/areEqual.js +28 -0
  106. package/lib/react-window/src/__tests__/shouldComponentUpdate.js +32 -0
  107. package/lib/react-window/src/areEqual.js +13 -0
  108. package/lib/react-window/src/createGridComponent.js +657 -0
  109. package/lib/react-window/src/createListComponent.js +574 -0
  110. package/lib/react-window/src/domHelpers.js +69 -0
  111. package/lib/react-window/src/index.js +9 -0
  112. package/lib/react-window/src/shallowDiffers.js +17 -0
  113. package/lib/react-window/src/shouldComponentUpdate.js +11 -0
  114. package/lib/react-window/src/test.js.flow +382 -0
  115. package/lib/react-window/src/timer.js +36 -0
  116. package/lib/svelte-tab/Tab.svelte +31 -0
  117. package/lib/svelte-tab/TabList.svelte +10 -0
  118. package/lib/svelte-tab/TabPanel.svelte +13 -0
  119. package/lib/svelte-tab/Tabs.svelte +68 -0
  120. package/lib/svelte-tab/tabs.js +4 -0
  121. package/lib/types/css.d.ts +7476 -0
  122. package/lib/types/dom.ts +17 -0
  123. package/lib/types/ext.d.ts +81 -0
  124. package/lib/types/internal.d.ts +94 -0
  125. package/lib/types/jsx.d.ts +309 -0
  126. package/lib/types/preact.d.ts +340 -0
  127. package/package.json +111 -0
  128. package/tsconfig.json +30 -0
@@ -0,0 +1,4385 @@
1
+ /******/ var __webpack_modules__ = {
2
+ /***/ './compat/src/Children.js':
3
+ /*!********************************!*\
4
+ !*** ./compat/src/Children.js ***!
5
+ \********************************/
6
+ /***/ (
7
+ __unused_webpack_module,
8
+ __webpack_exports__,
9
+ __webpack_require__
10
+ ) => {
11
+ __webpack_require__.r(__webpack_exports__);
12
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
+ /* harmony export */ Children: () => /* binding */ Children,
14
+ /* harmony export */
15
+ });
16
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ =
17
+ __webpack_require__(/*! preact */ './src/index.js');
18
+
19
+ var mapFn = function mapFn(children, fn) {
20
+ if (children == null) return null;
21
+ return (0, preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(
22
+ (0, preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(children).map(
23
+ fn
24
+ )
25
+ );
26
+ };
27
+
28
+ // This API is completely unnecessary for Preact, so it's basically passthrough.
29
+ var Children = {
30
+ map: mapFn,
31
+ forEach: mapFn,
32
+ count: function count(children) {
33
+ return children
34
+ ? (0, preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(children)
35
+ .length
36
+ : 0;
37
+ },
38
+ only: function only(children) {
39
+ var normalized = (0,
40
+ preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(children);
41
+ if (normalized.length !== 1) throw 'Children.only';
42
+ return normalized[0];
43
+ },
44
+ toArray: preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray,
45
+ };
46
+
47
+ /***/
48
+ },
49
+
50
+ /***/ './compat/src/PureComponent.js':
51
+ /*!*************************************!*\
52
+ !*** ./compat/src/PureComponent.js ***!
53
+ \*************************************/
54
+ /***/ (
55
+ __unused_webpack_module,
56
+ __webpack_exports__,
57
+ __webpack_require__
58
+ ) => {
59
+ __webpack_require__.r(__webpack_exports__);
60
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
61
+ /* harmony export */ PureComponent: () => /* binding */ PureComponent,
62
+ /* harmony export */
63
+ });
64
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ =
65
+ __webpack_require__(/*! preact */ './src/index.js');
66
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ =
67
+ __webpack_require__(/*! ./util */ './compat/src/util.js');
68
+
69
+ /**
70
+ * Component class with a predefined `shouldComponentUpdate` implementation
71
+ */
72
+ function PureComponent(p) {
73
+ this.props = p;
74
+ }
75
+ PureComponent.prototype =
76
+ new preact__WEBPACK_IMPORTED_MODULE_0__.Component();
77
+ // Some third-party libraries check if this property is present
78
+ PureComponent.prototype.isPureReactComponent = true;
79
+ PureComponent.prototype.shouldComponentUpdate = function (props, state) {
80
+ return (
81
+ (0, _util__WEBPACK_IMPORTED_MODULE_1__.shallowDiffers)(
82
+ this.props,
83
+ props
84
+ ) ||
85
+ (0, _util__WEBPACK_IMPORTED_MODULE_1__.shallowDiffers)(
86
+ this.state,
87
+ state
88
+ )
89
+ );
90
+ };
91
+
92
+ /***/
93
+ },
94
+
95
+ /***/ './compat/src/forwardRef.js':
96
+ /*!**********************************!*\
97
+ !*** ./compat/src/forwardRef.js ***!
98
+ \**********************************/
99
+ /***/ (
100
+ __unused_webpack_module,
101
+ __webpack_exports__,
102
+ __webpack_require__
103
+ ) => {
104
+ __webpack_require__.r(__webpack_exports__);
105
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
106
+ /* harmony export */ REACT_FORWARD_SYMBOL: () =>
107
+ /* binding */ REACT_FORWARD_SYMBOL,
108
+ /* harmony export */ forwardRef: () => /* binding */ forwardRef,
109
+ /* harmony export */
110
+ });
111
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ =
112
+ __webpack_require__(/*! preact */ './src/index.js');
113
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ =
114
+ __webpack_require__(/*! ./util */ './compat/src/util.js');
115
+
116
+ var oldDiffHook = preact__WEBPACK_IMPORTED_MODULE_0__.options.__b;
117
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.__b = function (vnode) {
118
+ if (vnode.type && vnode.type.__f && vnode.ref) {
119
+ vnode.props.ref = vnode.ref;
120
+ vnode.ref = null;
121
+ }
122
+ if (oldDiffHook) oldDiffHook(vnode);
123
+ };
124
+ var REACT_FORWARD_SYMBOL =
125
+ (typeof Symbol != 'undefined' &&
126
+ Symbol.for &&
127
+ Symbol.for('react.forward_ref')) ||
128
+ 0xf47;
129
+
130
+ /**
131
+ * Pass ref down to a child. This is mainly used in libraries with HOCs that
132
+ * wrap components. Using `forwardRef` there is an easy way to get a reference
133
+ * of the wrapped component instead of one of the wrapper itself.
134
+ * @param {import('@wellbye/pxw/lib/preact').ForwardFn} fn
135
+ * @returns {import('./types/internal').FunctionComponent}
136
+ */
137
+ function forwardRef(fn) {
138
+ function Forwarded(props) {
139
+ var clone = (0, _util__WEBPACK_IMPORTED_MODULE_1__.assign)({}, props);
140
+ delete clone.ref;
141
+ return fn(clone, props.ref || null);
142
+ }
143
+
144
+ // mobx-react checks for this being present
145
+ Forwarded.$$typeof = REACT_FORWARD_SYMBOL;
146
+ // mobx-react heavily relies on implementation details.
147
+ // It expects an object here with a `render` property,
148
+ // and prototype.render will fail. Without this
149
+ // mobx-react throws.
150
+ Forwarded.render = Forwarded;
151
+ Forwarded.prototype.isReactComponent = Forwarded.__f = true;
152
+ Forwarded.displayName =
153
+ 'ForwardRef(' + (fn.displayName || fn.name) + ')';
154
+ return Forwarded;
155
+ }
156
+
157
+ /***/
158
+ },
159
+
160
+ /***/ './compat/src/memo.js':
161
+ /*!****************************!*\
162
+ !*** ./compat/src/memo.js ***!
163
+ \****************************/
164
+ /***/ (
165
+ __unused_webpack_module,
166
+ __webpack_exports__,
167
+ __webpack_require__
168
+ ) => {
169
+ __webpack_require__.r(__webpack_exports__);
170
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
171
+ /* harmony export */ memo: () => /* binding */ memo,
172
+ /* harmony export */
173
+ });
174
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ =
175
+ __webpack_require__(/*! preact */ './src/index.js');
176
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ =
177
+ __webpack_require__(/*! ./util */ './compat/src/util.js');
178
+
179
+ /**
180
+ * Memoize a component, so that it only updates when the props actually have
181
+ * changed. This was previously known as `React.pure`.
182
+ * @param {import('./types/internal').FunctionComponent} c functional component
183
+ * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function
184
+ * @returns {import('./types/internal').FunctionComponent}
185
+ */
186
+ function memo(c, comparer) {
187
+ function shouldUpdate(nextProps) {
188
+ var ref = this.props.ref;
189
+ var updateRef = ref == nextProps.ref;
190
+ if (!updateRef && ref) {
191
+ ref.call ? ref(null) : (ref.current = null);
192
+ }
193
+ if (!comparer) {
194
+ return (0, _util__WEBPACK_IMPORTED_MODULE_1__.shallowDiffers)(
195
+ this.props,
196
+ nextProps
197
+ );
198
+ }
199
+ return !comparer(this.props, nextProps) || !updateRef;
200
+ }
201
+ function Memoed(props) {
202
+ this.shouldComponentUpdate = shouldUpdate;
203
+ return (0, preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(
204
+ c,
205
+ props
206
+ );
207
+ }
208
+ Memoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';
209
+ Memoed.prototype.isReactComponent = true;
210
+ Memoed.__f = true;
211
+ return Memoed;
212
+ }
213
+
214
+ /***/
215
+ },
216
+
217
+ /***/ './compat/src/portals.js':
218
+ /*!*******************************!*\
219
+ !*** ./compat/src/portals.js ***!
220
+ \*******************************/
221
+ /***/ (
222
+ __unused_webpack_module,
223
+ __webpack_exports__,
224
+ __webpack_require__
225
+ ) => {
226
+ __webpack_require__.r(__webpack_exports__);
227
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
228
+ /* harmony export */ createPortal: () => /* binding */ createPortal,
229
+ /* harmony export */
230
+ });
231
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ =
232
+ __webpack_require__(/*! preact */ './src/index.js');
233
+
234
+ /**
235
+ * @param {import('../../src/index').RenderableProps<{ context: any }>} props
236
+ */
237
+ function ContextProvider(props) {
238
+ this.getChildContext = function () {
239
+ return props.context;
240
+ };
241
+ return props.children;
242
+ }
243
+
244
+ /**
245
+ * Portal component
246
+ * @this {import('./types/internal').Component}
247
+ * @param {object | null | undefined} props
248
+ *
249
+ * TODO: use createRoot() instead of fake root
250
+ */
251
+ function Portal(props) {
252
+ var _this = this;
253
+ var container = props._container;
254
+ _this.componentWillUnmount = function () {
255
+ (0, preact__WEBPACK_IMPORTED_MODULE_0__.render)(null, _this._temp);
256
+ _this._temp = null;
257
+ _this._container = null;
258
+ };
259
+
260
+ // When we change container we should clear our old container and
261
+ // indicate a new mount.
262
+ if (_this._container && _this._container !== container) {
263
+ _this.componentWillUnmount();
264
+ }
265
+
266
+ // When props.vnode is undefined/false/null we are dealing with some kind of
267
+ // conditional vnode. This should not trigger a render.
268
+ if (props.__v) {
269
+ if (!_this._temp) {
270
+ _this._container = container;
271
+
272
+ // Create a fake DOM parent node that manages a subset of `container`'s children:
273
+ _this._temp = {
274
+ nodeType: 1,
275
+ parentNode: container,
276
+ childNodes: [],
277
+ appendChild: function appendChild(child) {
278
+ this.childNodes.push(child);
279
+ _this._container.appendChild(child);
280
+ },
281
+ insertBefore: function insertBefore(child, before) {
282
+ this.childNodes.push(child);
283
+ _this._container.appendChild(child);
284
+ },
285
+ removeChild: function removeChild(child) {
286
+ this.childNodes.splice(this.childNodes.indexOf(child) >>> 1, 1);
287
+ _this._container.removeChild(child);
288
+ },
289
+ };
290
+ }
291
+
292
+ // Render our wrapping element into temp.
293
+ (0, preact__WEBPACK_IMPORTED_MODULE_0__.render)(
294
+ (0, preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(
295
+ ContextProvider,
296
+ {
297
+ context: _this.context,
298
+ },
299
+ props.__v
300
+ ),
301
+ _this._temp
302
+ );
303
+ }
304
+ // When we come from a conditional render, on a mounted
305
+ // portal we should clear the DOM.
306
+ else if (_this._temp) {
307
+ _this.componentWillUnmount();
308
+ }
309
+ }
310
+
311
+ /**
312
+ * Create a `Portal` to continue rendering the vnode tree at a different DOM node
313
+ * @param {import('./types/internal').VNode} vnode The vnode to render
314
+ * @param {import('./types/internal').PreactElement} container The DOM node to continue rendering in to.
315
+ */
316
+ function createPortal(vnode, container) {
317
+ var el = (0, preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(
318
+ Portal,
319
+ {
320
+ __v: vnode,
321
+ _container: container,
322
+ }
323
+ );
324
+ el.containerInfo = container;
325
+ return el;
326
+ }
327
+
328
+ /***/
329
+ },
330
+
331
+ /***/ './compat/src/render.js':
332
+ /*!******************************!*\
333
+ !*** ./compat/src/render.js ***!
334
+ \******************************/
335
+ /***/ (
336
+ __unused_webpack_module,
337
+ __webpack_exports__,
338
+ __webpack_require__
339
+ ) => {
340
+ __webpack_require__.r(__webpack_exports__);
341
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
342
+ /* harmony export */ REACT_ELEMENT_TYPE: () =>
343
+ /* binding */ REACT_ELEMENT_TYPE,
344
+ /* harmony export */ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:
345
+ () =>
346
+ /* binding */ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
347
+ /* harmony export */ hydrate: () => /* binding */ hydrate,
348
+ /* harmony export */ render: () => /* binding */ render,
349
+ /* harmony export */
350
+ });
351
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ =
352
+ __webpack_require__(/*! preact */ './src/index.js');
353
+ function _typeof(obj) {
354
+ '@babel/helpers - typeof';
355
+ return (
356
+ (_typeof =
357
+ 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
358
+ ? function (obj) {
359
+ return typeof obj;
360
+ }
361
+ : function (obj) {
362
+ return obj &&
363
+ 'function' == typeof Symbol &&
364
+ obj.constructor === Symbol &&
365
+ obj !== Symbol.prototype
366
+ ? 'symbol'
367
+ : typeof obj;
368
+ }),
369
+ _typeof(obj)
370
+ );
371
+ }
372
+
373
+ var REACT_ELEMENT_TYPE =
374
+ (typeof Symbol != 'undefined' &&
375
+ Symbol.for &&
376
+ Symbol.for('react.element')) ||
377
+ 0xeac7;
378
+ var CAMEL_PROPS =
379
+ /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;
380
+ var IS_DOM = typeof document !== 'undefined';
381
+
382
+ // Input types for which onchange should not be converted to oninput.
383
+ // type="file|checkbox|radio", plus "range" in IE11.
384
+ // (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches "range")
385
+ var onChangeInputType = function onChangeInputType(type) {
386
+ return (
387
+ typeof Symbol != 'undefined' && _typeof(Symbol()) == 'symbol'
388
+ ? /fil|che|rad/i
389
+ : /fil|che|ra/i
390
+ ).test(type);
391
+ };
392
+
393
+ // Some libraries like `react-virtualized` explicitly check for this.
394
+ preact__WEBPACK_IMPORTED_MODULE_0__.Component.prototype.isReactComponent =
395
+ {};
396
+
397
+ // `UNSAFE_*` lifecycle hooks
398
+ // Preact only ever invokes the unprefixed methods.
399
+ // Here we provide a base "fallback" implementation that calls any defined UNSAFE_ prefixed method.
400
+ // - If a component defines its own `componentDidMount()` (including via defineProperty), use that.
401
+ // - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.
402
+ // - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.
403
+ // See https://github.com/preactjs/preact/issues/1941
404
+ [
405
+ 'componentWillMount',
406
+ 'componentWillReceiveProps',
407
+ 'componentWillUpdate',
408
+ ].forEach(function (key) {
409
+ Object.defineProperty(
410
+ preact__WEBPACK_IMPORTED_MODULE_0__.Component.prototype,
411
+ key,
412
+ {
413
+ configurable: true,
414
+ get: function get() {
415
+ return this['UNSAFE_' + key];
416
+ },
417
+ set: function set(v) {
418
+ Object.defineProperty(this, key, {
419
+ configurable: true,
420
+ writable: true,
421
+ value: v,
422
+ });
423
+ },
424
+ }
425
+ );
426
+ });
427
+
428
+ /**
429
+ * Proxy render() since React returns a Component reference.
430
+ * @param {import('./types/internal').VNode} vnode VNode tree to render
431
+ * @param {import('./types/internal').PreactElement} parent DOM node to render vnode tree into
432
+ * @param {() => void} [callback] Optional callback that will be called after rendering
433
+ * @returns {import('./types/internal').Component | null} The root component reference or null
434
+ */
435
+ function render(vnode, parent, callback) {
436
+ // React destroys any existing DOM nodes, see #1727
437
+ // ...but only on the first render, see #1828
438
+ if (parent.__k == null) {
439
+ parent.textContent = '';
440
+ }
441
+ (0, preact__WEBPACK_IMPORTED_MODULE_0__.render)(vnode, parent);
442
+ if (typeof callback == 'function') callback();
443
+ return vnode ? vnode.__c : null;
444
+ }
445
+ function hydrate(vnode, parent, callback) {
446
+ (0, preact__WEBPACK_IMPORTED_MODULE_0__.hydrate)(vnode, parent);
447
+ if (typeof callback == 'function') callback();
448
+ return vnode ? vnode.__c : null;
449
+ }
450
+ var oldEventHook = preact__WEBPACK_IMPORTED_MODULE_0__.options.event;
451
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.event = function (e) {
452
+ if (oldEventHook) e = oldEventHook(e);
453
+ e.persist = empty;
454
+ e.isPropagationStopped = isPropagationStopped;
455
+ e.isDefaultPrevented = isDefaultPrevented;
456
+ return (e.nativeEvent = e);
457
+ };
458
+ function empty() {}
459
+ function isPropagationStopped() {
460
+ return this.cancelBubble;
461
+ }
462
+ function isDefaultPrevented() {
463
+ return this.defaultPrevented;
464
+ }
465
+ var classNameDescriptor = {
466
+ configurable: true,
467
+ get: function get() {
468
+ return this.class;
469
+ },
470
+ };
471
+ var oldVNodeHook = preact__WEBPACK_IMPORTED_MODULE_0__.options.vnode;
472
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.vnode = function (vnode) {
473
+ var type = vnode.type;
474
+ var props = vnode.props;
475
+ var normalizedProps = props;
476
+
477
+ // only normalize props on Element nodes
478
+ if (typeof type === 'string') {
479
+ var nonCustomElement = type.indexOf('-') === -1;
480
+ normalizedProps = {};
481
+ for (var i in props) {
482
+ var value = props[i];
483
+ if (IS_DOM && i === 'children' && type === 'noscript') {
484
+ // Emulate React's behavior of not rendering the contents of noscript tags on the client.
485
+ continue;
486
+ }
487
+ else if (
488
+ i === 'value' &&
489
+ 'defaultValue' in props &&
490
+ value == null
491
+ ) {
492
+ // Skip applying value if it is null/undefined and we already set
493
+ // a default value
494
+ continue;
495
+ }
496
+ else if (
497
+ i === 'defaultValue' &&
498
+ 'value' in props &&
499
+ props.value == null
500
+ ) {
501
+ // `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.
502
+ // `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.
503
+ i = 'value';
504
+ }
505
+ else if (i === 'download' && value === true) {
506
+ // Calling `setAttribute` with a truthy value will lead to it being
507
+ // passed as a stringified value, e.g. `download="true"`. React
508
+ // converts it to an empty string instead, otherwise the attribute
509
+ // value will be used as the file name and the file will be called
510
+ // "true" upon downloading it.
511
+ value = '';
512
+ }
513
+ else if (/ondoubleclick/i.test(i)) {
514
+ i = 'ondblclick';
515
+ }
516
+ else if (
517
+ /^onchange(textarea|input)/i.test(i + type) &&
518
+ !onChangeInputType(props.type)
519
+ ) {
520
+ i = 'oninput';
521
+ }
522
+ else if (/^onfocus$/i.test(i)) {
523
+ i = 'onfocusin';
524
+ }
525
+ else if (/^onblur$/i.test(i)) {
526
+ i = 'onfocusout';
527
+ }
528
+ else if (/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)) {
529
+ i = i.toLowerCase();
530
+ }
531
+ else if (nonCustomElement && CAMEL_PROPS.test(i)) {
532
+ i = i.replace(/[A-Z0-9]/g, '-$&').toLowerCase();
533
+ }
534
+ else if (value === null) {
535
+ value = undefined;
536
+ }
537
+
538
+ // Add support for onInput and onChange, see #3561
539
+ // if we have an oninput prop already change it to oninputCapture
540
+ if (/^oninput$/i.test(i)) {
541
+ i = i.toLowerCase();
542
+ if (normalizedProps[i]) {
543
+ i = 'oninputCapture';
544
+ }
545
+ }
546
+ normalizedProps[i] = value;
547
+ }
548
+
549
+ // Add support for array select values: <select multiple value={[]} />
550
+ if (
551
+ type == 'select' &&
552
+ normalizedProps.multiple &&
553
+ Array.isArray(normalizedProps.value)
554
+ ) {
555
+ // forEach() always returns undefined, which we abuse here to unset the value prop.
556
+ normalizedProps.value = (0,
557
+ preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(
558
+ props.children
559
+ ).forEach(function (child) {
560
+ child.props.selected =
561
+ normalizedProps.value.indexOf(child.props.value) != -1;
562
+ });
563
+ }
564
+
565
+ // Adding support for defaultValue in select tag
566
+ if (type == 'select' && normalizedProps.defaultValue != null) {
567
+ normalizedProps.value = (0,
568
+ preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(
569
+ props.children
570
+ ).forEach(function (child) {
571
+ if (normalizedProps.multiple) {
572
+ child.props.selected =
573
+ normalizedProps.defaultValue.indexOf(child.props.value) != -1;
574
+ }
575
+ else {
576
+ child.props.selected =
577
+ normalizedProps.defaultValue == child.props.value;
578
+ }
579
+ });
580
+ }
581
+ vnode.props = normalizedProps;
582
+ if (props.class != props.className) {
583
+ classNameDescriptor.enumerable = 'className' in props;
584
+ if (props.className != null)
585
+ normalizedProps.class = props.className;
586
+ Object.defineProperty(
587
+ normalizedProps,
588
+ 'className',
589
+ classNameDescriptor
590
+ );
591
+ }
592
+ }
593
+ vnode.$$typeof = REACT_ELEMENT_TYPE;
594
+ if (oldVNodeHook) oldVNodeHook(vnode);
595
+ };
596
+
597
+ // Only needed for react-relay
598
+ var currentComponent;
599
+ var oldBeforeRender = preact__WEBPACK_IMPORTED_MODULE_0__.options.__r;
600
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.__r = function (vnode) {
601
+ if (oldBeforeRender) {
602
+ oldBeforeRender(vnode);
603
+ }
604
+ currentComponent = vnode.__c;
605
+ };
606
+
607
+ // This is a very very private internal function for React it
608
+ // is used to sort-of do runtime dependency injection. So far
609
+ // only `react-relay` makes use of it. It uses it to read the
610
+ // context value.
611
+ var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
612
+ ReactCurrentDispatcher: {
613
+ current: {
614
+ readContext: function readContext(context) {
615
+ return currentComponent.__n[context.__c].props.value;
616
+ },
617
+ },
618
+ },
619
+ };
620
+
621
+ /***/
622
+ },
623
+
624
+ /***/ './compat/src/suspense-list.js':
625
+ /*!*************************************!*\
626
+ !*** ./compat/src/suspense-list.js ***!
627
+ \*************************************/
628
+ /***/ (
629
+ __unused_webpack_module,
630
+ __webpack_exports__,
631
+ __webpack_require__
632
+ ) => {
633
+ __webpack_require__.r(__webpack_exports__);
634
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
635
+ /* harmony export */ SuspenseList: () => /* binding */ SuspenseList,
636
+ /* harmony export */
637
+ });
638
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ =
639
+ __webpack_require__(/*! preact */ './src/index.js');
640
+ /* harmony import */ var _suspense_js__WEBPACK_IMPORTED_MODULE_1__ =
641
+ __webpack_require__(/*! ./suspense.js */ './compat/src/suspense.js');
642
+
643
+ // Indexes to linked list nodes (nodes are stored as arrays to save bytes).
644
+ var SUSPENDED_COUNT = 0;
645
+ var RESOLVED_COUNT = 1;
646
+ var NEXT_NODE = 2;
647
+
648
+ // Having custom inheritance instead of a class here saves a lot of bytes.
649
+ function SuspenseList() {
650
+ this._next = null;
651
+ this._map = null;
652
+ }
653
+
654
+ // Mark one of child's earlier suspensions as resolved.
655
+ // Some pending callbacks may become callable due to this
656
+ // (e.g. the last suspended descendant gets resolved when
657
+ // revealOrder === 'together'). Process those callbacks as well.
658
+ var resolve = function resolve(list, child, node) {
659
+ if (++node[RESOLVED_COUNT] === node[SUSPENDED_COUNT]) {
660
+ // The number a child (or any of its descendants) has been suspended
661
+ // matches the number of times it's been resolved. Therefore we
662
+ // mark the child as completely resolved by deleting it from ._map.
663
+ // This is used to figure out when *all* children have been completely
664
+ // resolved when revealOrder is 'together'.
665
+ list._map.delete(child);
666
+ }
667
+
668
+ // If revealOrder is falsy then we can do an early exit, as the
669
+ // callbacks won't get queued in the node anyway.
670
+ // If revealOrder is 'together' then also do an early exit
671
+ // if all suspended descendants have not yet been resolved.
672
+ if (
673
+ !list.props.revealOrder ||
674
+ (list.props.revealOrder[0] === 't' && list._map.size)
675
+ ) {
676
+ return;
677
+ }
678
+
679
+ // Walk the currently suspended children in order, calling their
680
+ // stored callbacks on the way. Stop if we encounter a child that
681
+ // has not been completely resolved yet.
682
+ node = list._next;
683
+ while (node) {
684
+ while (node.length > 3) {
685
+ node.pop()();
686
+ }
687
+ if (node[RESOLVED_COUNT] < node[SUSPENDED_COUNT]) {
688
+ break;
689
+ }
690
+ list._next = node = node[NEXT_NODE];
691
+ }
692
+ };
693
+
694
+ // Things we do here to save some bytes but are not proper JS inheritance:
695
+ // - call `new Component()` as the prototype
696
+ // - do not set `Suspense.prototype.constructor` to `Suspense`
697
+ SuspenseList.prototype =
698
+ new preact__WEBPACK_IMPORTED_MODULE_0__.Component();
699
+ SuspenseList.prototype.__a = function (child) {
700
+ var list = this;
701
+ var delegated = (0,
702
+ _suspense_js__WEBPACK_IMPORTED_MODULE_1__.suspended)(list.__v);
703
+ var node = list._map.get(child);
704
+ node[SUSPENDED_COUNT]++;
705
+ return function (unsuspend) {
706
+ var wrappedUnsuspend = function wrappedUnsuspend() {
707
+ if (!list.props.revealOrder) {
708
+ // Special case the undefined (falsy) revealOrder, as there
709
+ // is no need to coordinate a specific order or unsuspends.
710
+ unsuspend();
711
+ }
712
+ else {
713
+ node.push(unsuspend);
714
+ resolve(list, child, node);
715
+ }
716
+ };
717
+ if (delegated) {
718
+ delegated(wrappedUnsuspend);
719
+ }
720
+ else {
721
+ wrappedUnsuspend();
722
+ }
723
+ };
724
+ };
725
+ SuspenseList.prototype.render = function (props) {
726
+ this._next = null;
727
+ this._map = new Map();
728
+ var children = (0, preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(
729
+ props.children
730
+ );
731
+ if (props.revealOrder && props.revealOrder[0] === 'b') {
732
+ // If order === 'backwards' (or, well, anything starting with a 'b')
733
+ // then flip the child list around so that the last child will be
734
+ // the first in the linked list.
735
+ children.reverse();
736
+ }
737
+ // Build the linked list. Iterate through the children in reverse order
738
+ // so that `_next` points to the first linked list node to be resolved.
739
+ for (var i = children.length; i--; ) {
740
+ // Create a new linked list node as an array of form:
741
+ // [suspended_count, resolved_count, next_node]
742
+ // where suspended_count and resolved_count are numeric counters for
743
+ // keeping track how many times a node has been suspended and resolved.
744
+ //
745
+ // Note that suspended_count starts from 1 instead of 0, so we can block
746
+ // processing callbacks until componentDidMount has been called. In a sense
747
+ // node is suspended at least until componentDidMount gets called!
748
+ //
749
+ // Pending callbacks are added to the end of the node:
750
+ // [suspended_count, resolved_count, next_node, callback_0, callback_1, ...]
751
+ this._map.set(children[i], (this._next = [1, 0, this._next]));
752
+ }
753
+ return props.children;
754
+ };
755
+ SuspenseList.prototype.componentDidUpdate =
756
+ SuspenseList.prototype.componentDidMount = function () {
757
+ var _this = this;
758
+ // Iterate through all children after mounting for two reasons:
759
+ // 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases
760
+ // each node[RELEASED_COUNT] by 1, therefore balancing the counters.
761
+ // The nodes can now be completely consumed from the linked list.
762
+ // 2. Handle nodes that might have gotten resolved between render and
763
+ // componentDidMount.
764
+ this._map.forEach(function (node, child) {
765
+ resolve(_this, child, node);
766
+ });
767
+ };
768
+
769
+ /***/
770
+ },
771
+
772
+ /***/ './compat/src/suspense.js':
773
+ /*!********************************!*\
774
+ !*** ./compat/src/suspense.js ***!
775
+ \********************************/
776
+ /***/ (
777
+ __unused_webpack_module,
778
+ __webpack_exports__,
779
+ __webpack_require__
780
+ ) => {
781
+ __webpack_require__.r(__webpack_exports__);
782
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
783
+ /* harmony export */ Suspense: () => /* binding */ Suspense,
784
+ /* harmony export */ lazy: () => /* binding */ lazy,
785
+ /* harmony export */ suspended: () => /* binding */ suspended,
786
+ /* harmony export */
787
+ });
788
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ =
789
+ __webpack_require__(/*! preact */ './src/index.js');
790
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ =
791
+ __webpack_require__(/*! ./util */ './compat/src/util.js');
792
+
793
+ var oldCatchError = preact__WEBPACK_IMPORTED_MODULE_0__.options.__e;
794
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.__e = function (
795
+ error,
796
+ newVNode,
797
+ oldVNode,
798
+ errorInfo
799
+ ) {
800
+ if (error.then) {
801
+ /** @type {import('./types/internal').Component} */
802
+ var component;
803
+ var vnode = newVNode;
804
+ for (; (vnode = vnode.__); ) {
805
+ if ((component = vnode.__c) && component.__c) {
806
+ if (newVNode.__e == null) {
807
+ newVNode.__e = oldVNode.__e;
808
+ newVNode.__k = oldVNode.__k;
809
+ }
810
+ // Don't call oldCatchError if we found a Suspense
811
+ return component.__c(error, newVNode);
812
+ }
813
+ }
814
+ }
815
+ oldCatchError(error, newVNode, oldVNode, errorInfo);
816
+ };
817
+ var oldUnmount = preact__WEBPACK_IMPORTED_MODULE_0__.options.unmount;
818
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.unmount = function (vnode) {
819
+ /** @type {import('./types/internal').Component} */
820
+ var component = vnode.__c;
821
+ if (component && component.__R) {
822
+ component.__R();
823
+ }
824
+
825
+ // if the component is still hydrating
826
+ // most likely it is because the component is suspended
827
+ // we set the vnode.type as `null` so that it is not a typeof function
828
+ // so the unmount will remove the vnode._dom
829
+ if (component && vnode.__h === true) {
830
+ vnode.type = null;
831
+ }
832
+ if (oldUnmount) oldUnmount(vnode);
833
+ };
834
+ function detachedClone(vnode, detachedParent, parentDom) {
835
+ if (vnode) {
836
+ if (vnode.__c && vnode.__c.__H) {
837
+ vnode.__c.__H.__.forEach(function (effect) {
838
+ if (typeof effect.__c == 'function') effect.__c();
839
+ });
840
+ vnode.__c.__H = null;
841
+ }
842
+ vnode = (0, _util__WEBPACK_IMPORTED_MODULE_1__.assign)({}, vnode);
843
+ if (vnode.__c != null) {
844
+ if (vnode.__c.__P === parentDom) {
845
+ vnode.__c.__P = detachedParent;
846
+ }
847
+ vnode.__c = null;
848
+ }
849
+ vnode.__k =
850
+ vnode.__k &&
851
+ vnode.__k.map(function (child) {
852
+ return detachedClone(child, detachedParent, parentDom);
853
+ });
854
+ }
855
+ return vnode;
856
+ }
857
+ function removeOriginal(vnode, detachedParent, originalParent) {
858
+ if (vnode) {
859
+ vnode.__v = null;
860
+ vnode.__k =
861
+ vnode.__k &&
862
+ vnode.__k.map(function (child) {
863
+ return removeOriginal(child, detachedParent, originalParent);
864
+ });
865
+ if (vnode.__c) {
866
+ if (vnode.__c.__P === detachedParent) {
867
+ if (vnode.__e) {
868
+ originalParent.insertBefore(vnode.__e, vnode.__d);
869
+ }
870
+ vnode.__c.__e = true;
871
+ vnode.__c.__P = originalParent;
872
+ }
873
+ }
874
+ }
875
+ return vnode;
876
+ }
877
+
878
+ // having custom inheritance instead of a class here saves a lot of bytes
879
+ function Suspense() {
880
+ // we do not call super here to golf some bytes...
881
+ this.__u = 0;
882
+ this._suspenders = null;
883
+ this.__b = null;
884
+ }
885
+
886
+ // Things we do here to save some bytes but are not proper JS inheritance:
887
+ // - call `new Component()` as the prototype
888
+ // - do not set `Suspense.prototype.constructor` to `Suspense`
889
+ Suspense.prototype = new preact__WEBPACK_IMPORTED_MODULE_0__.Component();
890
+
891
+ /**
892
+ * @this {import('./types/internal').SuspenseComponent}
893
+ * @param {Promise} promise The thrown promise
894
+ * @param {import('./types/internal').VNode<any, any>} suspendingVNode The suspending component
895
+ */
896
+ Suspense.prototype.__c = function (promise, suspendingVNode) {
897
+ var suspendingComponent = suspendingVNode.__c;
898
+
899
+ /** @type {import('./types/internal').SuspenseComponent} */
900
+ var c = this;
901
+ if (c._suspenders == null) {
902
+ c._suspenders = [];
903
+ }
904
+ c._suspenders.push(suspendingComponent);
905
+ var resolve = suspended(c.__v);
906
+ var resolved = false;
907
+ var onResolved = function onResolved() {
908
+ if (resolved) return;
909
+ resolved = true;
910
+ suspendingComponent.__R = null;
911
+ if (resolve) {
912
+ resolve(onSuspensionComplete);
913
+ }
914
+ else {
915
+ onSuspensionComplete();
916
+ }
917
+ };
918
+ suspendingComponent.__R = onResolved;
919
+ var onSuspensionComplete = function onSuspensionComplete() {
920
+ if (!--c.__u) {
921
+ // If the suspension was during hydration we don't need to restore the
922
+ // suspended children into the _children array
923
+ if (c.state.__a) {
924
+ var suspendedVNode = c.state.__a;
925
+ c.__v.__k[0] = removeOriginal(
926
+ suspendedVNode,
927
+ suspendedVNode.__c.__P,
928
+ suspendedVNode.__c.__O
929
+ );
930
+ }
931
+ c.setState({
932
+ __a: (c.__b = null),
933
+ });
934
+ var _suspended;
935
+ while ((_suspended = c._suspenders.pop())) {
936
+ _suspended.forceUpdate();
937
+ }
938
+ }
939
+ };
940
+
941
+ /**
942
+ * We do not set `suspended: true` during hydration because we want the actual markup
943
+ * to remain on screen and hydrate it when the suspense actually gets resolved.
944
+ * While in non-hydration cases the usual fallback -> component flow would occour.
945
+ */
946
+ var wasHydrating = suspendingVNode.__h === true;
947
+ if (!c.__u++ && !wasHydrating) {
948
+ c.setState({
949
+ __a: (c.__b = c.__v.__k[0]),
950
+ });
951
+ }
952
+ promise.then(onResolved, onResolved);
953
+ };
954
+ Suspense.prototype.componentWillUnmount = function () {
955
+ this._suspenders = [];
956
+ };
957
+
958
+ /**
959
+ * @this {import('./types/internal').SuspenseComponent}
960
+ * @param {import('./types/internal').SuspenseComponent["props"]} props
961
+ * @param {import('./types/internal').SuspenseState} state
962
+ */
963
+ Suspense.prototype.render = function (props, state) {
964
+ if (this.__b) {
965
+ // When the Suspense's _vnode was created by a call to createVNode
966
+ // (i.e. due to a setState further up in the tree)
967
+ // it's _children prop is null, in this case we "forget" about the parked vnodes to detach
968
+ if (this.__v.__k) {
969
+ var detachedParent = document.createElement('div');
970
+ var detachedComponent = this.__v.__k[0].__c;
971
+ this.__v.__k[0] = detachedClone(
972
+ this.__b,
973
+ detachedParent,
974
+ (detachedComponent.__O = detachedComponent.__P)
975
+ );
976
+ }
977
+ this.__b = null;
978
+ }
979
+
980
+ // Wrap fallback tree in a VNode that prevents itself from being marked as aborting mid-hydration:
981
+ /** @type {import('./types/internal').VNode} */
982
+ var fallback =
983
+ state.__a &&
984
+ (0, preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(
985
+ preact__WEBPACK_IMPORTED_MODULE_0__.Fragment,
986
+ null,
987
+ props.fallback
988
+ );
989
+ if (fallback) fallback.__h = null;
990
+ return [
991
+ (0, preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(
992
+ preact__WEBPACK_IMPORTED_MODULE_0__.Fragment,
993
+ null,
994
+ state.__a ? null : props.children
995
+ ),
996
+ fallback,
997
+ ];
998
+ };
999
+
1000
+ /**
1001
+ * Checks and calls the parent component's _suspended method, passing in the
1002
+ * suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified
1003
+ * that one of its children/descendants suspended.
1004
+ *
1005
+ * The parent MAY return a callback. The callback will get called when the
1006
+ * suspension resolves, notifying the parent of the fact.
1007
+ * Moreover, the callback gets function `unsuspend` as a parameter. The resolved
1008
+ * child descendant will not actually get unsuspended until `unsuspend` gets called.
1009
+ * This is a way for the parent to delay unsuspending.
1010
+ *
1011
+ * If the parent does not return a callback then the resolved vnode
1012
+ * gets unsuspended immediately when it resolves.
1013
+ *
1014
+ * @param {import('./types/internal').VNode} vnode
1015
+ * @returns {((unsuspend: () => void) => void)?}
1016
+ */
1017
+ function suspended(vnode) {
1018
+ /** @type {import('./types/internal').Component} */
1019
+ var component = vnode.__.__c;
1020
+ return component && component.__a && component.__a(vnode);
1021
+ }
1022
+ function lazy(loader) {
1023
+ var prom;
1024
+ var component;
1025
+ var error;
1026
+ function Lazy(props) {
1027
+ if (!prom) {
1028
+ prom = loader();
1029
+ prom.then(
1030
+ function (exports) {
1031
+ component = exports.default || exports;
1032
+ },
1033
+ function (e) {
1034
+ error = e;
1035
+ }
1036
+ );
1037
+ }
1038
+ if (error) {
1039
+ throw error;
1040
+ }
1041
+ if (!component) {
1042
+ throw prom;
1043
+ }
1044
+ return (0, preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(
1045
+ component,
1046
+ props
1047
+ );
1048
+ }
1049
+ Lazy.displayName = 'Lazy';
1050
+ Lazy.__f = true;
1051
+ return Lazy;
1052
+ }
1053
+
1054
+ /***/
1055
+ },
1056
+
1057
+ /***/ './compat/src/util.js':
1058
+ /*!****************************!*\
1059
+ !*** ./compat/src/util.js ***!
1060
+ \****************************/
1061
+ /***/ (
1062
+ __unused_webpack_module,
1063
+ __webpack_exports__,
1064
+ __webpack_require__
1065
+ ) => {
1066
+ __webpack_require__.r(__webpack_exports__);
1067
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1068
+ /* harmony export */ assign: () => /* binding */ assign,
1069
+ /* harmony export */ is: () => /* binding */ is,
1070
+ /* harmony export */ removeNode: () => /* binding */ removeNode,
1071
+ /* harmony export */ shallowDiffers: () => /* binding */ shallowDiffers,
1072
+ /* harmony export */
1073
+ });
1074
+ /**
1075
+ * Assign properties from `props` to `obj`
1076
+ * @template O, P The obj and props types
1077
+ * @param {O} obj The object to copy properties to
1078
+ * @param {P} props The object to copy properties from
1079
+ * @returns {O & P}
1080
+ */
1081
+ function assign(obj, props) {
1082
+ for (var i in props) {
1083
+ obj[i] = props[i];
1084
+ }
1085
+ return /** @type {O & P} */ obj;
1086
+ }
1087
+
1088
+ /**
1089
+ * Check if two objects have a different shape
1090
+ * @param {object} a
1091
+ * @param {object} b
1092
+ * @returns {boolean}
1093
+ */
1094
+ function shallowDiffers(a, b) {
1095
+ for (var i in a) {
1096
+ if (i !== '__source' && !(i in b)) return true;
1097
+ }
1098
+ for (var _i in b) {
1099
+ if (_i !== '__source' && a[_i] !== b[_i]) return true;
1100
+ }
1101
+ return false;
1102
+ }
1103
+ function removeNode(node) {
1104
+ var parentNode = node.parentNode;
1105
+ if (parentNode) parentNode.removeChild(node);
1106
+ }
1107
+
1108
+ /**
1109
+ * Check if two values are the same value
1110
+ * @param {*} x
1111
+ * @param {*} y
1112
+ * @returns {boolean}
1113
+ */
1114
+ function is(x, y) {
1115
+ return (
1116
+ (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y)
1117
+ );
1118
+ }
1119
+
1120
+ /***/
1121
+ },
1122
+
1123
+ /***/ './hooks/src/index.js':
1124
+ /*!****************************!*\
1125
+ !*** ./hooks/src/index.js ***!
1126
+ \****************************/
1127
+ /***/ (
1128
+ __unused_webpack_module,
1129
+ __webpack_exports__,
1130
+ __webpack_require__
1131
+ ) => {
1132
+ __webpack_require__.r(__webpack_exports__);
1133
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1134
+ /* harmony export */ useCallback: () => /* binding */ useCallback,
1135
+ /* harmony export */ useContext: () => /* binding */ useContext,
1136
+ /* harmony export */ useDebugValue: () => /* binding */ useDebugValue,
1137
+ /* harmony export */ useEffect: () => /* binding */ useEffect,
1138
+ /* harmony export */ useErrorBoundary: () =>
1139
+ /* binding */ useErrorBoundary,
1140
+ /* harmony export */ useId: () => /* binding */ useId,
1141
+ /* harmony export */ useImperativeHandle: () =>
1142
+ /* binding */ useImperativeHandle,
1143
+ /* harmony export */ useLayoutEffect: () =>
1144
+ /* binding */ useLayoutEffect,
1145
+ /* harmony export */ useMemo: () => /* binding */ useMemo,
1146
+ /* harmony export */ useReducer: () => /* binding */ useReducer,
1147
+ /* harmony export */ useRef: () => /* binding */ useRef,
1148
+ /* harmony export */ useState: () => /* binding */ useState,
1149
+ /* harmony export */
1150
+ });
1151
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ =
1152
+ __webpack_require__(/*! preact */ './src/index.js');
1153
+
1154
+ /** @type {number} */
1155
+ var currentIndex;
1156
+
1157
+ /** @type {import('./types/internal').Component} */
1158
+ var currentComponent;
1159
+
1160
+ /** @type {import('./types/internal').Component} */
1161
+ var previousComponent;
1162
+
1163
+ /** @type {number} */
1164
+ var currentHook = 0;
1165
+
1166
+ /** @type {Array<import('./types/internal').Component>} */
1167
+ var afterPaintEffects = [];
1168
+ var EMPTY = [];
1169
+ var oldBeforeDiff = preact__WEBPACK_IMPORTED_MODULE_0__.options.__b;
1170
+ var oldBeforeRender = preact__WEBPACK_IMPORTED_MODULE_0__.options.__r;
1171
+ var oldAfterDiff = preact__WEBPACK_IMPORTED_MODULE_0__.options.diffed;
1172
+ var oldCommit = preact__WEBPACK_IMPORTED_MODULE_0__.options.__c;
1173
+ var oldBeforeUnmount =
1174
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.unmount;
1175
+ var RAF_TIMEOUT = 100;
1176
+ var prevRaf;
1177
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.__b = function (vnode) {
1178
+ currentComponent = null;
1179
+ if (oldBeforeDiff) oldBeforeDiff(vnode);
1180
+ };
1181
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.__r = function (vnode) {
1182
+ if (oldBeforeRender) oldBeforeRender(vnode);
1183
+ currentComponent = vnode.__c;
1184
+ currentIndex = 0;
1185
+ var hooks = currentComponent.__H;
1186
+ if (hooks) {
1187
+ if (previousComponent === currentComponent) {
1188
+ hooks.__h = [];
1189
+ currentComponent.__h = [];
1190
+ hooks.__.forEach(function (hookItem) {
1191
+ if (hookItem.__N) {
1192
+ hookItem.__ = hookItem.__N;
1193
+ }
1194
+ hookItem.__V = EMPTY;
1195
+ hookItem.__N = hookItem._pendingArgs = undefined;
1196
+ });
1197
+ }
1198
+ else {
1199
+ hooks.__h.forEach(invokeCleanup);
1200
+ hooks.__h.forEach(invokeEffect);
1201
+ hooks.__h = [];
1202
+ }
1203
+ }
1204
+ previousComponent = currentComponent;
1205
+ };
1206
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.diffed = function (vnode) {
1207
+ if (oldAfterDiff) oldAfterDiff(vnode);
1208
+ var c = vnode.__c;
1209
+ if (c && c.__H) {
1210
+ if (c.__H.__h.length) afterPaint(afterPaintEffects.push(c));
1211
+ c.__H.__.forEach(function (hookItem) {
1212
+ if (hookItem._pendingArgs) {
1213
+ hookItem.__H = hookItem._pendingArgs;
1214
+ }
1215
+ if (hookItem.__V !== EMPTY) {
1216
+ hookItem.__ = hookItem.__V;
1217
+ }
1218
+ hookItem._pendingArgs = undefined;
1219
+ hookItem.__V = EMPTY;
1220
+ });
1221
+ }
1222
+ previousComponent = currentComponent = null;
1223
+ };
1224
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.__c = function (
1225
+ vnode,
1226
+ commitQueue
1227
+ ) {
1228
+ commitQueue.some(function (component) {
1229
+ try {
1230
+ component.__h.forEach(invokeCleanup);
1231
+ component.__h = component.__h.filter(function (cb) {
1232
+ return cb.__ ? invokeEffect(cb) : true;
1233
+ });
1234
+ }
1235
+ catch (e) {
1236
+ commitQueue.some(function (c) {
1237
+ if (c.__h) c.__h = [];
1238
+ });
1239
+ commitQueue = [];
1240
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.__e(e, component.__v);
1241
+ }
1242
+ });
1243
+ if (oldCommit) oldCommit(vnode, commitQueue);
1244
+ };
1245
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.unmount = function (vnode) {
1246
+ if (oldBeforeUnmount) oldBeforeUnmount(vnode);
1247
+ var c = vnode.__c;
1248
+ if (c && c.__H) {
1249
+ var hasErrored;
1250
+ c.__H.__.forEach(function (s) {
1251
+ try {
1252
+ invokeCleanup(s);
1253
+ }
1254
+ catch (e) {
1255
+ hasErrored = e;
1256
+ }
1257
+ });
1258
+ c.__H = undefined;
1259
+ if (hasErrored)
1260
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.__e(hasErrored, c.__v);
1261
+ }
1262
+ };
1263
+
1264
+ /**
1265
+ * Get a hook's state from the currentComponent
1266
+ * @param {number} index The index of the hook to get
1267
+ * @param {number} type The index of the hook to get
1268
+ * @returns {any}
1269
+ */
1270
+ function getHookState(index, type) {
1271
+ if (preact__WEBPACK_IMPORTED_MODULE_0__.options.__h) {
1272
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.__h(
1273
+ currentComponent,
1274
+ index,
1275
+ currentHook || type
1276
+ );
1277
+ }
1278
+ currentHook = 0;
1279
+
1280
+ // Largely inspired by:
1281
+ // * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs
1282
+ // * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs
1283
+ // Other implementations to look at:
1284
+ // * https://codesandbox.io/s/mnox05qp8
1285
+ var hooks =
1286
+ currentComponent.__H ||
1287
+ (currentComponent.__H = {
1288
+ __: [],
1289
+ __h: [],
1290
+ });
1291
+ if (index >= hooks.__.length) {
1292
+ hooks.__.push({
1293
+ __V: EMPTY,
1294
+ });
1295
+ }
1296
+ return hooks.__[index];
1297
+ }
1298
+
1299
+ /**
1300
+ * @param {import('@wellbye/pxw/lib/preact').StateUpdater<any>} [initialState]
1301
+ */
1302
+ function useState(initialState) {
1303
+ currentHook = 1;
1304
+ return useReducer(invokeOrReturn, initialState);
1305
+ }
1306
+
1307
+ /**
1308
+ * @param {import('@wellbye/pxw/lib/preact').Reducer<any, any>} reducer
1309
+ * @param {import('@wellbye/pxw/lib/preact').StateUpdater<any>} initialState
1310
+ * @param {(initialState: any) => void} [init]
1311
+ * @returns {[ any, (state: any) => void ]}
1312
+ */
1313
+ function useReducer(reducer, initialState, init) {
1314
+ /** @type {import('./types/internal').ReducerHookState} */
1315
+ var hookState = getHookState(currentIndex++, 2);
1316
+ hookState._reducer = reducer;
1317
+ if (!hookState.__c) {
1318
+ hookState.__ = [
1319
+ !init
1320
+ ? invokeOrReturn(undefined, initialState)
1321
+ : init(initialState),
1322
+ function (action) {
1323
+ var currentValue = hookState.__N
1324
+ ? hookState.__N[0]
1325
+ : hookState.__[0];
1326
+ var nextValue = hookState._reducer(currentValue, action);
1327
+ if (currentValue !== nextValue) {
1328
+ hookState.__N = [nextValue, hookState.__[1]];
1329
+ hookState.__c.setState({});
1330
+ }
1331
+ },
1332
+ ];
1333
+ hookState.__c = currentComponent;
1334
+ if (!currentComponent._hasScuFromHooks) {
1335
+ currentComponent._hasScuFromHooks = true;
1336
+ var prevScu = currentComponent.shouldComponentUpdate;
1337
+
1338
+ // This SCU has the purpose of bailing out after repeated updates
1339
+ // to stateful hooks.
1340
+ // we store the next value in _nextValue[0] and keep doing that for all
1341
+ // state setters, if we have next states and
1342
+ // all next states within a component end up being equal to their original state
1343
+ // we are safe to bail out for this specific component.
1344
+ currentComponent.shouldComponentUpdate = function (p, s, c) {
1345
+ if (!hookState.__c.__H) return true;
1346
+ var stateHooks = hookState.__c.__H.__.filter(function (x) {
1347
+ return x.__c;
1348
+ });
1349
+ var allHooksEmpty = stateHooks.every(function (x) {
1350
+ return !x.__N;
1351
+ });
1352
+ // When we have no updated hooks in the component we invoke the previous SCU or
1353
+ // traverse the VDOM tree further.
1354
+ if (allHooksEmpty) {
1355
+ return prevScu ? prevScu.call(this, p, s, c) : true;
1356
+ }
1357
+
1358
+ // We check whether we have components with a nextValue set that
1359
+ // have values that aren't equal to one another this pushes
1360
+ // us to update further down the tree
1361
+ var shouldUpdate = false;
1362
+ stateHooks.forEach(function (hookItem) {
1363
+ if (hookItem.__N) {
1364
+ var currentValue = hookItem.__[0];
1365
+ hookItem.__ = hookItem.__N;
1366
+ hookItem.__N = undefined;
1367
+ if (currentValue !== hookItem.__[0]) shouldUpdate = true;
1368
+ }
1369
+ });
1370
+ return shouldUpdate || hookState.__c.props !== p
1371
+ ? prevScu
1372
+ ? prevScu.call(this, p, s, c)
1373
+ : true
1374
+ : false;
1375
+ };
1376
+ }
1377
+ }
1378
+ return hookState.__N || hookState.__;
1379
+ }
1380
+
1381
+ /**
1382
+ * @param {import('./types/internal').Effect} callback
1383
+ * @param {any[]} args
1384
+ */
1385
+ function useEffect(callback, args) {
1386
+ /** @type {import('./types/internal').EffectHookState} */
1387
+ var state = getHookState(currentIndex++, 3);
1388
+ if (
1389
+ !preact__WEBPACK_IMPORTED_MODULE_0__.options.__s &&
1390
+ argsChanged(state.__H, args)
1391
+ ) {
1392
+ state.__ = callback;
1393
+ state._pendingArgs = args;
1394
+ currentComponent.__H.__h.push(state);
1395
+ }
1396
+ }
1397
+
1398
+ /**
1399
+ * @param {import('./types/internal').Effect} callback
1400
+ * @param {any[]} args
1401
+ */
1402
+ function useLayoutEffect(callback, args) {
1403
+ /** @type {import('./types/internal').EffectHookState} */
1404
+ var state = getHookState(currentIndex++, 4);
1405
+ if (
1406
+ !preact__WEBPACK_IMPORTED_MODULE_0__.options.__s &&
1407
+ argsChanged(state.__H, args)
1408
+ ) {
1409
+ state.__ = callback;
1410
+ state._pendingArgs = args;
1411
+ currentComponent.__h.push(state);
1412
+ }
1413
+ }
1414
+ function useRef(initialValue) {
1415
+ currentHook = 5;
1416
+ return useMemo(function () {
1417
+ return {
1418
+ current: initialValue,
1419
+ };
1420
+ }, []);
1421
+ }
1422
+
1423
+ /**
1424
+ * @param {object} ref
1425
+ * @param {() => object} createHandle
1426
+ * @param {any[]} args
1427
+ */
1428
+ function useImperativeHandle(ref, createHandle, args) {
1429
+ currentHook = 6;
1430
+ useLayoutEffect(
1431
+ function () {
1432
+ if (typeof ref == 'function') {
1433
+ ref(createHandle());
1434
+ return function () {
1435
+ return ref(null);
1436
+ };
1437
+ }
1438
+ else if (ref) {
1439
+ ref.current = createHandle();
1440
+ return function () {
1441
+ return (ref.current = null);
1442
+ };
1443
+ }
1444
+ },
1445
+ args == null ? args : args.concat(ref)
1446
+ );
1447
+ }
1448
+
1449
+ /**
1450
+ * @param {() => any} factory
1451
+ * @param {any[]} args
1452
+ */
1453
+ function useMemo(factory, args) {
1454
+ /** @type {import('./types/internal').MemoHookState} */
1455
+ var state = getHookState(currentIndex++, 7);
1456
+ if (argsChanged(state.__H, args)) {
1457
+ state.__V = factory();
1458
+ state._pendingArgs = args;
1459
+ state.__h = factory;
1460
+ return state.__V;
1461
+ }
1462
+ return state.__;
1463
+ }
1464
+
1465
+ /**
1466
+ * @param {() => void} callback
1467
+ * @param {any[]} args
1468
+ */
1469
+ function useCallback(callback, args) {
1470
+ currentHook = 8;
1471
+ return useMemo(function () {
1472
+ return callback;
1473
+ }, args);
1474
+ }
1475
+
1476
+ /**
1477
+ * @param {import('./types/internal').PreactContext} context
1478
+ */
1479
+ function useContext(context) {
1480
+ var provider = currentComponent.context[context.__c];
1481
+ // We could skip this call here, but than we'd not call
1482
+ // `options._hook`. We need to do that in order to make
1483
+ // the devtools aware of this hook.
1484
+ /** @type {import('./types/internal').ContextHookState} */
1485
+ var state = getHookState(currentIndex++, 9);
1486
+ // The devtools needs access to the context object to
1487
+ // be able to pull of the default value when no provider
1488
+ // is present in the tree.
1489
+ state.c = context;
1490
+ if (!provider) return context.__;
1491
+ // This is probably not safe to convert to "!"
1492
+ if (state.__ == null) {
1493
+ state.__ = true;
1494
+ provider.sub(currentComponent);
1495
+ }
1496
+ return provider.props.value;
1497
+ }
1498
+
1499
+ /**
1500
+ * Display a custom label for a custom hook for the devtools panel
1501
+ * @type {<T>(value: T, cb?: (value: T) => string | number) => void}
1502
+ */
1503
+ function useDebugValue(value, formatter) {
1504
+ if (preact__WEBPACK_IMPORTED_MODULE_0__.options.useDebugValue) {
1505
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.useDebugValue(
1506
+ formatter ? formatter(value) : value
1507
+ );
1508
+ }
1509
+ }
1510
+
1511
+ /**
1512
+ * @param {(error: any, errorInfo: import('preact').ErrorInfo) => void} cb
1513
+ */
1514
+ function useErrorBoundary(cb) {
1515
+ /** @type {import('./types/internal').ErrorBoundaryHookState} */
1516
+ var state = getHookState(currentIndex++, 10);
1517
+ var errState = useState();
1518
+ state.__ = cb;
1519
+ if (!currentComponent.componentDidCatch) {
1520
+ currentComponent.componentDidCatch = function (err, errorInfo) {
1521
+ if (state.__) state.__(err, errorInfo);
1522
+ errState[1](err);
1523
+ };
1524
+ }
1525
+ return [
1526
+ errState[0],
1527
+ function () {
1528
+ errState[1](undefined);
1529
+ },
1530
+ ];
1531
+ }
1532
+ function useId() {
1533
+ var state = getHookState(currentIndex++, 11);
1534
+ if (!state.__) {
1535
+ // Grab either the root node or the nearest async boundary node.
1536
+ /** @type {import('./types/internal').VNode} */
1537
+ var root = currentComponent.__v;
1538
+ while (root !== null && !root.__m && root.__ !== null) {
1539
+ root = root.__;
1540
+ }
1541
+ var mask = root.__m || (root.__m = [0, 0]);
1542
+ state.__ = 'P' + mask[0] + '-' + mask[1]++;
1543
+ }
1544
+ return state.__;
1545
+ }
1546
+ /**
1547
+ * After paint effects consumer.
1548
+ */
1549
+ function flushAfterPaintEffects() {
1550
+ var component;
1551
+ while ((component = afterPaintEffects.shift())) {
1552
+ if (!component.__P || !component.__H) continue;
1553
+ try {
1554
+ component.__H.__h.forEach(invokeCleanup);
1555
+ component.__H.__h.forEach(invokeEffect);
1556
+ component.__H.__h = [];
1557
+ }
1558
+ catch (e) {
1559
+ component.__H.__h = [];
1560
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.__e(e, component.__v);
1561
+ }
1562
+ }
1563
+ }
1564
+ var HAS_RAF = typeof requestAnimationFrame == 'function';
1565
+
1566
+ /**
1567
+ * Schedule a callback to be invoked after the browser has a chance to paint a new frame.
1568
+ * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after
1569
+ * the next browser frame.
1570
+ *
1571
+ * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked
1572
+ * even if RAF doesn't fire (for example if the browser tab is not visible)
1573
+ *
1574
+ * @param {() => void} callback
1575
+ */
1576
+ function afterNextFrame(callback) {
1577
+ var done = function done() {
1578
+ clearTimeout(timeout);
1579
+ if (HAS_RAF) cancelAnimationFrame(raf);
1580
+ setTimeout(callback);
1581
+ };
1582
+ var timeout = setTimeout(done, RAF_TIMEOUT);
1583
+ var raf;
1584
+ if (HAS_RAF) {
1585
+ raf = requestAnimationFrame(done);
1586
+ }
1587
+ }
1588
+
1589
+ // Note: if someone used options.debounceRendering = requestAnimationFrame,
1590
+ // then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.
1591
+ // Perhaps this is not such a big deal.
1592
+ /**
1593
+ * Schedule afterPaintEffects flush after the browser paints
1594
+ * @param {number} newQueueLength
1595
+ */
1596
+ function afterPaint(newQueueLength) {
1597
+ if (
1598
+ newQueueLength === 1 ||
1599
+ prevRaf !==
1600
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.requestAnimationFrame
1601
+ ) {
1602
+ prevRaf =
1603
+ preact__WEBPACK_IMPORTED_MODULE_0__.options.requestAnimationFrame;
1604
+ (prevRaf || afterNextFrame)(flushAfterPaintEffects);
1605
+ }
1606
+ }
1607
+
1608
+ /**
1609
+ * @param {import('./types/internal').EffectHookState} hook
1610
+ */
1611
+ function invokeCleanup(hook) {
1612
+ // A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode
1613
+ // and move the currentComponent away.
1614
+ var comp = currentComponent;
1615
+ var cleanup = hook.__c;
1616
+ if (typeof cleanup == 'function') {
1617
+ hook.__c = undefined;
1618
+ cleanup();
1619
+ }
1620
+ currentComponent = comp;
1621
+ }
1622
+
1623
+ /**
1624
+ * Invoke a Hook's effect
1625
+ * @param {import('./types/internal').EffectHookState} hook
1626
+ */
1627
+ function invokeEffect(hook) {
1628
+ // A hook call can introduce a call to render which creates a new root, this will call options.vnode
1629
+ // and move the currentComponent away.
1630
+ var comp = currentComponent;
1631
+ hook.__c = hook.__();
1632
+ currentComponent = comp;
1633
+ }
1634
+
1635
+ /**
1636
+ * @param {any[]} oldArgs
1637
+ * @param {any[]} newArgs
1638
+ */
1639
+ function argsChanged(oldArgs, newArgs) {
1640
+ return (
1641
+ !oldArgs ||
1642
+ oldArgs.length !== newArgs.length ||
1643
+ newArgs.some(function (arg, index) {
1644
+ return arg !== oldArgs[index];
1645
+ })
1646
+ );
1647
+ }
1648
+ function invokeOrReturn(arg, f) {
1649
+ return typeof f == 'function' ? f(arg) : f;
1650
+ }
1651
+
1652
+ /***/
1653
+ },
1654
+
1655
+ /***/ './src/clone-element.js':
1656
+ /*!******************************!*\
1657
+ !*** ./src/clone-element.js ***!
1658
+ \******************************/
1659
+ /***/ (
1660
+ __unused_webpack_module,
1661
+ __webpack_exports__,
1662
+ __webpack_require__
1663
+ ) => {
1664
+ __webpack_require__.r(__webpack_exports__);
1665
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1666
+ /* harmony export */ cloneElement: () => /* binding */ cloneElement,
1667
+ /* harmony export */
1668
+ });
1669
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ =
1670
+ __webpack_require__(/*! ./util */ './src/util.js');
1671
+ /* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_1__ =
1672
+ __webpack_require__(/*! ./create-element */ './src/create-element.js');
1673
+
1674
+ /**
1675
+ * Clones the given VNode, optionally adding attributes/props and replacing its children.
1676
+ * @param {import('./types/internal').VNode} vnode The virtual DOM element to clone
1677
+ * @param {object} props Attributes/props to add when cloning
1678
+ * @param {Array<import('./types/internal').ComponentChildren>} rest Any additional arguments will be used as replacement children.
1679
+ * @returns {import('./types/internal').VNode}
1680
+ */
1681
+ function cloneElement(vnode, props, children) {
1682
+ var normalizedProps = (0, _util__WEBPACK_IMPORTED_MODULE_0__.assign)(
1683
+ {},
1684
+ vnode.props
1685
+ ),
1686
+ key,
1687
+ ref,
1688
+ i;
1689
+ for (i in props) {
1690
+ if (i == 'key') key = props[i];
1691
+ else if (i == 'ref') ref = props[i];
1692
+ else normalizedProps[i] = props[i];
1693
+ }
1694
+ if (arguments.length > 2) {
1695
+ normalizedProps.children =
1696
+ arguments.length > 3
1697
+ ? _util__WEBPACK_IMPORTED_MODULE_0__.slice.call(arguments, 2)
1698
+ : children;
1699
+ }
1700
+ return (0, _create_element__WEBPACK_IMPORTED_MODULE_1__.createVNode)(
1701
+ vnode.type,
1702
+ normalizedProps,
1703
+ key || vnode.key,
1704
+ ref || vnode.ref,
1705
+ null
1706
+ );
1707
+ }
1708
+
1709
+ /***/
1710
+ },
1711
+
1712
+ /***/ './src/component.js':
1713
+ /*!**************************!*\
1714
+ !*** ./src/component.js ***!
1715
+ \**************************/
1716
+ /***/ (
1717
+ __unused_webpack_module,
1718
+ __webpack_exports__,
1719
+ __webpack_require__
1720
+ ) => {
1721
+ __webpack_require__.r(__webpack_exports__);
1722
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1723
+ /* harmony export */ Component: () => /* binding */ Component,
1724
+ /* harmony export */ enqueueRender: () => /* binding */ enqueueRender,
1725
+ /* harmony export */ getDomSibling: () => /* binding */ getDomSibling,
1726
+ /* harmony export */
1727
+ });
1728
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ =
1729
+ __webpack_require__(/*! ./util */ './src/util.js');
1730
+ /* harmony import */ var _diff_index__WEBPACK_IMPORTED_MODULE_1__ =
1731
+ __webpack_require__(/*! ./diff/index */ './src/diff/index.js');
1732
+ /* harmony import */ var _options__WEBPACK_IMPORTED_MODULE_2__ =
1733
+ __webpack_require__(/*! ./options */ './src/options.js');
1734
+ /* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_3__ =
1735
+ __webpack_require__(/*! ./create-element */ './src/create-element.js');
1736
+
1737
+ /**
1738
+ * Base Component class. Provides `setState()` and `forceUpdate()`, which
1739
+ * trigger rendering
1740
+ * @param {object} props The initial component props
1741
+ * @param {object} context The initial context from parent components'
1742
+ * getChildContext
1743
+ */
1744
+ function Component(props, context) {
1745
+ this.props = props;
1746
+ this.context = context;
1747
+ }
1748
+
1749
+ /**
1750
+ * Update component state and schedule a re-render.
1751
+ * @this {import('./types/internal').Component}
1752
+ * @param {object | ((s: object, p: object) => object)} update A hash of state
1753
+ * properties to update with new values or a function that given the current
1754
+ * state and props returns a new partial state
1755
+ * @param {() => void} [callback] A function to be called once component state is
1756
+ * updated
1757
+ */
1758
+ Component.prototype.setState = function (update, callback) {
1759
+ // only clone state when copying to nextState the first time.
1760
+ var s;
1761
+ if (this.__s != null && this.__s !== this.state) {
1762
+ s = this.__s;
1763
+ }
1764
+ else {
1765
+ s = this.__s = (0, _util__WEBPACK_IMPORTED_MODULE_0__.assign)(
1766
+ {},
1767
+ this.state
1768
+ );
1769
+ }
1770
+ if (typeof update == 'function') {
1771
+ // Some libraries like `immer` mark the current state as readonly,
1772
+ // preventing us from mutating it, so we need to clone it. See #2716
1773
+ update = update(
1774
+ (0, _util__WEBPACK_IMPORTED_MODULE_0__.assign)({}, s),
1775
+ this.props
1776
+ );
1777
+ }
1778
+ if (update) {
1779
+ (0, _util__WEBPACK_IMPORTED_MODULE_0__.assign)(s, update);
1780
+ }
1781
+
1782
+ // Skip update if updater function returned null
1783
+ if (update == null) return;
1784
+ if (this.__v) {
1785
+ if (callback) {
1786
+ this._sb.push(callback);
1787
+ }
1788
+ enqueueRender(this);
1789
+ }
1790
+ };
1791
+
1792
+ /**
1793
+ * Immediately perform a synchronous re-render of the component
1794
+ * @this {import('./types/internal').Component}
1795
+ * @param {() => void} [callback] A function to be called after component is
1796
+ * re-rendered
1797
+ */
1798
+ Component.prototype.forceUpdate = function (callback) {
1799
+ if (this.__v) {
1800
+ // Set render mode so that we can differentiate where the render request
1801
+ // is coming from. We need this because forceUpdate should never call
1802
+ // shouldComponentUpdate
1803
+ this.__e = true;
1804
+ if (callback) this.__h.push(callback);
1805
+ enqueueRender(this);
1806
+ }
1807
+ };
1808
+
1809
+ /**
1810
+ * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.
1811
+ * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).
1812
+ * @param {object} props Props (eg: JSX attributes) received from parent
1813
+ * element/component
1814
+ * @param {object} state The component's current state
1815
+ * @param {object} context Context object, as returned by the nearest
1816
+ * ancestor's `getChildContext()`
1817
+ * @returns {import('@wellbye/pxw/lib/preact').ComponentChildren | void}
1818
+ */
1819
+ Component.prototype.render =
1820
+ _create_element__WEBPACK_IMPORTED_MODULE_3__.Fragment;
1821
+
1822
+ /**
1823
+ * @param {import('./types/internal').VNode} vnode
1824
+ * @param {number | null} [childIndex]
1825
+ */
1826
+ function getDomSibling(vnode, childIndex) {
1827
+ if (childIndex == null) {
1828
+ // Use childIndex==null as a signal to resume the search from the vnode's sibling
1829
+ return vnode.__
1830
+ ? getDomSibling(vnode.__, vnode.__.__k.indexOf(vnode) + 1)
1831
+ : null;
1832
+ }
1833
+ var sibling;
1834
+ for (; childIndex < vnode.__k.length; childIndex++) {
1835
+ sibling = vnode.__k[childIndex];
1836
+ if (sibling != null && sibling.__e != null) {
1837
+ // Since updateParentDomPointers keeps _dom pointer correct,
1838
+ // we can rely on _dom to tell us if this subtree contains a
1839
+ // rendered DOM node, and what the first rendered DOM node is
1840
+ return sibling.__e;
1841
+ }
1842
+ }
1843
+
1844
+ // If we get here, we have not found a DOM node in this vnode's children.
1845
+ // We must resume from this vnode's sibling (in it's parent _children array)
1846
+ // Only climb up and search the parent if we aren't searching through a DOM
1847
+ // VNode (meaning we reached the DOM parent of the original vnode that began
1848
+ // the search)
1849
+ return typeof vnode.type == 'function' ? getDomSibling(vnode) : null;
1850
+ }
1851
+
1852
+ /**
1853
+ * Trigger in-place re-rendering of a component.
1854
+ * @param {import('./types/internal').Component} component The component to rerender
1855
+ */
1856
+ function renderComponent(component) {
1857
+ var vnode = component.__v,
1858
+ oldDom = vnode.__e,
1859
+ parentDom = component.__P;
1860
+ var onRenderComponent =
1861
+ _options__WEBPACK_IMPORTED_MODULE_2__['default'].onRenderComponent;
1862
+ if (onRenderComponent) onRenderComponent(component, 'begin');
1863
+ if (parentDom) {
1864
+ var commitQueue = [];
1865
+ var oldVNode = (0, _util__WEBPACK_IMPORTED_MODULE_0__.assign)(
1866
+ {},
1867
+ vnode
1868
+ );
1869
+ oldVNode.__v = vnode.__v + 1;
1870
+ (0, _util__WEBPACK_IMPORTED_MODULE_0__.makeTaskQueue)(commitQueue);
1871
+ commitQueue.task.pushChild('pre', function () {
1872
+ (0,
1873
+ _diff_index__WEBPACK_IMPORTED_MODULE_1__.diff)(parentDom, vnode, oldVNode, component.__n, parentDom.ownerSVGElement !== undefined, vnode.__h != null ? [oldDom] : null, commitQueue, oldDom == null ? getDomSibling(vnode) : oldDom, vnode.__h);
1874
+ });
1875
+ commitQueue.task.run();
1876
+ (0, _diff_index__WEBPACK_IMPORTED_MODULE_1__.commitRoot)(
1877
+ commitQueue,
1878
+ vnode
1879
+ );
1880
+ if (vnode.__e != oldDom) {
1881
+ updateParentDomPointers(vnode);
1882
+ }
1883
+ }
1884
+ if (onRenderComponent) onRenderComponent(component, 'end');
1885
+ }
1886
+
1887
+ /**
1888
+ * @param {import('./types/internal').VNode} vnode
1889
+ */
1890
+ function updateParentDomPointers(vnode) {
1891
+ if ((vnode = vnode.__) != null && vnode.__c != null) {
1892
+ vnode.__e = vnode.__c.base = null;
1893
+ for (var i = 0; i < vnode.__k.length; i++) {
1894
+ var child = vnode.__k[i];
1895
+ if (child != null && child.__e != null) {
1896
+ vnode.__e = vnode.__c.base = child.__e;
1897
+ break;
1898
+ }
1899
+ }
1900
+ return updateParentDomPointers(vnode);
1901
+ }
1902
+ }
1903
+
1904
+ /**
1905
+ * The render queue
1906
+ * @type {Array<import('./types/internal').Component>}
1907
+ */
1908
+ var rerenderQueue = [];
1909
+
1910
+ /*
1911
+ * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is
1912
+ * important that contributors to Preact can consistently reason about what calls to `setState`, etc.
1913
+ * do, and when their effects will be applied. See the links below for some further reading on designing
1914
+ * asynchronous APIs.
1915
+ * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)
1916
+ * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)
1917
+ */
1918
+
1919
+ var prevDebounce;
1920
+
1921
+ /**
1922
+ * Enqueue a rerender of a component
1923
+ * @param {import('./types/internal').Component} c The component to rerender
1924
+ */
1925
+ function enqueueRender(c) {
1926
+ if (
1927
+ (!c.__d &&
1928
+ (c.__d = true) &&
1929
+ rerenderQueue.push(c) &&
1930
+ !process.__r++) ||
1931
+ prevDebounce !==
1932
+ _options__WEBPACK_IMPORTED_MODULE_2__['default'].debounceRendering
1933
+ ) {
1934
+ prevDebounce =
1935
+ _options__WEBPACK_IMPORTED_MODULE_2__['default'].debounceRendering;
1936
+ (prevDebounce || setTimeout)(process);
1937
+ }
1938
+ }
1939
+
1940
+ /** Flush the render queue by rerendering all queued components */
1941
+ function process() {
1942
+ var queue;
1943
+ while ((process.__r = rerenderQueue.length)) {
1944
+ queue = rerenderQueue.sort(function (a, b) {
1945
+ return a.__v.__b - b.__v.__b;
1946
+ });
1947
+ rerenderQueue = [];
1948
+ // Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary
1949
+ // process() calls from getting scheduled while `queue` is still being consumed.
1950
+ queue.some(function (c) {
1951
+ if (c.__d) renderComponent(c);
1952
+ });
1953
+ }
1954
+ }
1955
+ process.__r = 0;
1956
+
1957
+ /***/
1958
+ },
1959
+
1960
+ /***/ './src/constants.js':
1961
+ /*!**************************!*\
1962
+ !*** ./src/constants.js ***!
1963
+ \**************************/
1964
+ /***/ (
1965
+ __unused_webpack_module,
1966
+ __webpack_exports__,
1967
+ __webpack_require__
1968
+ ) => {
1969
+ __webpack_require__.r(__webpack_exports__);
1970
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1971
+ /* harmony export */ EMPTY_ARR: () => /* binding */ EMPTY_ARR,
1972
+ /* harmony export */ EMPTY_OBJ: () => /* binding */ EMPTY_OBJ,
1973
+ /* harmony export */ IS_NON_DIMENSIONAL: () =>
1974
+ /* binding */ IS_NON_DIMENSIONAL,
1975
+ /* harmony export */
1976
+ });
1977
+ var EMPTY_OBJ = {};
1978
+ var EMPTY_ARR = [];
1979
+ var IS_NON_DIMENSIONAL =
1980
+ /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
1981
+
1982
+ /***/
1983
+ },
1984
+
1985
+ /***/ './src/create-context.js':
1986
+ /*!*******************************!*\
1987
+ !*** ./src/create-context.js ***!
1988
+ \*******************************/
1989
+ /***/ (
1990
+ __unused_webpack_module,
1991
+ __webpack_exports__,
1992
+ __webpack_require__
1993
+ ) => {
1994
+ __webpack_require__.r(__webpack_exports__);
1995
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1996
+ /* harmony export */ createContext: () => /* binding */ createContext,
1997
+ /* harmony export */ i: () => /* binding */ i,
1998
+ /* harmony export */
1999
+ });
2000
+ /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ =
2001
+ __webpack_require__(/*! ./component */ './src/component.js');
2002
+
2003
+ var i = 0;
2004
+ function createContext(defaultValue, contextId) {
2005
+ contextId = '__cC' + i++;
2006
+ var context = {
2007
+ __c: contextId,
2008
+ __: defaultValue,
2009
+ /** @type {import('./types/internal').FunctionComponent} */ Consumer:
2010
+ function Consumer(props, contextValue) {
2011
+ // return props.children(
2012
+ // context[contextId] ? context[contextId].props.value : defaultValue
2013
+ // );
2014
+ return props.children(contextValue);
2015
+ },
2016
+ /** @type {import('./types/internal').FunctionComponent} */ Provider:
2017
+ function Provider(props) {
2018
+ if (!this.getChildContext) {
2019
+ var subs = [];
2020
+ var ctx = {};
2021
+ ctx[contextId] = this;
2022
+ this.getChildContext = function () {
2023
+ return ctx;
2024
+ };
2025
+ this.shouldComponentUpdate = function (_props) {
2026
+ if (this.props.value !== _props.value) {
2027
+ // I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:
2028
+ // https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358
2029
+ // In those cases though, even with the value corrected, we're double-rendering all nodes.
2030
+ // It might be better to just tell folks not to use force-sync mode.
2031
+ // Currently, using `useContext()` in a class component will overwrite its `this.context` value.
2032
+ // subs.some(c => {
2033
+ // c.context = _props.value;
2034
+ // enqueueRender(c);
2035
+ // });
2036
+
2037
+ // subs.some(c => {
2038
+ // c.context[contextId] = _props.value;
2039
+ // enqueueRender(c);
2040
+ // });
2041
+ subs.some(
2042
+ _component__WEBPACK_IMPORTED_MODULE_0__.enqueueRender
2043
+ );
2044
+ }
2045
+ };
2046
+ this.sub = function (c) {
2047
+ subs.push(c);
2048
+ var old = c.componentWillUnmount;
2049
+ c.componentWillUnmount = function () {
2050
+ subs.splice(subs.indexOf(c), 1);
2051
+ if (old) old.call(c);
2052
+ };
2053
+ };
2054
+ }
2055
+ return props.children;
2056
+ },
2057
+ };
2058
+
2059
+ // Devtools needs access to the context object when it
2060
+ // encounters a Provider. This is necessary to support
2061
+ // setting `displayName` on the context object instead
2062
+ // of on the component itself. See:
2063
+ // https://reactjs.org/docs/context.html#contextdisplayname
2064
+
2065
+ return (context.Provider.__ = context.Consumer.contextType = context);
2066
+ }
2067
+
2068
+ /***/
2069
+ },
2070
+
2071
+ /***/ './src/create-element.js':
2072
+ /*!*******************************!*\
2073
+ !*** ./src/create-element.js ***!
2074
+ \*******************************/
2075
+ /***/ (
2076
+ __unused_webpack_module,
2077
+ __webpack_exports__,
2078
+ __webpack_require__
2079
+ ) => {
2080
+ __webpack_require__.r(__webpack_exports__);
2081
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2082
+ /* harmony export */ Fragment: () => /* binding */ Fragment,
2083
+ /* harmony export */ createElement: () => /* binding */ createElement,
2084
+ /* harmony export */ createRef: () => /* binding */ createRef,
2085
+ /* harmony export */ createVNode: () => /* binding */ createVNode,
2086
+ /* harmony export */ isValidElement: () => /* binding */ isValidElement,
2087
+ /* harmony export */
2088
+ });
2089
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ =
2090
+ __webpack_require__(/*! ./util */ './src/util.js');
2091
+ /* harmony import */ var _options__WEBPACK_IMPORTED_MODULE_1__ =
2092
+ __webpack_require__(/*! ./options */ './src/options.js');
2093
+
2094
+ var vnodeId = 0;
2095
+
2096
+ /**
2097
+ * Create an virtual node (used for JSX)
2098
+ * @param {import('./types/internal').VNode["type"]} type The node name or Component
2099
+ * constructor for this virtual node
2100
+ * @param {object | null | undefined} [props] The properties of the virtual node
2101
+ * @param {Array<import('@wellbye/pxw/lib/preact').ComponentChildren>} [children] The children of the virtual node
2102
+ * @returns {import('./types/internal').VNode}
2103
+ */
2104
+ function createElement(type, props, children) {
2105
+ var normalizedProps = {},
2106
+ key,
2107
+ ref,
2108
+ i;
2109
+ for (i in props) {
2110
+ if (i == 'key') key = props[i];
2111
+ else if (i == 'ref') ref = props[i];
2112
+ else normalizedProps[i] = props[i];
2113
+ }
2114
+ if (arguments.length > 2) {
2115
+ normalizedProps.children =
2116
+ arguments.length > 3
2117
+ ? _util__WEBPACK_IMPORTED_MODULE_0__.slice.call(arguments, 2)
2118
+ : children;
2119
+ }
2120
+
2121
+ // If a Component VNode, check for and apply defaultProps
2122
+ // Note: type may be undefined in development, must never error here.
2123
+ if (typeof type == 'function' && type.defaultProps != null) {
2124
+ for (i in type.defaultProps) {
2125
+ if (normalizedProps[i] === undefined) {
2126
+ normalizedProps[i] = type.defaultProps[i];
2127
+ }
2128
+ }
2129
+ }
2130
+ return createVNode(type, normalizedProps, key, ref, null);
2131
+ }
2132
+
2133
+ /**
2134
+ * Create a VNode (used internally by Preact)
2135
+ * @param {import('./types/internal').VNode["type"]} type The node name or Component
2136
+ * Constructor for this virtual node
2137
+ * @param {object | string | number | null} props The properties of this virtual node.
2138
+ * If this virtual node represents a text node, this is the text of the node (string or number).
2139
+ * @param {string | number | null} key The key for this virtual node, used when
2140
+ * diffing it against its children
2141
+ * @param {import('./types/internal').VNode["ref"]} ref The ref property that will
2142
+ * receive a reference to its created child
2143
+ * @returns {import('./types/internal').VNode}
2144
+ */
2145
+ function createVNode(type, props, key, ref, original) {
2146
+ // V8 seems to be better at detecting type shapes if the object is allocated from the same call site
2147
+ // Do not inline into createElement and coerceToVNode!
2148
+ var vnode = {
2149
+ type: type,
2150
+ props: props,
2151
+ key: key,
2152
+ ref: ref,
2153
+ __k: null,
2154
+ __: null,
2155
+ __b: 0,
2156
+ __e: null,
2157
+ // _nextDom must be initialized to undefined b/c it will eventually
2158
+ // be set to dom.nextSibling which can return `null` and it is important
2159
+ // to be able to distinguish between an uninitialized _nextDom and
2160
+ // a _nextDom that has been set to `null`
2161
+ __d: undefined,
2162
+ __c: null,
2163
+ __h: null,
2164
+ constructor: undefined,
2165
+ __v: original == null ? ++vnodeId : original,
2166
+ };
2167
+
2168
+ // Only invoke the vnode hook if this was *not* a direct copy:
2169
+ if (
2170
+ original == null &&
2171
+ _options__WEBPACK_IMPORTED_MODULE_1__['default'].vnode != null
2172
+ )
2173
+ _options__WEBPACK_IMPORTED_MODULE_1__['default'].vnode(vnode);
2174
+ return vnode;
2175
+ }
2176
+ function createRef() {
2177
+ return {
2178
+ current: null,
2179
+ };
2180
+ }
2181
+ function Fragment(props) {
2182
+ return props.children;
2183
+ }
2184
+
2185
+ /**
2186
+ * Check if a the argument is a valid Preact VNode.
2187
+ * @param {*} vnode
2188
+ * @returns {vnode is import('./types/internal').VNode}
2189
+ */
2190
+ var isValidElement = function isValidElement(vnode) {
2191
+ return vnode != null && vnode.constructor === undefined;
2192
+ };
2193
+
2194
+ /***/
2195
+ },
2196
+
2197
+ /***/ './src/diff/catch-error.js':
2198
+ /*!*********************************!*\
2199
+ !*** ./src/diff/catch-error.js ***!
2200
+ \*********************************/
2201
+ /***/ (
2202
+ __unused_webpack_module,
2203
+ __webpack_exports__,
2204
+ __webpack_require__
2205
+ ) => {
2206
+ __webpack_require__.r(__webpack_exports__);
2207
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2208
+ /* harmony export */ _catchError: () => /* binding */ _catchError,
2209
+ /* harmony export */
2210
+ });
2211
+ /**
2212
+ * Find the closest error boundary to a thrown error and call it
2213
+ * @param {object} error The thrown value
2214
+ * @param {import('../internal').VNode} vnode The vnode that threw
2215
+ * the error that was caught (except for unmounting when this parameter
2216
+ * is the highest parent that was being unmounted)
2217
+ * @param {import('../internal').VNode} [oldVNode]
2218
+ * @param {import('../internal').ErrorInfo} [errorInfo]
2219
+ */
2220
+ function _catchError(error, vnode, oldVNode, errorInfo) {
2221
+ /** @type {import('../internal').Component} */
2222
+ var component, ctor, handled;
2223
+ for (; (vnode = vnode.__); ) {
2224
+ if ((component = vnode.__c) && !component.__) {
2225
+ try {
2226
+ ctor = component.constructor;
2227
+ if (ctor && ctor.getDerivedStateFromError != null) {
2228
+ component.setState(ctor.getDerivedStateFromError(error));
2229
+ handled = component.__d;
2230
+ }
2231
+ if (component.componentDidCatch != null) {
2232
+ component.componentDidCatch(error, errorInfo || {});
2233
+ handled = component.__d;
2234
+ }
2235
+
2236
+ // This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.
2237
+ if (handled) {
2238
+ return (component.__E = component);
2239
+ }
2240
+ }
2241
+ catch (e) {
2242
+ error = e;
2243
+ }
2244
+ }
2245
+ }
2246
+ throw error;
2247
+ }
2248
+
2249
+ /***/
2250
+ },
2251
+
2252
+ /***/ './src/diff/children.js':
2253
+ /*!******************************!*\
2254
+ !*** ./src/diff/children.js ***!
2255
+ \******************************/
2256
+ /***/ (
2257
+ __unused_webpack_module,
2258
+ __webpack_exports__,
2259
+ __webpack_require__
2260
+ ) => {
2261
+ __webpack_require__.r(__webpack_exports__);
2262
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2263
+ /* harmony export */ diffChildren: () => /* binding */ diffChildren,
2264
+ /* harmony export */ toChildArray: () => /* binding */ toChildArray,
2265
+ /* harmony export */
2266
+ });
2267
+ /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ =
2268
+ __webpack_require__(/*! ./index */ './src/diff/index.js');
2269
+ /* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_1__ =
2270
+ __webpack_require__(/*! ../create-element */ './src/create-element.js');
2271
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ =
2272
+ __webpack_require__(/*! ../constants */ './src/constants.js');
2273
+ /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_3__ =
2274
+ __webpack_require__(/*! ../component */ './src/component.js');
2275
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ =
2276
+ __webpack_require__(/*! ../util */ './src/util.js');
2277
+
2278
+ /**
2279
+ * Diff the children of a virtual node
2280
+ * @param {import('../internal').PreactElement} parentDom The DOM element whose
2281
+ * children are being diffed
2282
+ * @param {import('../internal').ComponentChildren[]} renderResult
2283
+ * @param {import('../internal').VNode} newParentVNode The new virtual
2284
+ * node whose children should be diff'ed against oldParentVNode
2285
+ * @param {import('../internal').VNode} oldParentVNode The old virtual
2286
+ * node whose children should be diff'ed against newParentVNode
2287
+ * @param {object} globalContext The current context object - modified by getChildContext
2288
+ * @param {boolean} isSvg Whether or not this DOM node is an SVG node
2289
+ * @param {Array<import('../internal').PreactElement>} excessDomChildren
2290
+ * @param {Array<import('../internal').Component>} commitQueue List of components
2291
+ * which have callbacks to invoke in commitRoot
2292
+ * @param {import('../internal').PreactElement} oldDom The current attached DOM
2293
+ * element any new dom elements should be placed around. Likely `null` on first
2294
+ * render (except when hydrating). Can be a sibling DOM element when diffing
2295
+ * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.
2296
+ * @param {boolean} isHydrating Whether or not we are in hydration
2297
+ */
2298
+ function diffChildren(
2299
+ parentDom,
2300
+ renderResult,
2301
+ newParentVNode,
2302
+ oldParentVNode,
2303
+ globalContext,
2304
+ isSvg,
2305
+ excessDomChildren,
2306
+ commitQueue,
2307
+ oldDom,
2308
+ isHydrating
2309
+ ) {
2310
+ var i, j, oldVNode, childVNode, newDom, firstChildDom, refs;
2311
+
2312
+ // This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR
2313
+ // as EMPTY_OBJ._children should be `undefined`.
2314
+ var oldChildren =
2315
+ (oldParentVNode && oldParentVNode.__k) ||
2316
+ _constants__WEBPACK_IMPORTED_MODULE_2__.EMPTY_ARR;
2317
+ var oldChildrenLength = oldChildren.length;
2318
+ newParentVNode.__k = [];
2319
+ for (i = 0; i < renderResult.length; i++) {
2320
+ childVNode = renderResult[i];
2321
+ // console.debug(`**${newParentVNode.props.id}-child${i}-${childVNode.props?.id}-start`,JSON.stringify(renderResult));
2322
+
2323
+ if (childVNode == null || typeof childVNode == 'boolean') {
2324
+ childVNode = newParentVNode.__k[i] = null;
2325
+ }
2326
+ // If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,
2327
+ // or we are rendering a component (e.g. setState) copy the oldVNodes so it can have
2328
+ // it's own DOM & etc. pointers
2329
+ else if (
2330
+ typeof childVNode == 'string' ||
2331
+ typeof childVNode == 'number' ||
2332
+ // eslint-disable-next-line valid-typeof
2333
+ typeof childVNode == 'bigint'
2334
+ ) {
2335
+ childVNode = newParentVNode.__k[i] = (0,
2336
+ _create_element__WEBPACK_IMPORTED_MODULE_1__.createVNode)(
2337
+ null,
2338
+ childVNode,
2339
+ null,
2340
+ null,
2341
+ childVNode
2342
+ );
2343
+ }
2344
+ else if (Array.isArray(childVNode)) {
2345
+ childVNode = newParentVNode.__k[i] = (0,
2346
+ _create_element__WEBPACK_IMPORTED_MODULE_1__.createVNode)(
2347
+ _create_element__WEBPACK_IMPORTED_MODULE_1__.Fragment,
2348
+ {
2349
+ children: childVNode,
2350
+ },
2351
+ null,
2352
+ null,
2353
+ null
2354
+ );
2355
+ }
2356
+ else if (childVNode.__b > 0) {
2357
+ // VNode is already in use, clone it. This can happen in the following
2358
+ // scenario:
2359
+ // const reuse = <div />
2360
+ // <div>{reuse}<span />{reuse}</div>
2361
+ childVNode = newParentVNode.__k[i] = (0,
2362
+ _create_element__WEBPACK_IMPORTED_MODULE_1__.createVNode)(
2363
+ childVNode.type,
2364
+ childVNode.props,
2365
+ childVNode.key,
2366
+ childVNode.ref ? childVNode.ref : null,
2367
+ childVNode.__v
2368
+ );
2369
+ }
2370
+ else {
2371
+ childVNode = newParentVNode.__k[i] = childVNode;
2372
+ }
2373
+
2374
+ // Terser removes the `continue` here and wraps the loop body
2375
+ // in a `if (childVNode) { ... } condition
2376
+ if (childVNode == null) {
2377
+ continue;
2378
+ }
2379
+ childVNode.__ = newParentVNode;
2380
+ childVNode.__b = newParentVNode.__b + 1;
2381
+
2382
+ // Check if we find a corresponding element in oldChildren.
2383
+ // If found, delete the array item by setting to `undefined`.
2384
+ // We use `undefined`, as `null` is reserved for empty placeholders
2385
+ // (holes).
2386
+ oldVNode = oldChildren[i];
2387
+
2388
+ ///PLACE1/////////////////////////////////////
2389
+
2390
+ commitQueue.task.pushChild(
2391
+ 'pre',
2392
+ function (i, childVNode) {
2393
+ var oldVNode = oldChildren[i];
2394
+ if (
2395
+ oldVNode === null ||
2396
+ (oldVNode &&
2397
+ childVNode.key == oldVNode.key &&
2398
+ childVNode.type === oldVNode.type)
2399
+ ) {
2400
+ oldChildren[i] = undefined;
2401
+ }
2402
+ else {
2403
+ // Either oldVNode === undefined or oldChildrenLength > 0,
2404
+ // so after this loop oldVNode == null or oldVNode is a valid value.
2405
+ for (j = 0; j < oldChildrenLength; j++) {
2406
+ oldVNode = oldChildren[j];
2407
+ // If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.
2408
+ // We always match by type (in either case).
2409
+ if (
2410
+ oldVNode &&
2411
+ childVNode.key == oldVNode.key &&
2412
+ childVNode.type === oldVNode.type
2413
+ ) {
2414
+ oldChildren[j] = undefined;
2415
+ break;
2416
+ }
2417
+ oldVNode = null;
2418
+ }
2419
+ }
2420
+ oldVNode =
2421
+ oldVNode || _constants__WEBPACK_IMPORTED_MODULE_2__.EMPTY_OBJ;
2422
+
2423
+ ///PLACE2/////////////////////////////////////
2424
+
2425
+ // Morph the old element into the new one, but don't append it to the dom yet
2426
+ (0, _index__WEBPACK_IMPORTED_MODULE_0__.diff)(
2427
+ parentDom,
2428
+ childVNode,
2429
+ oldVNode,
2430
+ globalContext,
2431
+ isSvg,
2432
+ excessDomChildren,
2433
+ commitQueue,
2434
+ oldDom,
2435
+ isHydrating
2436
+ );
2437
+ return {
2438
+ oldVNode: oldVNode,
2439
+ };
2440
+ }.bind(null, i, childVNode, oldVNode)
2441
+ );
2442
+ commitQueue.task.pushChild(
2443
+ 'post',
2444
+ function (i, childVNode, oldVNode) {
2445
+ oldVNode = commitQueue.lastRet.oldVNode;
2446
+ oldVNode =
2447
+ oldVNode || _constants__WEBPACK_IMPORTED_MODULE_2__.EMPTY_OBJ;
2448
+ newDom = childVNode.__e;
2449
+ if ((j = childVNode.ref) && oldVNode.ref != j) {
2450
+ if (!refs) refs = [];
2451
+ if (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);
2452
+ refs.push(j, childVNode.__c || newDom, childVNode);
2453
+ }
2454
+ if (newDom != null) {
2455
+ if (firstChildDom == null) {
2456
+ firstChildDom = newDom;
2457
+ }
2458
+ if (
2459
+ typeof childVNode.type == 'function' &&
2460
+ childVNode.__k === oldVNode.__k
2461
+ ) {
2462
+ childVNode.__d = oldDom = reorderChildren(
2463
+ childVNode,
2464
+ oldDom,
2465
+ parentDom
2466
+ );
2467
+ }
2468
+ else {
2469
+ oldDom = placeChild(
2470
+ parentDom,
2471
+ childVNode,
2472
+ oldVNode,
2473
+ oldChildren,
2474
+ newDom,
2475
+ oldDom
2476
+ );
2477
+ }
2478
+ if (typeof newParentVNode.type == 'function') {
2479
+ // Because the newParentVNode is Fragment-like, we need to set it's
2480
+ // _nextDom property to the nextSibling of its last child DOM node.
2481
+ //
2482
+ // `oldDom` contains the correct value here because if the last child
2483
+ // is a Fragment-like, then oldDom has already been set to that child's _nextDom.
2484
+ // If the last child is a DOM VNode, then oldDom will be set to that DOM
2485
+ // node's nextSibling.
2486
+ newParentVNode.__d = oldDom;
2487
+ }
2488
+ }
2489
+ else if (
2490
+ oldDom &&
2491
+ oldVNode.__e == oldDom &&
2492
+ oldDom.parentNode != parentDom
2493
+ ) {
2494
+ // The above condition is to handle null placeholders. See test in placeholder.test.js:
2495
+ // `efficiently replace null placeholders in parent rerenders`
2496
+ oldDom = (0,
2497
+ _component__WEBPACK_IMPORTED_MODULE_3__.getDomSibling)(
2498
+ oldVNode
2499
+ );
2500
+ }
2501
+ }.bind(null, i, childVNode, oldVNode)
2502
+ );
2503
+ }
2504
+ commitQueue.task.pushChild('post', function () {
2505
+ newParentVNode.__e = firstChildDom;
2506
+
2507
+ // Remove remaining oldChildren if there are any.
2508
+ for (i = oldChildrenLength; i--; ) {
2509
+ if (oldChildren[i] != null) {
2510
+ (0, _index__WEBPACK_IMPORTED_MODULE_0__.unmount)(
2511
+ oldChildren[i],
2512
+ oldChildren[i]
2513
+ );
2514
+ }
2515
+ }
2516
+
2517
+ // Set refs only after unmount
2518
+ if (refs) {
2519
+ for (i = 0; i < refs.length; i++) {
2520
+ (0, _index__WEBPACK_IMPORTED_MODULE_0__.applyRef)(
2521
+ refs[i],
2522
+ refs[++i],
2523
+ refs[++i]
2524
+ );
2525
+ }
2526
+ }
2527
+ });
2528
+ }
2529
+ function reorderChildren(childVNode, oldDom, parentDom) {
2530
+ // Note: VNodes in nested suspended trees may be missing _children.
2531
+ var c = childVNode.__k;
2532
+ var tmp = 0;
2533
+ for (; c && tmp < c.length; tmp++) {
2534
+ var vnode = c[tmp];
2535
+ if (vnode) {
2536
+ // We typically enter this code path on sCU bailout, where we copy
2537
+ // oldVNode._children to newVNode._children. If that is the case, we need
2538
+ // to update the old children's _parent pointer to point to the newVNode
2539
+ // (childVNode here).
2540
+ vnode.__ = childVNode;
2541
+ if (typeof vnode.type == 'function') {
2542
+ oldDom = reorderChildren(vnode, oldDom, parentDom);
2543
+ }
2544
+ else {
2545
+ oldDom = placeChild(
2546
+ parentDom,
2547
+ vnode,
2548
+ vnode,
2549
+ c,
2550
+ vnode.__e,
2551
+ oldDom
2552
+ );
2553
+ }
2554
+ }
2555
+ }
2556
+ return oldDom;
2557
+ }
2558
+
2559
+ /**
2560
+ * Flatten and loop through the children of a virtual node
2561
+ * @param {import('../index').ComponentChildren} children The unflattened
2562
+ * children of a virtual node
2563
+ * @returns {import('../internal').VNode[]}
2564
+ */
2565
+ function toChildArray(children, out) {
2566
+ out = out || [];
2567
+ if (children == null || typeof children == 'boolean') {
2568
+ }
2569
+ else if (Array.isArray(children)) {
2570
+ children.some(function (child) {
2571
+ toChildArray(child, out);
2572
+ });
2573
+ }
2574
+ else {
2575
+ out.push(children);
2576
+ }
2577
+ return out;
2578
+ }
2579
+ function placeChild(
2580
+ parentDom,
2581
+ childVNode,
2582
+ oldVNode,
2583
+ oldChildren,
2584
+ newDom,
2585
+ oldDom
2586
+ ) {
2587
+ var nextDom;
2588
+ if (childVNode.__d !== undefined) {
2589
+ // Only Fragments or components that return Fragment like VNodes will
2590
+ // have a non-undefined _nextDom. Continue the diff from the sibling
2591
+ // of last DOM child of this child VNode
2592
+ nextDom = childVNode.__d;
2593
+
2594
+ // Eagerly cleanup _nextDom. We don't need to persist the value because
2595
+ // it is only used by `diffChildren` to determine where to resume the diff after
2596
+ // diffing Components and Fragments. Once we store it the nextDOM local var, we
2597
+ // can clean up the property
2598
+ childVNode.__d = undefined;
2599
+ }
2600
+ else if (
2601
+ oldVNode == null ||
2602
+ newDom != oldDom ||
2603
+ newDom.parentNode == null
2604
+ ) {
2605
+ outer: if (oldDom == null || oldDom.parentNode !== parentDom) {
2606
+ parentDom.appendChild(newDom);
2607
+ nextDom = null;
2608
+ }
2609
+ else {
2610
+ // `j<oldChildrenLength; j+=2` is an alternative to `j++<oldChildrenLength/2`
2611
+ for (
2612
+ var sibDom = oldDom, j = 0;
2613
+ (sibDom = sibDom.nextSibling) && j < oldChildren.length;
2614
+ j += 1
2615
+ ) {
2616
+ if (sibDom == newDom) {
2617
+ break outer;
2618
+ }
2619
+ }
2620
+ parentDom.insertBefore(newDom, oldDom);
2621
+ nextDom = oldDom;
2622
+ }
2623
+ }
2624
+
2625
+ // If we have pre-calculated the nextDOM node, use it. Else calculate it now
2626
+ // Strictly check for `undefined` here cuz `null` is a valid value of `nextDom`.
2627
+ // See more detail in create-element.js:createVNode
2628
+ if (nextDom !== undefined) {
2629
+ oldDom = nextDom;
2630
+ }
2631
+ else {
2632
+ oldDom = newDom.nextSibling;
2633
+ }
2634
+ return oldDom;
2635
+ }
2636
+
2637
+ /***/
2638
+ },
2639
+
2640
+ /***/ './src/diff/index.js':
2641
+ /*!***************************!*\
2642
+ !*** ./src/diff/index.js ***!
2643
+ \***************************/
2644
+ /***/ (
2645
+ __unused_webpack_module,
2646
+ __webpack_exports__,
2647
+ __webpack_require__
2648
+ ) => {
2649
+ __webpack_require__.r(__webpack_exports__);
2650
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2651
+ /* harmony export */ applyRef: () => /* binding */ applyRef,
2652
+ /* harmony export */ commitRoot: () => /* binding */ commitRoot,
2653
+ /* harmony export */ diff: () => /* binding */ diff,
2654
+ /* harmony export */ unmount: () => /* binding */ unmount,
2655
+ /* harmony export */
2656
+ });
2657
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ =
2658
+ __webpack_require__(/*! ../constants */ './src/constants.js');
2659
+ /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ =
2660
+ __webpack_require__(/*! ../component */ './src/component.js');
2661
+ /* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_2__ =
2662
+ __webpack_require__(/*! ../create-element */ './src/create-element.js');
2663
+ /* harmony import */ var _children__WEBPACK_IMPORTED_MODULE_3__ =
2664
+ __webpack_require__(/*! ./children */ './src/diff/children.js');
2665
+ /* harmony import */ var _props__WEBPACK_IMPORTED_MODULE_4__ =
2666
+ __webpack_require__(/*! ./props */ './src/diff/props.js');
2667
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ =
2668
+ __webpack_require__(/*! ../util */ './src/util.js');
2669
+ /* harmony import */ var _options__WEBPACK_IMPORTED_MODULE_6__ =
2670
+ __webpack_require__(/*! ../options */ './src/options.js');
2671
+
2672
+ /**
2673
+ * Diff two virtual nodes and apply proper changes to the DOM
2674
+ * @param {import('../internal').PreactElement} parentDom The parent of the DOM element
2675
+ * @param {import('../internal').VNode} newVNode The new virtual node
2676
+ * @param {import('../internal').VNode} oldVNode The old virtual node
2677
+ * @param {object} globalContext The current context object. Modified by getChildContext
2678
+ * @param {boolean} isSvg Whether or not this element is an SVG node
2679
+ * @param {Array<import('../internal').PreactElement>} excessDomChildren
2680
+ * @param {Array<import('../internal').Component>} commitQueue List of components
2681
+ * which have callbacks to invoke in commitRoot
2682
+ * @param {import('../internal').PreactElement} oldDom The current attached DOM
2683
+ * element any new dom elements should be placed around. Likely `null` on first
2684
+ * render (except when hydrating). Can be a sibling DOM element when diffing
2685
+ * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.
2686
+ * @param {boolean} [isHydrating] Whether or not we are in hydration
2687
+ */
2688
+ function diff(
2689
+ parentDom,
2690
+ newVNode,
2691
+ oldVNode,
2692
+ globalContext,
2693
+ isSvg,
2694
+ excessDomChildren,
2695
+ commitQueue,
2696
+ oldDom,
2697
+ isHydrating
2698
+ ) {
2699
+ var tmp,
2700
+ newType = newVNode.type;
2701
+
2702
+ // When passing through createElement it assigns the object
2703
+ // constructor as undefined. This to prevent JSON-injection.
2704
+ if (newVNode.constructor !== undefined) return null;
2705
+
2706
+ // If the previous diff bailed out, resume creating/hydrating.
2707
+ if (oldVNode.__h != null) {
2708
+ isHydrating = oldVNode.__h;
2709
+ oldDom = newVNode.__e = oldVNode.__e;
2710
+ // if we resume, we want the tree to be "unlocked"
2711
+ newVNode.__h = null;
2712
+ excessDomChildren = [oldDom];
2713
+ }
2714
+ if ((tmp = _options__WEBPACK_IMPORTED_MODULE_6__['default'].__b))
2715
+ tmp(newVNode);
2716
+ try {
2717
+ outer: if (typeof newType == 'function') {
2718
+ var _newType$prototype2;
2719
+ var c,
2720
+ isNew,
2721
+ oldProps,
2722
+ oldState,
2723
+ snapshot,
2724
+ clearProcessingException;
2725
+ var newProps = newVNode.props;
2726
+
2727
+ // Necessary for createContext api. Setting this property will pass
2728
+ // the context value as `this.context` just for this component.
2729
+ tmp = newType.contextType;
2730
+ var provider = tmp && globalContext[tmp.__c];
2731
+ var componentContext = tmp
2732
+ ? provider
2733
+ ? provider.props.value
2734
+ : tmp.__
2735
+ : globalContext;
2736
+
2737
+ // Get component and set it to `c`
2738
+ if (oldVNode.__c) {
2739
+ c = newVNode.__c = oldVNode.__c;
2740
+ clearProcessingException = c.__ = c.__E;
2741
+ }
2742
+ else {
2743
+ var _newType$prototype;
2744
+ // Instantiate the new component
2745
+ if (
2746
+ (_newType$prototype = newType.prototype) !== null &&
2747
+ _newType$prototype !== void 0 &&
2748
+ _newType$prototype.render
2749
+ ) {
2750
+ // @ts-ignore The check above verifies that newType is suppose to be constructed
2751
+ newVNode.__c = c = new newType(newProps, componentContext); // eslint-disable-line new-cap
2752
+ }
2753
+ else {
2754
+ // @ts-ignore Trust me, Component implements the interface we want
2755
+ newVNode.__c = c =
2756
+ new _component__WEBPACK_IMPORTED_MODULE_1__.Component(
2757
+ newProps,
2758
+ componentContext
2759
+ );
2760
+ c.constructor = newType;
2761
+ c.render = doRender;
2762
+ }
2763
+ if (provider) provider.sub(c);
2764
+ c.props = newProps;
2765
+ if (!c.state) c.state = {};
2766
+ c.context = componentContext;
2767
+ c.__n = globalContext;
2768
+ isNew = c.__d = true;
2769
+ c.__h = [];
2770
+ c._sb = [];
2771
+ }
2772
+
2773
+ // Invoke getDerivedStateFromProps
2774
+ if (c.__s == null) {
2775
+ c.__s = c.state;
2776
+ }
2777
+ if (newType.getDerivedStateFromProps != null) {
2778
+ if (c.__s == c.state) {
2779
+ c.__s = (0, _util__WEBPACK_IMPORTED_MODULE_5__.assign)(
2780
+ {},
2781
+ c.__s
2782
+ );
2783
+ }
2784
+ (0, _util__WEBPACK_IMPORTED_MODULE_5__.assign)(
2785
+ c.__s,
2786
+ newType.getDerivedStateFromProps(newProps, c.__s)
2787
+ );
2788
+ }
2789
+ oldProps = c.props;
2790
+ oldState = c.state;
2791
+
2792
+ // Invoke pre-render lifecycle methods
2793
+ if (isNew) {
2794
+ if (
2795
+ newType.getDerivedStateFromProps == null &&
2796
+ c.componentWillMount != null
2797
+ ) {
2798
+ c.componentWillMount();
2799
+ }
2800
+ if (c.componentDidMount != null) {
2801
+ c.__h.push(c.componentDidMount);
2802
+ }
2803
+ }
2804
+ else {
2805
+ if (
2806
+ newType.getDerivedStateFromProps == null &&
2807
+ newProps !== oldProps &&
2808
+ c.componentWillReceiveProps != null
2809
+ ) {
2810
+ c.componentWillReceiveProps(newProps, componentContext);
2811
+ }
2812
+ if (
2813
+ (!c.__e &&
2814
+ c.shouldComponentUpdate != null &&
2815
+ c.shouldComponentUpdate(newProps, c.__s, componentContext) ===
2816
+ false) ||
2817
+ newVNode.__v === oldVNode.__v
2818
+ ) {
2819
+ c.props = newProps;
2820
+ c.state = c.__s;
2821
+ // More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8
2822
+ if (newVNode.__v !== oldVNode.__v) c.__d = false;
2823
+ c.__v = newVNode;
2824
+ newVNode.__e = oldVNode.__e;
2825
+ newVNode.__k = oldVNode.__k;
2826
+ newVNode.__k.forEach(function (vnode) {
2827
+ if (vnode) vnode.__ = newVNode;
2828
+ });
2829
+ for (var i = 0; i < c._sb.length; i++) {
2830
+ c.__h.push(c._sb[i]);
2831
+ }
2832
+ c._sb = [];
2833
+ if (c.__h.length) {
2834
+ commitQueue.push(c);
2835
+ }
2836
+ break outer;
2837
+ }
2838
+ if (c.componentWillUpdate != null) {
2839
+ c.componentWillUpdate(newProps, c.__s, componentContext);
2840
+ }
2841
+ if (c.componentDidUpdate != null) {
2842
+ c.__h.push(function () {
2843
+ c.componentDidUpdate(oldProps, oldState, snapshot);
2844
+ });
2845
+ }
2846
+ }
2847
+ c.context = componentContext;
2848
+ c.props = newProps;
2849
+ c.__v = newVNode;
2850
+ c.__P = parentDom;
2851
+ var renderHook =
2852
+ _options__WEBPACK_IMPORTED_MODULE_6__['default'].__r,
2853
+ count = 0;
2854
+ if (
2855
+ (_newType$prototype2 = newType.prototype) !== null &&
2856
+ _newType$prototype2 !== void 0 &&
2857
+ _newType$prototype2.render
2858
+ ) {
2859
+ c.state = c.__s;
2860
+ c.__d = false;
2861
+ if (renderHook) renderHook(newVNode);
2862
+ tmp = c.render(c.props, c.state, c.context);
2863
+ for (var _i = 0; _i < c._sb.length; _i++) {
2864
+ c.__h.push(c._sb[_i]);
2865
+ }
2866
+ c._sb = [];
2867
+ }
2868
+ else {
2869
+ do {
2870
+ c.__d = false;
2871
+ if (renderHook) renderHook(newVNode);
2872
+ tmp = c.render(c.props, c.state, c.context);
2873
+
2874
+ // Handle setState called in render, see #2553
2875
+ c.state = c.__s;
2876
+ } while (c.__d && ++count < 25);
2877
+ }
2878
+
2879
+ // Handle setState called in render, see #2553
2880
+ c.state = c.__s;
2881
+ if (c.getChildContext != null) {
2882
+ globalContext = (0, _util__WEBPACK_IMPORTED_MODULE_5__.assign)(
2883
+ (0, _util__WEBPACK_IMPORTED_MODULE_5__.assign)(
2884
+ {},
2885
+ globalContext
2886
+ ),
2887
+ c.getChildContext()
2888
+ );
2889
+ }
2890
+ if (!isNew && c.getSnapshotBeforeUpdate != null) {
2891
+ snapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);
2892
+ }
2893
+ var isTopLevelFragment =
2894
+ tmp != null &&
2895
+ tmp.type ===
2896
+ _create_element__WEBPACK_IMPORTED_MODULE_2__.Fragment &&
2897
+ tmp.key == null;
2898
+ var renderResult = isTopLevelFragment ? tmp.props.children : tmp;
2899
+ commitQueue.task.pushChild('pre', function () {
2900
+ (0,
2901
+ _children__WEBPACK_IMPORTED_MODULE_3__.diffChildren)(parentDom, Array.isArray(renderResult) ? renderResult : [renderResult], newVNode, oldVNode, globalContext, isSvg, excessDomChildren, commitQueue, oldDom, isHydrating);
2902
+ });
2903
+ commitQueue.task.pushChild('post', function () {
2904
+ c.base = newVNode.__e;
2905
+
2906
+ // We successfully rendered this VNode, unset any stored hydration/bailout state:
2907
+ newVNode.__h = null;
2908
+ if (c.__h.length) {
2909
+ commitQueue.push(c);
2910
+ }
2911
+ if (clearProcessingException) {
2912
+ c.__E = c.__ = null;
2913
+ }
2914
+ c.__e = false;
2915
+ });
2916
+ }
2917
+ else if (
2918
+ excessDomChildren == null &&
2919
+ newVNode.__v === oldVNode.__v
2920
+ ) {
2921
+ commitQueue.task.pushChild('post', function () {
2922
+ newVNode.__k = oldVNode.__k;
2923
+ newVNode.__e = oldVNode.__e;
2924
+ });
2925
+ }
2926
+ else {
2927
+ var dom;
2928
+ commitQueue.task.pushChild('post', function () {
2929
+ dom = diffElementNodes(
2930
+ oldVNode.__e,
2931
+ newVNode,
2932
+ oldVNode,
2933
+ globalContext,
2934
+ isSvg,
2935
+ excessDomChildren,
2936
+ commitQueue,
2937
+ isHydrating
2938
+ );
2939
+ });
2940
+ commitQueue.task.pushChild('post', function () {
2941
+ newVNode.__e = dom;
2942
+ });
2943
+ }
2944
+ commitQueue.task.pushChild('post', function () {
2945
+ if ((tmp = _options__WEBPACK_IMPORTED_MODULE_6__['default'].diffed))
2946
+ tmp(newVNode);
2947
+ });
2948
+ }
2949
+ catch (e) {
2950
+ newVNode.__v = null;
2951
+ // if hydrating or creating initial tree, bailout preserves DOM:
2952
+ if (isHydrating || excessDomChildren != null) {
2953
+ newVNode.__e = oldDom;
2954
+ newVNode.__h = !!isHydrating;
2955
+ excessDomChildren[excessDomChildren.indexOf(oldDom)] = null;
2956
+ // ^ could possibly be simplified to:
2957
+ // excessDomChildren.length = 0;
2958
+ }
2959
+
2960
+ _options__WEBPACK_IMPORTED_MODULE_6__['default'].__e(
2961
+ e,
2962
+ newVNode,
2963
+ oldVNode
2964
+ );
2965
+ }
2966
+ }
2967
+
2968
+ /**
2969
+ * @param {Array<import('../internal').Component>} commitQueue List of components
2970
+ * which have callbacks to invoke in commitRoot
2971
+ * @param {import('../internal').VNode} root
2972
+ */
2973
+ function commitRoot(commitQueue, root) {
2974
+ if (_options__WEBPACK_IMPORTED_MODULE_6__['default'].__c)
2975
+ _options__WEBPACK_IMPORTED_MODULE_6__['default'].__c(
2976
+ root,
2977
+ commitQueue
2978
+ );
2979
+ commitQueue.some(function (c) {
2980
+ try {
2981
+ // @ts-ignore Reuse the commitQueue variable here so the type changes
2982
+ commitQueue = c.__h;
2983
+ c.__h = [];
2984
+ commitQueue.some(function (cb) {
2985
+ // @ts-ignore See above ts-ignore on commitQueue
2986
+ cb.call(c);
2987
+ });
2988
+ }
2989
+ catch (e) {
2990
+ _options__WEBPACK_IMPORTED_MODULE_6__['default'].__e(e, c.__v);
2991
+ }
2992
+ });
2993
+ }
2994
+
2995
+ /**
2996
+ * Diff two virtual nodes representing DOM element
2997
+ * @param {import('../internal').PreactElement} dom The DOM element representing
2998
+ * the virtual nodes being diffed
2999
+ * @param {import('../internal').VNode} newVNode The new virtual node
3000
+ * @param {import('../internal').VNode} oldVNode The old virtual node
3001
+ * @param {object} globalContext The current context object
3002
+ * @param {boolean} isSvg Whether or not this DOM node is an SVG node
3003
+ * @param {*} excessDomChildren
3004
+ * @param {Array<import('../internal').Component>} commitQueue List of components
3005
+ * which have callbacks to invoke in commitRoot
3006
+ * @param {boolean} isHydrating Whether or not we are in hydration
3007
+ * @returns {import('../internal').PreactElement}
3008
+ */
3009
+ function diffElementNodes(
3010
+ dom,
3011
+ newVNode,
3012
+ oldVNode,
3013
+ globalContext,
3014
+ isSvg,
3015
+ excessDomChildren,
3016
+ commitQueue,
3017
+ isHydrating
3018
+ ) {
3019
+ var oldProps = oldVNode.props;
3020
+ var newProps = newVNode.props;
3021
+ var nodeType = newVNode.type;
3022
+ var i = 0;
3023
+
3024
+ // Tracks entering and exiting SVG namespace when descending through the tree.
3025
+ if (nodeType === 'svg') isSvg = true;
3026
+ if (excessDomChildren != null) {
3027
+ for (; i < excessDomChildren.length; i++) {
3028
+ var child = excessDomChildren[i];
3029
+
3030
+ // if newVNode matches an element in excessDomChildren or the `dom`
3031
+ // argument matches an element in excessDomChildren, remove it from
3032
+ // excessDomChildren so it isn't later removed in diffChildren
3033
+ if (
3034
+ child &&
3035
+ 'setAttribute' in child === !!nodeType &&
3036
+ (nodeType ? child.localName === nodeType : child.nodeType === 3)
3037
+ ) {
3038
+ dom = child;
3039
+ excessDomChildren[i] = null;
3040
+ break;
3041
+ }
3042
+ }
3043
+ }
3044
+ if (dom == null) {
3045
+ if (nodeType === null) {
3046
+ // @ts-ignore createTextNode returns Text, we expect PreactElement
3047
+ // console.log('---',newProps);
3048
+
3049
+ return document.createTextNode(newProps);
3050
+ }
3051
+ if (isSvg) {
3052
+ dom = document.createElementNS(
3053
+ 'http://www.w3.org/2000/svg',
3054
+ // @ts-ignore We know `newVNode.type` is a string
3055
+ nodeType
3056
+ );
3057
+ }
3058
+ else {
3059
+ dom = document.createElement(
3060
+ // @ts-ignore We know `newVNode.type` is a string
3061
+ nodeType,
3062
+ newProps.is && newProps
3063
+ );
3064
+ }
3065
+
3066
+ // we created a new parent, so none of the previously attached children can be reused:
3067
+ excessDomChildren = null;
3068
+ // we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate
3069
+ isHydrating = false;
3070
+ }
3071
+ dom.__v = newVNode;
3072
+ if (nodeType === null) {
3073
+ // During hydration, we still have to split merged text from SSR'd HTML.
3074
+ if (
3075
+ oldProps !== newProps &&
3076
+ (!isHydrating || dom.data !== newProps)
3077
+ ) {
3078
+ dom.data = newProps;
3079
+ }
3080
+ }
3081
+ else {
3082
+ // If excessDomChildren was not null, repopulate it with the current element's children:
3083
+ excessDomChildren =
3084
+ excessDomChildren &&
3085
+ _util__WEBPACK_IMPORTED_MODULE_5__.slice.call(dom.childNodes);
3086
+ oldProps =
3087
+ oldVNode.props || _constants__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ;
3088
+ var oldHtml = oldProps.dangerouslySetInnerHTML;
3089
+ var newHtml = newProps.dangerouslySetInnerHTML;
3090
+
3091
+ // During hydration, props are not diffed at all (including dangerouslySetInnerHTML)
3092
+ // @TODO we should warn in debug mode when props don't match here.
3093
+ if (!isHydrating) {
3094
+ // But, if we are in a situation where we are using existing DOM (e.g. replaceNode)
3095
+ // we should read the existing DOM attributes to diff them
3096
+ if (excessDomChildren != null) {
3097
+ oldProps = {};
3098
+ for (i = 0; i < dom.attributes.length; i++) {
3099
+ oldProps[dom.attributes[i].name] = dom.attributes[i].value;
3100
+ }
3101
+ }
3102
+ if (newHtml || oldHtml) {
3103
+ // Avoid re-applying the same '__html' if it did not changed between re-render
3104
+ if (
3105
+ !newHtml ||
3106
+ ((!oldHtml || newHtml.__html != oldHtml.__html) &&
3107
+ newHtml.__html !== dom.innerHTML)
3108
+ ) {
3109
+ dom.innerHTML = (newHtml && newHtml.__html) || '';
3110
+ }
3111
+ }
3112
+ }
3113
+ (0, _props__WEBPACK_IMPORTED_MODULE_4__.diffProps)(
3114
+ dom,
3115
+ newProps,
3116
+ oldProps,
3117
+ isSvg,
3118
+ isHydrating
3119
+ );
3120
+
3121
+ // If the new vnode didn't have dangerouslySetInnerHTML, diff its children
3122
+ if (newHtml) {
3123
+ newVNode.__k = [];
3124
+ }
3125
+ else {
3126
+ var _i2 = newVNode.props.children;
3127
+ commitQueue.task.pushChild(
3128
+ 'pre',
3129
+ function (i) {
3130
+ (0, _children__WEBPACK_IMPORTED_MODULE_3__.diffChildren)(
3131
+ dom,
3132
+ Array.isArray(i) ? i : [i],
3133
+ newVNode,
3134
+ oldVNode,
3135
+ globalContext,
3136
+ isSvg && nodeType !== 'foreignObject',
3137
+ excessDomChildren,
3138
+ commitQueue,
3139
+ excessDomChildren
3140
+ ? excessDomChildren[0]
3141
+ : oldVNode.__k &&
3142
+ (0,
3143
+ _component__WEBPACK_IMPORTED_MODULE_1__.getDomSibling)(
3144
+ oldVNode,
3145
+ 0
3146
+ ),
3147
+ isHydrating
3148
+ );
3149
+ }.bind(this, _i2)
3150
+ );
3151
+ commitQueue.task.pushChild('pre', function (i) {
3152
+ // Remove children that are not part of any vnode.
3153
+ if (excessDomChildren != null) {
3154
+ for (i = excessDomChildren.length; i--; ) {
3155
+ if (excessDomChildren[i] != null)
3156
+ (0, _util__WEBPACK_IMPORTED_MODULE_5__.removeNode)(
3157
+ excessDomChildren[i]
3158
+ );
3159
+ }
3160
+ }
3161
+ });
3162
+ }
3163
+ commitQueue.task.pushChild(
3164
+ 'pre',
3165
+ function (i) {
3166
+ // (as above, don't diff props during hydration)
3167
+ if (!isHydrating) {
3168
+ if (
3169
+ 'value' in newProps &&
3170
+ (i = newProps.value) !== undefined &&
3171
+ // #2756 For the <progress>-element the initial value is 0,
3172
+ // despite the attribute not being present. When the attribute
3173
+ // is missing the progress bar is treated as indeterminate.
3174
+ // To fix that we'll always update it when it is 0 for progress elements
3175
+ (i !== dom.value ||
3176
+ (nodeType === 'progress' && !i) ||
3177
+ // This is only for IE 11 to fix <select> value not being updated.
3178
+ // To avoid a stale select value we need to set the option.value
3179
+ // again, which triggers IE11 to re-evaluate the select value
3180
+ (nodeType === 'option' && i !== oldProps.value))
3181
+ ) {
3182
+ (0, _props__WEBPACK_IMPORTED_MODULE_4__.setProperty)(
3183
+ dom,
3184
+ 'value',
3185
+ i,
3186
+ oldProps.value,
3187
+ false
3188
+ );
3189
+ }
3190
+ if (
3191
+ 'checked' in newProps &&
3192
+ (i = newProps.checked) !== undefined &&
3193
+ i !== dom.checked
3194
+ ) {
3195
+ (0, _props__WEBPACK_IMPORTED_MODULE_4__.setProperty)(
3196
+ dom,
3197
+ 'checked',
3198
+ i,
3199
+ oldProps.checked,
3200
+ false
3201
+ );
3202
+ }
3203
+ }
3204
+ }.bind(null, i)
3205
+ );
3206
+ }
3207
+ return dom;
3208
+ }
3209
+
3210
+ /**
3211
+ * Invoke or update a ref, depending on whether it is a function or object ref.
3212
+ * @param {object|function} ref
3213
+ * @param {any} value
3214
+ * @param {import('../internal').VNode} vnode
3215
+ */
3216
+ function applyRef(ref, value, vnode) {
3217
+ try {
3218
+ if (typeof ref == 'function') ref(value);
3219
+ else ref.current = value;
3220
+ }
3221
+ catch (e) {
3222
+ _options__WEBPACK_IMPORTED_MODULE_6__['default'].__e(e, vnode);
3223
+ }
3224
+ }
3225
+
3226
+ /**
3227
+ * Unmount a virtual node from the tree and apply DOM changes
3228
+ * @param {import('../internal').VNode} vnode The virtual node to unmount
3229
+ * @param {import('../internal').VNode} parentVNode The parent of the VNode that
3230
+ * initiated the unmount
3231
+ * @param {boolean} [skipRemove] Flag that indicates that a parent node of the
3232
+ * current element is already detached from the DOM.
3233
+ */
3234
+ function unmount(vnode, parentVNode, skipRemove) {
3235
+ var r;
3236
+ if (_options__WEBPACK_IMPORTED_MODULE_6__['default'].unmount)
3237
+ _options__WEBPACK_IMPORTED_MODULE_6__['default'].unmount(vnode);
3238
+ if ((r = vnode.ref)) {
3239
+ if (!r.current || r.current === vnode.__e) {
3240
+ applyRef(r, null, parentVNode);
3241
+ }
3242
+ }
3243
+ if ((r = vnode.__c) != null) {
3244
+ if (r.componentWillUnmount) {
3245
+ try {
3246
+ r.componentWillUnmount();
3247
+ }
3248
+ catch (e) {
3249
+ _options__WEBPACK_IMPORTED_MODULE_6__['default'].__e(
3250
+ e,
3251
+ parentVNode
3252
+ );
3253
+ }
3254
+ }
3255
+ r.base = r.__P = null;
3256
+ vnode.__c = undefined;
3257
+ }
3258
+ if ((r = vnode.__k)) {
3259
+ for (var i = 0; i < r.length; i++) {
3260
+ if (r[i]) {
3261
+ unmount(
3262
+ r[i],
3263
+ parentVNode,
3264
+ skipRemove || typeof vnode.type !== 'function'
3265
+ );
3266
+ }
3267
+ }
3268
+ }
3269
+ if (!skipRemove && vnode.__e != null) {
3270
+ (0, _util__WEBPACK_IMPORTED_MODULE_5__.removeNode)(vnode.__e);
3271
+ }
3272
+
3273
+ // Must be set to `undefined` to properly clean up `_nextDom`
3274
+ // for which `null` is a valid value. See comment in `create-element.js`
3275
+ vnode.__ = vnode.__e = vnode.__d = undefined;
3276
+ }
3277
+
3278
+ /** The `.render()` method for a PFC backing instance. */
3279
+ function doRender(props, state, context) {
3280
+ return this.constructor(props, context);
3281
+ }
3282
+
3283
+ /***/
3284
+ },
3285
+
3286
+ /***/ './src/diff/props.js':
3287
+ /*!***************************!*\
3288
+ !*** ./src/diff/props.js ***!
3289
+ \***************************/
3290
+ /***/ (
3291
+ __unused_webpack_module,
3292
+ __webpack_exports__,
3293
+ __webpack_require__
3294
+ ) => {
3295
+ __webpack_require__.r(__webpack_exports__);
3296
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3297
+ /* harmony export */ diffProps: () => /* binding */ diffProps,
3298
+ /* harmony export */ setProperty: () => /* binding */ setProperty,
3299
+ /* harmony export */
3300
+ });
3301
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ =
3302
+ __webpack_require__(/*! ../constants */ './src/constants.js');
3303
+ /* harmony import */ var _options__WEBPACK_IMPORTED_MODULE_1__ =
3304
+ __webpack_require__(/*! ../options */ './src/options.js');
3305
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ =
3306
+ __webpack_require__(/*! ../util */ './src/util.js');
3307
+
3308
+ /**
3309
+ * Diff the old and new properties of a VNode and apply changes to the DOM node
3310
+ * @param {import('../internal').PreactElement} dom The DOM node to apply
3311
+ * changes to
3312
+ * @param {object} newProps The new props
3313
+ * @param {object} oldProps The old props
3314
+ * @param {boolean} isSvg Whether or not this node is an SVG node
3315
+ * @param {boolean} hydrate Whether or not we are in hydration mode
3316
+ */
3317
+ function diffProps(dom, newProps, oldProps, isSvg, hydrate) {
3318
+ var i;
3319
+ for (i in oldProps) {
3320
+ if (i !== 'children' && i !== 'key' && !(i in newProps)) {
3321
+ setProperty(dom, i, null, oldProps[i], isSvg);
3322
+ }
3323
+ }
3324
+ for (i in newProps) {
3325
+ if (
3326
+ (!hydrate || typeof newProps[i] == 'function') &&
3327
+ i !== 'children' &&
3328
+ i !== 'key' &&
3329
+ i !== 'value' &&
3330
+ i !== 'checked' &&
3331
+ oldProps[i] !== newProps[i]
3332
+ ) {
3333
+ setProperty(dom, i, newProps[i], oldProps[i], isSvg);
3334
+ }
3335
+ }
3336
+ }
3337
+ function setStyle(style, key, value) {
3338
+ if (key[0] === '-') {
3339
+ style.setProperty(key, value);
3340
+ }
3341
+ else if (value == null) {
3342
+ style[key] = '';
3343
+ }
3344
+ else if (
3345
+ typeof value != 'number' ||
3346
+ _constants__WEBPACK_IMPORTED_MODULE_0__.IS_NON_DIMENSIONAL.test(key)
3347
+ ) {
3348
+ style[key] = value;
3349
+ }
3350
+ else {
3351
+ style[key] = value + 'px';
3352
+ }
3353
+ }
3354
+
3355
+ /**
3356
+ * Set a property value on a DOM node
3357
+ * @param {import('../internal').PreactElement} dom The DOM node to modify
3358
+ * @param {string} name The name of the property to set
3359
+ * @param {*} value The value to set the property to
3360
+ * @param {*} oldValue The old value the property had
3361
+ * @param {boolean} isSvg Whether or not this DOM node is an SVG node or not
3362
+ */
3363
+ function setProperty(dom, name, value, oldValue, isSvg) {
3364
+ var useCapture;
3365
+ o: if (name === 'style') {
3366
+ if (typeof value == 'string') {
3367
+ dom.style.cssText = value;
3368
+ }
3369
+ else {
3370
+ if (typeof oldValue == 'string') {
3371
+ dom.style.cssText = oldValue = '';
3372
+ }
3373
+ if (oldValue) {
3374
+ for (name in oldValue) {
3375
+ if (!(value && name in value)) {
3376
+ setStyle(dom.style, name, '');
3377
+ }
3378
+ }
3379
+ }
3380
+ if (value) {
3381
+ for (name in value) {
3382
+ if (!oldValue || value[name] !== oldValue[name]) {
3383
+ setStyle(dom.style, name, value[name]);
3384
+ }
3385
+ }
3386
+ }
3387
+ }
3388
+ }
3389
+ // Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6
3390
+ else if (name[0] === 'o' && name[1] === 'n') {
3391
+ useCapture = name !== (name = name.replace(/Capture$/, ''));
3392
+
3393
+ // Infer correct casing for DOM built-in events:
3394
+ if (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);
3395
+ else name = name.slice(2);
3396
+ if (!dom.l) dom.l = {};
3397
+ dom.l[name + useCapture] = value;
3398
+ if (value) {
3399
+ if (!oldValue) {
3400
+ var handler = useCapture ? eventProxyCapture : eventProxy;
3401
+ dom.addEventListener(name, handler, useCapture);
3402
+ }
3403
+ }
3404
+ else {
3405
+ var _handler = useCapture ? eventProxyCapture : eventProxy;
3406
+ dom.removeEventListener(name, _handler, useCapture);
3407
+ }
3408
+ }
3409
+ else if (name !== 'dangerouslySetInnerHTML') {
3410
+ if (isSvg) {
3411
+ // Normalize incorrect prop usage for SVG:
3412
+ // - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)
3413
+ // - className --> class
3414
+ name = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');
3415
+ }
3416
+ else if (
3417
+ name !== 'href' &&
3418
+ name !== 'list' &&
3419
+ name !== 'form' &&
3420
+ // Default value in browsers is `-1` and an empty string is
3421
+ // cast to `0` instead
3422
+ name !== 'tabIndex' &&
3423
+ name !== 'download' &&
3424
+ name in dom
3425
+ ) {
3426
+ try {
3427
+ dom[name] = value == null ? '' : value;
3428
+ // labelled break is 1b smaller here than a return statement (sorry)
3429
+ break o;
3430
+ }
3431
+ catch (e) {}
3432
+ }
3433
+
3434
+ // ARIA-attributes have a different notion of boolean values.
3435
+ // The value `false` is different from the attribute not
3436
+ // existing on the DOM, so we can't remove it. For non-boolean
3437
+ // ARIA-attributes we could treat false as a removal, but the
3438
+ // amount of exceptions would cost us too many bytes. On top of
3439
+ // that other VDOM frameworks also always stringify `false`.
3440
+
3441
+ if (typeof value === 'function') {
3442
+ // never serialize functions as attribute values
3443
+ }
3444
+ else if (
3445
+ value != null &&
3446
+ (value !== false || name.indexOf('-') != -1)
3447
+ ) {
3448
+ dom.setAttribute(name, value);
3449
+ }
3450
+ else {
3451
+ dom.removeAttribute(name);
3452
+ }
3453
+ }
3454
+ }
3455
+
3456
+ /**
3457
+ * Proxy an event to hooked event handlers
3458
+ * @param {Event} e The event object from the browser
3459
+ * @private
3460
+ */
3461
+ function eventProxy(e) {
3462
+ this.l[e.type + false](
3463
+ _options__WEBPACK_IMPORTED_MODULE_1__['default'].event
3464
+ ? _options__WEBPACK_IMPORTED_MODULE_1__['default'].event(e)
3465
+ : e
3466
+ );
3467
+ }
3468
+ function eventProxyCapture(e) {
3469
+ this.l[e.type + true](
3470
+ _options__WEBPACK_IMPORTED_MODULE_1__['default'].event
3471
+ ? _options__WEBPACK_IMPORTED_MODULE_1__['default'].event(e)
3472
+ : e
3473
+ );
3474
+ }
3475
+
3476
+ /***/
3477
+ },
3478
+
3479
+ /***/ './src/index.js':
3480
+ /*!**********************!*\
3481
+ !*** ./src/index.js ***!
3482
+ \**********************/
3483
+ /***/ (
3484
+ __unused_webpack_module,
3485
+ __webpack_exports__,
3486
+ __webpack_require__
3487
+ ) => {
3488
+ __webpack_require__.r(__webpack_exports__);
3489
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3490
+ /* harmony export */ Component: () =>
3491
+ /* reexport safe */ _component__WEBPACK_IMPORTED_MODULE_2__.Component,
3492
+ /* harmony export */ Fragment: () =>
3493
+ /* reexport safe */ _create_element__WEBPACK_IMPORTED_MODULE_1__.Fragment,
3494
+ /* harmony export */ cloneElement: () =>
3495
+ /* reexport safe */ _clone_element__WEBPACK_IMPORTED_MODULE_3__.cloneElement,
3496
+ /* harmony export */ createContext: () =>
3497
+ /* reexport safe */ _create_context__WEBPACK_IMPORTED_MODULE_4__.createContext,
3498
+ /* harmony export */ createElement: () =>
3499
+ /* reexport safe */ _create_element__WEBPACK_IMPORTED_MODULE_1__.createElement,
3500
+ /* harmony export */ createRef: () =>
3501
+ /* reexport safe */ _create_element__WEBPACK_IMPORTED_MODULE_1__.createRef,
3502
+ /* harmony export */ h: () =>
3503
+ /* reexport safe */ _create_element__WEBPACK_IMPORTED_MODULE_1__.createElement,
3504
+ /* harmony export */ hydrate: () =>
3505
+ /* reexport safe */ _render__WEBPACK_IMPORTED_MODULE_0__.hydrate,
3506
+ /* harmony export */ isValidElement: () =>
3507
+ /* reexport safe */ _create_element__WEBPACK_IMPORTED_MODULE_1__.isValidElement,
3508
+ /* harmony export */ options: () =>
3509
+ /* reexport safe */ _options__WEBPACK_IMPORTED_MODULE_6__['default'],
3510
+ /* harmony export */ render: () =>
3511
+ /* reexport safe */ _render__WEBPACK_IMPORTED_MODULE_0__.render,
3512
+ /* harmony export */ toChildArray: () =>
3513
+ /* reexport safe */ _diff_children__WEBPACK_IMPORTED_MODULE_5__.toChildArray,
3514
+ /* harmony export */
3515
+ });
3516
+ /* harmony import */ var _render__WEBPACK_IMPORTED_MODULE_0__ =
3517
+ __webpack_require__(/*! ./render */ './src/render.js');
3518
+ /* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_1__ =
3519
+ __webpack_require__(/*! ./create-element */ './src/create-element.js');
3520
+ /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ =
3521
+ __webpack_require__(/*! ./component */ './src/component.js');
3522
+ /* harmony import */ var _clone_element__WEBPACK_IMPORTED_MODULE_3__ =
3523
+ __webpack_require__(/*! ./clone-element */ './src/clone-element.js');
3524
+ /* harmony import */ var _create_context__WEBPACK_IMPORTED_MODULE_4__ =
3525
+ __webpack_require__(/*! ./create-context */ './src/create-context.js');
3526
+ /* harmony import */ var _diff_children__WEBPACK_IMPORTED_MODULE_5__ =
3527
+ __webpack_require__(/*! ./diff/children */ './src/diff/children.js');
3528
+ /* harmony import */ var _options__WEBPACK_IMPORTED_MODULE_6__ =
3529
+ __webpack_require__(/*! ./options */ './src/options.js');
3530
+
3531
+ /***/
3532
+ },
3533
+
3534
+ /***/ './src/options.js':
3535
+ /*!************************!*\
3536
+ !*** ./src/options.js ***!
3537
+ \************************/
3538
+ /***/ (
3539
+ __unused_webpack_module,
3540
+ __webpack_exports__,
3541
+ __webpack_require__
3542
+ ) => {
3543
+ __webpack_require__.r(__webpack_exports__);
3544
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3545
+ /* harmony export */ default: () => __WEBPACK_DEFAULT_EXPORT__,
3546
+ /* harmony export */
3547
+ });
3548
+ /* harmony import */ var _diff_catch_error__WEBPACK_IMPORTED_MODULE_0__ =
3549
+ __webpack_require__(
3550
+ /*! ./diff/catch-error */ './src/diff/catch-error.js'
3551
+ );
3552
+
3553
+ /**
3554
+ * The `option` object can potentially contain callback functions
3555
+ * that are called during various stages of our renderer. This is the
3556
+ * foundation on which all our addons like `preact/debug`, `preact/compat`,
3557
+ * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`
3558
+ * for a full list of available option hooks (most editors/IDEs allow you to
3559
+ * ctrl+click or cmd+click on mac the type definition below).
3560
+ * @type {import('./types/internal').Options}
3561
+ */
3562
+ var options = {
3563
+ __e: _diff_catch_error__WEBPACK_IMPORTED_MODULE_0__._catchError,
3564
+ };
3565
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = options;
3566
+
3567
+ /***/
3568
+ },
3569
+
3570
+ /***/ './src/render.js':
3571
+ /*!***********************!*\
3572
+ !*** ./src/render.js ***!
3573
+ \***********************/
3574
+ /***/ (
3575
+ __unused_webpack_module,
3576
+ __webpack_exports__,
3577
+ __webpack_require__
3578
+ ) => {
3579
+ __webpack_require__.r(__webpack_exports__);
3580
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3581
+ /* harmony export */ hydrate: () => /* binding */ hydrate,
3582
+ /* harmony export */ render: () => /* binding */ render,
3583
+ /* harmony export */
3584
+ });
3585
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ =
3586
+ __webpack_require__(/*! ./constants */ './src/constants.js');
3587
+ /* harmony import */ var _diff_index__WEBPACK_IMPORTED_MODULE_1__ =
3588
+ __webpack_require__(/*! ./diff/index */ './src/diff/index.js');
3589
+ /* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_2__ =
3590
+ __webpack_require__(/*! ./create-element */ './src/create-element.js');
3591
+ /* harmony import */ var _options__WEBPACK_IMPORTED_MODULE_3__ =
3592
+ __webpack_require__(/*! ./options */ './src/options.js');
3593
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ =
3594
+ __webpack_require__(/*! ./util */ './src/util.js');
3595
+
3596
+ /**
3597
+ * Render a Preact virtual node into a DOM element
3598
+ * @param {import('./types/internal').ComponentChild} vnode The virtual node to render
3599
+ * @param {import('./types/internal').PreactElement} parentDom The DOM element to
3600
+ * render into
3601
+ * @param {import('./types/internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an
3602
+ * existing DOM tree rooted at `replaceNode`
3603
+ */
3604
+ function render(vnode, parentDom, replaceNode) {
3605
+ if (_options__WEBPACK_IMPORTED_MODULE_3__['default'].__)
3606
+ _options__WEBPACK_IMPORTED_MODULE_3__['default'].__(vnode, parentDom);
3607
+
3608
+ // We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in
3609
+ // hydration mode or not by passing the `hydrate` function instead of a DOM
3610
+ // element..
3611
+ var isHydrating = typeof replaceNode === 'function';
3612
+
3613
+ // To be able to support calling `render()` multiple times on the same
3614
+ // DOM node, we need to obtain a reference to the previous tree. We do
3615
+ // this by assigning a new `_children` property to DOM nodes which points
3616
+ // to the last rendered tree. By default this property is not present, which
3617
+ // means that we are mounting a new tree for the first time.
3618
+ var oldVNode = isHydrating
3619
+ ? null
3620
+ : (replaceNode && replaceNode.__k) || parentDom.__k;
3621
+ vnode = ((!isHydrating && replaceNode) || parentDom).__k = (0,
3622
+ _create_element__WEBPACK_IMPORTED_MODULE_2__.createElement)(
3623
+ _create_element__WEBPACK_IMPORTED_MODULE_2__.Fragment,
3624
+ null,
3625
+ [vnode]
3626
+ );
3627
+
3628
+ // List of effects that need to be called after diffing.
3629
+ var commitQueue = [];
3630
+ vnode.props.id = 'proot';
3631
+ (0, _util__WEBPACK_IMPORTED_MODULE_4__.makeTaskQueue)(commitQueue);
3632
+ commitQueue.task.pushChild('pre', function () {
3633
+ (0, _diff_index__WEBPACK_IMPORTED_MODULE_1__.diff)(
3634
+ parentDom,
3635
+ // Determine the new vnode tree and store it on the DOM element on
3636
+ // our custom `_children` property.
3637
+ vnode,
3638
+ oldVNode || _constants__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ,
3639
+ _constants__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ,
3640
+ parentDom.ownerSVGElement !== undefined,
3641
+ !isHydrating && replaceNode
3642
+ ? [replaceNode]
3643
+ : oldVNode
3644
+ ? null
3645
+ : parentDom.firstChild
3646
+ ? _util__WEBPACK_IMPORTED_MODULE_4__.slice.call(
3647
+ parentDom.childNodes
3648
+ )
3649
+ : null,
3650
+ commitQueue,
3651
+ !isHydrating && replaceNode
3652
+ ? replaceNode
3653
+ : oldVNode
3654
+ ? oldVNode.__e
3655
+ : parentDom.firstChild,
3656
+ isHydrating
3657
+ );
3658
+ });
3659
+ commitQueue.task.run();
3660
+
3661
+ // Flush all queued effects
3662
+ (0, _diff_index__WEBPACK_IMPORTED_MODULE_1__.commitRoot)(
3663
+ commitQueue,
3664
+ vnode
3665
+ );
3666
+ return commitQueue;
3667
+ }
3668
+
3669
+ /**
3670
+ * Update an existing DOM element with data from a Preact virtual node
3671
+ * @param {import('./types/internal').ComponentChild} vnode The virtual node to render
3672
+ * @param {import('./types/internal').PreactElement} parentDom The DOM element to
3673
+ * updateimport logger from '../demo/logger';
3674
+
3675
+ */
3676
+ function hydrate(vnode, parentDom) {
3677
+ render(vnode, parentDom, hydrate);
3678
+ }
3679
+
3680
+ /***/
3681
+ },
3682
+
3683
+ /***/ './src/util.js':
3684
+ /*!*********************!*\
3685
+ !*** ./src/util.js ***!
3686
+ \*********************/
3687
+ /***/ (
3688
+ __unused_webpack_module,
3689
+ __webpack_exports__,
3690
+ __webpack_require__
3691
+ ) => {
3692
+ __webpack_require__.r(__webpack_exports__);
3693
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3694
+ /* harmony export */ assign: () => /* binding */ assign,
3695
+ /* harmony export */ makeTaskQueue: () => /* binding */ makeTaskQueue,
3696
+ /* harmony export */ removeNode: () => /* binding */ removeNode,
3697
+ /* harmony export */ slice: () => /* binding */ slice,
3698
+ /* harmony export */ vnName: () => /* binding */ vnName,
3699
+ /* harmony export */
3700
+ });
3701
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ =
3702
+ __webpack_require__(/*! ./constants */ './src/constants.js');
3703
+
3704
+ /**
3705
+ * Assign properties from `props` to `obj`
3706
+ * @template O, P The obj and props types
3707
+ * @param {O} obj The object to copy properties to
3708
+ * @param {P} props The object to copy properties from
3709
+ * @returns {O & P}
3710
+ */
3711
+ function assign(obj, props) {
3712
+ // @ts-ignore We change the type of `obj` to be `O & P`
3713
+ for (var i in props) {
3714
+ obj[i] = props[i];
3715
+ }
3716
+ return /** @type {O & P} */ obj;
3717
+ }
3718
+
3719
+ /**
3720
+ * Remove a child node from its parent if attached. This is a workaround for
3721
+ * IE11 which doesn't support `Element.prototype.remove()`. Using this function
3722
+ * is smaller than including a dedicated polyfill.
3723
+ * @param {Node} node The node to remove
3724
+ */
3725
+ function removeNode(node) {
3726
+ var parentNode = node.parentNode;
3727
+ if (parentNode) parentNode.removeChild(node);
3728
+ }
3729
+ var slice = _constants__WEBPACK_IMPORTED_MODULE_0__.EMPTY_ARR.slice;
3730
+ function makeTaskQueue(que) {
3731
+ que.task = {};
3732
+ que.task.pushChild = function (where, f) {
3733
+ if (!que.cur) {
3734
+ que.cur = {
3735
+ children: [],
3736
+ task: f,
3737
+ };
3738
+ que.root = que.cur;
3739
+ }
3740
+ else {
3741
+ que.cur.children.push({
3742
+ children: [],
3743
+ task: f,
3744
+ parent: que.cur,
3745
+ });
3746
+ }
3747
+ };
3748
+ que.task.run = function () {
3749
+ var maxStep = 1000;
3750
+ while (que.cur) {
3751
+ var _que$cur = que.cur,
3752
+ cpos = _que$cur.cpos,
3753
+ children = _que$cur.children,
3754
+ task = _que$cur.task,
3755
+ parent = _que$cur.parent;
3756
+ // console.log('ctask',i);
3757
+
3758
+ if (!cpos) {
3759
+ if (task) {
3760
+ que.cur.ret = task();
3761
+ }
3762
+ cpos = 0;
3763
+ }
3764
+ if (cpos < children.length) {
3765
+ var next = children[cpos];
3766
+ que.cur.cpos = cpos + 1;
3767
+ que.cur = next;
3768
+ }
3769
+ else if (parent) {
3770
+ que.lastRet = que.cur.ret;
3771
+ que.cur = parent;
3772
+ }
3773
+ else {
3774
+ break;
3775
+ }
3776
+
3777
+ // if(--maxStep < 0)break;
3778
+ }
3779
+ };
3780
+ }
3781
+
3782
+ function vnName(vnode, noDepth) {
3783
+ var _vnode$props;
3784
+ var name = vnode.type;
3785
+ if (typeof name == 'function') {
3786
+ name = name.name;
3787
+ }
3788
+ if (
3789
+ (_vnode$props = vnode.props) !== null &&
3790
+ _vnode$props !== void 0 &&
3791
+ _vnode$props.id
3792
+ )
3793
+ name += '#' + vnode.props.id;
3794
+ if (name == null) name = '#text<'.concat(vnode.props, '>');
3795
+ if (!noDepth) {
3796
+ var dp = ' '.repeat(vnode.__b);
3797
+ name = dp + name;
3798
+ }
3799
+ return name;
3800
+ }
3801
+
3802
+ /***/
3803
+ },
3804
+
3805
+ /******/
3806
+ };
3807
+ /************************************************************************/
3808
+ /******/ // The module cache
3809
+ /******/ var __webpack_module_cache__ = {};
3810
+ /******/
3811
+ /******/ // The require function
3812
+ /******/ function __webpack_require__(moduleId) {
3813
+ /******/ // Check if module is in cache
3814
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
3815
+ /******/ if (cachedModule !== undefined) {
3816
+ /******/ return cachedModule.exports;
3817
+ /******/
3818
+ }
3819
+ /******/ // Create a new module (and put it into the cache)
3820
+ /******/ var module = (__webpack_module_cache__[moduleId] = {
3821
+ /******/ // no module.id needed
3822
+ /******/ // no module.loaded needed
3823
+ /******/ exports: {},
3824
+ /******/
3825
+ });
3826
+ /******/
3827
+ /******/ // Execute the module function
3828
+ /******/ __webpack_modules__[moduleId](
3829
+ module,
3830
+ module.exports,
3831
+ __webpack_require__
3832
+ );
3833
+ /******/
3834
+ /******/ // Return the exports of the module
3835
+ /******/ return module.exports;
3836
+ /******/
3837
+ }
3838
+ /******/
3839
+ /************************************************************************/
3840
+ /******/ /* webpack/runtime/define property getters */
3841
+ /******/ (() => {
3842
+ /******/ // define getter functions for harmony exports
3843
+ /******/ __webpack_require__.d = (exports, definition) => {
3844
+ /******/ for (var key in definition) {
3845
+ /******/ if (
3846
+ __webpack_require__.o(definition, key) &&
3847
+ !__webpack_require__.o(exports, key)
3848
+ ) {
3849
+ /******/ Object.defineProperty(exports, key, {
3850
+ enumerable: true,
3851
+ get: definition[key],
3852
+ });
3853
+ /******/
3854
+ }
3855
+ /******/
3856
+ }
3857
+ /******/
3858
+ };
3859
+ /******/
3860
+ })();
3861
+ /******/
3862
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
3863
+ /******/ (() => {
3864
+ /******/ __webpack_require__.o = (obj, prop) =>
3865
+ Object.prototype.hasOwnProperty.call(obj, prop);
3866
+ /******/
3867
+ })();
3868
+ /******/
3869
+ /******/ /* webpack/runtime/make namespace object */
3870
+ /******/ (() => {
3871
+ /******/ // define __esModule on exports
3872
+ /******/ __webpack_require__.r = (exports) => {
3873
+ /******/ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
3874
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, {
3875
+ value: 'Module',
3876
+ });
3877
+ /******/
3878
+ }
3879
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
3880
+ /******/
3881
+ };
3882
+ /******/
3883
+ })();
3884
+ /******/
3885
+ /************************************************************************/
3886
+ var __webpack_exports__ = {};
3887
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
3888
+ (() => {
3889
+ /*!*****************************!*\
3890
+ !*** ./compat/src/index.js ***!
3891
+ \*****************************/
3892
+ __webpack_require__.r(__webpack_exports__);
3893
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3894
+ /* harmony export */ Children: () =>
3895
+ /* reexport safe */ _Children__WEBPACK_IMPORTED_MODULE_5__.Children,
3896
+ /* harmony export */ Component: () =>
3897
+ /* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.Component,
3898
+ /* harmony export */ Fragment: () =>
3899
+ /* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.Fragment,
3900
+ /* harmony export */ PureComponent: () =>
3901
+ /* reexport safe */ _PureComponent__WEBPACK_IMPORTED_MODULE_2__.PureComponent,
3902
+ /* harmony export */ StrictMode: () => /* binding */ StrictMode,
3903
+ /* harmony export */ Suspense: () =>
3904
+ /* reexport safe */ _suspense__WEBPACK_IMPORTED_MODULE_6__.Suspense,
3905
+ /* harmony export */ SuspenseList: () =>
3906
+ /* reexport safe */ _suspense_list__WEBPACK_IMPORTED_MODULE_7__.SuspenseList,
3907
+ /* harmony export */ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:
3908
+ () =>
3909
+ /* reexport safe */ _render__WEBPACK_IMPORTED_MODULE_10__.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
3910
+ /* harmony export */ cloneElement: () => /* binding */ cloneElement,
3911
+ /* harmony export */ createContext: () =>
3912
+ /* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.createContext,
3913
+ /* harmony export */ createElement: () =>
3914
+ /* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.createElement,
3915
+ /* harmony export */ createFactory: () => /* binding */ createFactory,
3916
+ /* harmony export */ createPortal: () =>
3917
+ /* reexport safe */ _portals__WEBPACK_IMPORTED_MODULE_8__.createPortal,
3918
+ /* harmony export */ createRef: () =>
3919
+ /* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.createRef,
3920
+ /* harmony export */ default: () => __WEBPACK_DEFAULT_EXPORT__,
3921
+ /* harmony export */ findDOMNode: () => /* binding */ findDOMNode,
3922
+ /* harmony export */ flushSync: () => /* binding */ flushSync,
3923
+ /* harmony export */ forwardRef: () =>
3924
+ /* reexport safe */ _forwardRef__WEBPACK_IMPORTED_MODULE_4__.forwardRef,
3925
+ /* harmony export */ hydrate: () =>
3926
+ /* reexport safe */ _render__WEBPACK_IMPORTED_MODULE_10__.hydrate,
3927
+ /* harmony export */ isValidElement: () => /* binding */ isValidElement,
3928
+ /* harmony export */ lazy: () =>
3929
+ /* reexport safe */ _suspense__WEBPACK_IMPORTED_MODULE_6__.lazy,
3930
+ /* harmony export */ memo: () =>
3931
+ /* reexport safe */ _memo__WEBPACK_IMPORTED_MODULE_3__.memo,
3932
+ /* harmony export */ options: () =>
3933
+ /* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.options,
3934
+ /* harmony export */ render: () =>
3935
+ /* reexport safe */ _render__WEBPACK_IMPORTED_MODULE_10__.render,
3936
+ /* harmony export */ startTransition: () => /* binding */ startTransition,
3937
+ /* harmony export */ toChildArray: () =>
3938
+ /* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray,
3939
+ /* harmony export */ unmountComponentAtNode: () =>
3940
+ /* binding */ unmountComponentAtNode,
3941
+ /* harmony export */ unstable_batchedUpdates: () =>
3942
+ /* binding */ unstable_batchedUpdates,
3943
+ /* harmony export */ useCallback: () =>
3944
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useCallback,
3945
+ /* harmony export */ useContext: () =>
3946
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useContext,
3947
+ /* harmony export */ useDebugValue: () =>
3948
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useDebugValue,
3949
+ /* harmony export */ useDeferredValue: () => /* binding */ useDeferredValue,
3950
+ /* harmony export */ useEffect: () =>
3951
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useEffect,
3952
+ /* harmony export */ useErrorBoundary: () =>
3953
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useErrorBoundary,
3954
+ /* harmony export */ useId: () =>
3955
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useId,
3956
+ /* harmony export */ useImperativeHandle: () =>
3957
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle,
3958
+ /* harmony export */ useInsertionEffect: () =>
3959
+ /* binding */ useInsertionEffect,
3960
+ /* harmony export */ useLayoutEffect: () =>
3961
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect,
3962
+ /* harmony export */ useMemo: () =>
3963
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useMemo,
3964
+ /* harmony export */ useReducer: () =>
3965
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useReducer,
3966
+ /* harmony export */ useRef: () =>
3967
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useRef,
3968
+ /* harmony export */ useState: () =>
3969
+ /* reexport safe */ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState,
3970
+ /* harmony export */ useSyncExternalStore: () =>
3971
+ /* binding */ useSyncExternalStore,
3972
+ /* harmony export */ useTransition: () => /* binding */ useTransition,
3973
+ /* harmony export */ version: () => /* binding */ version,
3974
+ /* harmony export */
3975
+ });
3976
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ =
3977
+ __webpack_require__(/*! preact */ './src/index.js');
3978
+ /* harmony import */ var preact_hooks__WEBPACK_IMPORTED_MODULE_1__ =
3979
+ __webpack_require__(/*! preact/hooks */ './hooks/src/index.js');
3980
+ /* harmony import */ var _PureComponent__WEBPACK_IMPORTED_MODULE_2__ =
3981
+ __webpack_require__(/*! ./PureComponent */ './compat/src/PureComponent.js');
3982
+ /* harmony import */ var _memo__WEBPACK_IMPORTED_MODULE_3__ =
3983
+ __webpack_require__(/*! ./memo */ './compat/src/memo.js');
3984
+ /* harmony import */ var _forwardRef__WEBPACK_IMPORTED_MODULE_4__ =
3985
+ __webpack_require__(/*! ./forwardRef */ './compat/src/forwardRef.js');
3986
+ /* harmony import */ var _Children__WEBPACK_IMPORTED_MODULE_5__ =
3987
+ __webpack_require__(/*! ./Children */ './compat/src/Children.js');
3988
+ /* harmony import */ var _suspense__WEBPACK_IMPORTED_MODULE_6__ =
3989
+ __webpack_require__(/*! ./suspense */ './compat/src/suspense.js');
3990
+ /* harmony import */ var _suspense_list__WEBPACK_IMPORTED_MODULE_7__ =
3991
+ __webpack_require__(/*! ./suspense-list */ './compat/src/suspense-list.js');
3992
+ /* harmony import */ var _portals__WEBPACK_IMPORTED_MODULE_8__ =
3993
+ __webpack_require__(/*! ./portals */ './compat/src/portals.js');
3994
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ =
3995
+ __webpack_require__(/*! ./util */ './compat/src/util.js');
3996
+ /* harmony import */ var _render__WEBPACK_IMPORTED_MODULE_10__ =
3997
+ __webpack_require__(/*! ./render */ './compat/src/render.js');
3998
+ function _slicedToArray(arr, i) {
3999
+ return (
4000
+ _arrayWithHoles(arr) ||
4001
+ _iterableToArrayLimit(arr, i) ||
4002
+ _unsupportedIterableToArray(arr, i) ||
4003
+ _nonIterableRest()
4004
+ );
4005
+ }
4006
+ function _nonIterableRest() {
4007
+ throw new TypeError(
4008
+ 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
4009
+ );
4010
+ }
4011
+ function _unsupportedIterableToArray(o, minLen) {
4012
+ if (!o) return;
4013
+ if (typeof o === 'string') return _arrayLikeToArray(o, minLen);
4014
+ var n = Object.prototype.toString.call(o).slice(8, -1);
4015
+ if (n === 'Object' && o.constructor) n = o.constructor.name;
4016
+ if (n === 'Map' || n === 'Set') return Array.from(o);
4017
+ if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
4018
+ return _arrayLikeToArray(o, minLen);
4019
+ }
4020
+ function _arrayLikeToArray(arr, len) {
4021
+ if (len == null || len > arr.length) len = arr.length;
4022
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
4023
+ arr2[i] = arr[i];
4024
+ }
4025
+ return arr2;
4026
+ }
4027
+ function _iterableToArrayLimit(arr, i) {
4028
+ var _i =
4029
+ arr == null
4030
+ ? null
4031
+ : (typeof Symbol !== 'undefined' && arr[Symbol.iterator]) ||
4032
+ arr['@@iterator'];
4033
+ if (_i == null) return;
4034
+ var _arr = [];
4035
+ var _n = true;
4036
+ var _d = false;
4037
+ var _s, _e;
4038
+ try {
4039
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
4040
+ _arr.push(_s.value);
4041
+ if (i && _arr.length === i) break;
4042
+ }
4043
+ }
4044
+ catch (err) {
4045
+ _d = true;
4046
+ _e = err;
4047
+ }
4048
+ finally {
4049
+ try {
4050
+ if (!_n && _i['return'] != null) _i['return']();
4051
+ }
4052
+ finally {
4053
+ if (_d) throw _e;
4054
+ }
4055
+ }
4056
+ return _arr;
4057
+ }
4058
+ function _arrayWithHoles(arr) {
4059
+ if (Array.isArray(arr)) return arr;
4060
+ }
4061
+
4062
+ var version = '17.0.2'; // trick libraries to think we are react
4063
+
4064
+ /**
4065
+ * Legacy version of createElement.
4066
+ * @param {import('./types/internal').VNode["type"]} type The node name or Component constructor
4067
+ */
4068
+ function createFactory(type) {
4069
+ return preact__WEBPACK_IMPORTED_MODULE_0__.createElement.bind(null, type);
4070
+ }
4071
+
4072
+ /**
4073
+ * Check if the passed element is a valid (p)react node.
4074
+ * @param {*} element The element to check
4075
+ * @returns {boolean}
4076
+ */
4077
+ function isValidElement(element) {
4078
+ return (
4079
+ !!element &&
4080
+ element.$$typeof ===
4081
+ _render__WEBPACK_IMPORTED_MODULE_10__.REACT_ELEMENT_TYPE
4082
+ );
4083
+ }
4084
+
4085
+ /**
4086
+ * Wrap `cloneElement` to abort if the passed element is not a valid element and apply
4087
+ * all vnode normalizations.
4088
+ * @param {import('./types/internal').VNode} element The vnode to clone
4089
+ * @param {object} props Props to add when cloning
4090
+ * @param {Array<import('./types/internal').ComponentChildren>} rest Optional component children
4091
+ */
4092
+ function cloneElement(element) {
4093
+ if (!isValidElement(element)) return element;
4094
+ return preact__WEBPACK_IMPORTED_MODULE_0__.cloneElement.apply(
4095
+ null,
4096
+ arguments
4097
+ );
4098
+ }
4099
+
4100
+ /**
4101
+ * Remove a component tree from the DOM, including state and event handlers.
4102
+ * @param {import('./types/internal').PreactElement} container
4103
+ * @returns {boolean}
4104
+ */
4105
+ function unmountComponentAtNode(container) {
4106
+ if (container.__k) {
4107
+ (0, preact__WEBPACK_IMPORTED_MODULE_0__.render)(null, container);
4108
+ return true;
4109
+ }
4110
+ return false;
4111
+ }
4112
+
4113
+ /**
4114
+ * Get the matching DOM node for a component
4115
+ * @param {import('./types/internal').Component} component
4116
+ * @returns {import('./types/internal').PreactElement | null}
4117
+ */
4118
+
4119
+ function findDOMNode(component) {
4120
+ return (
4121
+ (component &&
4122
+ (component.base || (component.nodeType === 1 && component))) ||
4123
+ null
4124
+ );
4125
+ }
4126
+
4127
+ /**
4128
+ * Deprecated way to control batched rendering inside the reconciler, but we
4129
+ * already schedule in batches inside our rendering code
4130
+ * @template Arg
4131
+ * @param {(arg: Arg) => void} callback function that triggers the updated
4132
+ * @param {Arg} [arg] Optional argument that can be passed to the callback
4133
+ */
4134
+ // eslint-disable-next-line camelcase
4135
+ var unstable_batchedUpdates = function unstable_batchedUpdates(
4136
+ callback,
4137
+ arg
4138
+ ) {
4139
+ return callback(arg);
4140
+ };
4141
+
4142
+ /**
4143
+ * In React, `flushSync` flushes the entire tree and forces a rerender. It's
4144
+ * implmented here as a no-op.
4145
+ * @template Arg
4146
+ * @template Result
4147
+ * @param {(arg: Arg) => Result} callback function that runs before the flush
4148
+ * @param {Arg} [arg] Optional arugment that can be passed to the callback
4149
+ * @returns
4150
+ */
4151
+ var flushSync = function flushSync(callback, arg) {
4152
+ return callback(arg);
4153
+ };
4154
+
4155
+ /**
4156
+ * Strict Mode is not implemented in Preact, so we provide a stand-in for it
4157
+ * that just renders its children without imposing any restrictions.
4158
+ */
4159
+ var StrictMode = preact__WEBPACK_IMPORTED_MODULE_0__.Fragment;
4160
+ function startTransition(cb) {
4161
+ cb();
4162
+ }
4163
+ function useDeferredValue(val) {
4164
+ return val;
4165
+ }
4166
+ function useTransition() {
4167
+ return [false, startTransition];
4168
+ }
4169
+
4170
+ // TODO: in theory this should be done after a VNode is diffed as we want to insert
4171
+ // styles/... before it attaches
4172
+ var useInsertionEffect =
4173
+ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect;
4174
+
4175
+ /**
4176
+ * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84
4177
+ * on a high level this cuts out the warnings, ... and attempts a smaller implementation
4178
+ */
4179
+ function useSyncExternalStore(subscribe, getSnapshot) {
4180
+ var value = getSnapshot();
4181
+ var _useState = (0, preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)({
4182
+ _instance: {
4183
+ __: value,
4184
+ _getSnapshot: getSnapshot,
4185
+ },
4186
+ }),
4187
+ _useState2 = _slicedToArray(_useState, 2),
4188
+ _instance = _useState2[0]._instance,
4189
+ forceUpdate = _useState2[1];
4190
+ (0, preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(
4191
+ function () {
4192
+ _instance.__ = value;
4193
+ _instance._getSnapshot = getSnapshot;
4194
+ if (
4195
+ !(0, _util__WEBPACK_IMPORTED_MODULE_9__.is)(
4196
+ _instance.__,
4197
+ getSnapshot()
4198
+ )
4199
+ ) {
4200
+ forceUpdate({
4201
+ _instance: _instance,
4202
+ });
4203
+ }
4204
+ },
4205
+ [subscribe, value, getSnapshot]
4206
+ );
4207
+ (0, preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useEffect)(
4208
+ function () {
4209
+ if (
4210
+ !(0, _util__WEBPACK_IMPORTED_MODULE_9__.is)(
4211
+ _instance.__,
4212
+ _instance._getSnapshot()
4213
+ )
4214
+ ) {
4215
+ forceUpdate({
4216
+ _instance: _instance,
4217
+ });
4218
+ }
4219
+ return subscribe(function () {
4220
+ if (
4221
+ !(0, _util__WEBPACK_IMPORTED_MODULE_9__.is)(
4222
+ _instance.__,
4223
+ _instance._getSnapshot()
4224
+ )
4225
+ ) {
4226
+ forceUpdate({
4227
+ _instance: _instance,
4228
+ });
4229
+ }
4230
+ });
4231
+ },
4232
+ [subscribe]
4233
+ );
4234
+ return value;
4235
+ }
4236
+
4237
+ // React copies the named exports to the default one.
4238
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = {
4239
+ useState: preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState,
4240
+ useId: preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useId,
4241
+ useReducer: preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useReducer,
4242
+ useEffect: preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useEffect,
4243
+ useLayoutEffect: preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect,
4244
+ useInsertionEffect: useInsertionEffect,
4245
+ useTransition: useTransition,
4246
+ useDeferredValue: useDeferredValue,
4247
+ useSyncExternalStore: useSyncExternalStore,
4248
+ startTransition: startTransition,
4249
+ useRef: preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useRef,
4250
+ useImperativeHandle:
4251
+ preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle,
4252
+ useMemo: preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useMemo,
4253
+ useCallback: preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useCallback,
4254
+ useContext: preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useContext,
4255
+ useDebugValue: preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useDebugValue,
4256
+ version: version,
4257
+ Children: _Children__WEBPACK_IMPORTED_MODULE_5__.Children,
4258
+ render: _render__WEBPACK_IMPORTED_MODULE_10__.render,
4259
+ hydrate: _render__WEBPACK_IMPORTED_MODULE_10__.hydrate,
4260
+ unmountComponentAtNode: unmountComponentAtNode,
4261
+ createPortal: _portals__WEBPACK_IMPORTED_MODULE_8__.createPortal,
4262
+ createElement: preact__WEBPACK_IMPORTED_MODULE_0__.createElement,
4263
+ createContext: preact__WEBPACK_IMPORTED_MODULE_0__.createContext,
4264
+ createFactory: createFactory,
4265
+ cloneElement: cloneElement,
4266
+ createRef: preact__WEBPACK_IMPORTED_MODULE_0__.createRef,
4267
+ Fragment: preact__WEBPACK_IMPORTED_MODULE_0__.Fragment,
4268
+ isValidElement: isValidElement,
4269
+ findDOMNode: findDOMNode,
4270
+ Component: preact__WEBPACK_IMPORTED_MODULE_0__.Component,
4271
+ PureComponent: _PureComponent__WEBPACK_IMPORTED_MODULE_2__.PureComponent,
4272
+ memo: _memo__WEBPACK_IMPORTED_MODULE_3__.memo,
4273
+ forwardRef: _forwardRef__WEBPACK_IMPORTED_MODULE_4__.forwardRef,
4274
+ flushSync: flushSync,
4275
+ unstable_batchedUpdates: unstable_batchedUpdates,
4276
+ StrictMode: StrictMode,
4277
+ Suspense: _suspense__WEBPACK_IMPORTED_MODULE_6__.Suspense,
4278
+ SuspenseList: _suspense_list__WEBPACK_IMPORTED_MODULE_7__.SuspenseList,
4279
+ lazy: _suspense__WEBPACK_IMPORTED_MODULE_6__.lazy,
4280
+ toChildArray: preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray,
4281
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:
4282
+ _render__WEBPACK_IMPORTED_MODULE_10__.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
4283
+ };
4284
+ })();
4285
+
4286
+ var __webpack_exports__Children = __webpack_exports__.Children;
4287
+ var __webpack_exports__Component = __webpack_exports__.Component;
4288
+ var __webpack_exports__Fragment = __webpack_exports__.Fragment;
4289
+ var __webpack_exports__PureComponent = __webpack_exports__.PureComponent;
4290
+ var __webpack_exports__StrictMode = __webpack_exports__.StrictMode;
4291
+ var __webpack_exports__Suspense = __webpack_exports__.Suspense;
4292
+ var __webpack_exports__SuspenseList = __webpack_exports__.SuspenseList;
4293
+ var __webpack_exports___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
4294
+ __webpack_exports__.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
4295
+ var __webpack_exports__cloneElement = __webpack_exports__.cloneElement;
4296
+ var __webpack_exports__createContext = __webpack_exports__.createContext;
4297
+ var __webpack_exports__createElement = __webpack_exports__.createElement;
4298
+ var __webpack_exports__createFactory = __webpack_exports__.createFactory;
4299
+ var __webpack_exports__createPortal = __webpack_exports__.createPortal;
4300
+ var __webpack_exports__createRef = __webpack_exports__.createRef;
4301
+ var __webpack_exports__default = __webpack_exports__['default'];
4302
+ var __webpack_exports__findDOMNode = __webpack_exports__.findDOMNode;
4303
+ var __webpack_exports__flushSync = __webpack_exports__.flushSync;
4304
+ var __webpack_exports__forwardRef = __webpack_exports__.forwardRef;
4305
+ var __webpack_exports__hydrate = __webpack_exports__.hydrate;
4306
+ var __webpack_exports__isValidElement = __webpack_exports__.isValidElement;
4307
+ var __webpack_exports__lazy = __webpack_exports__.lazy;
4308
+ var __webpack_exports__memo = __webpack_exports__.memo;
4309
+ var __webpack_exports__options = __webpack_exports__.options;
4310
+ var __webpack_exports__render = __webpack_exports__.render;
4311
+ var __webpack_exports__startTransition = __webpack_exports__.startTransition;
4312
+ var __webpack_exports__toChildArray = __webpack_exports__.toChildArray;
4313
+ var __webpack_exports__unmountComponentAtNode =
4314
+ __webpack_exports__.unmountComponentAtNode;
4315
+ var __webpack_exports__unstable_batchedUpdates =
4316
+ __webpack_exports__.unstable_batchedUpdates;
4317
+ var __webpack_exports__useCallback = __webpack_exports__.useCallback;
4318
+ var __webpack_exports__useContext = __webpack_exports__.useContext;
4319
+ var __webpack_exports__useDebugValue = __webpack_exports__.useDebugValue;
4320
+ var __webpack_exports__useDeferredValue = __webpack_exports__.useDeferredValue;
4321
+ var __webpack_exports__useEffect = __webpack_exports__.useEffect;
4322
+ var __webpack_exports__useErrorBoundary = __webpack_exports__.useErrorBoundary;
4323
+ var __webpack_exports__useId = __webpack_exports__.useId;
4324
+ var __webpack_exports__useImperativeHandle =
4325
+ __webpack_exports__.useImperativeHandle;
4326
+ var __webpack_exports__useInsertionEffect =
4327
+ __webpack_exports__.useInsertionEffect;
4328
+ var __webpack_exports__useLayoutEffect = __webpack_exports__.useLayoutEffect;
4329
+ var __webpack_exports__useMemo = __webpack_exports__.useMemo;
4330
+ var __webpack_exports__useReducer = __webpack_exports__.useReducer;
4331
+ var __webpack_exports__useRef = __webpack_exports__.useRef;
4332
+ var __webpack_exports__useState = __webpack_exports__.useState;
4333
+ var __webpack_exports__useSyncExternalStore =
4334
+ __webpack_exports__.useSyncExternalStore;
4335
+ var __webpack_exports__useTransition = __webpack_exports__.useTransition;
4336
+ var __webpack_exports__version = __webpack_exports__.version;
4337
+ export {
4338
+ __webpack_exports__Children as Children,
4339
+ __webpack_exports__Component as Component,
4340
+ __webpack_exports__Fragment as Fragment,
4341
+ __webpack_exports__PureComponent as PureComponent,
4342
+ __webpack_exports__StrictMode as StrictMode,
4343
+ __webpack_exports__Suspense as Suspense,
4344
+ __webpack_exports__SuspenseList as SuspenseList,
4345
+ __webpack_exports___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
4346
+ __webpack_exports__cloneElement as cloneElement,
4347
+ __webpack_exports__createContext as createContext,
4348
+ __webpack_exports__createElement as createElement,
4349
+ __webpack_exports__createFactory as createFactory,
4350
+ __webpack_exports__createPortal as createPortal,
4351
+ __webpack_exports__createRef as createRef,
4352
+ __webpack_exports__default as default,
4353
+ __webpack_exports__findDOMNode as findDOMNode,
4354
+ __webpack_exports__flushSync as flushSync,
4355
+ __webpack_exports__forwardRef as forwardRef,
4356
+ __webpack_exports__hydrate as hydrate,
4357
+ __webpack_exports__isValidElement as isValidElement,
4358
+ __webpack_exports__lazy as lazy,
4359
+ __webpack_exports__memo as memo,
4360
+ __webpack_exports__options as options,
4361
+ __webpack_exports__render as render,
4362
+ __webpack_exports__startTransition as startTransition,
4363
+ __webpack_exports__toChildArray as toChildArray,
4364
+ __webpack_exports__unmountComponentAtNode as unmountComponentAtNode,
4365
+ __webpack_exports__unstable_batchedUpdates as unstable_batchedUpdates,
4366
+ __webpack_exports__useCallback as useCallback,
4367
+ __webpack_exports__useContext as useContext,
4368
+ __webpack_exports__useDebugValue as useDebugValue,
4369
+ __webpack_exports__useDeferredValue as useDeferredValue,
4370
+ __webpack_exports__useEffect as useEffect,
4371
+ __webpack_exports__useErrorBoundary as useErrorBoundary,
4372
+ __webpack_exports__useId as useId,
4373
+ __webpack_exports__useImperativeHandle as useImperativeHandle,
4374
+ __webpack_exports__useInsertionEffect as useInsertionEffect,
4375
+ __webpack_exports__useLayoutEffect as useLayoutEffect,
4376
+ __webpack_exports__useMemo as useMemo,
4377
+ __webpack_exports__useReducer as useReducer,
4378
+ __webpack_exports__useRef as useRef,
4379
+ __webpack_exports__useState as useState,
4380
+ __webpack_exports__useSyncExternalStore as useSyncExternalStore,
4381
+ __webpack_exports__useTransition as useTransition,
4382
+ __webpack_exports__version as version,
4383
+ };
4384
+
4385
+ //# sourceMappingURL=preact.tq.js.map