| 1 |
/******/ (function() { // webpackBootstrap |
| 2 |
/******/ "use strict"; |
| 3 |
/******/ var __webpack_modules__ = ({ |
| 4 |
|
| 5 |
/***/ "react": |
| 6 |
/*!************************!*\ |
| 7 |
!*** external "React" ***! |
| 8 |
\************************/ |
| 9 |
/***/ (function(module) { |
| 10 |
|
| 11 |
module.exports = window["React"]; |
| 12 |
|
| 13 |
/***/ }) |
| 14 |
|
| 15 |
/******/ }); |
| 16 |
/************************************************************************/ |
| 17 |
/******/ // The module cache |
| 18 |
/******/ var __webpack_module_cache__ = {}; |
| 19 |
/******/ |
| 20 |
/******/ // The require function |
| 21 |
/******/ function __webpack_require__(moduleId) { |
| 22 |
/******/ // Check if module is in cache |
| 23 |
/******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| 24 |
/******/ if (cachedModule !== undefined) { |
| 25 |
/******/ return cachedModule.exports; |
| 26 |
/******/ } |
| 27 |
/******/ // Create a new module (and put it into the cache) |
| 28 |
/******/ var module = __webpack_module_cache__[moduleId] = { |
| 29 |
/******/ // no module.id needed |
| 30 |
/******/ // no module.loaded needed |
| 31 |
/******/ exports: {} |
| 32 |
/******/ }; |
| 33 |
/******/ |
| 34 |
/******/ // Execute the module function |
| 35 |
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| 36 |
/******/ |
| 37 |
/******/ // Return the exports of the module |
| 38 |
/******/ return module.exports; |
| 39 |
/******/ } |
| 40 |
/******/ |
| 41 |
/************************************************************************/ |
| 42 |
/******/ /* webpack/runtime/define property getters */ |
| 43 |
/******/ !function() { |
| 44 |
/******/ // define getter functions for harmony exports |
| 45 |
/******/ __webpack_require__.d = function(exports, definition) { |
| 46 |
/******/ for(var key in definition) { |
| 47 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 48 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 49 |
/******/ } |
| 50 |
/******/ } |
| 51 |
/******/ }; |
| 52 |
/******/ }(); |
| 53 |
/******/ |
| 54 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 55 |
/******/ !function() { |
| 56 |
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } |
| 57 |
/******/ }(); |
| 58 |
/******/ |
| 59 |
/******/ /* webpack/runtime/make namespace object */ |
| 60 |
/******/ !function() { |
| 61 |
/******/ // define __esModule on exports |
| 62 |
/******/ __webpack_require__.r = function(exports) { |
| 63 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| 64 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 65 |
/******/ } |
| 66 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 67 |
/******/ }; |
| 68 |
/******/ }(); |
| 69 |
/******/ |
| 70 |
/************************************************************************/ |
| 71 |
var __webpack_exports__ = {}; |
| 72 |
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. |
| 73 |
!function() { |
| 74 |
/*!**********************************************************!*\ |
| 75 |
!*** ./node_modules/@elementor/locations/dist/index.mjs ***! |
| 76 |
\**********************************************************/ |
| 77 |
__webpack_require__.r(__webpack_exports__); |
| 78 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 79 |
/* harmony export */ "createLocation": function() { return /* binding */ createLocation; }, |
| 80 |
/* harmony export */ "flushAllInjections": function() { return /* binding */ flushAllInjections; } |
| 81 |
/* harmony export */ }); |
| 82 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 83 |
// src/locations.tsx |
| 84 |
|
| 85 |
|
| 86 |
// src/components/filler-wrapper.tsx |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
// src/components/error-boundary.tsx |
| 91 |
|
| 92 |
var ErrorBoundary = class extends react__WEBPACK_IMPORTED_MODULE_0__.Component { |
| 93 |
state = { |
| 94 |
hasError: false |
| 95 |
}; |
| 96 |
static getDerivedStateFromError() { |
| 97 |
return { hasError: true }; |
| 98 |
} |
| 99 |
render() { |
| 100 |
if (this.state.hasError) { |
| 101 |
return this.props.fallback; |
| 102 |
} |
| 103 |
return this.props.children; |
| 104 |
} |
| 105 |
}; |
| 106 |
|
| 107 |
// src/components/filler-wrapper.tsx |
| 108 |
function FillerWrapper({ children }) { |
| 109 |
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Suspense, { fallback: null }, children)); |
| 110 |
} |
| 111 |
|
| 112 |
// src/locations.tsx |
| 113 |
|
| 114 |
var DEFAULT_PRIORITY = 10; |
| 115 |
var flushInjectionsFns = []; |
| 116 |
function createLocation() { |
| 117 |
const injections = /* @__PURE__ */ new Map(); |
| 118 |
const getInjections = createGetInjections(injections); |
| 119 |
const useInjections = createUseInjections(getInjections); |
| 120 |
const Slot = createSlot(useInjections); |
| 121 |
const inject = createInject(injections); |
| 122 |
flushInjectionsFns.push(() => injections.clear()); |
| 123 |
return { |
| 124 |
inject, |
| 125 |
getInjections, |
| 126 |
useInjections, |
| 127 |
Slot |
| 128 |
}; |
| 129 |
} |
| 130 |
function flushAllInjections() { |
| 131 |
flushInjectionsFns.forEach((flush) => flush()); |
| 132 |
} |
| 133 |
function wrapFiller(FillerComponent) { |
| 134 |
return (props) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(FillerWrapper, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(FillerComponent, { ...props })); |
| 135 |
} |
| 136 |
function createSlot(useInjections) { |
| 137 |
return (props) => { |
| 138 |
const injections = useInjections(); |
| 139 |
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, injections.map(({ id, filler: Component2 }) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component2, { ...props, key: id }))); |
| 140 |
}; |
| 141 |
} |
| 142 |
function createGetInjections(injections) { |
| 143 |
return () => [...injections.values()].sort((a, b) => a.priority - b.priority); |
| 144 |
} |
| 145 |
function createInject(injections) { |
| 146 |
return ({ filler, id, options = {} }) => { |
| 147 |
if (injections.has(id) && !options?.overwrite) { |
| 148 |
console.error( |
| 149 |
`An injection with the id "${id}" already exists. Did you mean to use "options.overwrite"?` |
| 150 |
); |
| 151 |
return; |
| 152 |
} |
| 153 |
injections.set(id, { |
| 154 |
id, |
| 155 |
filler: wrapFiller(filler), |
| 156 |
priority: options.priority ?? DEFAULT_PRIORITY |
| 157 |
}); |
| 158 |
}; |
| 159 |
} |
| 160 |
function createUseInjections(getInjections) { |
| 161 |
return () => (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => getInjections(), []); |
| 162 |
} |
| 163 |
|
| 164 |
//# sourceMappingURL=index.mjs.map |
| 165 |
}(); |
| 166 |
(window.__UNSTABLE__elementorPackages = window.__UNSTABLE__elementorPackages || {}).locations = __webpack_exports__; |
| 167 |
/******/ })() |
| 168 |
; |