PageSourceSearch

https://app.screenclip.com/npm.loadable.41247f993a5d4a75a951.js

js screenclip.com collected 2026-09-24 09:06:37 UTC 18,121 bytes, 577 lines download raw bytes

1(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[19],{
2
3/***/ "MKeS":
4/***/ (function(module, __webpack_exports__, __webpack_require__) {
5
6"use strict";
7/* unused harmony export __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED */
8/* unused harmony export lazy */
9/* unused harmony export loadableReady */
10/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("q1tI");
11/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("zLVn");
13/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("wx14");
14/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("JX7q");
15/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("dI71");
16/* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("TOwV");
17/* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_is__WEBPACK_IMPORTED_MODULE_5__);
18/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("2mql");
19/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6__);
20
21
22
23
24
25
26
27
28/* eslint-disable import/prefer-default-export */
29function invariant(condition, message) {
30  if (condition) return;
31  var error = new Error("loadable: " + message);
32  error.framesToPop = 1;
33  error.name = 'Invariant Violation';
34  throw error;
35}
36function warn(message) {
37  // eslint-disable-next-line no-console
38  console.warn("loadable: " + message);
39}
40
41var Context = /*#__PURE__*/
42react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext();
43
44var LOADABLE_REQUIRED_CHUNKS_KEY = '__LOADABLE_REQUIRED_CHUNKS__';
45function getRequiredChunkKey(namespace) {
46  return "" + namespace + LOADABLE_REQUIRED_CHUNKS_KEY;
47}
48
49var sharedInternals = /*#__PURE__*/Object.freeze({
50  __proto__: null,
51  getRequiredChunkKey: getRequiredChunkKey,
52  invariant: invariant,
53  Context: Context
54});
55
56var LOADABLE_SHARED = {
57  initialChunks: {}
58};
59
60var STATUS_PENDING = 'PENDING';
61var STATUS_RESOLVED = 'RESOLVED';
62var STATUS_REJECTED = 'REJECTED';
63
64function resolveConstructor(ctor) {
65  if (typeof ctor === 'function') {
66    return {
67      requireAsync: ctor,
68      resolve: function resolve() {
69        return undefined;
70      },
71      chunkName: function chunkName() {
72        return undefined;
73      }
74    };
75  }
76
77  return ctor;
78}
79
80var withChunkExtractor = function withChunkExtractor(Component) {
81  return function (props) {
82    return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Context.Consumer, null, function (extractor) {
83      return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Component, Object.assign({
84        __chunkExtractor: extractor
85      }, props));
86    });
87  };
88};
89
90var identity = function identity(v) {
91  return v;
92};
93
94function createLoadable(_ref) {
95  var _ref$defaultResolveCo = _ref.defaultResolveComponent,
96      defaultResolveComponent = _ref$defaultResolveCo === void 0 ? identity : _ref$defaultResolveCo,
97      _render = _ref.render,
98      onLoad = _ref.onLoad;
99
100  function loadable(loadableConstructor, options) {
101    if (options === void 0) {
102      options = {};
103    }
104
105    var ctor = resolveConstructor(loadableConstructor);
106    var cache = {};
107    /**
108     * Cachekey represents the component to be loaded
109     * if key changes - component has to be reloaded
110     * @param props
111     * @returns {null|Component}
112     */
113
114    function _getCacheKey(props) {
115      if (options.cacheKey) {
116        return options.cacheKey(props);
117      }
118
119      if (ctor.resolve) {
120        return ctor.resolve(props);
121      }
122
123      return 'static';
124    }
125    /**
126     * Resolves loaded `module` to a specific `Component
127     * @param module
128     * @param props
129     * @param Loadable
130     * @returns Component
131     */
132
133
134    function resolve(module, props, Loadable) {
135      var Component = options.resolveComponent ? options.resolveComponent(module, props) : defaultResolveComponent(module);
136
137      if (options.resolveComponent && !Object(react_is__WEBPACK_IMPORTED_MODULE_5__["isValidElementType"])(Component)) {
138        throw new Error("resolveComponent returned something that is not a React component!");
139      }
140
141      hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6___default()(Loadable, Component, {
142        preload: true
143      });
144      return Component;
145    }
146
147    var InnerLoadable =
148    /*#__PURE__*/
149    function (_React$Component) {
150      Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(InnerLoadable, _React$Component);
151
152      InnerLoadable.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
153        var cacheKey = _getCacheKey(props);
154
155        return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])({}, state, {
156          cacheKey: cacheKey,
157          // change of a key triggers loading state automatically
158          loading: state.loading || state.cacheKey !== cacheKey
159        });
160      };
161
162      function InnerLoadable(props) {
163        var _this;
164
165        _this = _React$Component.call(this, props) || this;
166        _this.state = {
167          result: null,
168          error: null,
169          loading: true,
170          cacheKey: _getCacheKey(props)
171        };
172        invariant(!props.__chunkExtractor || ctor.requireSync, 'SSR requires `@loadable/babel-plugin`, please install it'); // Server-side
173
174        if (props.__chunkExtractor) {
175          // This module has been marked with no SSR
176          if (options.ssr === false) {
177            return Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this);
178          } // We run load function, we assume that it won't fail and that it
179          // triggers a synchronous loading of the module
180
181
182          ctor.requireAsync(props)["catch"](function () {
183            return null;
184          }); // So we can require now the module synchronously
185
186          _this.loadSync();
187
188          props.__chunkExtractor.addChunk(ctor.chunkName(props));
189
190          return Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this);
191        } // Client-side with `isReady` method present (SSR probably)
192        // If module is already loaded, we use a synchronous loading
193        // Only perform this synchronous loading if the component has not
194        // been marked with no SSR, else we risk hydration mismatches
195
196
197        if (options.ssr !== false && ( // is ready - was loaded in this session
198        ctor.isReady && ctor.isReady(props) || // is ready - was loaded during SSR process
199        ctor.chunkName && LOADABLE_SHARED.initialChunks[ctor.chunkName(props)])) {
200          _this.loadSync();
201        }
202
203        return _this;
204      }
205
206      var _proto = InnerLoadable.prototype;
207
208      _proto.componentDidMount = function componentDidMount() {
209        this.mounted = true; // retrieve loading promise from a global cache
210
211        var cachedPromise = this.getCache(); // if promise exists, but rejected - clear cache
212
213        if (cachedPromise && cachedPromise.status === STATUS_REJECTED) {
214          this.setCache();
215        } // component might be resolved synchronously in the constructor
216
217
218        if (this.state.loading) {
219          this.loadAsync();
220        }
221      };
222
223      _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
224        // Component has to be reloaded on cacheKey change
225        if (prevState.cacheKey !== this.state.cacheKey) {
226          this.loadAsync();
227        }
228      };
229
230      _proto.componentWillUnmount = function componentWillUnmount() {
231        this.mounted = false;
232      };
233
234      _proto.safeSetState = function safeSetState(nextState, callback) {
235        if (this.mounted) {
236          this.setState(nextState, callback);
237        }
238      }
239      /**
240       * returns a cache key for the current props
241       * @returns {Component|string}
242       */
243      ;
244
245      _proto.getCacheKey = function getCacheKey() {
246        return _getCacheKey(this.props);
247      }
248      /**
249       * access the persistent cache
250       */
251      ;
252
253      _proto.getCache = function getCache() {
254        return cache[this.getCacheKey()];
255      }
256      /**
257       * sets the cache value. If called without value sets it as undefined
258       */
259      ;
260
261      _proto.setCache = function setCache(value) {
262        if (value === void 0) {
263          value = undefined;
264        }
265
266        cache[this.getCacheKey()] = value;
267      };
268
269      _proto.triggerOnLoad = function triggerOnLoad() {
270        var _this2 = this;
271
272        if (onLoad) {
273          setTimeout(function () {
274            onLoad(_this2.state.result, _this2.props);
275          });
276        }
277      }
278      /**
279       * Synchronously loads component
280       * target module is expected to already exists in the module cache
281       * or be capable to resolve synchronously (webpack target=node)
282       */
283      ;
284
285      _proto.loadSync = function loadSync() {
286        // load sync is expecting component to be in the "loading" state already
287        // sounds weird, but loading=true is the initial state of InnerLoadable
288        if (!this.state.loading) return;
289
290        try {
291          var loadedModule = ctor.requireSync(this.props);
292          var result = resolve(loadedModule, this.props, Loadable);
293          this.state.result = result;
294          this.state.loading = false;
295        } catch (error) {
296          console.error('loadable-components: failed to synchronously load component, which expected to be available', {
297            fileName: ctor.resolve(this.props),
298            chunkName: ctor.chunkName(this.props),
299            error: error ? error.message : error
300          });
301          this.state.error = error;
302        }
303      }
304      /**
305       * Asynchronously loads a component.
306       */
307      ;
308
309      _proto.loadAsync = function loadAsync() {
310        var _this3 = this;
311
312        var promise = this.resolveAsync();
313        promise.then(function (loadedModule) {
314          var result = resolve(loadedModule, _this3.props, {
315            Loadable: Loadable
316          });
317
318          _this3.safeSetState({
319            result: result,
320            loading: false
321          }, function () {
322            return _this3.triggerOnLoad();
323          });
324        })["catch"](function (error) {
325          return _this3.safeSetState({
326            error: error,
327            loading: false
328          });
329        });
330        return promise;
331      }
332      /**
333       * Asynchronously resolves(not loads) a component.
334       * Note - this function does not change the state
335       */
336      ;
337
338      _proto.resolveAsync = function resolveAsync() {
339        var _this4 = this;
340
341        var _this$props = this.props,
342            __chunkExtractor = _this$props.__chunkExtractor,
343            forwardedRef = _this$props.forwardedRef,
344            props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_this$props, ["__chunkExtractor", "forwardedRef"]);
345
346        var promise = this.getCache();
347
348        if (!promise) {
349          promise = ctor.requireAsync(props);
350          promise.status = STATUS_PENDING;
351          this.setCache(promise);
352          promise.then(function () {
353            promise.status = STATUS_RESOLVED;
354          }, function (error) {
355            console.error('loadable-components: failed to asynchronously load component', {
356              fileName: ctor.resolve(_this4.props),
357              chunkName: ctor.chunkName(_this4.props),
358              error: error ? error.message : error
359            });
360            promise.status = STATUS_REJECTED;
361          });
362        }
363
364        return promise;
365      };
366
367      _proto.render = function render() {
368        var _this$props2 = this.props,
369            forwardedRef = _this$props2.forwardedRef,
370            propFallback = _this$props2.fallback,
371            __chunkExtractor = _this$props2.__chunkExtractor,
372            props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_this$props2, ["forwardedRef", "fallback", "__chunkExtractor"]);
373
374        var _this$state = this.state,
375            error = _this$state.error,
376            loading = _this$state.loading,
377            result = _this$state.result;
378
379        if (options.suspense) {
380          var cachedPromise = this.getCache() || this.loadAsync();
381
382          if (cachedPromise.status === STATUS_PENDING) {
383            throw this.loadAsync();
384          }
385        }
386
387        if (error) {
388          throw error;
389        }
390
391        var fallback = propFallback || options.fallback || null;
392
393        if (loading) {
394          return fallback;
395        }
396
397        return _render({
398          fallback: fallback,
399          result: result,
400          options: options,
401          props: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])({}, props, {
402            ref: forwardedRef
403          })
404        });
405      };
406
407      return InnerLoadable;
408    }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
409
410    var EnhancedInnerLoadable = withChunkExtractor(InnerLoadable);
411    var Loadable = react__WEBPACK_IMPORTED_MODULE_0___default.a.forwardRef(function (props, ref) {
412      return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(EnhancedInnerLoadable, Object.assign({
413        forwardedRef: ref
414      }, props));
415    }); // In future, preload could use `<link rel="preload">`
416
417    Loadable.preload = function (props) {
418      ctor.requireAsync(props);
419    };
420
421    Loadable.load = function (props) {
422      return ctor.requireAsync(props);
423    };
424
425    return Loadable;
426  }
427
428  function lazy(ctor, options) {
429    return loadable(ctor, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])({}, options, {
430      suspense: true
431    }));
432  }
433
434  return {
435    loadable: loadable,
436    lazy: lazy
437  };
438}
439
440function defaultResolveComponent(loadedModule) {
441  // eslint-disable-next-line no-underscore-dangle
442  return loadedModule.__esModule ? loadedModule["default"] : loadedModule["default"] || loadedModule;
443}
444
445/* eslint-disable no-use-before-define, react/no-multi-comp */
446
447var _createLoadable =
448/*#__PURE__*/
449createLoadable({
450  defaultResolveComponent: defaultResolveComponent,
451  render: function render(_ref) {
452    var Component = _ref.result,
453        props = _ref.props;
454    return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Component, props);
455  }
456}),
457    loadable = _createLoadable.loadable,
458    lazy = _createLoadable.lazy;
459
460/* eslint-disable no-use-before-define, react/no-multi-comp */
461
462var _createLoadable$1 =
463/*#__PURE__*/
464createLoadable({
465  onLoad: function onLoad(result, props) {
466    if (result && props.forwardedRef) {
467      if (typeof props.forwardedRef === 'function') {
468        props.forwardedRef(result);
469      } else {
470        props.forwardedRef.current = result;
471      }
472    }
473  },
474  render: function render(_ref) {
475    var result = _ref.result,
476        props = _ref.props;
477
478    if (props.children) {
479      return props.children(result);
480    }
481
482    return null;
483  }
484}),
485    loadable$1 = _createLoadable$1.loadable,
486    lazy$1 = _createLoadable$1.lazy;
487
488/* eslint-disable no-underscore-dangle, camelcase */
489var BROWSER = typeof window !== 'undefined';
490function loadableReady(done, _temp) {
491  if (done === void 0) {
492    done = function done() {};
493  }
494
495  var _ref = _temp === void 0 ? {} : _temp,
496      _ref$namespace = _ref.namespace,
497      namespace = _ref$namespace === void 0 ? '' : _ref$namespace;
498
499  if (!BROWSER) {
500    warn('`loadableReady()` must be called in browser only');
501    done();
502    return Promise.resolve();
503  }
504
505  var requiredChunks = null;
506
507  if (BROWSER) {
508    var id = getRequiredChunkKey(namespace);
509    var dataElement = document.getElementById(id);
510
511    if (dataElement) {
512      requiredChunks = JSON.parse(dataElement.textContent);
513      var extElement = document.getElementById(id + "_ext");
514
515      if (extElement) {
516        var _JSON$parse = JSON.parse(extElement.textContent),
517            namedChunks = _JSON$parse.namedChunks;
518
519        namedChunks.forEach(function (chunkName) {
520          LOADABLE_SHARED.initialChunks[chunkName] = true;
521        });
522      } else {
523        // version mismatch
524        throw new Error('loadable-component: @loadable/server does not match @loadable/component');
525      }
526    }
527  }
528
529  if (!requiredChunks) {
530    warn('`loadableReady()` requires state, please use `getScriptTags` or `getScriptElements` server-side');
531    done();
532    return Promise.resolve();
533  }
534
535  var resolved = false;
536  return new Promise(function (resolve) {
537    window.__LOADABLE_LOADED_CHUNKS__ = window.__LOADABLE_LOADED_CHUNKS__ || [];
538    var loadedChunks = window.__LOADABLE_LOADED_CHUNKS__;
539    var originalPush = loadedChunks.push.bind(loadedChunks);
540
541    function checkReadyState() {
542      if (requiredChunks.every(function (chunk) {
543        return loadedChunks.some(function (_ref2) {
544          var chunks = _ref2[0];
545          return chunks.indexOf(chunk) > -1;
546        });
547      })) {
548        if (!resolved) {
549          resolved = true;
550          resolve();
551        }
552      }
553    }
554
555    loadedChunks.push = function () {
556      originalPush.apply(void 0, arguments);
557      checkReadyState();
558    };
559
560    checkReadyState();
561  }).then(done);
562}
563
564/* eslint-disable no-underscore-dangle */
565var loadable$2 = loadable;
566loadable$2.lib = loadable$1;
567var lazy$2 = lazy;
568lazy$2.lib = lazy$1;
569var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = sharedInternals;
570
571/* harmony default export */ __webpack_exports__["a"] = (loadable$2);
572
573
574
575/***/ })
576
577}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.