| @@ -1,4090 +1,3431 @@ | ||
| 1 | -/******/ (() => { // webpackBootstrap | |
| 2 | -/******/ var __webpack_modules__ = ({ | |
| 1 | +(function(react, react_dom, _elementor_ui, _wordpress_i18n, _elementor_icons, _elementor_ui_DialogHeaderGroup, _elementor_ui_DialogHeader) { | |
| 3 | 2 | |
| 4 | -/***/ "../assets/dev/js/utils/react.js": | |
| 5 | -/*!***************************************!*\ | |
| 6 | - !*** ../assets/dev/js/utils/react.js ***! | |
| 7 | - \***************************************/ | |
| 8 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3 | +//#region \0rolldown/runtime.js | |
| 4 | + var __create = Object.create; | |
| 5 | + var __defProp = Object.defineProperty; | |
| 6 | + var __name = (target, value) => __defProp(target, "name", { | |
| 7 | + value, | |
| 8 | + configurable: true | |
| 9 | + }); | |
| 10 | + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 11 | + var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 12 | + var __getProtoOf = Object.getPrototypeOf; | |
| 13 | + var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 14 | + var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); | |
| 15 | + var __copyProps = (to, from, except, desc) => { | |
| 16 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 17 | + for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { | |
| 18 | + key = keys[i]; | |
| 19 | + if (!__hasOwnProp.call(to, key) && key !== except) { | |
| 20 | + __defProp(to, key, { | |
| 21 | + get: ((k) => from[k]).bind(null, key), | |
| 22 | + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable | |
| 23 | + }); | |
| 24 | + } | |
| 25 | + } | |
| 26 | + } | |
| 27 | + return to; | |
| 28 | + }; | |
| 29 | + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { | |
| 30 | + value: mod, | |
| 31 | + enumerable: true | |
| 32 | + }) : target, mod)); | |
| 9 | 33 | |
| 10 | -"use strict"; | |
| 34 | +//#endregion | |
| 35 | +react = __toESM(react); | |
| 36 | +react_dom = __toESM(react_dom); | |
| 37 | +_elementor_ui_DialogHeaderGroup = __toESM(_elementor_ui_DialogHeaderGroup); | |
| 38 | +_elementor_ui_DialogHeader = __toESM(_elementor_ui_DialogHeader); | |
| 11 | 39 | |
| 40 | +//#region node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js | |
| 41 | +/** @license React v16.13.1 | |
| 42 | + * react-is.development.js | |
| 43 | + * | |
| 44 | + * Copyright (c) Facebook, Inc. and its affiliates. | |
| 45 | + * | |
| 46 | + * This source code is licensed under the MIT license found in the | |
| 47 | + * LICENSE file in the root directory of this source tree. | |
| 48 | + */ | |
| 49 | + var require_react_is_development = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 50 | + (function() { | |
| 51 | + "use strict"; | |
| 52 | + var hasSymbol = typeof Symbol === "function" && Symbol.for; | |
| 53 | + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; | |
| 54 | + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; | |
| 55 | + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; | |
| 56 | + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; | |
| 57 | + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; | |
| 58 | + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; | |
| 59 | + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; | |
| 60 | + var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; | |
| 61 | + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; | |
| 62 | + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; | |
| 63 | + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; | |
| 64 | + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; | |
| 65 | + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; | |
| 66 | + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; | |
| 67 | + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; | |
| 68 | + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; | |
| 69 | + var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; | |
| 70 | + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; | |
| 71 | + function isValidElementType(type) { | |
| 72 | + return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | |
| 73 | + } | |
| 74 | + function typeOf(object) { | |
| 75 | + if (typeof object === "object" && object !== null) { | |
| 76 | + var $$typeof = object.$$typeof; | |
| 77 | + switch ($$typeof) { | |
| 78 | + case REACT_ELEMENT_TYPE: | |
| 79 | + var type = object.type; | |
| 80 | + switch (type) { | |
| 81 | + case REACT_ASYNC_MODE_TYPE: | |
| 82 | + case REACT_CONCURRENT_MODE_TYPE: | |
| 83 | + case REACT_FRAGMENT_TYPE: | |
| 84 | + case REACT_PROFILER_TYPE: | |
| 85 | + case REACT_STRICT_MODE_TYPE: | |
| 86 | + case REACT_SUSPENSE_TYPE: return type; | |
| 87 | + default: | |
| 88 | + var $$typeofType = type && type.$$typeof; | |
| 89 | + switch ($$typeofType) { | |
| 90 | + case REACT_CONTEXT_TYPE: | |
| 91 | + case REACT_FORWARD_REF_TYPE: | |
| 92 | + case REACT_LAZY_TYPE: | |
| 93 | + case REACT_MEMO_TYPE: | |
| 94 | + case REACT_PROVIDER_TYPE: return $$typeofType; | |
| 95 | + default: return $$typeof; | |
| 96 | + } | |
| 97 | + } | |
| 98 | + case REACT_PORTAL_TYPE: return $$typeof; | |
| 99 | + } | |
| 100 | + } | |
| 101 | + } | |
| 102 | + var AsyncMode = REACT_ASYNC_MODE_TYPE; | |
| 103 | + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | |
| 104 | + var ContextConsumer = REACT_CONTEXT_TYPE; | |
| 105 | + var ContextProvider = REACT_PROVIDER_TYPE; | |
| 106 | + var Element = REACT_ELEMENT_TYPE; | |
| 107 | + var ForwardRef = REACT_FORWARD_REF_TYPE; | |
| 108 | + var Fragment = REACT_FRAGMENT_TYPE; | |
| 109 | + var Lazy = REACT_LAZY_TYPE; | |
| 110 | + var Memo = REACT_MEMO_TYPE; | |
| 111 | + var Portal = REACT_PORTAL_TYPE; | |
| 112 | + var Profiler = REACT_PROFILER_TYPE; | |
| 113 | + var StrictMode = REACT_STRICT_MODE_TYPE; | |
| 114 | + var Suspense = REACT_SUSPENSE_TYPE; | |
| 115 | + var hasWarnedAboutDeprecatedIsAsyncMode = false; | |
| 116 | + function isAsyncMode(object) { | |
| 117 | + if (!hasWarnedAboutDeprecatedIsAsyncMode) { | |
| 118 | + hasWarnedAboutDeprecatedIsAsyncMode = true; | |
| 119 | + console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); | |
| 120 | + } | |
| 121 | + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; | |
| 122 | + } | |
| 123 | + function isConcurrentMode(object) { | |
| 124 | + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | |
| 125 | + } | |
| 126 | + function isContextConsumer(object) { | |
| 127 | + return typeOf(object) === REACT_CONTEXT_TYPE; | |
| 128 | + } | |
| 129 | + function isContextProvider(object) { | |
| 130 | + return typeOf(object) === REACT_PROVIDER_TYPE; | |
| 131 | + } | |
| 132 | + function isElement(object) { | |
| 133 | + return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | |
| 134 | + } | |
| 135 | + function isForwardRef(object) { | |
| 136 | + return typeOf(object) === REACT_FORWARD_REF_TYPE; | |
| 137 | + } | |
| 138 | + function isFragment(object) { | |
| 139 | + return typeOf(object) === REACT_FRAGMENT_TYPE; | |
| 140 | + } | |
| 141 | + function isLazy(object) { | |
| 142 | + return typeOf(object) === REACT_LAZY_TYPE; | |
| 143 | + } | |
| 144 | + function isMemo(object) { | |
| 145 | + return typeOf(object) === REACT_MEMO_TYPE; | |
| 146 | + } | |
| 147 | + function isPortal(object) { | |
| 148 | + return typeOf(object) === REACT_PORTAL_TYPE; | |
| 149 | + } | |
| 150 | + function isProfiler(object) { | |
| 151 | + return typeOf(object) === REACT_PROFILER_TYPE; | |
| 152 | + } | |
| 153 | + function isStrictMode(object) { | |
| 154 | + return typeOf(object) === REACT_STRICT_MODE_TYPE; | |
| 155 | + } | |
| 156 | + function isSuspense(object) { | |
| 157 | + return typeOf(object) === REACT_SUSPENSE_TYPE; | |
| 158 | + } | |
| 159 | + exports.AsyncMode = AsyncMode; | |
| 160 | + exports.ConcurrentMode = ConcurrentMode; | |
| 161 | + exports.ContextConsumer = ContextConsumer; | |
| 162 | + exports.ContextProvider = ContextProvider; | |
| 163 | + exports.Element = Element; | |
| 164 | + exports.ForwardRef = ForwardRef; | |
| 165 | + exports.Fragment = Fragment; | |
| 166 | + exports.Lazy = Lazy; | |
| 167 | + exports.Memo = Memo; | |
| 168 | + exports.Portal = Portal; | |
| 169 | + exports.Profiler = Profiler; | |
| 170 | + exports.StrictMode = StrictMode; | |
| 171 | + exports.Suspense = Suspense; | |
| 172 | + exports.isAsyncMode = isAsyncMode; | |
| 173 | + exports.isConcurrentMode = isConcurrentMode; | |
| 174 | + exports.isContextConsumer = isContextConsumer; | |
| 175 | + exports.isContextProvider = isContextProvider; | |
| 176 | + exports.isElement = isElement; | |
| 177 | + exports.isForwardRef = isForwardRef; | |
| 178 | + exports.isFragment = isFragment; | |
| 179 | + exports.isLazy = isLazy; | |
| 180 | + exports.isMemo = isMemo; | |
| 181 | + exports.isPortal = isPortal; | |
| 182 | + exports.isProfiler = isProfiler; | |
| 183 | + exports.isStrictMode = isStrictMode; | |
| 184 | + exports.isSuspense = isSuspense; | |
| 185 | + exports.isValidElementType = isValidElementType; | |
| 186 | + exports.typeOf = typeOf; | |
| 187 | + })(); | |
| 188 | + })); | |
| 12 | 189 | |
| 13 | -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 14 | -Object.defineProperty(exports, "__esModule", ({ | |
| 15 | - value: true | |
| 16 | -})); | |
| 17 | -exports["default"] = void 0; | |
| 18 | -var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 19 | -var ReactDOM = _interopRequireWildcard(__webpack_require__(/*! react-dom */ "react-dom")); | |
| 20 | -var _client = __webpack_require__(/*! react-dom/client */ "../node_modules/react-dom/client.js"); | |
| 21 | -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } | |
| 22 | -/** | |
| 23 | - * Support conditional rendering of a React App to the DOM, based on the React version. | |
| 24 | - * We use `createRoot` when available, but fallback to `ReactDOM.render` for older versions. | |
| 25 | - * | |
| 26 | - * @param { React.ReactElement } app The app to render. | |
| 27 | - * @param { HTMLElement } domElement The DOM element to render the app into. | |
| 28 | - * | |
| 29 | - * @return {{ unmount: () => void }} The unmount function. | |
| 30 | - */ | |
| 31 | -function render(app, domElement) { | |
| 32 | - var unmountFunction; | |
| 33 | - try { | |
| 34 | - var root = (0, _client.createRoot)(domElement); | |
| 35 | - root.render(app); | |
| 36 | - unmountFunction = function unmountFunction() { | |
| 37 | - root.unmount(); | |
| 38 | - }; | |
| 39 | - } catch (e) { | |
| 40 | - // eslint-disable-next-line react/no-deprecated | |
| 41 | - ReactDOM.render(app, domElement); | |
| 42 | - unmountFunction = function unmountFunction() { | |
| 43 | - // eslint-disable-next-line react/no-deprecated | |
| 44 | - ReactDOM.unmountComponentAtNode(domElement); | |
| 45 | - }; | |
| 46 | - } | |
| 47 | - return { | |
| 48 | - unmount: unmountFunction | |
| 49 | - }; | |
| 50 | -} | |
| 51 | -var _default = exports["default"] = { | |
| 52 | - render: render | |
| 53 | -}; | |
| 190 | +//#endregion | |
| 191 | +//#region node_modules/prop-types/node_modules/react-is/index.js | |
| 192 | + var require_react_is = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 193 | + module.exports = require_react_is_development(); | |
| 194 | + })); | |
| 54 | 195 | |
| 55 | -/***/ }), | |
| 196 | +//#endregion | |
| 197 | +//#region node_modules/object-assign/index.js | |
| 198 | +/* | |
| 199 | + object-assign | |
| 200 | + (c) Sindre Sorhus | |
| 201 | + @license MIT | |
| 202 | + */ | |
| 203 | + var require_object_assign = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 204 | + var getOwnPropertySymbols = Object.getOwnPropertySymbols; | |
| 205 | + var hasOwnProperty = Object.prototype.hasOwnProperty; | |
| 206 | + var propIsEnumerable = Object.prototype.propertyIsEnumerable; | |
| 207 | + function toObject(val) { | |
| 208 | + if (val === null || val === void 0) throw new TypeError("Object.assign cannot be called with null or undefined"); | |
| 209 | + return Object(val); | |
| 210 | + } | |
| 211 | + function shouldUseNative() { | |
| 212 | + try { | |
| 213 | + if (!Object.assign) return false; | |
| 214 | + var test1 = /* @__PURE__ */ new String("abc"); | |
| 215 | + test1[5] = "de"; | |
| 216 | + if (Object.getOwnPropertyNames(test1)[0] === "5") return false; | |
| 217 | + var test2 = {}; | |
| 218 | + for (var i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i; | |
| 219 | + if (Object.getOwnPropertyNames(test2).map(function(n) { | |
| 220 | + return test2[n]; | |
| 221 | + }).join("") !== "0123456789") return false; | |
| 222 | + var test3 = {}; | |
| 223 | + "abcdefghijklmnopqrst".split("").forEach(function(letter) { | |
| 224 | + test3[letter] = letter; | |
| 225 | + }); | |
| 226 | + if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") return false; | |
| 227 | + return true; | |
| 228 | + } catch (err) { | |
| 229 | + return false; | |
| 230 | + } | |
| 231 | + } | |
| 232 | + module.exports = shouldUseNative() ? Object.assign : function(target, source) { | |
| 233 | + var from; | |
| 234 | + var to = toObject(target); | |
| 235 | + var symbols; | |
| 236 | + for (var s = 1; s < arguments.length; s++) { | |
| 237 | + from = Object(arguments[s]); | |
| 238 | + for (var key in from) if (hasOwnProperty.call(from, key)) to[key] = from[key]; | |
| 239 | + if (getOwnPropertySymbols) { | |
| 240 | + symbols = getOwnPropertySymbols(from); | |
| 241 | + for (var i = 0; i < symbols.length; i++) if (propIsEnumerable.call(from, symbols[i])) to[symbols[i]] = from[symbols[i]]; | |
| 242 | + } | |
| 243 | + } | |
| 244 | + return to; | |
| 245 | + }; | |
| 246 | + })); | |
| 56 | 247 | |
| 57 | -/***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-api.js": | |
| 58 | -/*!********************************************************************!*\ | |
| 59 | - !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-api.js ***! | |
| 60 | - \********************************************************************/ | |
| 61 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 248 | +//#endregion | |
| 249 | +//#region node_modules/prop-types/lib/ReactPropTypesSecret.js | |
| 250 | +/** | |
| 251 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 252 | + * | |
| 253 | + * This source code is licensed under the MIT license found in the | |
| 254 | + * LICENSE file in the root directory of this source tree. | |
| 255 | + */ | |
| 256 | + var require_ReactPropTypesSecret = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 257 | + var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; | |
| 258 | + module.exports = ReactPropTypesSecret; | |
| 259 | + })); | |
| 62 | 260 | |
| 63 | -"use strict"; | |
| 261 | +//#endregion | |
| 262 | +//#region node_modules/prop-types/lib/has.js | |
| 263 | + var require_has = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 264 | + module.exports = Function.call.bind(Object.prototype.hasOwnProperty); | |
| 265 | + })); | |
| 64 | 266 | |
| 267 | +//#endregion | |
| 268 | +//#region node_modules/prop-types/checkPropTypes.js | |
| 269 | +/** | |
| 270 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 271 | + * | |
| 272 | + * This source code is licensed under the MIT license found in the | |
| 273 | + * LICENSE file in the root directory of this source tree. | |
| 274 | + */ | |
| 275 | + var require_checkPropTypes = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 276 | + var printWarning = function() {}; | |
| 277 | + var ReactPropTypesSecret = require_ReactPropTypesSecret(); | |
| 278 | + var loggedTypeFailures = {}; | |
| 279 | + var has = require_has(); | |
| 280 | + printWarning = function(text) { | |
| 281 | + var message = "Warning: " + text; | |
| 282 | + if (typeof console !== "undefined") console.error(message); | |
| 283 | + try { | |
| 284 | + throw new Error(message); | |
| 285 | + } catch (x) {} | |
| 286 | + }; | |
| 287 | + /** | |
| 288 | + * Assert that the values match with the type specs. | |
| 289 | + * Error messages are memorized and will only be shown once. | |
| 290 | + * | |
| 291 | + * @param {object} typeSpecs Map of name to a ReactPropType | |
| 292 | + * @param {object} values Runtime values that need to be type-checked | |
| 293 | + * @param {string} location e.g. "prop", "context", "child context" | |
| 294 | + * @param {string} componentName Name of the component for error messages. | |
| 295 | + * @param {?Function} getStack Returns the component stack. | |
| 296 | + * @private | |
| 297 | + */ | |
| 298 | + function checkPropTypes(typeSpecs, values, location, componentName, getStack) { | |
| 299 | + for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) { | |
| 300 | + var error; | |
| 301 | + try { | |
| 302 | + if (typeof typeSpecs[typeSpecName] !== "function") { | |
| 303 | + var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); | |
| 304 | + err.name = "Invariant Violation"; | |
| 305 | + throw err; | |
| 306 | + } | |
| 307 | + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); | |
| 308 | + } catch (ex) { | |
| 309 | + error = ex; | |
| 310 | + } | |
| 311 | + if (error && !(error instanceof Error)) printWarning((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."); | |
| 312 | + if (error instanceof Error && !(error.message in loggedTypeFailures)) { | |
| 313 | + loggedTypeFailures[error.message] = true; | |
| 314 | + var stack = getStack ? getStack() : ""; | |
| 315 | + printWarning("Failed " + location + " type: " + error.message + (stack != null ? stack : "")); | |
| 316 | + } | |
| 317 | + } | |
| 318 | + } | |
| 319 | + /** | |
| 320 | + * Resets warning cache when testing. | |
| 321 | + * | |
| 322 | + * @private | |
| 323 | + */ | |
| 324 | + checkPropTypes.resetWarningCache = function() { | |
| 325 | + loggedTypeFailures = {}; | |
| 326 | + }; | |
| 327 | + module.exports = checkPropTypes; | |
| 328 | + })); | |
| 65 | 329 | |
| 66 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 67 | -Object.defineProperty(exports, "__esModule", ({ | |
| 68 | - value: true | |
| 69 | -})); | |
| 70 | -exports.triggerOptOut = exports.triggerOptIn = void 0; | |
| 71 | -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 72 | -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 73 | -var triggerOptIn = exports.triggerOptIn = /*#__PURE__*/function () { | |
| 74 | - var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() { | |
| 75 | - return _regenerator.default.wrap(function (_context) { | |
| 76 | - while (1) switch (_context.prev = _context.next) { | |
| 77 | - case 0: | |
| 78 | - return _context.abrupt("return", elementorCommon.ajax.addRequest('editor_v4_opt_in')); | |
| 79 | - case 1: | |
| 80 | - case "end": | |
| 81 | - return _context.stop(); | |
| 82 | - } | |
| 83 | - }, _callee); | |
| 84 | - })); | |
| 85 | - return function triggerOptIn() { | |
| 86 | - return _ref.apply(this, arguments); | |
| 87 | - }; | |
| 88 | -}(); | |
| 89 | -var triggerOptOut = exports.triggerOptOut = /*#__PURE__*/function () { | |
| 90 | - var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() { | |
| 91 | - return _regenerator.default.wrap(function (_context2) { | |
| 92 | - while (1) switch (_context2.prev = _context2.next) { | |
| 93 | - case 0: | |
| 94 | - return _context2.abrupt("return", elementorCommon.ajax.addRequest('editor_v4_opt_out')); | |
| 95 | - case 1: | |
| 96 | - case "end": | |
| 97 | - return _context2.stop(); | |
| 98 | - } | |
| 99 | - }, _callee2); | |
| 100 | - })); | |
| 101 | - return function triggerOptOut() { | |
| 102 | - return _ref2.apply(this, arguments); | |
| 103 | - }; | |
| 104 | -}(); | |
| 330 | +//#endregion | |
| 331 | +//#region node_modules/prop-types/factoryWithTypeCheckers.js | |
| 332 | +/** | |
| 333 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 334 | + * | |
| 335 | + * This source code is licensed under the MIT license found in the | |
| 336 | + * LICENSE file in the root directory of this source tree. | |
| 337 | + */ | |
| 338 | + var require_factoryWithTypeCheckers = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 339 | + var ReactIs = require_react_is(); | |
| 340 | + var assign = require_object_assign(); | |
| 341 | + var ReactPropTypesSecret = require_ReactPropTypesSecret(); | |
| 342 | + var has = require_has(); | |
| 343 | + var checkPropTypes = require_checkPropTypes(); | |
| 344 | + var printWarning = function() {}; | |
| 345 | + printWarning = function(text) { | |
| 346 | + var message = "Warning: " + text; | |
| 347 | + if (typeof console !== "undefined") console.error(message); | |
| 348 | + try { | |
| 349 | + throw new Error(message); | |
| 350 | + } catch (x) {} | |
| 351 | + }; | |
| 352 | + function emptyFunctionThatReturnsNull() { | |
| 353 | + return null; | |
| 354 | + } | |
| 355 | + module.exports = function(isValidElement, throwOnDirectAccess) { | |
| 356 | + var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; | |
| 357 | + var FAUX_ITERATOR_SYMBOL = "@@iterator"; | |
| 358 | + /** | |
| 359 | + * Returns the iterator method function contained on the iterable object. | |
| 360 | + * | |
| 361 | + * Be sure to invoke the function with the iterable as context: | |
| 362 | + * | |
| 363 | + * var iteratorFn = getIteratorFn(myIterable); | |
| 364 | + * if (iteratorFn) { | |
| 365 | + * var iterator = iteratorFn.call(myIterable); | |
| 366 | + * ... | |
| 367 | + * } | |
| 368 | + * | |
| 369 | + * @param {?object} maybeIterable | |
| 370 | + * @return {?function} | |
| 371 | + */ | |
| 372 | + function getIteratorFn(maybeIterable) { | |
| 373 | + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | |
| 374 | + if (typeof iteratorFn === "function") return iteratorFn; | |
| 375 | + } | |
| 376 | + /** | |
| 377 | + * Collection of methods that allow declaration and validation of props that are | |
| 378 | + * supplied to React components. Example usage: | |
| 379 | + * | |
| 380 | + * var Props = require('ReactPropTypes'); | |
| 381 | + * var MyArticle = React.createClass({ | |
| 382 | + * propTypes: { | |
| 383 | + * // An optional string prop named "description". | |
| 384 | + * description: Props.string, | |
| 385 | + * | |
| 386 | + * // A required enum prop named "category". | |
| 387 | + * category: Props.oneOf(['News','Photos']).isRequired, | |
| 388 | + * | |
| 389 | + * // A prop named "dialog" that requires an instance of Dialog. | |
| 390 | + * dialog: Props.instanceOf(Dialog).isRequired | |
| 391 | + * }, | |
| 392 | + * render: function() { ... } | |
| 393 | + * }); | |
| 394 | + * | |
| 395 | + * A more formal specification of how these methods are used: | |
| 396 | + * | |
| 397 | + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) | |
| 398 | + * decl := ReactPropTypes.{type}(.isRequired)? | |
| 399 | + * | |
| 400 | + * Each and every declaration produces a function with the same signature. This | |
| 401 | + * allows the creation of custom validation functions. For example: | |
| 402 | + * | |
| 403 | + * var MyLink = React.createClass({ | |
| 404 | + * propTypes: { | |
| 405 | + * // An optional string or URI prop named "href". | |
| 406 | + * href: function(props, propName, componentName) { | |
| 407 | + * var propValue = props[propName]; | |
| 408 | + * if (propValue != null && typeof propValue !== 'string' && | |
| 409 | + * !(propValue instanceof URI)) { | |
| 410 | + * return new Error( | |
| 411 | + * 'Expected a string or an URI for ' + propName + ' in ' + | |
| 412 | + * componentName | |
| 413 | + * ); | |
| 414 | + * } | |
| 415 | + * } | |
| 416 | + * }, | |
| 417 | + * render: function() {...} | |
| 418 | + * }); | |
| 419 | + * | |
| 420 | + * @internal | |
| 421 | + */ | |
| 422 | + var ANONYMOUS = "<<anonymous>>"; | |
| 423 | + var ReactPropTypes = { | |
| 424 | + array: createPrimitiveTypeChecker("array"), | |
| 425 | + bigint: createPrimitiveTypeChecker("bigint"), | |
| 426 | + bool: createPrimitiveTypeChecker("boolean"), | |
| 427 | + func: createPrimitiveTypeChecker("function"), | |
| 428 | + number: createPrimitiveTypeChecker("number"), | |
| 429 | + object: createPrimitiveTypeChecker("object"), | |
| 430 | + string: createPrimitiveTypeChecker("string"), | |
| 431 | + symbol: createPrimitiveTypeChecker("symbol"), | |
| 432 | + any: createAnyTypeChecker(), | |
| 433 | + arrayOf: createArrayOfTypeChecker, | |
| 434 | + element: createElementTypeChecker(), | |
| 435 | + elementType: createElementTypeTypeChecker(), | |
| 436 | + instanceOf: createInstanceTypeChecker, | |
| 437 | + node: createNodeChecker(), | |
| 438 | + objectOf: createObjectOfTypeChecker, | |
| 439 | + oneOf: createEnumTypeChecker, | |
| 440 | + oneOfType: createUnionTypeChecker, | |
| 441 | + shape: createShapeTypeChecker, | |
| 442 | + exact: createStrictShapeTypeChecker | |
| 443 | + }; | |
| 444 | + /** | |
| 445 | + * inlined Object.is polyfill to avoid requiring consumers ship their own | |
| 446 | + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | |
| 447 | + */ | |
| 448 | + function is(x, y) { | |
| 449 | + if (x === y) return x !== 0 || 1 / x === 1 / y; | |
| 450 | + else return x !== x && y !== y; | |
| 451 | + } | |
| 452 | + /** | |
| 453 | + * We use an Error-like object for backward compatibility as people may call | |
| 454 | + * PropTypes directly and inspect their output. However, we don't use real | |
| 455 | + * Errors anymore. We don't inspect their stack anyway, and creating them | |
| 456 | + * is prohibitively expensive if they are created too often, such as what | |
| 457 | + * happens in oneOfType() for any type before the one that matched. | |
| 458 | + */ | |
| 459 | + function PropTypeError(message, data) { | |
| 460 | + this.message = message; | |
| 461 | + this.data = data && typeof data === "object" ? data : {}; | |
| 462 | + this.stack = ""; | |
| 463 | + } | |
| 464 | + PropTypeError.prototype = Error.prototype; | |
| 465 | + function createChainableTypeChecker(validate) { | |
| 466 | + var manualPropTypeCallCache = {}; | |
| 467 | + var manualPropTypeWarningCount = 0; | |
| 468 | + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | |
| 469 | + componentName = componentName || ANONYMOUS; | |
| 470 | + propFullName = propFullName || propName; | |
| 471 | + if (secret !== ReactPropTypesSecret) { | |
| 472 | + if (throwOnDirectAccess) { | |
| 473 | + var err = /* @__PURE__ */ new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"); | |
| 474 | + err.name = "Invariant Violation"; | |
| 475 | + throw err; | |
| 476 | + } else if (typeof console !== "undefined") { | |
| 477 | + var cacheKey = componentName + ":" + propName; | |
| 478 | + if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) { | |
| 479 | + printWarning("You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."); | |
| 480 | + manualPropTypeCallCache[cacheKey] = true; | |
| 481 | + manualPropTypeWarningCount++; | |
| 482 | + } | |
| 483 | + } | |
| 484 | + } | |
| 485 | + if (props[propName] == null) { | |
| 486 | + if (isRequired) { | |
| 487 | + if (props[propName] === null) return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")); | |
| 488 | + return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")); | |
| 489 | + } | |
| 490 | + return null; | |
| 491 | + } else return validate(props, propName, componentName, location, propFullName); | |
| 492 | + } | |
| 493 | + var chainedCheckType = checkType.bind(null, false); | |
| 494 | + chainedCheckType.isRequired = checkType.bind(null, true); | |
| 495 | + return chainedCheckType; | |
| 496 | + } | |
| 497 | + function createPrimitiveTypeChecker(expectedType) { | |
| 498 | + function validate(props, propName, componentName, location, propFullName, secret) { | |
| 499 | + var propValue = props[propName]; | |
| 500 | + if (getPropType(propValue) !== expectedType) { | |
| 501 | + var preciseType = getPreciseType(propValue); | |
| 502 | + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType }); | |
| 503 | + } | |
| 504 | + return null; | |
| 505 | + } | |
| 506 | + return createChainableTypeChecker(validate); | |
| 507 | + } | |
| 508 | + function createAnyTypeChecker() { | |
| 509 | + return createChainableTypeChecker(emptyFunctionThatReturnsNull); | |
| 510 | + } | |
| 511 | + function createArrayOfTypeChecker(typeChecker) { | |
| 512 | + function validate(props, propName, componentName, location, propFullName) { | |
| 513 | + if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); | |
| 514 | + var propValue = props[propName]; | |
| 515 | + if (!Array.isArray(propValue)) { | |
| 516 | + var propType = getPropType(propValue); | |
| 517 | + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); | |
| 518 | + } | |
| 519 | + for (var i = 0; i < propValue.length; i++) { | |
| 520 | + var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret); | |
| 521 | + if (error instanceof Error) return error; | |
| 522 | + } | |
| 523 | + return null; | |
| 524 | + } | |
| 525 | + return createChainableTypeChecker(validate); | |
| 526 | + } | |
| 527 | + function createElementTypeChecker() { | |
| 528 | + function validate(props, propName, componentName, location, propFullName) { | |
| 529 | + var propValue = props[propName]; | |
| 530 | + if (!isValidElement(propValue)) { | |
| 531 | + var propType = getPropType(propValue); | |
| 532 | + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); | |
| 533 | + } | |
| 534 | + return null; | |
| 535 | + } | |
| 536 | + return createChainableTypeChecker(validate); | |
| 537 | + } | |
| 538 | + function createElementTypeTypeChecker() { | |
| 539 | + function validate(props, propName, componentName, location, propFullName) { | |
| 540 | + var propValue = props[propName]; | |
| 541 | + if (!ReactIs.isValidElementType(propValue)) { | |
| 542 | + var propType = getPropType(propValue); | |
| 543 | + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); | |
| 544 | + } | |
| 545 | + return null; | |
| 546 | + } | |
| 547 | + return createChainableTypeChecker(validate); | |
| 548 | + } | |
| 549 | + function createInstanceTypeChecker(expectedClass) { | |
| 550 | + function validate(props, propName, componentName, location, propFullName) { | |
| 551 | + if (!(props[propName] instanceof expectedClass)) { | |
| 552 | + var expectedClassName = expectedClass.name || ANONYMOUS; | |
| 553 | + var actualClassName = getClassName(props[propName]); | |
| 554 | + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); | |
| 555 | + } | |
| 556 | + return null; | |
| 557 | + } | |
| 558 | + return createChainableTypeChecker(validate); | |
| 559 | + } | |
| 560 | + function createEnumTypeChecker(expectedValues) { | |
| 561 | + if (!Array.isArray(expectedValues)) { | |
| 562 | + if (arguments.length > 1) printWarning("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."); | |
| 563 | + else printWarning("Invalid argument supplied to oneOf, expected an array."); | |
| 564 | + return emptyFunctionThatReturnsNull; | |
| 565 | + } | |
| 566 | + function validate(props, propName, componentName, location, propFullName) { | |
| 567 | + var propValue = props[propName]; | |
| 568 | + for (var i = 0; i < expectedValues.length; i++) if (is(propValue, expectedValues[i])) return null; | |
| 569 | + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | |
| 570 | + if (getPreciseType(value) === "symbol") return String(value); | |
| 571 | + return value; | |
| 572 | + }); | |
| 573 | + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); | |
| 574 | + } | |
| 575 | + return createChainableTypeChecker(validate); | |
| 576 | + } | |
| 577 | + function createObjectOfTypeChecker(typeChecker) { | |
| 578 | + function validate(props, propName, componentName, location, propFullName) { | |
| 579 | + if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); | |
| 580 | + var propValue = props[propName]; | |
| 581 | + var propType = getPropType(propValue); | |
| 582 | + if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); | |
| 583 | + for (var key in propValue) if (has(propValue, key)) { | |
| 584 | + var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); | |
| 585 | + if (error instanceof Error) return error; | |
| 586 | + } | |
| 587 | + return null; | |
| 588 | + } | |
| 589 | + return createChainableTypeChecker(validate); | |
| 590 | + } | |
| 591 | + function createUnionTypeChecker(arrayOfTypeCheckers) { | |
| 592 | + if (!Array.isArray(arrayOfTypeCheckers)) { | |
| 593 | + printWarning("Invalid argument supplied to oneOfType, expected an instance of array."); | |
| 594 | + return emptyFunctionThatReturnsNull; | |
| 595 | + } | |
| 596 | + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 597 | + var checker = arrayOfTypeCheckers[i]; | |
| 598 | + if (typeof checker !== "function") { | |
| 599 | + printWarning("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."); | |
| 600 | + return emptyFunctionThatReturnsNull; | |
| 601 | + } | |
| 602 | + } | |
| 603 | + function validate(props, propName, componentName, location, propFullName) { | |
| 604 | + var expectedTypes = []; | |
| 605 | + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 606 | + var checker = arrayOfTypeCheckers[i]; | |
| 607 | + var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); | |
| 608 | + if (checkerResult == null) return null; | |
| 609 | + if (checkerResult.data && has(checkerResult.data, "expectedType")) expectedTypes.push(checkerResult.data.expectedType); | |
| 610 | + } | |
| 611 | + var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; | |
| 612 | + return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); | |
| 613 | + } | |
| 614 | + return createChainableTypeChecker(validate); | |
| 615 | + } | |
| 616 | + function createNodeChecker() { | |
| 617 | + function validate(props, propName, componentName, location, propFullName) { | |
| 618 | + if (!isNode(props[propName])) return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); | |
| 619 | + return null; | |
| 620 | + } | |
| 621 | + return createChainableTypeChecker(validate); | |
| 622 | + } | |
| 623 | + function invalidValidatorError(componentName, location, propFullName, key, type) { | |
| 624 | + return new PropTypeError((componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."); | |
| 625 | + } | |
| 626 | + function createShapeTypeChecker(shapeTypes) { | |
| 627 | + function validate(props, propName, componentName, location, propFullName) { | |
| 628 | + var propValue = props[propName]; | |
| 629 | + var propType = getPropType(propValue); | |
| 630 | + if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); | |
| 631 | + for (var key in shapeTypes) { | |
| 632 | + var checker = shapeTypes[key]; | |
| 633 | + if (typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 634 | + var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); | |
| 635 | + if (error) return error; | |
| 636 | + } | |
| 637 | + return null; | |
| 638 | + } | |
| 639 | + return createChainableTypeChecker(validate); | |
| 640 | + } | |
| 641 | + function createStrictShapeTypeChecker(shapeTypes) { | |
| 642 | + function validate(props, propName, componentName, location, propFullName) { | |
| 643 | + var propValue = props[propName]; | |
| 644 | + var propType = getPropType(propValue); | |
| 645 | + if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); | |
| 646 | + for (var key in assign({}, props[propName], shapeTypes)) { | |
| 647 | + var checker = shapeTypes[key]; | |
| 648 | + if (has(shapeTypes, key) && typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 649 | + if (!checker) return new PropTypeError("Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")); | |
| 650 | + var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); | |
| 651 | + if (error) return error; | |
| 652 | + } | |
| 653 | + return null; | |
| 654 | + } | |
| 655 | + return createChainableTypeChecker(validate); | |
| 656 | + } | |
| 657 | + function isNode(propValue) { | |
| 658 | + switch (typeof propValue) { | |
| 659 | + case "number": | |
| 660 | + case "string": | |
| 661 | + case "undefined": return true; | |
| 662 | + case "boolean": return !propValue; | |
| 663 | + case "object": | |
| 664 | + if (Array.isArray(propValue)) return propValue.every(isNode); | |
| 665 | + if (propValue === null || isValidElement(propValue)) return true; | |
| 666 | + var iteratorFn = getIteratorFn(propValue); | |
| 667 | + if (iteratorFn) { | |
| 668 | + var iterator = iteratorFn.call(propValue); | |
| 669 | + var step; | |
| 670 | + if (iteratorFn !== propValue.entries) { | |
| 671 | + while (!(step = iterator.next()).done) if (!isNode(step.value)) return false; | |
| 672 | + } else while (!(step = iterator.next()).done) { | |
| 673 | + var entry = step.value; | |
| 674 | + if (entry) { | |
| 675 | + if (!isNode(entry[1])) return false; | |
| 676 | + } | |
| 677 | + } | |
| 678 | + } else return false; | |
| 679 | + return true; | |
| 680 | + default: return false; | |
| 681 | + } | |
| 682 | + } | |
| 683 | + function isSymbol(propType, propValue) { | |
| 684 | + if (propType === "symbol") return true; | |
| 685 | + if (!propValue) return false; | |
| 686 | + if (propValue["@@toStringTag"] === "Symbol") return true; | |
| 687 | + if (typeof Symbol === "function" && propValue instanceof Symbol) return true; | |
| 688 | + return false; | |
| 689 | + } | |
| 690 | + function getPropType(propValue) { | |
| 691 | + var propType = typeof propValue; | |
| 692 | + if (Array.isArray(propValue)) return "array"; | |
| 693 | + if (propValue instanceof RegExp) return "object"; | |
| 694 | + if (isSymbol(propType, propValue)) return "symbol"; | |
| 695 | + return propType; | |
| 696 | + } | |
| 697 | + function getPreciseType(propValue) { | |
| 698 | + if (typeof propValue === "undefined" || propValue === null) return "" + propValue; | |
| 699 | + var propType = getPropType(propValue); | |
| 700 | + if (propType === "object") { | |
| 701 | + if (propValue instanceof Date) return "date"; | |
| 702 | + else if (propValue instanceof RegExp) return "regexp"; | |
| 703 | + } | |
| 704 | + return propType; | |
| 705 | + } | |
| 706 | + function getPostfixForTypeWarning(value) { | |
| 707 | + var type = getPreciseType(value); | |
| 708 | + switch (type) { | |
| 709 | + case "array": | |
| 710 | + case "object": return "an " + type; | |
| 711 | + case "boolean": | |
| 712 | + case "date": | |
| 713 | + case "regexp": return "a " + type; | |
| 714 | + default: return type; | |
| 715 | + } | |
| 716 | + } | |
| 717 | + function getClassName(propValue) { | |
| 718 | + if (!propValue.constructor || !propValue.constructor.name) return ANONYMOUS; | |
| 719 | + return propValue.constructor.name; | |
| 720 | + } | |
| 721 | + ReactPropTypes.checkPropTypes = checkPropTypes; | |
| 722 | + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | |
| 723 | + ReactPropTypes.PropTypes = ReactPropTypes; | |
| 724 | + return ReactPropTypes; | |
| 725 | + }; | |
| 726 | + })); | |
| 105 | 727 | |
| 106 | -/***/ }), | |
| 728 | +//#endregion | |
| 729 | +//#region node_modules/prop-types/index.js | |
| 730 | + var require_prop_types = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 731 | + var ReactIs = require_react_is(); | |
| 732 | + var throwOnDirectAccess = true; | |
| 733 | + module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); | |
| 734 | + })); | |
| 107 | 735 | |
| 108 | -/***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js": | |
| 109 | -/*!************************************************************************!*\ | |
| 110 | - !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js ***! | |
| 111 | - \************************************************************************/ | |
| 112 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 736 | +//#endregion | |
| 737 | +//#region node_modules/react-dom/client.js | |
| 738 | + var require_client = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 739 | + var m = (globalThis.ReactDOM); | |
| 740 | + var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | |
| 741 | + exports.createRoot = function(c, o) { | |
| 742 | + i.usingClientEntryPoint = true; | |
| 743 | + try { | |
| 744 | + return m.createRoot(c, o); | |
| 745 | + } finally { | |
| 746 | + i.usingClientEntryPoint = false; | |
| 747 | + } | |
| 748 | + }; | |
| 749 | + })); | |
| 113 | 750 | |
| 114 | -"use strict"; | |
| 115 | -/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 751 | +//#endregion | |
| 752 | +//#region assets/dev/js/utils/react.js | |
| 753 | +var import_prop_types = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 754 | + var import_client = require_client(); | |
| 755 | + /** | |
| 756 | + * Support conditional rendering of a React App to the DOM, based on the React version. | |
| 757 | + * We use `createRoot` when available, but fallback to `ReactDOM.render` for older versions. | |
| 758 | + * | |
| 759 | + * @param {Promise.resolve(React).ReactElement} app The app to render. | |
| 760 | + * @param {HTMLElement} domElement The DOM element to render the app into. | |
| 761 | + * | |
| 762 | + * @return {{ unmount: () => void }} The unmount function. | |
| 763 | + */ | |
| 764 | + function render(app, domElement) { | |
| 765 | + var unmountFunction; | |
| 766 | + try { | |
| 767 | + var root = (0, import_client.createRoot)(domElement); | |
| 768 | + root.render(app); | |
| 769 | + unmountFunction = function unmountFunction() { | |
| 770 | + root.unmount(); | |
| 771 | + }; | |
| 772 | + } catch (e) { | |
| 773 | + react_dom.render(app, domElement); | |
| 774 | + unmountFunction = function unmountFunction() { | |
| 775 | + react_dom.unmountComponentAtNode(domElement); | |
| 776 | + }; | |
| 777 | + } | |
| 778 | + return { unmount: unmountFunction }; | |
| 779 | + } | |
| 780 | + var react_default = { render }; | |
| 116 | 781 | |
| 782 | +//#endregion | |
| 783 | +//#region node_modules/@babel/runtime/helpers/esm/typeof.js | |
| 784 | + function _typeof(o) { | |
| 785 | + "@babel/helpers - typeof"; | |
| 786 | + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 787 | + return typeof o; | |
| 788 | + } : function(o) { | |
| 789 | + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 790 | + }, _typeof(o); | |
| 791 | + } | |
| 117 | 792 | |
| 118 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 119 | -Object.defineProperty(exports, "__esModule", ({ | |
| 120 | - value: true | |
| 121 | -})); | |
| 122 | -exports.TextNode = exports.ContentListItem = exports.ContentList = exports.AdvantagesListItem = exports.AdvantagesList = void 0; | |
| 123 | -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 124 | -var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 125 | -var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 126 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 127 | -var _excluded = ["children"], | |
| 128 | - _excluded2 = ["children"], | |
| 129 | - _excluded3 = ["children"], | |
| 130 | - _excluded4 = ["children"], | |
| 131 | - _excluded5 = ["children"]; | |
| 132 | -var TextNode = exports.TextNode = function TextNode(_ref) { | |
| 133 | - var children = _ref.children, | |
| 134 | - props = (0, _objectWithoutProperties2.default)(_ref, _excluded); | |
| 135 | - return /*#__PURE__*/_react.default.createElement(_ui.Typography, (0, _extends2.default)({ | |
| 136 | - color: "text.primary" | |
| 137 | - }, props), children); | |
| 138 | -}; | |
| 139 | -TextNode.propTypes = { | |
| 140 | - children: PropTypes.node | |
| 141 | -}; | |
| 142 | -var ContentList = exports.ContentList = function ContentList(_ref2) { | |
| 143 | - var children = _ref2.children, | |
| 144 | - props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2); | |
| 145 | - return /*#__PURE__*/_react.default.createElement(_ui.Box, (0, _extends2.default)({ | |
| 146 | - component: "ul", | |
| 147 | - sx: { | |
| 148 | - listStyle: 'disc' | |
| 149 | - } | |
| 150 | - }, props), children); | |
| 151 | -}; | |
| 152 | -ContentList.propTypes = { | |
| 153 | - children: PropTypes.node | |
| 154 | -}; | |
| 155 | -var ContentListItem = exports.ContentListItem = function ContentListItem(_ref3) { | |
| 156 | - var children = _ref3.children, | |
| 157 | - props = (0, _objectWithoutProperties2.default)(_ref3, _excluded3); | |
| 158 | - return /*#__PURE__*/_react.default.createElement(TextNode, (0, _extends2.default)({ | |
| 159 | - component: "li" | |
| 160 | - }, props), children); | |
| 161 | -}; | |
| 162 | -ContentListItem.propTypes = { | |
| 163 | - children: PropTypes.node | |
| 164 | -}; | |
| 165 | -var AdvantagesList = exports.AdvantagesList = function AdvantagesList(_ref4) { | |
| 166 | - var children = _ref4.children, | |
| 167 | - props = (0, _objectWithoutProperties2.default)(_ref4, _excluded4); | |
| 168 | - return /*#__PURE__*/_react.default.createElement(_ui.Box, (0, _extends2.default)({ | |
| 169 | - component: "ul", | |
| 170 | - sx: { | |
| 171 | - marginInlineStart: 2 | |
| 172 | - } | |
| 173 | - }, props), children); | |
| 174 | -}; | |
| 175 | -AdvantagesList.propTypes = { | |
| 176 | - children: PropTypes.node | |
| 177 | -}; | |
| 178 | -var AdvantagesListItem = exports.AdvantagesListItem = function AdvantagesListItem(_ref5) { | |
| 179 | - var children = _ref5.children, | |
| 180 | - props = (0, _objectWithoutProperties2.default)(_ref5, _excluded5); | |
| 181 | - return /*#__PURE__*/_react.default.createElement(TextNode, (0, _extends2.default)({ | |
| 182 | - component: "li", | |
| 183 | - sx: { | |
| 184 | - lineHeight: '150%', | |
| 185 | - listStyle: 'disc' | |
| 186 | - } | |
| 187 | - }, props), children); | |
| 188 | -}; | |
| 189 | -AdvantagesListItem.propTypes = { | |
| 190 | - children: PropTypes.node | |
| 191 | -}; | |
| 793 | +//#endregion | |
| 794 | +//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js | |
| 795 | + function toPrimitive(t, r) { | |
| 796 | + if ("object" != _typeof(t) || !t) return t; | |
| 797 | + var e = t[Symbol.toPrimitive]; | |
| 798 | + if (void 0 !== e) { | |
| 799 | + var i = e.call(t, r || "default"); | |
| 800 | + if ("object" != _typeof(i)) return i; | |
| 801 | + throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 802 | + } | |
| 803 | + return ("string" === r ? String : Number)(t); | |
| 804 | + } | |
| 192 | 805 | |
| 193 | -/***/ }), | |
| 806 | +//#endregion | |
| 807 | +//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | |
| 808 | + function toPropertyKey(t) { | |
| 809 | + var i = toPrimitive(t, "string"); | |
| 810 | + return "symbol" == _typeof(i) ? i : i + ""; | |
| 811 | + } | |
| 194 | 812 | |
| 195 | -/***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-img-placeholders.js": | |
| 196 | -/*!*********************************************************************************!*\ | |
| 197 | - !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-img-placeholders.js ***! | |
| 198 | - \*********************************************************************************/ | |
| 199 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 813 | +//#endregion | |
| 814 | +//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js | |
| 815 | + function _defineProperty(e, r, t) { | |
| 816 | + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 817 | + value: t, | |
| 818 | + enumerable: !0, | |
| 819 | + configurable: !0, | |
| 820 | + writable: !0 | |
| 821 | + }) : e[r] = t, e; | |
| 822 | + } | |
| 200 | 823 | |
| 201 | -"use strict"; | |
| 824 | +//#endregion | |
| 825 | +//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js | |
| 826 | + function _arrayWithHoles(r) { | |
| 827 | + if (Array.isArray(r)) return r; | |
| 828 | + } | |
| 202 | 829 | |
| 830 | +//#endregion | |
| 831 | +//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js | |
| 832 | + function _iterableToArrayLimit(r, l) { | |
| 833 | + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 834 | + if (null != t) { | |
| 835 | + var e; | |
| 836 | + var n; | |
| 837 | + var i; | |
| 838 | + var u; | |
| 839 | + var a = []; | |
| 840 | + var f = !0; | |
| 841 | + var o = !1; | |
| 842 | + try { | |
| 843 | + if (i = (t = t.call(r)).next, 0 === l) { | |
| 844 | + if (Object(t) !== t) return; | |
| 845 | + f = !1; | |
| 846 | + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 847 | + } catch (r) { | |
| 848 | + o = !0, n = r; | |
| 849 | + } finally { | |
| 850 | + try { | |
| 851 | + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 852 | + } finally { | |
| 853 | + if (o) throw n; | |
| 854 | + } | |
| 855 | + } | |
| 856 | + return a; | |
| 857 | + } | |
| 858 | + } | |
| 203 | 859 | |
| 204 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 205 | -Object.defineProperty(exports, "__esModule", ({ | |
| 206 | - value: true | |
| 207 | -})); | |
| 208 | -exports.ImageSquarePlaceholder = exports.ImageLandscapePlaceholder = void 0; | |
| 209 | -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 210 | -var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 211 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 212 | -var ImageLandscapePlaceholder = exports.ImageLandscapePlaceholder = function ImageLandscapePlaceholder(props) { | |
| 213 | - return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ | |
| 214 | - viewBox: "0 0 600 260" | |
| 215 | - }, props), /*#__PURE__*/_react.default.createElement("rect", { | |
| 216 | - x: "0", | |
| 217 | - y: "0", | |
| 218 | - width: "600", | |
| 219 | - height: "260", | |
| 220 | - fill: "#d9d9d9" | |
| 221 | - })); | |
| 222 | -}; | |
| 223 | -var ImageSquarePlaceholder = exports.ImageSquarePlaceholder = function ImageSquarePlaceholder(props) { | |
| 224 | - return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ | |
| 225 | - viewBox: "0 0 500 500" | |
| 226 | - }, props), /*#__PURE__*/_react.default.createElement("rect", { | |
| 227 | - x: "0", | |
| 228 | - y: "0", | |
| 229 | - width: "500", | |
| 230 | - height: "500", | |
| 231 | - fill: "#d9d9d9" | |
| 232 | - })); | |
| 233 | -}; | |
| 860 | +//#endregion | |
| 861 | +//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js | |
| 862 | + function _arrayLikeToArray(r, a) { | |
| 863 | + (null == a || a > r.length) && (a = r.length); | |
| 864 | + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 865 | + return n; | |
| 866 | + } | |
| 234 | 867 | |
| 235 | -/***/ }), | |
| 868 | +//#endregion | |
| 869 | +//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js | |
| 870 | + function _unsupportedIterableToArray(r, a) { | |
| 871 | + if (r) { | |
| 872 | + if ("string" == typeof r) return _arrayLikeToArray(r, a); | |
| 873 | + var t = {}.toString.call(r).slice(8, -1); | |
| 874 | + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; | |
| 875 | + } | |
| 876 | + } | |
| 236 | 877 | |
| 237 | -/***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-message.js": | |
| 238 | -/*!************************************************************************!*\ | |
| 239 | - !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-message.js ***! | |
| 240 | - \************************************************************************/ | |
| 241 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 878 | +//#endregion | |
| 879 | +//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js | |
| 880 | + function _nonIterableRest() { | |
| 881 | + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 882 | + } | |
| 242 | 883 | |
| 243 | -"use strict"; | |
| 244 | -/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 884 | +//#endregion | |
| 885 | +//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js | |
| 886 | + function _slicedToArray(r, e) { | |
| 887 | + return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); | |
| 888 | + } | |
| 245 | 889 | |
| 890 | +//#endregion | |
| 891 | +//#region node_modules/@babel/runtime/helpers/esm/extends.js | |
| 892 | + function _extends() { | |
| 893 | + return _extends = Object.assign ? Object.assign.bind() : function(n) { | |
| 894 | + for (var e = 1; e < arguments.length; e++) { | |
| 895 | + var t = arguments[e]; | |
| 896 | + for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | |
| 897 | + } | |
| 898 | + return n; | |
| 899 | + }, _extends.apply(null, arguments); | |
| 900 | + } | |
| 246 | 901 | |
| 247 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 248 | -Object.defineProperty(exports, "__esModule", ({ | |
| 249 | - value: true | |
| 250 | -})); | |
| 251 | -exports.Message = void 0; | |
| 252 | -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 253 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 254 | -var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 255 | -var Message = exports.Message = function Message(_ref) { | |
| 256 | - var action = _ref.action, | |
| 257 | - children = _ref.children, | |
| 258 | - _ref$severity = _ref.severity, | |
| 259 | - severity = _ref$severity === void 0 ? 'message' : _ref$severity, | |
| 260 | - onClose = _ref.onClose; | |
| 261 | - return /*#__PURE__*/_react.default.createElement(_ui.Snackbar, { | |
| 262 | - open: true, | |
| 263 | - autoHideDuration: 4000, | |
| 264 | - anchorOrigin: { | |
| 265 | - vertical: 'bottom', | |
| 266 | - horizontal: 'center' | |
| 267 | - }, | |
| 268 | - onClose: onClose | |
| 269 | - }, 'message' !== severity ? /*#__PURE__*/_react.default.createElement(_ui.Alert, { | |
| 270 | - variant: "filled", | |
| 271 | - severity: severity, | |
| 272 | - onClose: onClose | |
| 273 | - }, children) : /*#__PURE__*/_react.default.createElement(_ui.SnackbarContent, { | |
| 274 | - message: /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 275 | - direction: "row", | |
| 276 | - gap: 1.5, | |
| 277 | - alignItems: "center" | |
| 278 | - }, /*#__PURE__*/_react.default.createElement(_icons.CircleCheckFilledIcon, null), children), | |
| 279 | - action: /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 280 | - direction: "row", | |
| 281 | - spacing: 1, | |
| 282 | - alignItems: "center" | |
| 283 | - }, action, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { | |
| 284 | - color: "inherit", | |
| 285 | - size: "small", | |
| 286 | - onClick: onClose | |
| 287 | - }, /*#__PURE__*/_react.default.createElement(_icons.XIcon, { | |
| 288 | - fontSize: "small" | |
| 289 | - }))) | |
| 290 | - })); | |
| 291 | -}; | |
| 292 | -Message.propTypes = { | |
| 293 | - action: PropTypes.node, | |
| 294 | - children: PropTypes.node, | |
| 295 | - severity: PropTypes.oneOf(['message', 'success', 'warning', 'error']), | |
| 296 | - onClose: PropTypes.func | |
| 297 | -}; | |
| 902 | +//#endregion | |
| 903 | +//#region node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js | |
| 904 | + function _objectWithoutPropertiesLoose(r, e) { | |
| 905 | + if (null == r) return {}; | |
| 906 | + var t = {}; | |
| 907 | + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { | |
| 908 | + if (-1 !== e.indexOf(n)) continue; | |
| 909 | + t[n] = r[n]; | |
| 910 | + } | |
| 911 | + return t; | |
| 912 | + } | |
| 298 | 913 | |
| 299 | -/***/ }), | |
| 914 | +//#endregion | |
| 915 | +//#region node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js | |
| 916 | + function _objectWithoutProperties(e, t) { | |
| 917 | + if (null == e) return {}; | |
| 918 | + var o; | |
| 919 | + var r; | |
| 920 | + var i = _objectWithoutPropertiesLoose(e, t); | |
| 921 | + if (Object.getOwnPropertySymbols) { | |
| 922 | + var n = Object.getOwnPropertySymbols(e); | |
| 923 | + for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); | |
| 924 | + } | |
| 925 | + return i; | |
| 926 | + } | |
| 300 | 927 | |
| 301 | -/***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-terms.js": | |
| 302 | -/*!**********************************************************************!*\ | |
| 303 | - !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-terms.js ***! | |
| 304 | - \**********************************************************************/ | |
| 305 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 928 | +//#endregion | |
| 929 | +//#region modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js | |
| 930 | + var _excluded$1 = ["children"]; | |
| 931 | + var _excluded2 = ["children"]; | |
| 932 | + var _excluded3 = ["children"]; | |
| 933 | + var _excluded4 = ["children"]; | |
| 934 | + var _excluded5 = ["children"]; | |
| 935 | + var TextNode = function TextNode(_ref) { | |
| 936 | + var children = _ref.children; | |
| 937 | + var props = _objectWithoutProperties(_ref, _excluded$1); | |
| 938 | + return /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, _extends({ color: "text.primary" }, props), children); | |
| 939 | + }; | |
| 940 | + TextNode.propTypes = { children: import_prop_types.default.node }; | |
| 941 | + var ContentList = function ContentList(_ref2) { | |
| 942 | + var children = _ref2.children; | |
| 943 | + var props = _objectWithoutProperties(_ref2, _excluded2); | |
| 944 | + return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, _extends({ | |
| 945 | + component: "ul", | |
| 946 | + sx: { listStyle: "disc" } | |
| 947 | + }, props), children); | |
| 948 | + }; | |
| 949 | + ContentList.propTypes = { children: import_prop_types.default.node }; | |
| 950 | + var ContentListItem = function ContentListItem(_ref3) { | |
| 951 | + var children = _ref3.children; | |
| 952 | + var props = _objectWithoutProperties(_ref3, _excluded3); | |
| 953 | + return /*#__PURE__*/ react.default.createElement(TextNode, _extends({ component: "li" }, props), children); | |
| 954 | + }; | |
| 955 | + ContentListItem.propTypes = { children: import_prop_types.default.node }; | |
| 956 | + var AdvantagesList = function AdvantagesList(_ref4) { | |
| 957 | + var children = _ref4.children; | |
| 958 | + var props = _objectWithoutProperties(_ref4, _excluded4); | |
| 959 | + return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, _extends({ | |
| 960 | + component: "ul", | |
| 961 | + sx: { marginInlineStart: 2 } | |
| 962 | + }, props), children); | |
| 963 | + }; | |
| 964 | + AdvantagesList.propTypes = { children: import_prop_types.default.node }; | |
| 965 | + var AdvantagesListItem = function AdvantagesListItem(_ref5) { | |
| 966 | + var children = _ref5.children; | |
| 967 | + var props = _objectWithoutProperties(_ref5, _excluded5); | |
| 968 | + return /*#__PURE__*/ react.default.createElement(TextNode, _extends({ | |
| 969 | + component: "li", | |
| 970 | + sx: { | |
| 971 | + lineHeight: "150%", | |
| 972 | + listStyle: "disc" | |
| 973 | + } | |
| 974 | + }, props), children); | |
| 975 | + }; | |
| 976 | + AdvantagesListItem.propTypes = { children: import_prop_types.default.node }; | |
| 306 | 977 | |
| 307 | -"use strict"; | |
| 308 | -/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 978 | +//#endregion | |
| 979 | +//#region modules/atomic-opt-in/assets/js/opt-in-page/opt-in-img-placeholders.js | |
| 980 | + var ImageLandscapePlaceholder = function ImageLandscapePlaceholder(props) { | |
| 981 | + return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 600 260" }, props), /*#__PURE__*/ react.default.createElement("rect", { | |
| 982 | + x: "0", | |
| 983 | + y: "0", | |
| 984 | + width: "600", | |
| 985 | + height: "260", | |
| 986 | + fill: "#d9d9d9" | |
| 987 | + })); | |
| 988 | + }; | |
| 989 | + var ImageSquarePlaceholder = function ImageSquarePlaceholder(props) { | |
| 990 | + return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 500 500" }, props), /*#__PURE__*/ react.default.createElement("rect", { | |
| 991 | + x: "0", | |
| 992 | + y: "0", | |
| 993 | + width: "500", | |
| 994 | + height: "500", | |
| 995 | + fill: "#d9d9d9" | |
| 996 | + })); | |
| 997 | + }; | |
| 309 | 998 | |
| 999 | +//#endregion | |
| 1000 | +//#region modules/atomic-opt-in/assets/js/opt-in-page/opt-in-message.js | |
| 1001 | + var Message = function Message(_ref) { | |
| 1002 | + var action = _ref.action; | |
| 1003 | + var children = _ref.children; | |
| 1004 | + var _ref$severity = _ref.severity; | |
| 1005 | + var severity = _ref$severity === void 0 ? "message" : _ref$severity; | |
| 1006 | + var onClose = _ref.onClose; | |
| 1007 | + return /*#__PURE__*/ react.default.createElement(_elementor_ui.Snackbar, { | |
| 1008 | + open: true, | |
| 1009 | + autoHideDuration: 4e3, | |
| 1010 | + anchorOrigin: { | |
| 1011 | + vertical: "bottom", | |
| 1012 | + horizontal: "center" | |
| 1013 | + }, | |
| 1014 | + onClose | |
| 1015 | + }, "message" !== severity ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Alert, { | |
| 1016 | + variant: "filled", | |
| 1017 | + severity, | |
| 1018 | + onClose | |
| 1019 | + }, children) : /*#__PURE__*/ react.default.createElement(_elementor_ui.SnackbarContent, { | |
| 1020 | + message: /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 1021 | + direction: "row", | |
| 1022 | + gap: 1.5, | |
| 1023 | + alignItems: "center" | |
| 1024 | + }, /*#__PURE__*/ react.default.createElement(_elementor_icons.CircleCheckFilledIcon, null), children), | |
| 1025 | + action: /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 1026 | + direction: "row", | |
| 1027 | + spacing: 1, | |
| 1028 | + alignItems: "center" | |
| 1029 | + }, action, /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, { | |
| 1030 | + color: "inherit", | |
| 1031 | + size: "small", | |
| 1032 | + onClick: onClose | |
| 1033 | + }, /*#__PURE__*/ react.default.createElement(_elementor_icons.XIcon, { fontSize: "small" }))) | |
| 1034 | + })); | |
| 1035 | + }; | |
| 1036 | + Message.propTypes = { | |
| 1037 | + action: import_prop_types.default.node, | |
| 1038 | + children: import_prop_types.default.node, | |
| 1039 | + severity: import_prop_types.default.oneOf([ | |
| 1040 | + "message", | |
| 1041 | + "success", | |
| 1042 | + "warning", | |
| 1043 | + "error" | |
| 1044 | + ]), | |
| 1045 | + onClose: import_prop_types.default.func | |
| 1046 | + }; | |
| 310 | 1047 | |
| 311 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 312 | -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 313 | -Object.defineProperty(exports, "__esModule", ({ | |
| 314 | - value: true | |
| 315 | -})); | |
| 316 | -exports.Terms = void 0; | |
| 317 | -var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 318 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 319 | -var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 320 | -var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 321 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 322 | -var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 323 | -var _optInContent = __webpack_require__(/*! ./opt-in-content */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js"); | |
| 324 | -var _DialogHeaderGroup = _interopRequireDefault(__webpack_require__(/*! @elementor/ui/DialogHeaderGroup */ "@elementor/ui/DialogHeaderGroup")); | |
| 325 | -var _DialogHeader = _interopRequireDefault(__webpack_require__(/*! @elementor/ui/DialogHeader */ "@elementor/ui/DialogHeader")); | |
| 326 | -var _excluded = ["onClose", "onSubmit", "isEnrolled"]; | |
| 327 | -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } | |
| 328 | -var i18n = { | |
| 329 | - header: (0, _i18n.__)('Atomic Editor', 'elementor'), | |
| 330 | - checkboxText: (0, _i18n.__)('I’ve read and understood.', 'elementor'), | |
| 331 | - optIn: { | |
| 332 | - titleText: (0, _i18n.__)('You are about to enable Atomic Editor features!', 'elementor'), | |
| 333 | - // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace | |
| 334 | - introText: (0, _i18n.__)('By activating, you’ll get access to the next generation of Elementor’s Editor. This is your chance to explore new capabilities and help shape the future of Elementor! ', 'elementor'), | |
| 335 | - details: [(0, _i18n.__)('When you activate, you’ll also be activating Containers and Nested Elements. You can turn them back off by going to: WP Admin > Elementor > Settings > Features.', 'elementor')], | |
| 336 | - activateButton: (0, _i18n.__)('Activate', 'elementor'), | |
| 337 | - cancelButton: (0, _i18n.__)('Cancel', 'elementor') | |
| 338 | - }, | |
| 339 | - optOut: { | |
| 340 | - titleText: (0, _i18n.__)('You\'re about to lose all content created with Atomic features', 'elementor'), | |
| 341 | - details: [(0, _i18n.__)('By deactivating, you’ll lose all Atomic Elements, Classes and Variables. Any content you created with these features will no longer be available or appear on your site.', 'elementor'), (0, _i18n.__)('Containers and Nested Elements will stay in their current status.', 'elementor')], | |
| 342 | - activateButton: (0, _i18n.__)('Deactivate', 'elementor'), | |
| 343 | - cancelButton: (0, _i18n.__)('Cancel', 'elementor') | |
| 344 | - } | |
| 345 | -}; | |
| 346 | -var Terms = exports.Terms = function Terms(_ref) { | |
| 347 | - var onClose = _ref.onClose, | |
| 348 | - onSubmit = _ref.onSubmit, | |
| 349 | - isEnrolled = _ref.isEnrolled, | |
| 350 | - props = (0, _objectWithoutProperties2.default)(_ref, _excluded); | |
| 351 | - var _useState = (0, _react.useState)(false), | |
| 352 | - _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 353 | - checked = _useState2[0], | |
| 354 | - setChecked = _useState2[1]; | |
| 355 | - var handleCheckboxChange = function handleCheckboxChange() { | |
| 356 | - setChecked(function (prev) { | |
| 357 | - return !prev; | |
| 358 | - }); | |
| 359 | - }; | |
| 360 | - var handleSubmit = function handleSubmit() { | |
| 361 | - if (checked) { | |
| 362 | - onSubmit(); | |
| 363 | - } | |
| 364 | - }; | |
| 365 | - var currentState = isEnrolled ? 'optOut' : 'optIn'; | |
| 366 | - return /*#__PURE__*/_react.default.createElement(_ui.Dialog, (0, _extends2.default)({}, props, { | |
| 367 | - open: true, | |
| 368 | - onClose: onClose, | |
| 369 | - maxWidth: "md" | |
| 370 | - }), /*#__PURE__*/_react.default.createElement(_DialogHeader.default, null, /*#__PURE__*/_react.default.createElement(_DialogHeaderGroup.default, null, /*#__PURE__*/_react.default.createElement(_ui.DialogTitle, null, i18n.header))), /*#__PURE__*/_react.default.createElement(_ui.DialogContent, { | |
| 371 | - dividers: true | |
| 372 | - }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 373 | - gap: 2.5 | |
| 374 | - }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 375 | - gap: 1.5, | |
| 376 | - sx: { | |
| 377 | - mx: 2, | |
| 378 | - maxWidth: '550px' | |
| 379 | - } | |
| 380 | - }, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { | |
| 381 | - align: "center", | |
| 382 | - variant: "h6" | |
| 383 | - }, i18n[currentState].titleText), i18n[currentState].introText && /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { | |
| 384 | - align: "center", | |
| 385 | - variant: "body3" | |
| 386 | - }, i18n[currentState].introText)), /*#__PURE__*/_react.default.createElement(_ui.Stack, null, /*#__PURE__*/_react.default.createElement(_optInContent.ContentList, { | |
| 387 | - sx: { | |
| 388 | - mx: 3, | |
| 389 | - maxWidth: '550px' | |
| 390 | - } | |
| 391 | - }, i18n[currentState].details.map(function (entry, index) { | |
| 392 | - return /*#__PURE__*/_react.default.createElement(_optInContent.ContentListItem, { | |
| 393 | - key: index, | |
| 394 | - variant: "body3" | |
| 395 | - }, entry); | |
| 396 | - }))), /*#__PURE__*/_react.default.createElement(_ui.FormControlLabel, { | |
| 397 | - control: /*#__PURE__*/_react.default.createElement(_ui.Checkbox, { | |
| 398 | - checked: !!checked, | |
| 399 | - onChange: handleCheckboxChange, | |
| 400 | - color: "secondary", | |
| 401 | - size: "small" | |
| 402 | - }), | |
| 403 | - label: /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { | |
| 404 | - variant: "body2" | |
| 405 | - }, i18n.checkboxText) | |
| 406 | - }))), /*#__PURE__*/_react.default.createElement(_ui.DialogActions, null, /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 407 | - variant: "text", | |
| 408 | - color: "secondary", | |
| 409 | - onClick: onClose | |
| 410 | - }, i18n[currentState].cancelButton), /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 411 | - disabled: !checked, | |
| 412 | - variant: "contained", | |
| 413 | - onClick: handleSubmit | |
| 414 | - }, i18n[currentState].activateButton))); | |
| 415 | -}; | |
| 416 | -Terms.propTypes = { | |
| 417 | - onClose: PropTypes.func, | |
| 418 | - onSubmit: PropTypes.func, | |
| 419 | - isEnrolled: PropTypes.bool | |
| 420 | -}; | |
| 1048 | +//#endregion | |
| 1049 | +//#region node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js | |
| 1050 | + function asyncGeneratorStep(n, t, e, r, o, a, c) { | |
| 1051 | + try { | |
| 1052 | + var i = n[a](c); | |
| 1053 | + var u = i.value; | |
| 1054 | + } catch (n) { | |
| 1055 | + e(n); | |
| 1056 | + return; | |
| 1057 | + } | |
| 1058 | + i.done ? t(u) : Promise.resolve(u).then(r, o); | |
| 1059 | + } | |
| 1060 | + function _asyncToGenerator(n) { | |
| 1061 | + return function() { | |
| 1062 | + var t = this; | |
| 1063 | + var e = arguments; | |
| 1064 | + return new Promise(function(r, o) { | |
| 1065 | + var a = n.apply(t, e); | |
| 1066 | + function _next(n) { | |
| 1067 | + asyncGeneratorStep(a, r, o, _next, _throw, "next", n); | |
| 1068 | + } | |
| 1069 | + function _throw(n) { | |
| 1070 | + asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); | |
| 1071 | + } | |
| 1072 | + _next(void 0); | |
| 1073 | + }); | |
| 1074 | + }; | |
| 1075 | + } | |
| 421 | 1076 | |
| 422 | -/***/ }), | |
| 1077 | +//#endregion | |
| 1078 | +//#region node_modules/@babel/runtime/helpers/OverloadYield.js | |
| 1079 | + var require_OverloadYield = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1080 | + function _OverloadYield(e, d) { | |
| 1081 | + this.v = e, this.k = d; | |
| 1082 | + } | |
| 1083 | + module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1084 | + })); | |
| 423 | 1085 | |
| 424 | -/***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in.js": | |
| 425 | -/*!****************************************************************!*\ | |
| 426 | - !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in.js ***! | |
| 427 | - \****************************************************************/ | |
| 428 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1086 | +//#endregion | |
| 1087 | +//#region node_modules/@babel/runtime/helpers/regeneratorDefine.js | |
| 1088 | + var require_regeneratorDefine = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1089 | + function _regeneratorDefine(e, r, n, t) { | |
| 1090 | + var i = Object.defineProperty; | |
| 1091 | + try { | |
| 1092 | + i({}, "", {}); | |
| 1093 | + } catch (e) { | |
| 1094 | + i = 0; | |
| 1095 | + } | |
| 1096 | + module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { | |
| 1097 | + function o(r, n) { | |
| 1098 | + _regeneratorDefine(e, r, function(e) { | |
| 1099 | + return this._invoke(r, n, e); | |
| 1100 | + }); | |
| 1101 | + } | |
| 1102 | + r ? i ? i(e, r, { | |
| 1103 | + value: n, | |
| 1104 | + enumerable: !t, | |
| 1105 | + configurable: !t, | |
| 1106 | + writable: !t | |
| 1107 | + }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); | |
| 1108 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); | |
| 1109 | + } | |
| 1110 | + module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1111 | + })); | |
| 429 | 1112 | |
| 430 | -"use strict"; | |
| 431 | -/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 1113 | +//#endregion | |
| 1114 | +//#region node_modules/@babel/runtime/helpers/regenerator.js | |
| 1115 | + var require_regenerator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1116 | + var regeneratorDefine = require_regeneratorDefine(); | |
| 1117 | + function _regenerator() { | |
| 1118 | + /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ | |
| 1119 | + var e; | |
| 1120 | + var t; | |
| 1121 | + var r = "function" == typeof Symbol ? Symbol : {}; | |
| 1122 | + var n = r.iterator || "@@iterator"; | |
| 1123 | + var o = r.toStringTag || "@@toStringTag"; | |
| 1124 | + function i(r, n, o, i) { | |
| 1125 | + var c = n && n.prototype instanceof Generator ? n : Generator; | |
| 1126 | + var u = Object.create(c.prototype); | |
| 1127 | + return regeneratorDefine(u, "_invoke", function(r, n, o) { | |
| 1128 | + var i; | |
| 1129 | + var c; | |
| 1130 | + var u; | |
| 1131 | + var f = 0; | |
| 1132 | + var p = o || []; | |
| 1133 | + var y = !1; | |
| 1134 | + var G = { | |
| 1135 | + p: 0, | |
| 1136 | + n: 0, | |
| 1137 | + v: e, | |
| 1138 | + a: d, | |
| 1139 | + f: d.bind(e, 4), | |
| 1140 | + d: function d(t, r) { | |
| 1141 | + return i = t, c = 0, u = e, G.n = r, a; | |
| 1142 | + } | |
| 1143 | + }; | |
| 1144 | + function d(r, n) { | |
| 1145 | + for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { | |
| 1146 | + var o; | |
| 1147 | + var i = p[t]; | |
| 1148 | + var d = G.p; | |
| 1149 | + var l = i[2]; | |
| 1150 | + r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); | |
| 1151 | + } | |
| 1152 | + if (o || r > 1) return a; | |
| 1153 | + throw y = !0, n; | |
| 1154 | + } | |
| 1155 | + return function(o, p, l) { | |
| 1156 | + if (f > 1) throw TypeError("Generator is already running"); | |
| 1157 | + for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { | |
| 1158 | + i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); | |
| 1159 | + try { | |
| 1160 | + if (f = 2, i) { | |
| 1161 | + if (c || (o = "next"), t = i[o]) { | |
| 1162 | + if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); | |
| 1163 | + if (!t.done) return t; | |
| 1164 | + u = t.value, c < 2 && (c = 0); | |
| 1165 | + } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); | |
| 1166 | + i = e; | |
| 1167 | + } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; | |
| 1168 | + } catch (t) { | |
| 1169 | + i = e, c = 1, u = t; | |
| 1170 | + } finally { | |
| 1171 | + f = 1; | |
| 1172 | + } | |
| 1173 | + } | |
| 1174 | + return { | |
| 1175 | + value: t, | |
| 1176 | + done: y | |
| 1177 | + }; | |
| 1178 | + }; | |
| 1179 | + }(r, o, i), !0), u; | |
| 1180 | + } | |
| 1181 | + var a = {}; | |
| 1182 | + function Generator() {} | |
| 1183 | + function GeneratorFunction() {} | |
| 1184 | + function GeneratorFunctionPrototype() {} | |
| 1185 | + t = Object.getPrototypeOf; | |
| 1186 | + var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() { | |
| 1187 | + return this; | |
| 1188 | + }), t); | |
| 1189 | + var u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); | |
| 1190 | + function f(e) { | |
| 1191 | + return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; | |
| 1192 | + } | |
| 1193 | + return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function() { | |
| 1194 | + return this; | |
| 1195 | + }), regeneratorDefine(u, "toString", function() { | |
| 1196 | + return "[object Generator]"; | |
| 1197 | + }), (module.exports = _regenerator = function _regenerator() { | |
| 1198 | + return { | |
| 1199 | + w: i, | |
| 1200 | + m: f | |
| 1201 | + }; | |
| 1202 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 1203 | + } | |
| 1204 | + module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1205 | + })); | |
| 432 | 1206 | |
| 1207 | +//#endregion | |
| 1208 | +//#region node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js | |
| 1209 | + var require_regeneratorAsyncIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1210 | + var OverloadYield = require_OverloadYield(); | |
| 1211 | + var regeneratorDefine = require_regeneratorDefine(); | |
| 1212 | + function AsyncIterator(t, e) { | |
| 1213 | + function n(r, o, i, f) { | |
| 1214 | + try { | |
| 1215 | + var c = t[r](o); | |
| 1216 | + var u = c.value; | |
| 1217 | + return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) { | |
| 1218 | + n("next", t, i, f); | |
| 1219 | + }, function(t) { | |
| 1220 | + n("throw", t, i, f); | |
| 1221 | + }) : e.resolve(u).then(function(t) { | |
| 1222 | + c.value = t, i(c); | |
| 1223 | + }, function(t) { | |
| 1224 | + return n("throw", t, i, f); | |
| 1225 | + }); | |
| 1226 | + } catch (t) { | |
| 1227 | + f(t); | |
| 1228 | + } | |
| 1229 | + } | |
| 1230 | + var r; | |
| 1231 | + this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() { | |
| 1232 | + return this; | |
| 1233 | + })), regeneratorDefine(this, "_invoke", function(t, o, i) { | |
| 1234 | + function f() { | |
| 1235 | + return new e(function(e, r) { | |
| 1236 | + n(t, i, e, r); | |
| 1237 | + }); | |
| 1238 | + } | |
| 1239 | + return r = r ? r.then(f, f) : f(); | |
| 1240 | + }, !0); | |
| 1241 | + } | |
| 1242 | + module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1243 | + })); | |
| 433 | 1244 | |
| 434 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 435 | -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 436 | -Object.defineProperty(exports, "__esModule", ({ | |
| 437 | - value: true | |
| 438 | -})); | |
| 439 | -exports.OptIn = void 0; | |
| 440 | -var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 441 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 442 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 443 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 444 | -var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 445 | -var _optInContent = __webpack_require__(/*! ./opt-in-content */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js"); | |
| 446 | -var _optInImgPlaceholders = __webpack_require__(/*! ./opt-in-img-placeholders */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-img-placeholders.js"); | |
| 447 | -var _optInMessage = __webpack_require__(/*! ./opt-in-message */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-message.js"); | |
| 448 | -var _optInApi = __webpack_require__(/*! ./opt-in-api */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-api.js"); | |
| 449 | -var _dompurify = _interopRequireDefault(__webpack_require__(/*! dompurify */ "../node_modules/dompurify/dist/purify.cjs.js")); | |
| 450 | -var _optInTerms = __webpack_require__(/*! ./opt-in-terms */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-terms.js"); | |
| 451 | -var _elementorSettingsEdi; | |
| 452 | -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } | |
| 453 | -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | |
| 454 | -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | |
| 455 | -var decodeHtmlUrl = function decodeHtmlUrl(html) { | |
| 456 | - var textarea = document.createElement('textarea'); | |
| 457 | - textarea.innerHTML = html; | |
| 458 | - return textarea.value; | |
| 459 | -}; | |
| 460 | -var OPT_IN_MSG = 'e-editor-v4-opt-in-message'; | |
| 461 | -var OPT_OUT_MSG = 'e-editor-v4-opt-out-message'; | |
| 462 | -var i18n = { | |
| 463 | - title: (0, _i18n.__)('Activate Atomic Editor features', 'elementor'), | |
| 464 | - welcomeText: (0, _i18n.__)('The Atomic Editor presents a new generation of high-performance, flexible building blocks designed for less bloat and precise styling with a unified interface.', 'elementor'), | |
| 465 | - advantages: [[(0, _i18n.__)('Combine legacy widgets & new elements', 'elementor'), (0, _i18n.__)('Your current and new workflows work together on the same page.', 'elementor')], [(0, _i18n.__)('Build reusable design systems', 'elementor'), (0, _i18n.__)('Classes, Variables and Components give you a clear path for scale.', 'elementor')], [(0, _i18n.__)('Consistent styling experience', 'elementor'), (0, _i18n.__)('A unified Style tab for all Atomic Elements with full control over responsive design.', 'elementor')], [(0, _i18n.__)('Unparalleled performance', 'elementor'), (0, _i18n.__)('Cleaner code and a lighter CSS footprint with single-div wrappers.', 'elementor')]], | |
| 466 | - andMore: (0, _i18n.__)('And much more!', 'elementor'), | |
| 467 | - readMore: (0, _i18n.__)('Learn more', 'elementor'), | |
| 468 | - feedback: (0, _i18n.__)('We’d love your feedback!', 'elementor'), | |
| 469 | - overToGithub: (0, _i18n.__)('Head over to Github', 'elementor'), | |
| 470 | - tellUsWhy: (0, _i18n.__)('Tell us why', 'elementor'), | |
| 471 | - image: (0, _i18n.__)('Editor V4', 'elementor'), | |
| 472 | - buttons: { | |
| 473 | - tryOut: (0, _i18n.__)('Try out the new experience', 'elementor'), | |
| 474 | - optIn: (0, _i18n.__)('Activate the new experience', 'elementor'), | |
| 475 | - optOut: (0, _i18n.__)('Deactivate', 'elementor') | |
| 476 | - }, | |
| 477 | - messages: { | |
| 478 | - optInSuccess: (0, _i18n.__)('Welcome! You’ve got the newest version of the editor.', 'elementor'), | |
| 479 | - optOut: (0, _i18n.__)('You’ve deactivated the new Editor. Have feedback?', 'elementor'), | |
| 480 | - error: (0, _i18n.__)('Ouch, there was a glitch. Try activating again soon.', 'elementor') | |
| 481 | - } | |
| 482 | -}; | |
| 483 | -var optInLinks = { | |
| 484 | - feedbackUrl: 'https://go.elementor.com/wp-dash-opt-in-v4-feedback/', | |
| 485 | - readMoreUrl: 'https://go.elementor.com/wp-dash-opt-in-v4-help-center/', | |
| 486 | - tryOutUrl: _dompurify.default.sanitize(decodeHtmlUrl((_elementorSettingsEdi = elementorSettingsEditor4OptIn) === null || _elementorSettingsEdi === void 0 || (_elementorSettingsEdi = _elementorSettingsEdi.urls) === null || _elementorSettingsEdi === void 0 ? void 0 : _elementorSettingsEdi.start_building)) || '#' | |
| 487 | -}; | |
| 488 | -var optInImages = { | |
| 489 | - square: { | |
| 490 | - src: 'https://assets.elementor.com/v4-promotion/v1/images/v4_opt_in_500.png', | |
| 491 | - sx: { | |
| 492 | - width: '100%', | |
| 493 | - maxHeight: '507px', | |
| 494 | - maxWidth: 'sm', | |
| 495 | - height: 'auto', | |
| 496 | - mx: 'auto', | |
| 497 | - borderRadius: 2 | |
| 498 | - } | |
| 499 | - }, | |
| 500 | - landscape: { | |
| 501 | - src: 'https://assets.elementor.com/v4-promotion/v1/images/v4_opt_in_260.png', | |
| 502 | - sx: { | |
| 503 | - width: '100%', | |
| 504 | - height: 'auto', | |
| 505 | - maxHeight: '260px', | |
| 506 | - mx: 'auto', | |
| 507 | - maxWidth: 'sm', | |
| 508 | - borderRadius: 2 | |
| 509 | - } | |
| 510 | - } | |
| 511 | -}; | |
| 512 | -var OptIn = exports.OptIn = function OptIn(_ref) { | |
| 513 | - var _state$features; | |
| 514 | - var state = _ref.state; | |
| 515 | - var _useState = (0, _react.useState)(false), | |
| 516 | - _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 517 | - showTerms = _useState2[0], | |
| 518 | - setShowTerms = _useState2[1]; | |
| 519 | - var _useState3 = (0, _react.useState)(''), | |
| 520 | - _useState4 = (0, _slicedToArray2.default)(_useState3, 2), | |
| 521 | - optInMessage = _useState4[0], | |
| 522 | - setOptInMessage = _useState4[1]; | |
| 523 | - var _useState5 = (0, _react.useState)(''), | |
| 524 | - _useState6 = (0, _slicedToArray2.default)(_useState5, 2), | |
| 525 | - optOutMessage = _useState6[0], | |
| 526 | - setOptOutMessage = _useState6[1]; | |
| 527 | - var _useState7 = (0, _react.useState)(''), | |
| 528 | - _useState8 = (0, _slicedToArray2.default)(_useState7, 2), | |
| 529 | - errorMessage = _useState8[0], | |
| 530 | - setErrorMessage = _useState8[1]; | |
| 531 | - (0, _react.useEffect)(function () { | |
| 532 | - var optInMsg = sessionStorage.getItem(OPT_IN_MSG); | |
| 533 | - var optOutMsg = sessionStorage.getItem(OPT_OUT_MSG); | |
| 534 | - if (optInMsg) { | |
| 535 | - setTimeout(function () { | |
| 536 | - setOptInMessage(optInMsg); | |
| 537 | - }, 100); | |
| 538 | - sessionStorage.removeItem(OPT_IN_MSG); | |
| 539 | - } | |
| 540 | - if (optOutMsg) { | |
| 541 | - setTimeout(function () { | |
| 542 | - setOptOutMessage(optOutMsg); | |
| 543 | - }, 100); | |
| 544 | - sessionStorage.removeItem(OPT_OUT_MSG); | |
| 545 | - } | |
| 546 | - }, []); | |
| 547 | - var maybeOptIn = function maybeOptIn() { | |
| 548 | - (0, _optInApi.triggerOptIn)().then(function () { | |
| 549 | - sessionStorage.setItem(OPT_IN_MSG, i18n.messages.optInSuccess); | |
| 550 | - window.location.reload(); | |
| 551 | - }).catch(function () { | |
| 552 | - setErrorMessage(i18n.messages.error); | |
| 553 | - }); | |
| 554 | - }; | |
| 555 | - var maybeOptOut = function maybeOptOut() { | |
| 556 | - (0, _optInApi.triggerOptOut)().then(function () { | |
| 557 | - sessionStorage.setItem(OPT_OUT_MSG, i18n.messages.optOut); | |
| 558 | - window.location.reload(); | |
| 559 | - }).catch(function () { | |
| 560 | - setErrorMessage(i18n.messages.error); | |
| 561 | - }); | |
| 562 | - }; | |
| 563 | - var handlePopoverClose = function handlePopoverClose() { | |
| 564 | - setShowTerms(false); | |
| 565 | - }; | |
| 566 | - var isEnrolled = !!(state !== null && state !== void 0 && (_state$features = state.features) !== null && _state$features !== void 0 && _state$features.editor_v4); | |
| 567 | - return /*#__PURE__*/_react.default.createElement(_ui.Container, { | |
| 568 | - maxWidth: "xl", | |
| 569 | - sx: { | |
| 570 | - marginBlockStart: 2.5, | |
| 571 | - display: 'flex', | |
| 572 | - flexBasis: '100%', | |
| 573 | - gap: 3, | |
| 574 | - flexDirection: { | |
| 575 | - xs: 'column-reverse', | |
| 576 | - md: 'row' | |
| 577 | - } | |
| 578 | - } | |
| 579 | - }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 580 | - sx: { | |
| 581 | - flex: 1, | |
| 582 | - maxWidth: { | |
| 583 | - md: '580px', | |
| 584 | - sm: '600px' | |
| 585 | - }, | |
| 586 | - gap: 2.5, | |
| 587 | - mx: 'auto' | |
| 588 | - } | |
| 589 | - }, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { | |
| 590 | - variant: "h4", | |
| 591 | - width: "fit-content" | |
| 592 | - }, /*#__PURE__*/_react.default.createElement("span", null, i18n.title)), /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 593 | - direction: "column", | |
| 594 | - gap: 1 | |
| 595 | - }, /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, null, i18n.welcomeText)), /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesList, { | |
| 596 | - sx: { | |
| 597 | - gap: 0.5 | |
| 598 | - } | |
| 599 | - }, i18n.advantages.map(function (entry, i) { | |
| 600 | - return /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesListItem, { | |
| 601 | - key: i | |
| 602 | - }, /*#__PURE__*/_react.default.createElement("b", null, entry[0]), " - ", entry[1]); | |
| 603 | - }), /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesListItem, { | |
| 604 | - key: i18n.advantages.length | |
| 605 | - }, i18n.andMore, " ", /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 606 | - color: "text.primary", | |
| 607 | - href: optInLinks.readMoreUrl, | |
| 608 | - target: "_blank" | |
| 609 | - }, i18n.readMore))))), /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 610 | - direction: "column", | |
| 611 | - width: "clamp(240px, max(340px, 75%), 340px)", | |
| 612 | - maxWidth: "100%", | |
| 613 | - gap: 2 | |
| 614 | - }, !isEnrolled ? /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 615 | - onClick: function onClick() { | |
| 616 | - setShowTerms(true); | |
| 617 | - }, | |
| 618 | - size: "large", | |
| 619 | - color: "primary", | |
| 620 | - variant: "contained", | |
| 621 | - sx: { | |
| 622 | - flexGrow: 1 | |
| 623 | - } | |
| 624 | - }, i18n.buttons.optIn) : /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 625 | - onClick: function onClick() { | |
| 626 | - return window.location.href = optInLinks.tryOutUrl; | |
| 627 | - }, | |
| 628 | - size: "large", | |
| 629 | - color: "primary", | |
| 630 | - variant: "contained", | |
| 631 | - sx: { | |
| 632 | - flexGrow: 1 | |
| 633 | - } | |
| 634 | - }, i18n.buttons.tryOut), /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 635 | - onClick: function onClick() { | |
| 636 | - setShowTerms(true); | |
| 637 | - }, | |
| 638 | - size: "large", | |
| 639 | - color: "secondary", | |
| 640 | - variant: "outlined", | |
| 641 | - sx: { | |
| 642 | - flexGrow: 1, | |
| 643 | - visibility: isEnrolled ? 'visible' : 'hidden' | |
| 644 | - } | |
| 645 | - }, i18n.buttons.optOut)), /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, null, i18n.feedback, " ", /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 646 | - underline: "hover", | |
| 647 | - href: optInLinks.feedbackUrl, | |
| 648 | - target: "_blank" | |
| 649 | - }, i18n.overToGithub))), /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 650 | - sx: { | |
| 651 | - flex: 1, | |
| 652 | - px: 0, | |
| 653 | - maxWidth: { | |
| 654 | - md: '507px', | |
| 655 | - sm: '600px' | |
| 656 | - }, | |
| 657 | - mx: 'auto' | |
| 658 | - } | |
| 659 | - }, optInImages.square.src ? /*#__PURE__*/_react.default.createElement(_ui.Image, { | |
| 660 | - src: optInImages.square.src, | |
| 661 | - alt: i18n.image, | |
| 662 | - sx: _objectSpread(_objectSpread({}, optInImages.square.sx), {}, { | |
| 663 | - display: { | |
| 664 | - xs: 'none', | |
| 665 | - md: 'block' | |
| 666 | - } | |
| 667 | - }) | |
| 668 | - }) : /*#__PURE__*/_react.default.createElement(_optInImgPlaceholders.ImageSquarePlaceholder, { | |
| 669 | - sx: _objectSpread(_objectSpread({}, optInImages.square.sx), {}, { | |
| 670 | - display: { | |
| 671 | - xs: 'none', | |
| 672 | - md: 'block' | |
| 673 | - } | |
| 674 | - }) | |
| 675 | - }), optInImages.landscape.src ? /*#__PURE__*/_react.default.createElement(_ui.Image, { | |
| 676 | - src: optInImages.landscape.src, | |
| 677 | - alt: i18n.image, | |
| 678 | - sx: _objectSpread(_objectSpread({}, optInImages.landscape.sx), {}, { | |
| 679 | - display: { | |
| 680 | - xs: 'block', | |
| 681 | - md: 'none' | |
| 682 | - } | |
| 683 | - }) | |
| 684 | - }) : /*#__PURE__*/_react.default.createElement(_optInImgPlaceholders.ImageLandscapePlaceholder, { | |
| 685 | - sx: _objectSpread(_objectSpread({}, optInImages.landscape.sx), {}, { | |
| 686 | - display: { | |
| 687 | - xs: 'block', | |
| 688 | - md: 'none' | |
| 689 | - } | |
| 690 | - }) | |
| 691 | - })), showTerms && /*#__PURE__*/_react.default.createElement(_optInTerms.Terms, { | |
| 692 | - onClose: handlePopoverClose, | |
| 693 | - onSubmit: isEnrolled ? maybeOptOut : maybeOptIn, | |
| 694 | - isEnrolled: isEnrolled | |
| 695 | - }), optInMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, { | |
| 696 | - onClose: function onClose() { | |
| 697 | - return setOptInMessage(''); | |
| 698 | - }, | |
| 699 | - action: /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 700 | - href: optInLinks.tryOutUrl, | |
| 701 | - color: "#FFFFFF", | |
| 702 | - sx: { | |
| 703 | - cursor: 'pointer', | |
| 704 | - textDecoration: 'none', | |
| 705 | - pl: 3 | |
| 706 | - } | |
| 707 | - }, i18n.buttons.tryOut) | |
| 708 | - }, optInMessage), optOutMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, { | |
| 709 | - onClose: function onClose() { | |
| 710 | - return setOptOutMessage(''); | |
| 711 | - }, | |
| 712 | - action: /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 713 | - href: optInLinks.feedbackUrl, | |
| 714 | - target: "_blank", | |
| 715 | - color: "#FFFFFF", | |
| 716 | - sx: { | |
| 717 | - cursor: 'pointer', | |
| 718 | - textDecoration: 'none', | |
| 719 | - pl: 3 | |
| 720 | - } | |
| 721 | - }, i18n.tellUsWhy) | |
| 722 | - }, optOutMessage), errorMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, { | |
| 723 | - severity: "error", | |
| 724 | - onClose: function onClose() { | |
| 725 | - return setErrorMessage(''); | |
| 726 | - } | |
| 727 | - }, errorMessage)); | |
| 728 | -}; | |
| 729 | -OptIn.propTypes = { | |
| 730 | - state: PropTypes.shape({ | |
| 731 | - features: PropTypes.shape({ | |
| 732 | - editor_v4: PropTypes.bool | |
| 733 | - }) | |
| 734 | - }).isRequired | |
| 735 | -}; | |
| 1245 | +//#endregion | |
| 1246 | +//#region node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js | |
| 1247 | + var require_regeneratorAsyncGen = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1248 | + var regenerator = require_regenerator$1(); | |
| 1249 | + var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); | |
| 1250 | + function _regeneratorAsyncGen(r, e, t, o, n) { | |
| 1251 | + return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); | |
| 1252 | + } | |
| 1253 | + module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1254 | + })); | |
| 736 | 1255 | |
| 737 | -/***/ }), | |
| 1256 | +//#endregion | |
| 1257 | +//#region node_modules/@babel/runtime/helpers/regeneratorAsync.js | |
| 1258 | + var require_regeneratorAsync = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1259 | + var regeneratorAsyncGen = require_regeneratorAsyncGen(); | |
| 1260 | + function _regeneratorAsync(n, e, r, t, o) { | |
| 1261 | + var a = regeneratorAsyncGen(n, e, r, t, o); | |
| 1262 | + return a.next().then(function(n) { | |
| 1263 | + return n.done ? n.value : a.next(); | |
| 1264 | + }); | |
| 1265 | + } | |
| 1266 | + module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1267 | + })); | |
| 738 | 1268 | |
| 739 | -/***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js": | |
| 740 | -/*!***************************************************************!*\ | |
| 741 | - !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***! | |
| 742 | - \***************************************************************/ | |
| 743 | -/***/ ((module) => { | |
| 1269 | +//#endregion | |
| 1270 | +//#region node_modules/@babel/runtime/helpers/regeneratorKeys.js | |
| 1271 | + var require_regeneratorKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1272 | + function _regeneratorKeys(e) { | |
| 1273 | + var n = Object(e); | |
| 1274 | + var r = []; | |
| 1275 | + for (var t in n) r.unshift(t); | |
| 1276 | + return function e() { | |
| 1277 | + for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; | |
| 1278 | + return e.done = !0, e; | |
| 1279 | + }; | |
| 1280 | + } | |
| 1281 | + module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1282 | + })); | |
| 744 | 1283 | |
| 745 | -function _OverloadYield(e, d) { | |
| 746 | - this.v = e, this.k = d; | |
| 747 | -} | |
| 748 | -module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1284 | +//#endregion | |
| 1285 | +//#region node_modules/@babel/runtime/helpers/typeof.js | |
| 1286 | + var require_typeof = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1287 | + function _typeof(o) { | |
| 1288 | + "@babel/helpers - typeof"; | |
| 1289 | + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 1290 | + return typeof o; | |
| 1291 | + } : function(o) { | |
| 1292 | + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 1293 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); | |
| 1294 | + } | |
| 1295 | + module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1296 | + })); | |
| 749 | 1297 | |
| 750 | -/***/ }), | |
| 1298 | +//#endregion | |
| 1299 | +//#region node_modules/@babel/runtime/helpers/regeneratorValues.js | |
| 1300 | + var require_regeneratorValues = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1301 | + var _typeof = require_typeof()["default"]; | |
| 1302 | + function _regeneratorValues(e) { | |
| 1303 | + if (null != e) { | |
| 1304 | + var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"]; | |
| 1305 | + var r = 0; | |
| 1306 | + if (t) return t.call(e); | |
| 1307 | + if ("function" == typeof e.next) return e; | |
| 1308 | + if (!isNaN(e.length)) return { next: function next() { | |
| 1309 | + return e && r >= e.length && (e = void 0), { | |
| 1310 | + value: e && e[r++], | |
| 1311 | + done: !e | |
| 1312 | + }; | |
| 1313 | + } }; | |
| 1314 | + } | |
| 1315 | + throw new TypeError(_typeof(e) + " is not iterable"); | |
| 1316 | + } | |
| 1317 | + module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1318 | + })); | |
| 751 | 1319 | |
| 752 | -/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": | |
| 753 | -/*!******************************************************************!*\ | |
| 754 | - !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! | |
| 755 | - \******************************************************************/ | |
| 756 | -/***/ ((module) => { | |
| 1320 | +//#endregion | |
| 1321 | +//#region node_modules/@babel/runtime/helpers/regeneratorRuntime.js | |
| 1322 | + var require_regeneratorRuntime = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1323 | + var OverloadYield = require_OverloadYield(); | |
| 1324 | + var regenerator = require_regenerator$1(); | |
| 1325 | + var regeneratorAsync = require_regeneratorAsync(); | |
| 1326 | + var regeneratorAsyncGen = require_regeneratorAsyncGen(); | |
| 1327 | + var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); | |
| 1328 | + var regeneratorKeys = require_regeneratorKeys(); | |
| 1329 | + var regeneratorValues = require_regeneratorValues(); | |
| 1330 | + function _regeneratorRuntime() { | |
| 1331 | + "use strict"; | |
| 1332 | + var r = regenerator(); | |
| 1333 | + var e = r.m(_regeneratorRuntime); | |
| 1334 | + var t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; | |
| 1335 | + function n(r) { | |
| 1336 | + var e = "function" == typeof r && r.constructor; | |
| 1337 | + return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); | |
| 1338 | + } | |
| 1339 | + var o = { | |
| 1340 | + "throw": 1, | |
| 1341 | + "return": 2, | |
| 1342 | + "break": 3, | |
| 1343 | + "continue": 3 | |
| 1344 | + }; | |
| 1345 | + function a(r) { | |
| 1346 | + var e; | |
| 1347 | + var t; | |
| 1348 | + return function(n) { | |
| 1349 | + e || (e = { | |
| 1350 | + stop: function stop() { | |
| 1351 | + return t(n.a, 2); | |
| 1352 | + }, | |
| 1353 | + "catch": function _catch() { | |
| 1354 | + return n.v; | |
| 1355 | + }, | |
| 1356 | + abrupt: function abrupt(r, e) { | |
| 1357 | + return t(n.a, o[r], e); | |
| 1358 | + }, | |
| 1359 | + delegateYield: function delegateYield(r, o, a) { | |
| 1360 | + return e.resultName = o, t(n.d, regeneratorValues(r), a); | |
| 1361 | + }, | |
| 1362 | + finish: function finish(r) { | |
| 1363 | + return t(n.f, r); | |
| 1364 | + } | |
| 1365 | + }, t = function t(r, _t, o) { | |
| 1366 | + n.p = e.prev, n.n = e.next; | |
| 1367 | + try { | |
| 1368 | + return r(_t, o); | |
| 1369 | + } finally { | |
| 1370 | + e.next = n.n; | |
| 1371 | + } | |
| 1372 | + }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; | |
| 1373 | + try { | |
| 1374 | + return r.call(this, e); | |
| 1375 | + } finally { | |
| 1376 | + n.p = e.prev, n.n = e.next; | |
| 1377 | + } | |
| 1378 | + }; | |
| 1379 | + } | |
| 1380 | + return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { | |
| 1381 | + return { | |
| 1382 | + wrap: function wrap(e, t, n, o) { | |
| 1383 | + return r.w(a(e), t, n, o && o.reverse()); | |
| 1384 | + }, | |
| 1385 | + isGeneratorFunction: n, | |
| 1386 | + mark: r.m, | |
| 1387 | + awrap: function awrap(r, e) { | |
| 1388 | + return new OverloadYield(r, e); | |
| 1389 | + }, | |
| 1390 | + AsyncIterator: regeneratorAsyncIterator, | |
| 1391 | + async: function async(r, e, t, o, u) { | |
| 1392 | + return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); | |
| 1393 | + }, | |
| 1394 | + keys: regeneratorKeys, | |
| 1395 | + values: regeneratorValues | |
| 1396 | + }; | |
| 1397 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 1398 | + } | |
| 1399 | + module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1400 | + })); | |
| 757 | 1401 | |
| 758 | -function _arrayLikeToArray(r, a) { | |
| 759 | - (null == a || a > r.length) && (a = r.length); | |
| 760 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 761 | - return n; | |
| 762 | -} | |
| 763 | -module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1402 | +//#endregion | |
| 1403 | +//#region node_modules/@babel/runtime/regenerator/index.js | |
| 1404 | + var require_regenerator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1405 | + var runtime = require_regeneratorRuntime()(); | |
| 1406 | + module.exports = runtime; | |
| 1407 | + try { | |
| 1408 | + regeneratorRuntime = runtime; | |
| 1409 | + } catch (accidentalStrictMode) { | |
| 1410 | + if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime; | |
| 1411 | + else Function("r", "regeneratorRuntime = r")(runtime); | |
| 1412 | + } | |
| 1413 | + })); | |
| 764 | 1414 | |
| 765 | -/***/ }), | |
| 1415 | +//#endregion | |
| 1416 | +//#region modules/atomic-opt-in/assets/js/opt-in-page/opt-in-api.js | |
| 1417 | + var import_regenerator = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 1418 | + var triggerOptIn = /*#__PURE__*/ function() { | |
| 1419 | + var _ref = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() { | |
| 1420 | + return import_regenerator.default.wrap(function(_context) { | |
| 1421 | + while (1) switch (_context.prev = _context.next) { | |
| 1422 | + case 0: return _context.abrupt("return", elementorCommon.ajax.addRequest("editor_v4_opt_in")); | |
| 1423 | + case 1: | |
| 1424 | + case "end": return _context.stop(); | |
| 1425 | + } | |
| 1426 | + }, _callee); | |
| 1427 | + })); | |
| 1428 | + return function triggerOptIn() { | |
| 1429 | + return _ref.apply(this, arguments); | |
| 1430 | + }; | |
| 1431 | + }(); | |
| 1432 | + var triggerOptOut = /*#__PURE__*/ function() { | |
| 1433 | + var _ref2 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee2() { | |
| 1434 | + return import_regenerator.default.wrap(function(_context2) { | |
| 1435 | + while (1) switch (_context2.prev = _context2.next) { | |
| 1436 | + case 0: return _context2.abrupt("return", elementorCommon.ajax.addRequest("editor_v4_opt_out")); | |
| 1437 | + case 1: | |
| 1438 | + case "end": return _context2.stop(); | |
| 1439 | + } | |
| 1440 | + }, _callee2); | |
| 1441 | + })); | |
| 1442 | + return function triggerOptOut() { | |
| 1443 | + return _ref2.apply(this, arguments); | |
| 1444 | + }; | |
| 1445 | + }(); | |
| 766 | 1446 | |
| 767 | -/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": | |
| 768 | -/*!****************************************************************!*\ | |
| 769 | - !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! | |
| 770 | - \****************************************************************/ | |
| 771 | -/***/ ((module) => { | |
| 772 | - | |
| 773 | -function _arrayWithHoles(r) { | |
| 774 | - if (Array.isArray(r)) return r; | |
| 775 | -} | |
| 776 | -module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 777 | - | |
| 778 | -/***/ }), | |
| 779 | - | |
| 780 | -/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js": | |
| 781 | -/*!******************************************************************!*\ | |
| 782 | - !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! | |
| 783 | - \******************************************************************/ | |
| 784 | -/***/ ((module) => { | |
| 785 | - | |
| 786 | -function asyncGeneratorStep(n, t, e, r, o, a, c) { | |
| 787 | - try { | |
| 788 | - var i = n[a](c), | |
| 789 | - u = i.value; | |
| 790 | - } catch (n) { | |
| 791 | - return void e(n); | |
| 792 | - } | |
| 793 | - i.done ? t(u) : Promise.resolve(u).then(r, o); | |
| 794 | -} | |
| 795 | -function _asyncToGenerator(n) { | |
| 796 | - return function () { | |
| 797 | - var t = this, | |
| 798 | - e = arguments; | |
| 799 | - return new Promise(function (r, o) { | |
| 800 | - var a = n.apply(t, e); | |
| 801 | - function _next(n) { | |
| 802 | - asyncGeneratorStep(a, r, o, _next, _throw, "next", n); | |
| 803 | - } | |
| 804 | - function _throw(n) { | |
| 805 | - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); | |
| 806 | - } | |
| 807 | - _next(void 0); | |
| 808 | - }); | |
| 809 | - }; | |
| 810 | -} | |
| 811 | -module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 812 | - | |
| 813 | -/***/ }), | |
| 814 | - | |
| 815 | -/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": | |
| 816 | -/*!****************************************************************!*\ | |
| 817 | - !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! | |
| 818 | - \****************************************************************/ | |
| 819 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 820 | - | |
| 821 | -var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 822 | -function _defineProperty(e, r, t) { | |
| 823 | - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 824 | - value: t, | |
| 825 | - enumerable: !0, | |
| 826 | - configurable: !0, | |
| 827 | - writable: !0 | |
| 828 | - }) : e[r] = t, e; | |
| 829 | -} | |
| 830 | -module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 831 | - | |
| 832 | -/***/ }), | |
| 833 | - | |
| 834 | -/***/ "../node_modules/@babel/runtime/helpers/extends.js": | |
| 835 | -/*!*********************************************************!*\ | |
| 836 | - !*** ../node_modules/@babel/runtime/helpers/extends.js ***! | |
| 837 | - \*********************************************************/ | |
| 838 | -/***/ ((module) => { | |
| 839 | - | |
| 840 | -function _extends() { | |
| 841 | - return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) { | |
| 842 | - for (var e = 1; e < arguments.length; e++) { | |
| 843 | - var t = arguments[e]; | |
| 844 | - for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | |
| 845 | - } | |
| 846 | - return n; | |
| 847 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments); | |
| 848 | -} | |
| 849 | -module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 850 | - | |
| 851 | -/***/ }), | |
| 852 | - | |
| 853 | -/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": | |
| 854 | -/*!***********************************************************************!*\ | |
| 855 | - !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | |
| 856 | - \***********************************************************************/ | |
| 857 | -/***/ ((module) => { | |
| 858 | - | |
| 859 | -function _interopRequireDefault(e) { | |
| 860 | - return e && e.__esModule ? e : { | |
| 861 | - "default": e | |
| 862 | - }; | |
| 863 | -} | |
| 864 | -module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 865 | - | |
| 866 | -/***/ }), | |
| 867 | - | |
| 868 | -/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": | |
| 869 | -/*!**********************************************************************!*\ | |
| 870 | - !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! | |
| 871 | - \**********************************************************************/ | |
| 872 | -/***/ ((module) => { | |
| 873 | - | |
| 874 | -function _iterableToArrayLimit(r, l) { | |
| 875 | - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 876 | - if (null != t) { | |
| 877 | - var e, | |
| 878 | - n, | |
| 879 | - i, | |
| 880 | - u, | |
| 881 | - a = [], | |
| 882 | - f = !0, | |
| 883 | - o = !1; | |
| 884 | - try { | |
| 885 | - if (i = (t = t.call(r)).next, 0 === l) { | |
| 886 | - if (Object(t) !== t) return; | |
| 887 | - f = !1; | |
| 888 | - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 889 | - } catch (r) { | |
| 890 | - o = !0, n = r; | |
| 891 | - } finally { | |
| 892 | - try { | |
| 893 | - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 894 | - } finally { | |
| 895 | - if (o) throw n; | |
| 896 | - } | |
| 897 | - } | |
| 898 | - return a; | |
| 899 | - } | |
| 900 | -} | |
| 901 | -module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 902 | - | |
| 903 | -/***/ }), | |
| 904 | - | |
| 905 | -/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": | |
| 906 | -/*!*****************************************************************!*\ | |
| 907 | - !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! | |
| 908 | - \*****************************************************************/ | |
| 909 | -/***/ ((module) => { | |
| 910 | - | |
| 911 | -function _nonIterableRest() { | |
| 912 | - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 913 | -} | |
| 914 | -module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 915 | - | |
| 916 | -/***/ }), | |
| 917 | - | |
| 918 | -/***/ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js": | |
| 919 | -/*!*************************************************************************!*\ | |
| 920 | - !*** ../node_modules/@babel/runtime/helpers/objectWithoutProperties.js ***! | |
| 921 | - \*************************************************************************/ | |
| 922 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 923 | - | |
| 924 | -var objectWithoutPropertiesLoose = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"); | |
| 925 | -function _objectWithoutProperties(e, t) { | |
| 926 | - if (null == e) return {}; | |
| 927 | - var o, | |
| 928 | - r, | |
| 929 | - i = objectWithoutPropertiesLoose(e, t); | |
| 930 | - if (Object.getOwnPropertySymbols) { | |
| 931 | - var n = Object.getOwnPropertySymbols(e); | |
| 932 | - for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); | |
| 933 | - } | |
| 934 | - return i; | |
| 935 | -} | |
| 936 | -module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 937 | - | |
| 938 | -/***/ }), | |
| 939 | - | |
| 940 | -/***/ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js": | |
| 941 | -/*!******************************************************************************!*\ | |
| 942 | - !*** ../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***! | |
| 943 | - \******************************************************************************/ | |
| 944 | -/***/ ((module) => { | |
| 945 | - | |
| 946 | -function _objectWithoutPropertiesLoose(r, e) { | |
| 947 | - if (null == r) return {}; | |
| 948 | - var t = {}; | |
| 949 | - for (var n in r) if ({}.hasOwnProperty.call(r, n)) { | |
| 950 | - if (-1 !== e.indexOf(n)) continue; | |
| 951 | - t[n] = r[n]; | |
| 952 | - } | |
| 953 | - return t; | |
| 954 | -} | |
| 955 | -module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 956 | - | |
| 957 | -/***/ }), | |
| 958 | - | |
| 959 | -/***/ "../node_modules/@babel/runtime/helpers/regenerator.js": | |
| 960 | -/*!*************************************************************!*\ | |
| 961 | - !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***! | |
| 962 | - \*************************************************************/ | |
| 963 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 964 | - | |
| 965 | -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js"); | |
| 966 | -function _regenerator() { | |
| 967 | - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ | |
| 968 | - var e, | |
| 969 | - t, | |
| 970 | - r = "function" == typeof Symbol ? Symbol : {}, | |
| 971 | - n = r.iterator || "@@iterator", | |
| 972 | - o = r.toStringTag || "@@toStringTag"; | |
| 973 | - function i(r, n, o, i) { | |
| 974 | - var c = n && n.prototype instanceof Generator ? n : Generator, | |
| 975 | - u = Object.create(c.prototype); | |
| 976 | - return regeneratorDefine(u, "_invoke", function (r, n, o) { | |
| 977 | - var i, | |
| 978 | - c, | |
| 979 | - u, | |
| 980 | - f = 0, | |
| 981 | - p = o || [], | |
| 982 | - y = !1, | |
| 983 | - G = { | |
| 984 | - p: 0, | |
| 985 | - n: 0, | |
| 986 | - v: e, | |
| 987 | - a: d, | |
| 988 | - f: d.bind(e, 4), | |
| 989 | - d: function d(t, r) { | |
| 990 | - return i = t, c = 0, u = e, G.n = r, a; | |
| 991 | - } | |
| 992 | - }; | |
| 993 | - function d(r, n) { | |
| 994 | - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { | |
| 995 | - var o, | |
| 996 | - i = p[t], | |
| 997 | - d = G.p, | |
| 998 | - l = i[2]; | |
| 999 | - r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); | |
| 1000 | - } | |
| 1001 | - if (o || r > 1) return a; | |
| 1002 | - throw y = !0, n; | |
| 1003 | - } | |
| 1004 | - return function (o, p, l) { | |
| 1005 | - if (f > 1) throw TypeError("Generator is already running"); | |
| 1006 | - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { | |
| 1007 | - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); | |
| 1008 | - try { | |
| 1009 | - if (f = 2, i) { | |
| 1010 | - if (c || (o = "next"), t = i[o]) { | |
| 1011 | - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); | |
| 1012 | - if (!t.done) return t; | |
| 1013 | - u = t.value, c < 2 && (c = 0); | |
| 1014 | - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); | |
| 1015 | - i = e; | |
| 1016 | - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; | |
| 1017 | - } catch (t) { | |
| 1018 | - i = e, c = 1, u = t; | |
| 1019 | - } finally { | |
| 1020 | - f = 1; | |
| 1021 | - } | |
| 1022 | - } | |
| 1023 | - return { | |
| 1024 | - value: t, | |
| 1025 | - done: y | |
| 1026 | - }; | |
| 1027 | - }; | |
| 1028 | - }(r, o, i), !0), u; | |
| 1029 | - } | |
| 1030 | - var a = {}; | |
| 1031 | - function Generator() {} | |
| 1032 | - function GeneratorFunction() {} | |
| 1033 | - function GeneratorFunctionPrototype() {} | |
| 1034 | - t = Object.getPrototypeOf; | |
| 1035 | - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () { | |
| 1036 | - return this; | |
| 1037 | - }), t), | |
| 1038 | - u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); | |
| 1039 | - function f(e) { | |
| 1040 | - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; | |
| 1041 | - } | |
| 1042 | - return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () { | |
| 1043 | - return this; | |
| 1044 | - }), regeneratorDefine(u, "toString", function () { | |
| 1045 | - return "[object Generator]"; | |
| 1046 | - }), (module.exports = _regenerator = function _regenerator() { | |
| 1047 | - return { | |
| 1048 | - w: i, | |
| 1049 | - m: f | |
| 1050 | - }; | |
| 1051 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 1052 | -} | |
| 1053 | -module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1054 | - | |
| 1055 | -/***/ }), | |
| 1056 | - | |
| 1057 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js": | |
| 1058 | -/*!******************************************************************!*\ | |
| 1059 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***! | |
| 1060 | - \******************************************************************/ | |
| 1061 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1062 | - | |
| 1063 | -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"); | |
| 1064 | -function _regeneratorAsync(n, e, r, t, o) { | |
| 1065 | - var a = regeneratorAsyncGen(n, e, r, t, o); | |
| 1066 | - return a.next().then(function (n) { | |
| 1067 | - return n.done ? n.value : a.next(); | |
| 1068 | - }); | |
| 1069 | -} | |
| 1070 | -module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1071 | - | |
| 1072 | -/***/ }), | |
| 1073 | - | |
| 1074 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js": | |
| 1075 | -/*!*********************************************************************!*\ | |
| 1076 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***! | |
| 1077 | - \*********************************************************************/ | |
| 1078 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1079 | - | |
| 1080 | -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js"); | |
| 1081 | -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"); | |
| 1082 | -function _regeneratorAsyncGen(r, e, t, o, n) { | |
| 1083 | - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); | |
| 1084 | -} | |
| 1085 | -module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1086 | - | |
| 1087 | -/***/ }), | |
| 1088 | - | |
| 1089 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js": | |
| 1090 | -/*!**************************************************************************!*\ | |
| 1091 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***! | |
| 1092 | - \**************************************************************************/ | |
| 1093 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1094 | - | |
| 1095 | -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js"); | |
| 1096 | -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js"); | |
| 1097 | -function AsyncIterator(t, e) { | |
| 1098 | - function n(r, o, i, f) { | |
| 1099 | - try { | |
| 1100 | - var c = t[r](o), | |
| 1101 | - u = c.value; | |
| 1102 | - return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) { | |
| 1103 | - n("next", t, i, f); | |
| 1104 | - }, function (t) { | |
| 1105 | - n("throw", t, i, f); | |
| 1106 | - }) : e.resolve(u).then(function (t) { | |
| 1107 | - c.value = t, i(c); | |
| 1108 | - }, function (t) { | |
| 1109 | - return n("throw", t, i, f); | |
| 1110 | - }); | |
| 1111 | - } catch (t) { | |
| 1112 | - f(t); | |
| 1113 | - } | |
| 1114 | - } | |
| 1115 | - var r; | |
| 1116 | - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { | |
| 1117 | - return this; | |
| 1118 | - })), regeneratorDefine(this, "_invoke", function (t, o, i) { | |
| 1119 | - function f() { | |
| 1120 | - return new e(function (e, r) { | |
| 1121 | - n(t, i, e, r); | |
| 1122 | - }); | |
| 1123 | - } | |
| 1124 | - return r = r ? r.then(f, f) : f(); | |
| 1125 | - }, !0); | |
| 1126 | -} | |
| 1127 | -module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1128 | - | |
| 1129 | -/***/ }), | |
| 1130 | - | |
| 1131 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js": | |
| 1132 | -/*!*******************************************************************!*\ | |
| 1133 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***! | |
| 1134 | - \*******************************************************************/ | |
| 1135 | -/***/ ((module) => { | |
| 1136 | - | |
| 1137 | -function _regeneratorDefine(e, r, n, t) { | |
| 1138 | - var i = Object.defineProperty; | |
| 1139 | - try { | |
| 1140 | - i({}, "", {}); | |
| 1141 | - } catch (e) { | |
| 1142 | - i = 0; | |
| 1143 | - } | |
| 1144 | - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { | |
| 1145 | - function o(r, n) { | |
| 1146 | - _regeneratorDefine(e, r, function (e) { | |
| 1147 | - return this._invoke(r, n, e); | |
| 1148 | - }); | |
| 1149 | - } | |
| 1150 | - r ? i ? i(e, r, { | |
| 1151 | - value: n, | |
| 1152 | - enumerable: !t, | |
| 1153 | - configurable: !t, | |
| 1154 | - writable: !t | |
| 1155 | - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); | |
| 1156 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); | |
| 1157 | -} | |
| 1158 | -module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1159 | - | |
| 1160 | -/***/ }), | |
| 1161 | - | |
| 1162 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js": | |
| 1163 | -/*!*****************************************************************!*\ | |
| 1164 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***! | |
| 1165 | - \*****************************************************************/ | |
| 1166 | -/***/ ((module) => { | |
| 1167 | - | |
| 1168 | -function _regeneratorKeys(e) { | |
| 1169 | - var n = Object(e), | |
| 1170 | - r = []; | |
| 1171 | - for (var t in n) r.unshift(t); | |
| 1172 | - return function e() { | |
| 1173 | - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; | |
| 1174 | - return e.done = !0, e; | |
| 1175 | - }; | |
| 1176 | -} | |
| 1177 | -module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1178 | - | |
| 1179 | -/***/ }), | |
| 1180 | - | |
| 1181 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js": | |
| 1182 | -/*!********************************************************************!*\ | |
| 1183 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! | |
| 1184 | - \********************************************************************/ | |
| 1185 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1186 | - | |
| 1187 | -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js"); | |
| 1188 | -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js"); | |
| 1189 | -var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js"); | |
| 1190 | -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"); | |
| 1191 | -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"); | |
| 1192 | -var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js"); | |
| 1193 | -var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js"); | |
| 1194 | -function _regeneratorRuntime() { | |
| 1195 | - "use strict"; | |
| 1196 | - | |
| 1197 | - var r = regenerator(), | |
| 1198 | - e = r.m(_regeneratorRuntime), | |
| 1199 | - t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; | |
| 1200 | - function n(r) { | |
| 1201 | - var e = "function" == typeof r && r.constructor; | |
| 1202 | - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); | |
| 1203 | - } | |
| 1204 | - var o = { | |
| 1205 | - "throw": 1, | |
| 1206 | - "return": 2, | |
| 1207 | - "break": 3, | |
| 1208 | - "continue": 3 | |
| 1209 | - }; | |
| 1210 | - function a(r) { | |
| 1211 | - var e, t; | |
| 1212 | - return function (n) { | |
| 1213 | - e || (e = { | |
| 1214 | - stop: function stop() { | |
| 1215 | - return t(n.a, 2); | |
| 1216 | - }, | |
| 1217 | - "catch": function _catch() { | |
| 1218 | - return n.v; | |
| 1219 | - }, | |
| 1220 | - abrupt: function abrupt(r, e) { | |
| 1221 | - return t(n.a, o[r], e); | |
| 1222 | - }, | |
| 1223 | - delegateYield: function delegateYield(r, o, a) { | |
| 1224 | - return e.resultName = o, t(n.d, regeneratorValues(r), a); | |
| 1225 | - }, | |
| 1226 | - finish: function finish(r) { | |
| 1227 | - return t(n.f, r); | |
| 1228 | - } | |
| 1229 | - }, t = function t(r, _t, o) { | |
| 1230 | - n.p = e.prev, n.n = e.next; | |
| 1231 | - try { | |
| 1232 | - return r(_t, o); | |
| 1233 | - } finally { | |
| 1234 | - e.next = n.n; | |
| 1235 | - } | |
| 1236 | - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; | |
| 1237 | - try { | |
| 1238 | - return r.call(this, e); | |
| 1239 | - } finally { | |
| 1240 | - n.p = e.prev, n.n = e.next; | |
| 1241 | - } | |
| 1242 | - }; | |
| 1243 | - } | |
| 1244 | - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { | |
| 1245 | - return { | |
| 1246 | - wrap: function wrap(e, t, n, o) { | |
| 1247 | - return r.w(a(e), t, n, o && o.reverse()); | |
| 1248 | - }, | |
| 1249 | - isGeneratorFunction: n, | |
| 1250 | - mark: r.m, | |
| 1251 | - awrap: function awrap(r, e) { | |
| 1252 | - return new OverloadYield(r, e); | |
| 1253 | - }, | |
| 1254 | - AsyncIterator: regeneratorAsyncIterator, | |
| 1255 | - async: function async(r, e, t, o, u) { | |
| 1256 | - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); | |
| 1257 | - }, | |
| 1258 | - keys: regeneratorKeys, | |
| 1259 | - values: regeneratorValues | |
| 1260 | - }; | |
| 1261 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 1262 | -} | |
| 1263 | -module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1264 | - | |
| 1265 | -/***/ }), | |
| 1266 | - | |
| 1267 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js": | |
| 1268 | -/*!*******************************************************************!*\ | |
| 1269 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***! | |
| 1270 | - \*******************************************************************/ | |
| 1271 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1272 | - | |
| 1273 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 1274 | -function _regeneratorValues(e) { | |
| 1275 | - if (null != e) { | |
| 1276 | - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], | |
| 1277 | - r = 0; | |
| 1278 | - if (t) return t.call(e); | |
| 1279 | - if ("function" == typeof e.next) return e; | |
| 1280 | - if (!isNaN(e.length)) return { | |
| 1281 | - next: function next() { | |
| 1282 | - return e && r >= e.length && (e = void 0), { | |
| 1283 | - value: e && e[r++], | |
| 1284 | - done: !e | |
| 1285 | - }; | |
| 1286 | - } | |
| 1287 | - }; | |
| 1288 | - } | |
| 1289 | - throw new TypeError(_typeof(e) + " is not iterable"); | |
| 1290 | -} | |
| 1291 | -module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1292 | - | |
| 1293 | -/***/ }), | |
| 1294 | - | |
| 1295 | -/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": | |
| 1296 | -/*!***************************************************************!*\ | |
| 1297 | - !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! | |
| 1298 | - \***************************************************************/ | |
| 1299 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1300 | - | |
| 1301 | -var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); | |
| 1302 | -var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); | |
| 1303 | -var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 1304 | -var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); | |
| 1305 | -function _slicedToArray(r, e) { | |
| 1306 | - return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); | |
| 1307 | -} | |
| 1308 | -module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1309 | - | |
| 1310 | -/***/ }), | |
| 1311 | - | |
| 1312 | -/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": | |
| 1313 | -/*!*************************************************************!*\ | |
| 1314 | - !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! | |
| 1315 | - \*************************************************************/ | |
| 1316 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1317 | - | |
| 1318 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 1319 | -function toPrimitive(t, r) { | |
| 1320 | - if ("object" != _typeof(t) || !t) return t; | |
| 1321 | - var e = t[Symbol.toPrimitive]; | |
| 1322 | - if (void 0 !== e) { | |
| 1323 | - var i = e.call(t, r || "default"); | |
| 1324 | - if ("object" != _typeof(i)) return i; | |
| 1325 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 1326 | - } | |
| 1327 | - return ("string" === r ? String : Number)(t); | |
| 1328 | -} | |
| 1329 | -module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1330 | - | |
| 1331 | -/***/ }), | |
| 1332 | - | |
| 1333 | -/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": | |
| 1334 | -/*!***************************************************************!*\ | |
| 1335 | - !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! | |
| 1336 | - \***************************************************************/ | |
| 1337 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1338 | - | |
| 1339 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 1340 | -var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); | |
| 1341 | -function toPropertyKey(t) { | |
| 1342 | - var i = toPrimitive(t, "string"); | |
| 1343 | - return "symbol" == _typeof(i) ? i : i + ""; | |
| 1344 | -} | |
| 1345 | -module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1346 | - | |
| 1347 | -/***/ }), | |
| 1348 | - | |
| 1349 | -/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 1350 | -/*!********************************************************!*\ | |
| 1351 | - !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 1352 | - \********************************************************/ | |
| 1353 | -/***/ ((module) => { | |
| 1354 | - | |
| 1355 | -function _typeof(o) { | |
| 1356 | - "@babel/helpers - typeof"; | |
| 1357 | - | |
| 1358 | - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { | |
| 1359 | - return typeof o; | |
| 1360 | - } : function (o) { | |
| 1361 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 1362 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); | |
| 1363 | -} | |
| 1364 | -module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1365 | - | |
| 1366 | -/***/ }), | |
| 1367 | - | |
| 1368 | -/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": | |
| 1369 | -/*!****************************************************************************!*\ | |
| 1370 | - !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! | |
| 1371 | - \****************************************************************************/ | |
| 1372 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1373 | - | |
| 1374 | -var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 1375 | -function _unsupportedIterableToArray(r, a) { | |
| 1376 | - if (r) { | |
| 1377 | - if ("string" == typeof r) return arrayLikeToArray(r, a); | |
| 1378 | - var t = {}.toString.call(r).slice(8, -1); | |
| 1379 | - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0; | |
| 1380 | - } | |
| 1381 | -} | |
| 1382 | -module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1383 | - | |
| 1384 | -/***/ }), | |
| 1385 | - | |
| 1386 | -/***/ "../node_modules/@babel/runtime/regenerator/index.js": | |
| 1387 | -/*!***********************************************************!*\ | |
| 1388 | - !*** ../node_modules/@babel/runtime/regenerator/index.js ***! | |
| 1389 | - \***********************************************************/ | |
| 1390 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1391 | - | |
| 1392 | -// TODO(Babel 8): Remove this file. | |
| 1393 | - | |
| 1394 | -var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); | |
| 1395 | -module.exports = runtime; | |
| 1396 | - | |
| 1397 | -// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= | |
| 1398 | -try { | |
| 1399 | - regeneratorRuntime = runtime; | |
| 1400 | -} catch (accidentalStrictMode) { | |
| 1401 | - if (typeof globalThis === "object") { | |
| 1402 | - globalThis.regeneratorRuntime = runtime; | |
| 1403 | - } else { | |
| 1404 | - Function("r", "regeneratorRuntime = r")(runtime); | |
| 1405 | - } | |
| 1406 | -} | |
| 1407 | - | |
| 1408 | - | |
| 1409 | -/***/ }), | |
| 1410 | - | |
| 1411 | -/***/ "../node_modules/dompurify/dist/purify.cjs.js": | |
| 1412 | -/*!****************************************************!*\ | |
| 1413 | - !*** ../node_modules/dompurify/dist/purify.cjs.js ***! | |
| 1414 | - \****************************************************/ | |
| 1415 | -/***/ ((module) => { | |
| 1416 | - | |
| 1417 | -"use strict"; | |
| 1447 | +//#endregion | |
| 1448 | +//#region node_modules/dompurify/dist/purify.es.mjs | |
| 1418 | 1449 | /*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */ |
| 1419 | - | |
| 1420 | - | |
| 1421 | - | |
| 1422 | -const { | |
| 1423 | - entries, | |
| 1424 | - setPrototypeOf, | |
| 1425 | - isFrozen, | |
| 1426 | - getPrototypeOf, | |
| 1427 | - getOwnPropertyDescriptor | |
| 1428 | -} = Object; | |
| 1429 | -let { | |
| 1430 | - freeze, | |
| 1431 | - seal, | |
| 1432 | - create | |
| 1433 | -} = Object; // eslint-disable-line import/no-mutable-exports | |
| 1434 | -let { | |
| 1435 | - apply, | |
| 1436 | - construct | |
| 1437 | -} = typeof Reflect !== 'undefined' && Reflect; | |
| 1438 | -if (!freeze) { | |
| 1439 | - freeze = function freeze(x) { | |
| 1440 | - return x; | |
| 1441 | - }; | |
| 1442 | -} | |
| 1443 | -if (!seal) { | |
| 1444 | - seal = function seal(x) { | |
| 1445 | - return x; | |
| 1446 | - }; | |
| 1447 | -} | |
| 1448 | -if (!apply) { | |
| 1449 | - apply = function apply(func, thisArg) { | |
| 1450 | - for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | |
| 1451 | - args[_key - 2] = arguments[_key]; | |
| 1452 | - } | |
| 1453 | - return func.apply(thisArg, args); | |
| 1454 | - }; | |
| 1455 | -} | |
| 1456 | -if (!construct) { | |
| 1457 | - construct = function construct(Func) { | |
| 1458 | - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | |
| 1459 | - args[_key2 - 1] = arguments[_key2]; | |
| 1460 | - } | |
| 1461 | - return new Func(...args); | |
| 1462 | - }; | |
| 1463 | -} | |
| 1464 | -const arrayForEach = unapply(Array.prototype.forEach); | |
| 1465 | -const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf); | |
| 1466 | -const arrayPop = unapply(Array.prototype.pop); | |
| 1467 | -const arrayPush = unapply(Array.prototype.push); | |
| 1468 | -const arraySplice = unapply(Array.prototype.splice); | |
| 1469 | -const stringToLowerCase = unapply(String.prototype.toLowerCase); | |
| 1470 | -const stringToString = unapply(String.prototype.toString); | |
| 1471 | -const stringMatch = unapply(String.prototype.match); | |
| 1472 | -const stringReplace = unapply(String.prototype.replace); | |
| 1473 | -const stringIndexOf = unapply(String.prototype.indexOf); | |
| 1474 | -const stringTrim = unapply(String.prototype.trim); | |
| 1475 | -const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); | |
| 1476 | -const regExpTest = unapply(RegExp.prototype.test); | |
| 1477 | -const typeErrorCreate = unconstruct(TypeError); | |
| 1478 | -/** | |
| 1479 | - * Creates a new function that calls the given function with a specified thisArg and arguments. | |
| 1480 | - * | |
| 1481 | - * @param func - The function to be wrapped and called. | |
| 1482 | - * @returns A new function that calls the given function with a specified thisArg and arguments. | |
| 1483 | - */ | |
| 1484 | -function unapply(func) { | |
| 1485 | - return function (thisArg) { | |
| 1486 | - if (thisArg instanceof RegExp) { | |
| 1487 | - thisArg.lastIndex = 0; | |
| 1488 | - } | |
| 1489 | - for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | |
| 1490 | - args[_key3 - 1] = arguments[_key3]; | |
| 1491 | - } | |
| 1492 | - return apply(func, thisArg, args); | |
| 1493 | - }; | |
| 1494 | -} | |
| 1495 | -/** | |
| 1496 | - * Creates a new function that constructs an instance of the given constructor function with the provided arguments. | |
| 1497 | - * | |
| 1498 | - * @param func - The constructor function to be wrapped and called. | |
| 1499 | - * @returns A new function that constructs an instance of the given constructor function with the provided arguments. | |
| 1500 | - */ | |
| 1501 | -function unconstruct(Func) { | |
| 1502 | - return function () { | |
| 1503 | - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | |
| 1504 | - args[_key4] = arguments[_key4]; | |
| 1505 | - } | |
| 1506 | - return construct(Func, args); | |
| 1507 | - }; | |
| 1508 | -} | |
| 1509 | -/** | |
| 1510 | - * Add properties to a lookup table | |
| 1511 | - * | |
| 1512 | - * @param set - The set to which elements will be added. | |
| 1513 | - * @param array - The array containing elements to be added to the set. | |
| 1514 | - * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set. | |
| 1515 | - * @returns The modified set with added elements. | |
| 1516 | - */ | |
| 1517 | -function addToSet(set, array) { | |
| 1518 | - let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase; | |
| 1519 | - if (setPrototypeOf) { | |
| 1520 | - // Make 'in' and truthy checks like Boolean(set.constructor) | |
| 1521 | - // independent of any properties defined on Object.prototype. | |
| 1522 | - // Prevent prototype setters from intercepting set as a this value. | |
| 1523 | - setPrototypeOf(set, null); | |
| 1524 | - } | |
| 1525 | - let l = array.length; | |
| 1526 | - while (l--) { | |
| 1527 | - let element = array[l]; | |
| 1528 | - if (typeof element === 'string') { | |
| 1529 | - const lcElement = transformCaseFunc(element); | |
| 1530 | - if (lcElement !== element) { | |
| 1531 | - // Config presets (e.g. tags.js, attrs.js) are immutable. | |
| 1532 | - if (!isFrozen(array)) { | |
| 1533 | - array[l] = lcElement; | |
| 1534 | - } | |
| 1535 | - element = lcElement; | |
| 1536 | - } | |
| 1537 | - } | |
| 1538 | - set[element] = true; | |
| 1539 | - } | |
| 1540 | - return set; | |
| 1541 | -} | |
| 1542 | -/** | |
| 1543 | - * Clean up an array to harden against CSPP | |
| 1544 | - * | |
| 1545 | - * @param array - The array to be cleaned. | |
| 1546 | - * @returns The cleaned version of the array | |
| 1547 | - */ | |
| 1548 | -function cleanArray(array) { | |
| 1549 | - for (let index = 0; index < array.length; index++) { | |
| 1550 | - const isPropertyExist = objectHasOwnProperty(array, index); | |
| 1551 | - if (!isPropertyExist) { | |
| 1552 | - array[index] = null; | |
| 1553 | - } | |
| 1554 | - } | |
| 1555 | - return array; | |
| 1556 | -} | |
| 1557 | -/** | |
| 1558 | - * Shallow clone an object | |
| 1559 | - * | |
| 1560 | - * @param object - The object to be cloned. | |
| 1561 | - * @returns A new object that copies the original. | |
| 1562 | - */ | |
| 1563 | -function clone(object) { | |
| 1564 | - const newObject = create(null); | |
| 1565 | - for (const [property, value] of entries(object)) { | |
| 1566 | - const isPropertyExist = objectHasOwnProperty(object, property); | |
| 1567 | - if (isPropertyExist) { | |
| 1568 | - if (Array.isArray(value)) { | |
| 1569 | - newObject[property] = cleanArray(value); | |
| 1570 | - } else if (value && typeof value === 'object' && value.constructor === Object) { | |
| 1571 | - newObject[property] = clone(value); | |
| 1572 | - } else { | |
| 1573 | - newObject[property] = value; | |
| 1574 | - } | |
| 1575 | - } | |
| 1576 | - } | |
| 1577 | - return newObject; | |
| 1578 | -} | |
| 1579 | -/** | |
| 1580 | - * This method automatically checks if the prop is function or getter and behaves accordingly. | |
| 1581 | - * | |
| 1582 | - * @param object - The object to look up the getter function in its prototype chain. | |
| 1583 | - * @param prop - The property name for which to find the getter function. | |
| 1584 | - * @returns The getter function found in the prototype chain or a fallback function. | |
| 1585 | - */ | |
| 1586 | -function lookupGetter(object, prop) { | |
| 1587 | - while (object !== null) { | |
| 1588 | - const desc = getOwnPropertyDescriptor(object, prop); | |
| 1589 | - if (desc) { | |
| 1590 | - if (desc.get) { | |
| 1591 | - return unapply(desc.get); | |
| 1592 | - } | |
| 1593 | - if (typeof desc.value === 'function') { | |
| 1594 | - return unapply(desc.value); | |
| 1595 | - } | |
| 1596 | - } | |
| 1597 | - object = getPrototypeOf(object); | |
| 1598 | - } | |
| 1599 | - function fallbackValue() { | |
| 1600 | - return null; | |
| 1601 | - } | |
| 1602 | - return fallbackValue; | |
| 1603 | -} | |
| 1604 | - | |
| 1605 | -const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); | |
| 1606 | -const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']); | |
| 1607 | -const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); | |
| 1608 | -// List of SVG elements that are disallowed by default. | |
| 1609 | -// We still need to know them so that we can do namespace | |
| 1610 | -// checks properly in case one wants to add them to | |
| 1611 | -// allow-list. | |
| 1612 | -const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']); | |
| 1613 | -const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']); | |
| 1614 | -// Similarly to SVG, we want to know all MathML elements, | |
| 1615 | -// even those that we disallow by default. | |
| 1616 | -const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']); | |
| 1617 | -const text = freeze(['#text']); | |
| 1618 | - | |
| 1619 | -const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']); | |
| 1620 | -const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']); | |
| 1621 | -const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']); | |
| 1622 | -const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']); | |
| 1623 | - | |
| 1624 | -// eslint-disable-next-line unicorn/better-regex | |
| 1625 | -const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode | |
| 1626 | -const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); | |
| 1627 | -const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex | |
| 1628 | -const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape | |
| 1629 | -const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape | |
| 1630 | -const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape | |
| 1631 | -); | |
| 1632 | -const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); | |
| 1633 | -const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex | |
| 1634 | -); | |
| 1635 | -const DOCTYPE_NAME = seal(/^html$/i); | |
| 1636 | -const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i); | |
| 1637 | - | |
| 1638 | -var EXPRESSIONS = /*#__PURE__*/Object.freeze({ | |
| 1639 | - __proto__: null, | |
| 1640 | - ARIA_ATTR: ARIA_ATTR, | |
| 1641 | - ATTR_WHITESPACE: ATTR_WHITESPACE, | |
| 1642 | - CUSTOM_ELEMENT: CUSTOM_ELEMENT, | |
| 1643 | - DATA_ATTR: DATA_ATTR, | |
| 1644 | - DOCTYPE_NAME: DOCTYPE_NAME, | |
| 1645 | - ERB_EXPR: ERB_EXPR, | |
| 1646 | - IS_ALLOWED_URI: IS_ALLOWED_URI, | |
| 1647 | - IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA, | |
| 1648 | - MUSTACHE_EXPR: MUSTACHE_EXPR, | |
| 1649 | - TMPLIT_EXPR: TMPLIT_EXPR | |
| 1650 | -}); | |
| 1651 | - | |
| 1652 | -/* eslint-disable @typescript-eslint/indent */ | |
| 1653 | -// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType | |
| 1654 | -const NODE_TYPE = { | |
| 1655 | - element: 1, | |
| 1656 | - attribute: 2, | |
| 1657 | - text: 3, | |
| 1658 | - cdataSection: 4, | |
| 1659 | - entityReference: 5, | |
| 1660 | - // Deprecated | |
| 1661 | - entityNode: 6, | |
| 1662 | - // Deprecated | |
| 1663 | - progressingInstruction: 7, | |
| 1664 | - comment: 8, | |
| 1665 | - document: 9, | |
| 1666 | - documentType: 10, | |
| 1667 | - documentFragment: 11, | |
| 1668 | - notation: 12 // Deprecated | |
| 1669 | -}; | |
| 1670 | -const getGlobal = function getGlobal() { | |
| 1671 | - return typeof window === 'undefined' ? null : window; | |
| 1672 | -}; | |
| 1673 | -/** | |
| 1674 | - * Creates a no-op policy for internal use only. | |
| 1675 | - * Don't export this function outside this module! | |
| 1676 | - * @param trustedTypes The policy factory. | |
| 1677 | - * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). | |
| 1678 | - * @return The policy created (or null, if Trusted Types | |
| 1679 | - * are not supported or creating the policy failed). | |
| 1680 | - */ | |
| 1681 | -const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) { | |
| 1682 | - if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') { | |
| 1683 | - return null; | |
| 1684 | - } | |
| 1685 | - // Allow the callers to control the unique policy name | |
| 1686 | - // by adding a data-tt-policy-suffix to the script element with the DOMPurify. | |
| 1687 | - // Policy creation with duplicate names throws in Trusted Types. | |
| 1688 | - let suffix = null; | |
| 1689 | - const ATTR_NAME = 'data-tt-policy-suffix'; | |
| 1690 | - if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) { | |
| 1691 | - suffix = purifyHostElement.getAttribute(ATTR_NAME); | |
| 1692 | - } | |
| 1693 | - const policyName = 'dompurify' + (suffix ? '#' + suffix : ''); | |
| 1694 | - try { | |
| 1695 | - return trustedTypes.createPolicy(policyName, { | |
| 1696 | - createHTML(html) { | |
| 1697 | - return html; | |
| 1698 | - }, | |
| 1699 | - createScriptURL(scriptUrl) { | |
| 1700 | - return scriptUrl; | |
| 1701 | - } | |
| 1702 | - }); | |
| 1703 | - } catch (_) { | |
| 1704 | - // Policy creation failed (most likely another DOMPurify script has | |
| 1705 | - // already run). Skip creating the policy, as this will only cause errors | |
| 1706 | - // if TT are enforced. | |
| 1707 | - console.warn('TrustedTypes policy ' + policyName + ' could not be created.'); | |
| 1708 | - return null; | |
| 1709 | - } | |
| 1710 | -}; | |
| 1711 | -const _createHooksMap = function _createHooksMap() { | |
| 1712 | - return { | |
| 1713 | - afterSanitizeAttributes: [], | |
| 1714 | - afterSanitizeElements: [], | |
| 1715 | - afterSanitizeShadowDOM: [], | |
| 1716 | - beforeSanitizeAttributes: [], | |
| 1717 | - beforeSanitizeElements: [], | |
| 1718 | - beforeSanitizeShadowDOM: [], | |
| 1719 | - uponSanitizeAttribute: [], | |
| 1720 | - uponSanitizeElement: [], | |
| 1721 | - uponSanitizeShadowNode: [] | |
| 1722 | - }; | |
| 1723 | -}; | |
| 1724 | -function createDOMPurify() { | |
| 1725 | - let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal(); | |
| 1726 | - const DOMPurify = root => createDOMPurify(root); | |
| 1727 | - DOMPurify.version = '3.3.0'; | |
| 1728 | - DOMPurify.removed = []; | |
| 1729 | - if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) { | |
| 1730 | - // Not running in a browser, provide a factory function | |
| 1731 | - // so that you can pass your own Window | |
| 1732 | - DOMPurify.isSupported = false; | |
| 1733 | - return DOMPurify; | |
| 1734 | - } | |
| 1735 | - let { | |
| 1736 | - document | |
| 1737 | - } = window; | |
| 1738 | - const originalDocument = document; | |
| 1739 | - const currentScript = originalDocument.currentScript; | |
| 1740 | - const { | |
| 1741 | - DocumentFragment, | |
| 1742 | - HTMLTemplateElement, | |
| 1743 | - Node, | |
| 1744 | - Element, | |
| 1745 | - NodeFilter, | |
| 1746 | - NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap, | |
| 1747 | - HTMLFormElement, | |
| 1748 | - DOMParser, | |
| 1749 | - trustedTypes | |
| 1750 | - } = window; | |
| 1751 | - const ElementPrototype = Element.prototype; | |
| 1752 | - const cloneNode = lookupGetter(ElementPrototype, 'cloneNode'); | |
| 1753 | - const remove = lookupGetter(ElementPrototype, 'remove'); | |
| 1754 | - const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling'); | |
| 1755 | - const getChildNodes = lookupGetter(ElementPrototype, 'childNodes'); | |
| 1756 | - const getParentNode = lookupGetter(ElementPrototype, 'parentNode'); | |
| 1757 | - // As per issue #47, the web-components registry is inherited by a | |
| 1758 | - // new document created via createHTMLDocument. As per the spec | |
| 1759 | - // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries) | |
| 1760 | - // a new empty registry is used when creating a template contents owner | |
| 1761 | - // document, so we use that as our parent document to ensure nothing | |
| 1762 | - // is inherited. | |
| 1763 | - if (typeof HTMLTemplateElement === 'function') { | |
| 1764 | - const template = document.createElement('template'); | |
| 1765 | - if (template.content && template.content.ownerDocument) { | |
| 1766 | - document = template.content.ownerDocument; | |
| 1767 | - } | |
| 1768 | - } | |
| 1769 | - let trustedTypesPolicy; | |
| 1770 | - let emptyHTML = ''; | |
| 1771 | - const { | |
| 1772 | - implementation, | |
| 1773 | - createNodeIterator, | |
| 1774 | - createDocumentFragment, | |
| 1775 | - getElementsByTagName | |
| 1776 | - } = document; | |
| 1777 | - const { | |
| 1778 | - importNode | |
| 1779 | - } = originalDocument; | |
| 1780 | - let hooks = _createHooksMap(); | |
| 1781 | - /** | |
| 1782 | - * Expose whether this browser supports running the full DOMPurify. | |
| 1783 | - */ | |
| 1784 | - DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined; | |
| 1785 | - const { | |
| 1786 | - MUSTACHE_EXPR, | |
| 1787 | - ERB_EXPR, | |
| 1788 | - TMPLIT_EXPR, | |
| 1789 | - DATA_ATTR, | |
| 1790 | - ARIA_ATTR, | |
| 1791 | - IS_SCRIPT_OR_DATA, | |
| 1792 | - ATTR_WHITESPACE, | |
| 1793 | - CUSTOM_ELEMENT | |
| 1794 | - } = EXPRESSIONS; | |
| 1795 | - let { | |
| 1796 | - IS_ALLOWED_URI: IS_ALLOWED_URI$1 | |
| 1797 | - } = EXPRESSIONS; | |
| 1798 | - /** | |
| 1799 | - * We consider the elements and attributes below to be safe. Ideally | |
| 1800 | - * don't add any new ones but feel free to remove unwanted ones. | |
| 1801 | - */ | |
| 1802 | - /* allowed element names */ | |
| 1803 | - let ALLOWED_TAGS = null; | |
| 1804 | - const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]); | |
| 1805 | - /* Allowed attribute names */ | |
| 1806 | - let ALLOWED_ATTR = null; | |
| 1807 | - const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); | |
| 1808 | - /* | |
| 1809 | - * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements. | |
| 1810 | - * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements) | |
| 1811 | - * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list) | |
| 1812 | - * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`. | |
| 1813 | - */ | |
| 1814 | - let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, { | |
| 1815 | - tagNameCheck: { | |
| 1816 | - writable: true, | |
| 1817 | - configurable: false, | |
| 1818 | - enumerable: true, | |
| 1819 | - value: null | |
| 1820 | - }, | |
| 1821 | - attributeNameCheck: { | |
| 1822 | - writable: true, | |
| 1823 | - configurable: false, | |
| 1824 | - enumerable: true, | |
| 1825 | - value: null | |
| 1826 | - }, | |
| 1827 | - allowCustomizedBuiltInElements: { | |
| 1828 | - writable: true, | |
| 1829 | - configurable: false, | |
| 1830 | - enumerable: true, | |
| 1831 | - value: false | |
| 1832 | - } | |
| 1833 | - })); | |
| 1834 | - /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */ | |
| 1835 | - let FORBID_TAGS = null; | |
| 1836 | - /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */ | |
| 1837 | - let FORBID_ATTR = null; | |
| 1838 | - /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */ | |
| 1839 | - const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, { | |
| 1840 | - tagCheck: { | |
| 1841 | - writable: true, | |
| 1842 | - configurable: false, | |
| 1843 | - enumerable: true, | |
| 1844 | - value: null | |
| 1845 | - }, | |
| 1846 | - attributeCheck: { | |
| 1847 | - writable: true, | |
| 1848 | - configurable: false, | |
| 1849 | - enumerable: true, | |
| 1850 | - value: null | |
| 1851 | - } | |
| 1852 | - })); | |
| 1853 | - /* Decide if ARIA attributes are okay */ | |
| 1854 | - let ALLOW_ARIA_ATTR = true; | |
| 1855 | - /* Decide if custom data attributes are okay */ | |
| 1856 | - let ALLOW_DATA_ATTR = true; | |
| 1857 | - /* Decide if unknown protocols are okay */ | |
| 1858 | - let ALLOW_UNKNOWN_PROTOCOLS = false; | |
| 1859 | - /* Decide if self-closing tags in attributes are allowed. | |
| 1860 | - * Usually removed due to a mXSS issue in jQuery 3.0 */ | |
| 1861 | - let ALLOW_SELF_CLOSE_IN_ATTR = true; | |
| 1862 | - /* Output should be safe for common template engines. | |
| 1863 | - * This means, DOMPurify removes data attributes, mustaches and ERB | |
| 1864 | - */ | |
| 1865 | - let SAFE_FOR_TEMPLATES = false; | |
| 1866 | - /* Output should be safe even for XML used within HTML and alike. | |
| 1867 | - * This means, DOMPurify removes comments when containing risky content. | |
| 1868 | - */ | |
| 1869 | - let SAFE_FOR_XML = true; | |
| 1870 | - /* Decide if document with <html>... should be returned */ | |
| 1871 | - let WHOLE_DOCUMENT = false; | |
| 1872 | - /* Track whether config is already set on this instance of DOMPurify. */ | |
| 1873 | - let SET_CONFIG = false; | |
| 1874 | - /* Decide if all elements (e.g. style, script) must be children of | |
| 1875 | - * document.body. By default, browsers might move them to document.head */ | |
| 1876 | - let FORCE_BODY = false; | |
| 1877 | - /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html | |
| 1878 | - * string (or a TrustedHTML object if Trusted Types are supported). | |
| 1879 | - * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead | |
| 1880 | - */ | |
| 1881 | - let RETURN_DOM = false; | |
| 1882 | - /* Decide if a DOM `DocumentFragment` should be returned, instead of a html | |
| 1883 | - * string (or a TrustedHTML object if Trusted Types are supported) */ | |
| 1884 | - let RETURN_DOM_FRAGMENT = false; | |
| 1885 | - /* Try to return a Trusted Type object instead of a string, return a string in | |
| 1886 | - * case Trusted Types are not supported */ | |
| 1887 | - let RETURN_TRUSTED_TYPE = false; | |
| 1888 | - /* Output should be free from DOM clobbering attacks? | |
| 1889 | - * This sanitizes markups named with colliding, clobberable built-in DOM APIs. | |
| 1890 | - */ | |
| 1891 | - let SANITIZE_DOM = true; | |
| 1892 | - /* Achieve full DOM Clobbering protection by isolating the namespace of named | |
| 1893 | - * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules. | |
| 1894 | - * | |
| 1895 | - * HTML/DOM spec rules that enable DOM Clobbering: | |
| 1896 | - * - Named Access on Window (§7.3.3) | |
| 1897 | - * - DOM Tree Accessors (§3.1.5) | |
| 1898 | - * - Form Element Parent-Child Relations (§4.10.3) | |
| 1899 | - * - Iframe srcdoc / Nested WindowProxies (§4.8.5) | |
| 1900 | - * - HTMLCollection (§4.2.10.2) | |
| 1901 | - * | |
| 1902 | - * Namespace isolation is implemented by prefixing `id` and `name` attributes | |
| 1903 | - * with a constant string, i.e., `user-content-` | |
| 1904 | - */ | |
| 1905 | - let SANITIZE_NAMED_PROPS = false; | |
| 1906 | - const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-'; | |
| 1907 | - /* Keep element content when removing element? */ | |
| 1908 | - let KEEP_CONTENT = true; | |
| 1909 | - /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead | |
| 1910 | - * of importing it into a new Document and returning a sanitized copy */ | |
| 1911 | - let IN_PLACE = false; | |
| 1912 | - /* Allow usage of profiles like html, svg and mathMl */ | |
| 1913 | - let USE_PROFILES = {}; | |
| 1914 | - /* Tags to ignore content of when KEEP_CONTENT is true */ | |
| 1915 | - let FORBID_CONTENTS = null; | |
| 1916 | - const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']); | |
| 1917 | - /* Tags that are safe for data: URIs */ | |
| 1918 | - let DATA_URI_TAGS = null; | |
| 1919 | - const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']); | |
| 1920 | - /* Attributes safe for values like "javascript:" */ | |
| 1921 | - let URI_SAFE_ATTRIBUTES = null; | |
| 1922 | - const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']); | |
| 1923 | - const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; | |
| 1924 | - const SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; | |
| 1925 | - const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; | |
| 1926 | - /* Document namespace */ | |
| 1927 | - let NAMESPACE = HTML_NAMESPACE; | |
| 1928 | - let IS_EMPTY_INPUT = false; | |
| 1929 | - /* Allowed XHTML+XML namespaces */ | |
| 1930 | - let ALLOWED_NAMESPACES = null; | |
| 1931 | - const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); | |
| 1932 | - let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']); | |
| 1933 | - let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']); | |
| 1934 | - // Certain elements are allowed in both SVG and HTML | |
| 1935 | - // namespace. We need to specify them explicitly | |
| 1936 | - // so that they don't get erroneously deleted from | |
| 1937 | - // HTML namespace. | |
| 1938 | - const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']); | |
| 1939 | - /* Parsing of strict XHTML documents */ | |
| 1940 | - let PARSER_MEDIA_TYPE = null; | |
| 1941 | - const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html']; | |
| 1942 | - const DEFAULT_PARSER_MEDIA_TYPE = 'text/html'; | |
| 1943 | - let transformCaseFunc = null; | |
| 1944 | - /* Keep a reference to config to pass to hooks */ | |
| 1945 | - let CONFIG = null; | |
| 1946 | - /* Ideally, do not touch anything below this line */ | |
| 1947 | - /* ______________________________________________ */ | |
| 1948 | - const formElement = document.createElement('form'); | |
| 1949 | - const isRegexOrFunction = function isRegexOrFunction(testValue) { | |
| 1950 | - return testValue instanceof RegExp || testValue instanceof Function; | |
| 1951 | - }; | |
| 1952 | - /** | |
| 1953 | - * _parseConfig | |
| 1954 | - * | |
| 1955 | - * @param cfg optional config literal | |
| 1956 | - */ | |
| 1957 | - // eslint-disable-next-line complexity | |
| 1958 | - const _parseConfig = function _parseConfig() { | |
| 1959 | - let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 1960 | - if (CONFIG && CONFIG === cfg) { | |
| 1961 | - return; | |
| 1962 | - } | |
| 1963 | - /* Shield configuration object from tampering */ | |
| 1964 | - if (!cfg || typeof cfg !== 'object') { | |
| 1965 | - cfg = {}; | |
| 1966 | - } | |
| 1967 | - /* Shield configuration object from prototype pollution */ | |
| 1968 | - cfg = clone(cfg); | |
| 1969 | - PARSER_MEDIA_TYPE = | |
| 1970 | - // eslint-disable-next-line unicorn/prefer-includes | |
| 1971 | - SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; | |
| 1972 | - // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is. | |
| 1973 | - transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase; | |
| 1974 | - /* Set configuration parameters */ | |
| 1975 | - ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; | |
| 1976 | - ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; | |
| 1977 | - ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; | |
| 1978 | - URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES; | |
| 1979 | - DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS; | |
| 1980 | - FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; | |
| 1981 | - FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({}); | |
| 1982 | - FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({}); | |
| 1983 | - USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false; | |
| 1984 | - ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true | |
| 1985 | - ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true | |
| 1986 | - ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false | |
| 1987 | - ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true | |
| 1988 | - SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false | |
| 1989 | - SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true | |
| 1990 | - WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false | |
| 1991 | - RETURN_DOM = cfg.RETURN_DOM || false; // Default false | |
| 1992 | - RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false | |
| 1993 | - RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false | |
| 1994 | - FORCE_BODY = cfg.FORCE_BODY || false; // Default false | |
| 1995 | - SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true | |
| 1996 | - SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false | |
| 1997 | - KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true | |
| 1998 | - IN_PLACE = cfg.IN_PLACE || false; // Default false | |
| 1999 | - IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI; | |
| 2000 | - NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; | |
| 2001 | - MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS; | |
| 2002 | - HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS; | |
| 2003 | - CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {}; | |
| 2004 | - if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) { | |
| 2005 | - CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck; | |
| 2006 | - } | |
| 2007 | - if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) { | |
| 2008 | - CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck; | |
| 2009 | - } | |
| 2010 | - if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') { | |
| 2011 | - CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements; | |
| 2012 | - } | |
| 2013 | - if (SAFE_FOR_TEMPLATES) { | |
| 2014 | - ALLOW_DATA_ATTR = false; | |
| 2015 | - } | |
| 2016 | - if (RETURN_DOM_FRAGMENT) { | |
| 2017 | - RETURN_DOM = true; | |
| 2018 | - } | |
| 2019 | - /* Parse profile info */ | |
| 2020 | - if (USE_PROFILES) { | |
| 2021 | - ALLOWED_TAGS = addToSet({}, text); | |
| 2022 | - ALLOWED_ATTR = []; | |
| 2023 | - if (USE_PROFILES.html === true) { | |
| 2024 | - addToSet(ALLOWED_TAGS, html$1); | |
| 2025 | - addToSet(ALLOWED_ATTR, html); | |
| 2026 | - } | |
| 2027 | - if (USE_PROFILES.svg === true) { | |
| 2028 | - addToSet(ALLOWED_TAGS, svg$1); | |
| 2029 | - addToSet(ALLOWED_ATTR, svg); | |
| 2030 | - addToSet(ALLOWED_ATTR, xml); | |
| 2031 | - } | |
| 2032 | - if (USE_PROFILES.svgFilters === true) { | |
| 2033 | - addToSet(ALLOWED_TAGS, svgFilters); | |
| 2034 | - addToSet(ALLOWED_ATTR, svg); | |
| 2035 | - addToSet(ALLOWED_ATTR, xml); | |
| 2036 | - } | |
| 2037 | - if (USE_PROFILES.mathMl === true) { | |
| 2038 | - addToSet(ALLOWED_TAGS, mathMl$1); | |
| 2039 | - addToSet(ALLOWED_ATTR, mathMl); | |
| 2040 | - addToSet(ALLOWED_ATTR, xml); | |
| 2041 | - } | |
| 2042 | - } | |
| 2043 | - /* Merge configuration parameters */ | |
| 2044 | - if (cfg.ADD_TAGS) { | |
| 2045 | - if (typeof cfg.ADD_TAGS === 'function') { | |
| 2046 | - EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS; | |
| 2047 | - } else { | |
| 2048 | - if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { | |
| 2049 | - ALLOWED_TAGS = clone(ALLOWED_TAGS); | |
| 2050 | - } | |
| 2051 | - addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); | |
| 2052 | - } | |
| 2053 | - } | |
| 2054 | - if (cfg.ADD_ATTR) { | |
| 2055 | - if (typeof cfg.ADD_ATTR === 'function') { | |
| 2056 | - EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR; | |
| 2057 | - } else { | |
| 2058 | - if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { | |
| 2059 | - ALLOWED_ATTR = clone(ALLOWED_ATTR); | |
| 2060 | - } | |
| 2061 | - addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); | |
| 2062 | - } | |
| 2063 | - } | |
| 2064 | - if (cfg.ADD_URI_SAFE_ATTR) { | |
| 2065 | - addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); | |
| 2066 | - } | |
| 2067 | - if (cfg.FORBID_CONTENTS) { | |
| 2068 | - if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { | |
| 2069 | - FORBID_CONTENTS = clone(FORBID_CONTENTS); | |
| 2070 | - } | |
| 2071 | - addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); | |
| 2072 | - } | |
| 2073 | - /* Add #text in case KEEP_CONTENT is set to true */ | |
| 2074 | - if (KEEP_CONTENT) { | |
| 2075 | - ALLOWED_TAGS['#text'] = true; | |
| 2076 | - } | |
| 2077 | - /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */ | |
| 2078 | - if (WHOLE_DOCUMENT) { | |
| 2079 | - addToSet(ALLOWED_TAGS, ['html', 'head', 'body']); | |
| 2080 | - } | |
| 2081 | - /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */ | |
| 2082 | - if (ALLOWED_TAGS.table) { | |
| 2083 | - addToSet(ALLOWED_TAGS, ['tbody']); | |
| 2084 | - delete FORBID_TAGS.tbody; | |
| 2085 | - } | |
| 2086 | - if (cfg.TRUSTED_TYPES_POLICY) { | |
| 2087 | - if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') { | |
| 2088 | - throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); | |
| 2089 | - } | |
| 2090 | - if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') { | |
| 2091 | - throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); | |
| 2092 | - } | |
| 2093 | - // Overwrite existing TrustedTypes policy. | |
| 2094 | - trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; | |
| 2095 | - // Sign local variables required by `sanitize`. | |
| 2096 | - emptyHTML = trustedTypesPolicy.createHTML(''); | |
| 2097 | - } else { | |
| 2098 | - // Uninitialized policy, attempt to initialize the internal dompurify policy. | |
| 2099 | - if (trustedTypesPolicy === undefined) { | |
| 2100 | - trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); | |
| 2101 | - } | |
| 2102 | - // If creating the internal policy succeeded sign internal variables. | |
| 2103 | - if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') { | |
| 2104 | - emptyHTML = trustedTypesPolicy.createHTML(''); | |
| 2105 | - } | |
| 2106 | - } | |
| 2107 | - // Prevent further manipulation of configuration. | |
| 2108 | - // Not available in IE8, Safari 5, etc. | |
| 2109 | - if (freeze) { | |
| 2110 | - freeze(cfg); | |
| 2111 | - } | |
| 2112 | - CONFIG = cfg; | |
| 2113 | - }; | |
| 2114 | - /* Keep track of all possible SVG and MathML tags | |
| 2115 | - * so that we can perform the namespace checks | |
| 2116 | - * correctly. */ | |
| 2117 | - const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); | |
| 2118 | - const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); | |
| 2119 | - /** | |
| 2120 | - * @param element a DOM element whose namespace is being checked | |
| 2121 | - * @returns Return false if the element has a | |
| 2122 | - * namespace that a spec-compliant parser would never | |
| 2123 | - * return. Return true otherwise. | |
| 2124 | - */ | |
| 2125 | - const _checkValidNamespace = function _checkValidNamespace(element) { | |
| 2126 | - let parent = getParentNode(element); | |
| 2127 | - // In JSDOM, if we're inside shadow DOM, then parentNode | |
| 2128 | - // can be null. We just simulate parent in this case. | |
| 2129 | - if (!parent || !parent.tagName) { | |
| 2130 | - parent = { | |
| 2131 | - namespaceURI: NAMESPACE, | |
| 2132 | - tagName: 'template' | |
| 2133 | - }; | |
| 2134 | - } | |
| 2135 | - const tagName = stringToLowerCase(element.tagName); | |
| 2136 | - const parentTagName = stringToLowerCase(parent.tagName); | |
| 2137 | - if (!ALLOWED_NAMESPACES[element.namespaceURI]) { | |
| 2138 | - return false; | |
| 2139 | - } | |
| 2140 | - if (element.namespaceURI === SVG_NAMESPACE) { | |
| 2141 | - // The only way to switch from HTML namespace to SVG | |
| 2142 | - // is via <svg>. If it happens via any other tag, then | |
| 2143 | - // it should be killed. | |
| 2144 | - if (parent.namespaceURI === HTML_NAMESPACE) { | |
| 2145 | - return tagName === 'svg'; | |
| 2146 | - } | |
| 2147 | - // The only way to switch from MathML to SVG is via` | |
| 2148 | - // svg if parent is either <annotation-xml> or MathML | |
| 2149 | - // text integration points. | |
| 2150 | - if (parent.namespaceURI === MATHML_NAMESPACE) { | |
| 2151 | - return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); | |
| 2152 | - } | |
| 2153 | - // We only allow elements that are defined in SVG | |
| 2154 | - // spec. All others are disallowed in SVG namespace. | |
| 2155 | - return Boolean(ALL_SVG_TAGS[tagName]); | |
| 2156 | - } | |
| 2157 | - if (element.namespaceURI === MATHML_NAMESPACE) { | |
| 2158 | - // The only way to switch from HTML namespace to MathML | |
| 2159 | - // is via <math>. If it happens via any other tag, then | |
| 2160 | - // it should be killed. | |
| 2161 | - if (parent.namespaceURI === HTML_NAMESPACE) { | |
| 2162 | - return tagName === 'math'; | |
| 2163 | - } | |
| 2164 | - // The only way to switch from SVG to MathML is via | |
| 2165 | - // <math> and HTML integration points | |
| 2166 | - if (parent.namespaceURI === SVG_NAMESPACE) { | |
| 2167 | - return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName]; | |
| 2168 | - } | |
| 2169 | - // We only allow elements that are defined in MathML | |
| 2170 | - // spec. All others are disallowed in MathML namespace. | |
| 2171 | - return Boolean(ALL_MATHML_TAGS[tagName]); | |
| 2172 | - } | |
| 2173 | - if (element.namespaceURI === HTML_NAMESPACE) { | |
| 2174 | - // The only way to switch from SVG to HTML is via | |
| 2175 | - // HTML integration points, and from MathML to HTML | |
| 2176 | - // is via MathML text integration points | |
| 2177 | - if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { | |
| 2178 | - return false; | |
| 2179 | - } | |
| 2180 | - if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { | |
| 2181 | - return false; | |
| 2182 | - } | |
| 2183 | - // We disallow tags that are specific for MathML | |
| 2184 | - // or SVG and should never appear in HTML namespace | |
| 2185 | - return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); | |
| 2186 | - } | |
| 2187 | - // For XHTML and XML documents that support custom namespaces | |
| 2188 | - if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) { | |
| 2189 | - return true; | |
| 2190 | - } | |
| 2191 | - // The code should never reach this place (this means | |
| 2192 | - // that the element somehow got namespace that is not | |
| 2193 | - // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES). | |
| 2194 | - // Return false just in case. | |
| 2195 | - return false; | |
| 2196 | - }; | |
| 2197 | - /** | |
| 2198 | - * _forceRemove | |
| 2199 | - * | |
| 2200 | - * @param node a DOM node | |
| 2201 | - */ | |
| 2202 | - const _forceRemove = function _forceRemove(node) { | |
| 2203 | - arrayPush(DOMPurify.removed, { | |
| 2204 | - element: node | |
| 2205 | - }); | |
| 2206 | - try { | |
| 2207 | - // eslint-disable-next-line unicorn/prefer-dom-node-remove | |
| 2208 | - getParentNode(node).removeChild(node); | |
| 2209 | - } catch (_) { | |
| 2210 | - remove(node); | |
| 2211 | - } | |
| 2212 | - }; | |
| 2213 | - /** | |
| 2214 | - * _removeAttribute | |
| 2215 | - * | |
| 2216 | - * @param name an Attribute name | |
| 2217 | - * @param element a DOM node | |
| 2218 | - */ | |
| 2219 | - const _removeAttribute = function _removeAttribute(name, element) { | |
| 2220 | - try { | |
| 2221 | - arrayPush(DOMPurify.removed, { | |
| 2222 | - attribute: element.getAttributeNode(name), | |
| 2223 | - from: element | |
| 2224 | - }); | |
| 2225 | - } catch (_) { | |
| 2226 | - arrayPush(DOMPurify.removed, { | |
| 2227 | - attribute: null, | |
| 2228 | - from: element | |
| 2229 | - }); | |
| 2230 | - } | |
| 2231 | - element.removeAttribute(name); | |
| 2232 | - // We void attribute values for unremovable "is" attributes | |
| 2233 | - if (name === 'is') { | |
| 2234 | - if (RETURN_DOM || RETURN_DOM_FRAGMENT) { | |
| 2235 | - try { | |
| 2236 | - _forceRemove(element); | |
| 2237 | - } catch (_) {} | |
| 2238 | - } else { | |
| 2239 | - try { | |
| 2240 | - element.setAttribute(name, ''); | |
| 2241 | - } catch (_) {} | |
| 2242 | - } | |
| 2243 | - } | |
| 2244 | - }; | |
| 2245 | - /** | |
| 2246 | - * _initDocument | |
| 2247 | - * | |
| 2248 | - * @param dirty - a string of dirty markup | |
| 2249 | - * @return a DOM, filled with the dirty markup | |
| 2250 | - */ | |
| 2251 | - const _initDocument = function _initDocument(dirty) { | |
| 2252 | - /* Create a HTML document */ | |
| 2253 | - let doc = null; | |
| 2254 | - let leadingWhitespace = null; | |
| 2255 | - if (FORCE_BODY) { | |
| 2256 | - dirty = '<remove></remove>' + dirty; | |
| 2257 | - } else { | |
| 2258 | - /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */ | |
| 2259 | - const matches = stringMatch(dirty, /^[\r\n\t ]+/); | |
| 2260 | - leadingWhitespace = matches && matches[0]; | |
| 2261 | - } | |
| 2262 | - if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) { | |
| 2263 | - // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict) | |
| 2264 | - dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>'; | |
| 2265 | - } | |
| 2266 | - const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; | |
| 2267 | - /* | |
| 2268 | - * Use the DOMParser API by default, fallback later if needs be | |
| 2269 | - * DOMParser not work for svg when has multiple root element. | |
| 2270 | - */ | |
| 2271 | - if (NAMESPACE === HTML_NAMESPACE) { | |
| 2272 | - try { | |
| 2273 | - doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); | |
| 2274 | - } catch (_) {} | |
| 2275 | - } | |
| 2276 | - /* Use createHTMLDocument in case DOMParser is not available */ | |
| 2277 | - if (!doc || !doc.documentElement) { | |
| 2278 | - doc = implementation.createDocument(NAMESPACE, 'template', null); | |
| 2279 | - try { | |
| 2280 | - doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; | |
| 2281 | - } catch (_) { | |
| 2282 | - // Syntax error if dirtyPayload is invalid xml | |
| 2283 | - } | |
| 2284 | - } | |
| 2285 | - const body = doc.body || doc.documentElement; | |
| 2286 | - if (dirty && leadingWhitespace) { | |
| 2287 | - body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null); | |
| 2288 | - } | |
| 2289 | - /* Work on whole document or just its body */ | |
| 2290 | - if (NAMESPACE === HTML_NAMESPACE) { | |
| 2291 | - return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0]; | |
| 2292 | - } | |
| 2293 | - return WHOLE_DOCUMENT ? doc.documentElement : body; | |
| 2294 | - }; | |
| 2295 | - /** | |
| 2296 | - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. | |
| 2297 | - * | |
| 2298 | - * @param root The root element or node to start traversing on. | |
| 2299 | - * @return The created NodeIterator | |
| 2300 | - */ | |
| 2301 | - const _createNodeIterator = function _createNodeIterator(root) { | |
| 2302 | - return createNodeIterator.call(root.ownerDocument || root, root, | |
| 2303 | - // eslint-disable-next-line no-bitwise | |
| 2304 | - NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null); | |
| 2305 | - }; | |
| 2306 | - /** | |
| 2307 | - * _isClobbered | |
| 2308 | - * | |
| 2309 | - * @param element element to check for clobbering attacks | |
| 2310 | - * @return true if clobbered, false if safe | |
| 2311 | - */ | |
| 2312 | - const _isClobbered = function _isClobbered(element) { | |
| 2313 | - return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function'); | |
| 2314 | - }; | |
| 2315 | - /** | |
| 2316 | - * Checks whether the given object is a DOM node. | |
| 2317 | - * | |
| 2318 | - * @param value object to check whether it's a DOM node | |
| 2319 | - * @return true is object is a DOM node | |
| 2320 | - */ | |
| 2321 | - const _isNode = function _isNode(value) { | |
| 2322 | - return typeof Node === 'function' && value instanceof Node; | |
| 2323 | - }; | |
| 2324 | - function _executeHooks(hooks, currentNode, data) { | |
| 2325 | - arrayForEach(hooks, hook => { | |
| 2326 | - hook.call(DOMPurify, currentNode, data, CONFIG); | |
| 2327 | - }); | |
| 2328 | - } | |
| 2329 | - /** | |
| 2330 | - * _sanitizeElements | |
| 2331 | - * | |
| 2332 | - * @protect nodeName | |
| 2333 | - * @protect textContent | |
| 2334 | - * @protect removeChild | |
| 2335 | - * @param currentNode to check for permission to exist | |
| 2336 | - * @return true if node was killed, false if left alive | |
| 2337 | - */ | |
| 2338 | - const _sanitizeElements = function _sanitizeElements(currentNode) { | |
| 2339 | - let content = null; | |
| 2340 | - /* Execute a hook if present */ | |
| 2341 | - _executeHooks(hooks.beforeSanitizeElements, currentNode, null); | |
| 2342 | - /* Check if element is clobbered or can clobber */ | |
| 2343 | - if (_isClobbered(currentNode)) { | |
| 2344 | - _forceRemove(currentNode); | |
| 2345 | - return true; | |
| 2346 | - } | |
| 2347 | - /* Now let's check the element's type and name */ | |
| 2348 | - const tagName = transformCaseFunc(currentNode.nodeName); | |
| 2349 | - /* Execute a hook if present */ | |
| 2350 | - _executeHooks(hooks.uponSanitizeElement, currentNode, { | |
| 2351 | - tagName, | |
| 2352 | - allowedTags: ALLOWED_TAGS | |
| 2353 | - }); | |
| 2354 | - /* Detect mXSS attempts abusing namespace confusion */ | |
| 2355 | - if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) { | |
| 2356 | - _forceRemove(currentNode); | |
| 2357 | - return true; | |
| 2358 | - } | |
| 2359 | - /* Remove any occurrence of processing instructions */ | |
| 2360 | - if (currentNode.nodeType === NODE_TYPE.progressingInstruction) { | |
| 2361 | - _forceRemove(currentNode); | |
| 2362 | - return true; | |
| 2363 | - } | |
| 2364 | - /* Remove any kind of possibly harmful comments */ | |
| 2365 | - if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) { | |
| 2366 | - _forceRemove(currentNode); | |
| 2367 | - return true; | |
| 2368 | - } | |
| 2369 | - /* Remove element if anything forbids its presence */ | |
| 2370 | - if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) { | |
| 2371 | - /* Check if we have a custom element to handle */ | |
| 2372 | - if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { | |
| 2373 | - if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { | |
| 2374 | - return false; | |
| 2375 | - } | |
| 2376 | - if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) { | |
| 2377 | - return false; | |
| 2378 | - } | |
| 2379 | - } | |
| 2380 | - /* Keep content except for bad-listed elements */ | |
| 2381 | - if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { | |
| 2382 | - const parentNode = getParentNode(currentNode) || currentNode.parentNode; | |
| 2383 | - const childNodes = getChildNodes(currentNode) || currentNode.childNodes; | |
| 2384 | - if (childNodes && parentNode) { | |
| 2385 | - const childCount = childNodes.length; | |
| 2386 | - for (let i = childCount - 1; i >= 0; --i) { | |
| 2387 | - const childClone = cloneNode(childNodes[i], true); | |
| 2388 | - childClone.__removalCount = (currentNode.__removalCount || 0) + 1; | |
| 2389 | - parentNode.insertBefore(childClone, getNextSibling(currentNode)); | |
| 2390 | - } | |
| 2391 | - } | |
| 2392 | - } | |
| 2393 | - _forceRemove(currentNode); | |
| 2394 | - return true; | |
| 2395 | - } | |
| 2396 | - /* Check whether element has a valid namespace */ | |
| 2397 | - if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) { | |
| 2398 | - _forceRemove(currentNode); | |
| 2399 | - return true; | |
| 2400 | - } | |
| 2401 | - /* Make sure that older browsers don't get fallback-tag mXSS */ | |
| 2402 | - if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) { | |
| 2403 | - _forceRemove(currentNode); | |
| 2404 | - return true; | |
| 2405 | - } | |
| 2406 | - /* Sanitize element content to be template-safe */ | |
| 2407 | - if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { | |
| 2408 | - /* Get the element's text content */ | |
| 2409 | - content = currentNode.textContent; | |
| 2410 | - arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { | |
| 2411 | - content = stringReplace(content, expr, ' '); | |
| 2412 | - }); | |
| 2413 | - if (currentNode.textContent !== content) { | |
| 2414 | - arrayPush(DOMPurify.removed, { | |
| 2415 | - element: currentNode.cloneNode() | |
| 2416 | - }); | |
| 2417 | - currentNode.textContent = content; | |
| 2418 | - } | |
| 2419 | - } | |
| 2420 | - /* Execute a hook if present */ | |
| 2421 | - _executeHooks(hooks.afterSanitizeElements, currentNode, null); | |
| 2422 | - return false; | |
| 2423 | - }; | |
| 2424 | - /** | |
| 2425 | - * _isValidAttribute | |
| 2426 | - * | |
| 2427 | - * @param lcTag Lowercase tag name of containing element. | |
| 2428 | - * @param lcName Lowercase attribute name. | |
| 2429 | - * @param value Attribute value. | |
| 2430 | - * @return Returns true if `value` is valid, otherwise false. | |
| 2431 | - */ | |
| 2432 | - // eslint-disable-next-line complexity | |
| 2433 | - const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) { | |
| 2434 | - /* Make sure attribute cannot clobber */ | |
| 2435 | - if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) { | |
| 2436 | - return false; | |
| 2437 | - } | |
| 2438 | - /* Allow valid data-* attributes: At least one character after "-" | |
| 2439 | - (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes) | |
| 2440 | - XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804) | |
| 2441 | - We don't need to check the value; it's always URI safe. */ | |
| 2442 | - if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) { | |
| 2443 | - if ( | |
| 2444 | - // First condition does a very basic check if a) it's basically a valid custom element tagname AND | |
| 2445 | - // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck | |
| 2446 | - // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck | |
| 2447 | - _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || | |
| 2448 | - // Alternative, second condition checks if it's an `is`-attribute, AND | |
| 2449 | - // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck | |
| 2450 | - lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else { | |
| 2451 | - return false; | |
| 2452 | - } | |
| 2453 | - /* Check value is safe. First, is attr inert? If so, is safe */ | |
| 2454 | - } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) { | |
| 2455 | - return false; | |
| 2456 | - } else ; | |
| 2457 | - return true; | |
| 2458 | - }; | |
| 2459 | - /** | |
| 2460 | - * _isBasicCustomElement | |
| 2461 | - * checks if at least one dash is included in tagName, and it's not the first char | |
| 2462 | - * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name | |
| 2463 | - * | |
| 2464 | - * @param tagName name of the tag of the node to sanitize | |
| 2465 | - * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false. | |
| 2466 | - */ | |
| 2467 | - const _isBasicCustomElement = function _isBasicCustomElement(tagName) { | |
| 2468 | - return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT); | |
| 2469 | - }; | |
| 2470 | - /** | |
| 2471 | - * _sanitizeAttributes | |
| 2472 | - * | |
| 2473 | - * @protect attributes | |
| 2474 | - * @protect nodeName | |
| 2475 | - * @protect removeAttribute | |
| 2476 | - * @protect setAttribute | |
| 2477 | - * | |
| 2478 | - * @param currentNode to sanitize | |
| 2479 | - */ | |
| 2480 | - const _sanitizeAttributes = function _sanitizeAttributes(currentNode) { | |
| 2481 | - /* Execute a hook if present */ | |
| 2482 | - _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null); | |
| 2483 | - const { | |
| 2484 | - attributes | |
| 2485 | - } = currentNode; | |
| 2486 | - /* Check if we have attributes; if not we might have a text node */ | |
| 2487 | - if (!attributes || _isClobbered(currentNode)) { | |
| 2488 | - return; | |
| 2489 | - } | |
| 2490 | - const hookEvent = { | |
| 2491 | - attrName: '', | |
| 2492 | - attrValue: '', | |
| 2493 | - keepAttr: true, | |
| 2494 | - allowedAttributes: ALLOWED_ATTR, | |
| 2495 | - forceKeepAttr: undefined | |
| 2496 | - }; | |
| 2497 | - let l = attributes.length; | |
| 2498 | - /* Go backwards over all attributes; safely remove bad ones */ | |
| 2499 | - while (l--) { | |
| 2500 | - const attr = attributes[l]; | |
| 2501 | - const { | |
| 2502 | - name, | |
| 2503 | - namespaceURI, | |
| 2504 | - value: attrValue | |
| 2505 | - } = attr; | |
| 2506 | - const lcName = transformCaseFunc(name); | |
| 2507 | - const initValue = attrValue; | |
| 2508 | - let value = name === 'value' ? initValue : stringTrim(initValue); | |
| 2509 | - /* Execute a hook if present */ | |
| 2510 | - hookEvent.attrName = lcName; | |
| 2511 | - hookEvent.attrValue = value; | |
| 2512 | - hookEvent.keepAttr = true; | |
| 2513 | - hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set | |
| 2514 | - _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent); | |
| 2515 | - value = hookEvent.attrValue; | |
| 2516 | - /* Full DOM Clobbering protection via namespace isolation, | |
| 2517 | - * Prefix id and name attributes with `user-content-` | |
| 2518 | - */ | |
| 2519 | - if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) { | |
| 2520 | - // Remove the attribute with this value | |
| 2521 | - _removeAttribute(name, currentNode); | |
| 2522 | - // Prefix the value and later re-create the attribute with the sanitized value | |
| 2523 | - value = SANITIZE_NAMED_PROPS_PREFIX + value; | |
| 2524 | - } | |
| 2525 | - /* Work around a security issue with comments inside attributes */ | |
| 2526 | - if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) { | |
| 2527 | - _removeAttribute(name, currentNode); | |
| 2528 | - continue; | |
| 2529 | - } | |
| 2530 | - /* Make sure we cannot easily use animated hrefs, even if animations are allowed */ | |
| 2531 | - if (lcName === 'attributename' && stringMatch(value, 'href')) { | |
| 2532 | - _removeAttribute(name, currentNode); | |
| 2533 | - continue; | |
| 2534 | - } | |
| 2535 | - /* Did the hooks approve of the attribute? */ | |
| 2536 | - if (hookEvent.forceKeepAttr) { | |
| 2537 | - continue; | |
| 2538 | - } | |
| 2539 | - /* Did the hooks approve of the attribute? */ | |
| 2540 | - if (!hookEvent.keepAttr) { | |
| 2541 | - _removeAttribute(name, currentNode); | |
| 2542 | - continue; | |
| 2543 | - } | |
| 2544 | - /* Work around a security issue in jQuery 3.0 */ | |
| 2545 | - if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) { | |
| 2546 | - _removeAttribute(name, currentNode); | |
| 2547 | - continue; | |
| 2548 | - } | |
| 2549 | - /* Sanitize attribute content to be template-safe */ | |
| 2550 | - if (SAFE_FOR_TEMPLATES) { | |
| 2551 | - arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { | |
| 2552 | - value = stringReplace(value, expr, ' '); | |
| 2553 | - }); | |
| 2554 | - } | |
| 2555 | - /* Is `value` valid for this attribute? */ | |
| 2556 | - const lcTag = transformCaseFunc(currentNode.nodeName); | |
| 2557 | - if (!_isValidAttribute(lcTag, lcName, value)) { | |
| 2558 | - _removeAttribute(name, currentNode); | |
| 2559 | - continue; | |
| 2560 | - } | |
| 2561 | - /* Handle attributes that require Trusted Types */ | |
| 2562 | - if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') { | |
| 2563 | - if (namespaceURI) ; else { | |
| 2564 | - switch (trustedTypes.getAttributeType(lcTag, lcName)) { | |
| 2565 | - case 'TrustedHTML': | |
| 2566 | - { | |
| 2567 | - value = trustedTypesPolicy.createHTML(value); | |
| 2568 | - break; | |
| 2569 | - } | |
| 2570 | - case 'TrustedScriptURL': | |
| 2571 | - { | |
| 2572 | - value = trustedTypesPolicy.createScriptURL(value); | |
| 2573 | - break; | |
| 2574 | - } | |
| 2575 | - } | |
| 2576 | - } | |
| 2577 | - } | |
| 2578 | - /* Handle invalid data-* attribute set by try-catching it */ | |
| 2579 | - if (value !== initValue) { | |
| 2580 | - try { | |
| 2581 | - if (namespaceURI) { | |
| 2582 | - currentNode.setAttributeNS(namespaceURI, name, value); | |
| 2583 | - } else { | |
| 2584 | - /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */ | |
| 2585 | - currentNode.setAttribute(name, value); | |
| 2586 | - } | |
| 2587 | - if (_isClobbered(currentNode)) { | |
| 2588 | - _forceRemove(currentNode); | |
| 2589 | - } else { | |
| 2590 | - arrayPop(DOMPurify.removed); | |
| 2591 | - } | |
| 2592 | - } catch (_) { | |
| 2593 | - _removeAttribute(name, currentNode); | |
| 2594 | - } | |
| 2595 | - } | |
| 2596 | - } | |
| 2597 | - /* Execute a hook if present */ | |
| 2598 | - _executeHooks(hooks.afterSanitizeAttributes, currentNode, null); | |
| 2599 | - }; | |
| 2600 | - /** | |
| 2601 | - * _sanitizeShadowDOM | |
| 2602 | - * | |
| 2603 | - * @param fragment to iterate over recursively | |
| 2604 | - */ | |
| 2605 | - const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) { | |
| 2606 | - let shadowNode = null; | |
| 2607 | - const shadowIterator = _createNodeIterator(fragment); | |
| 2608 | - /* Execute a hook if present */ | |
| 2609 | - _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null); | |
| 2610 | - while (shadowNode = shadowIterator.nextNode()) { | |
| 2611 | - /* Execute a hook if present */ | |
| 2612 | - _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null); | |
| 2613 | - /* Sanitize tags and elements */ | |
| 2614 | - _sanitizeElements(shadowNode); | |
| 2615 | - /* Check attributes next */ | |
| 2616 | - _sanitizeAttributes(shadowNode); | |
| 2617 | - /* Deep shadow DOM detected */ | |
| 2618 | - if (shadowNode.content instanceof DocumentFragment) { | |
| 2619 | - _sanitizeShadowDOM(shadowNode.content); | |
| 2620 | - } | |
| 2621 | - } | |
| 2622 | - /* Execute a hook if present */ | |
| 2623 | - _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null); | |
| 2624 | - }; | |
| 2625 | - // eslint-disable-next-line complexity | |
| 2626 | - DOMPurify.sanitize = function (dirty) { | |
| 2627 | - let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 2628 | - let body = null; | |
| 2629 | - let importedNode = null; | |
| 2630 | - let currentNode = null; | |
| 2631 | - let returnNode = null; | |
| 2632 | - /* Make sure we have a string to sanitize. | |
| 2633 | - DO NOT return early, as this will return the wrong type if | |
| 2634 | - the user has requested a DOM object rather than a string */ | |
| 2635 | - IS_EMPTY_INPUT = !dirty; | |
| 2636 | - if (IS_EMPTY_INPUT) { | |
| 2637 | - dirty = '<!-->'; | |
| 2638 | - } | |
| 2639 | - /* Stringify, in case dirty is an object */ | |
| 2640 | - if (typeof dirty !== 'string' && !_isNode(dirty)) { | |
| 2641 | - if (typeof dirty.toString === 'function') { | |
| 2642 | - dirty = dirty.toString(); | |
| 2643 | - if (typeof dirty !== 'string') { | |
| 2644 | - throw typeErrorCreate('dirty is not a string, aborting'); | |
| 2645 | - } | |
| 2646 | - } else { | |
| 2647 | - throw typeErrorCreate('toString is not a function'); | |
| 2648 | - } | |
| 2649 | - } | |
| 2650 | - /* Return dirty HTML if DOMPurify cannot run */ | |
| 2651 | - if (!DOMPurify.isSupported) { | |
| 2652 | - return dirty; | |
| 2653 | - } | |
| 2654 | - /* Assign config vars */ | |
| 2655 | - if (!SET_CONFIG) { | |
| 2656 | - _parseConfig(cfg); | |
| 2657 | - } | |
| 2658 | - /* Clean up removed elements */ | |
| 2659 | - DOMPurify.removed = []; | |
| 2660 | - /* Check if dirty is correctly typed for IN_PLACE */ | |
| 2661 | - if (typeof dirty === 'string') { | |
| 2662 | - IN_PLACE = false; | |
| 2663 | - } | |
| 2664 | - if (IN_PLACE) { | |
| 2665 | - /* Do some early pre-sanitization to avoid unsafe root nodes */ | |
| 2666 | - if (dirty.nodeName) { | |
| 2667 | - const tagName = transformCaseFunc(dirty.nodeName); | |
| 2668 | - if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { | |
| 2669 | - throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place'); | |
| 2670 | - } | |
| 2671 | - } | |
| 2672 | - } else if (dirty instanceof Node) { | |
| 2673 | - /* If dirty is a DOM element, append to an empty document to avoid | |
| 2674 | - elements being stripped by the parser */ | |
| 2675 | - body = _initDocument('<!---->'); | |
| 2676 | - importedNode = body.ownerDocument.importNode(dirty, true); | |
| 2677 | - if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') { | |
| 2678 | - /* Node is already a body, use as is */ | |
| 2679 | - body = importedNode; | |
| 2680 | - } else if (importedNode.nodeName === 'HTML') { | |
| 2681 | - body = importedNode; | |
| 2682 | - } else { | |
| 2683 | - // eslint-disable-next-line unicorn/prefer-dom-node-append | |
| 2684 | - body.appendChild(importedNode); | |
| 2685 | - } | |
| 2686 | - } else { | |
| 2687 | - /* Exit directly if we have nothing to do */ | |
| 2688 | - if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && | |
| 2689 | - // eslint-disable-next-line unicorn/prefer-includes | |
| 2690 | - dirty.indexOf('<') === -1) { | |
| 2691 | - return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty; | |
| 2692 | - } | |
| 2693 | - /* Initialize the document to work on */ | |
| 2694 | - body = _initDocument(dirty); | |
| 2695 | - /* Check we have a DOM node from the data */ | |
| 2696 | - if (!body) { | |
| 2697 | - return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ''; | |
| 2698 | - } | |
| 2699 | - } | |
| 2700 | - /* Remove first element node (ours) if FORCE_BODY is set */ | |
| 2701 | - if (body && FORCE_BODY) { | |
| 2702 | - _forceRemove(body.firstChild); | |
| 2703 | - } | |
| 2704 | - /* Get node iterator */ | |
| 2705 | - const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body); | |
| 2706 | - /* Now start iterating over the created document */ | |
| 2707 | - while (currentNode = nodeIterator.nextNode()) { | |
| 2708 | - /* Sanitize tags and elements */ | |
| 2709 | - _sanitizeElements(currentNode); | |
| 2710 | - /* Check attributes next */ | |
| 2711 | - _sanitizeAttributes(currentNode); | |
| 2712 | - /* Shadow DOM detected, sanitize it */ | |
| 2713 | - if (currentNode.content instanceof DocumentFragment) { | |
| 2714 | - _sanitizeShadowDOM(currentNode.content); | |
| 2715 | - } | |
| 2716 | - } | |
| 2717 | - /* If we sanitized `dirty` in-place, return it. */ | |
| 2718 | - if (IN_PLACE) { | |
| 2719 | - return dirty; | |
| 2720 | - } | |
| 2721 | - /* Return sanitized string or DOM */ | |
| 2722 | - if (RETURN_DOM) { | |
| 2723 | - if (RETURN_DOM_FRAGMENT) { | |
| 2724 | - returnNode = createDocumentFragment.call(body.ownerDocument); | |
| 2725 | - while (body.firstChild) { | |
| 2726 | - // eslint-disable-next-line unicorn/prefer-dom-node-append | |
| 2727 | - returnNode.appendChild(body.firstChild); | |
| 2728 | - } | |
| 2729 | - } else { | |
| 2730 | - returnNode = body; | |
| 2731 | - } | |
| 2732 | - if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { | |
| 2733 | - /* | |
| 2734 | - AdoptNode() is not used because internal state is not reset | |
| 2735 | - (e.g. the past names map of a HTMLFormElement), this is safe | |
| 2736 | - in theory but we would rather not risk another attack vector. | |
| 2737 | - The state that is cloned by importNode() is explicitly defined | |
| 2738 | - by the specs. | |
| 2739 | - */ | |
| 2740 | - returnNode = importNode.call(originalDocument, returnNode, true); | |
| 2741 | - } | |
| 2742 | - return returnNode; | |
| 2743 | - } | |
| 2744 | - let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; | |
| 2745 | - /* Serialize doctype if allowed */ | |
| 2746 | - if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { | |
| 2747 | - serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML; | |
| 2748 | - } | |
| 2749 | - /* Sanitize final string template-safe */ | |
| 2750 | - if (SAFE_FOR_TEMPLATES) { | |
| 2751 | - arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { | |
| 2752 | - serializedHTML = stringReplace(serializedHTML, expr, ' '); | |
| 2753 | - }); | |
| 2754 | - } | |
| 2755 | - return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; | |
| 2756 | - }; | |
| 2757 | - DOMPurify.setConfig = function () { | |
| 2758 | - let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 2759 | - _parseConfig(cfg); | |
| 2760 | - SET_CONFIG = true; | |
| 2761 | - }; | |
| 2762 | - DOMPurify.clearConfig = function () { | |
| 2763 | - CONFIG = null; | |
| 2764 | - SET_CONFIG = false; | |
| 2765 | - }; | |
| 2766 | - DOMPurify.isValidAttribute = function (tag, attr, value) { | |
| 2767 | - /* Initialize shared config vars if necessary. */ | |
| 2768 | - if (!CONFIG) { | |
| 2769 | - _parseConfig({}); | |
| 2770 | - } | |
| 2771 | - const lcTag = transformCaseFunc(tag); | |
| 2772 | - const lcName = transformCaseFunc(attr); | |
| 2773 | - return _isValidAttribute(lcTag, lcName, value); | |
| 2774 | - }; | |
| 2775 | - DOMPurify.addHook = function (entryPoint, hookFunction) { | |
| 2776 | - if (typeof hookFunction !== 'function') { | |
| 2777 | - return; | |
| 2778 | - } | |
| 2779 | - arrayPush(hooks[entryPoint], hookFunction); | |
| 2780 | - }; | |
| 2781 | - DOMPurify.removeHook = function (entryPoint, hookFunction) { | |
| 2782 | - if (hookFunction !== undefined) { | |
| 2783 | - const index = arrayLastIndexOf(hooks[entryPoint], hookFunction); | |
| 2784 | - return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0]; | |
| 2785 | - } | |
| 2786 | - return arrayPop(hooks[entryPoint]); | |
| 2787 | - }; | |
| 2788 | - DOMPurify.removeHooks = function (entryPoint) { | |
| 2789 | - hooks[entryPoint] = []; | |
| 2790 | - }; | |
| 2791 | - DOMPurify.removeAllHooks = function () { | |
| 2792 | - hooks = _createHooksMap(); | |
| 2793 | - }; | |
| 2794 | - return DOMPurify; | |
| 2795 | -} | |
| 2796 | -var purify = createDOMPurify(); | |
| 2797 | - | |
| 2798 | -module.exports = purify; | |
| 2799 | -//# sourceMappingURL=purify.cjs.js.map | |
| 2800 | - | |
| 2801 | - | |
| 2802 | -/***/ }), | |
| 2803 | - | |
| 2804 | -/***/ "../node_modules/object-assign/index.js": | |
| 2805 | -/*!**********************************************!*\ | |
| 2806 | - !*** ../node_modules/object-assign/index.js ***! | |
| 2807 | - \**********************************************/ | |
| 2808 | -/***/ ((module) => { | |
| 2809 | - | |
| 2810 | -"use strict"; | |
| 2811 | -/* | |
| 2812 | -object-assign | |
| 2813 | -(c) Sindre Sorhus | |
| 2814 | -@license MIT | |
| 2815 | -*/ | |
| 2816 | - | |
| 2817 | - | |
| 2818 | -/* eslint-disable no-unused-vars */ | |
| 2819 | -var getOwnPropertySymbols = Object.getOwnPropertySymbols; | |
| 2820 | -var hasOwnProperty = Object.prototype.hasOwnProperty; | |
| 2821 | -var propIsEnumerable = Object.prototype.propertyIsEnumerable; | |
| 2822 | - | |
| 2823 | -function toObject(val) { | |
| 2824 | - if (val === null || val === undefined) { | |
| 2825 | - throw new TypeError('Object.assign cannot be called with null or undefined'); | |
| 1450 | + var { entries, setPrototypeOf, isFrozen, getPrototypeOf, getOwnPropertyDescriptor } = Object; | |
| 1451 | + var { freeze, seal, create } = Object; | |
| 1452 | + var { apply, construct } = typeof Reflect !== "undefined" && Reflect; | |
| 1453 | + if (!freeze) freeze = function freeze(x) { | |
| 1454 | + return x; | |
| 1455 | + }; | |
| 1456 | + if (!seal) seal = function seal(x) { | |
| 1457 | + return x; | |
| 1458 | + }; | |
| 1459 | + if (!apply) apply = function apply(func, thisArg) { | |
| 1460 | + for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key]; | |
| 1461 | + return func.apply(thisArg, args); | |
| 1462 | + }; | |
| 1463 | + if (!construct) construct = function construct(Func) { | |
| 1464 | + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2]; | |
| 1465 | + return new Func(...args); | |
| 1466 | + }; | |
| 1467 | + var arrayForEach = unapply(Array.prototype.forEach); | |
| 1468 | + var arrayLastIndexOf = unapply(Array.prototype.lastIndexOf); | |
| 1469 | + var arrayPop = unapply(Array.prototype.pop); | |
| 1470 | + var arrayPush = unapply(Array.prototype.push); | |
| 1471 | + var arraySplice = unapply(Array.prototype.splice); | |
| 1472 | + var stringToLowerCase = unapply(String.prototype.toLowerCase); | |
| 1473 | + var stringToString = unapply(String.prototype.toString); | |
| 1474 | + var stringMatch = unapply(String.prototype.match); | |
| 1475 | + var stringReplace = unapply(String.prototype.replace); | |
| 1476 | + var stringIndexOf = unapply(String.prototype.indexOf); | |
| 1477 | + var stringTrim = unapply(String.prototype.trim); | |
| 1478 | + var objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); | |
| 1479 | + var regExpTest = unapply(RegExp.prototype.test); | |
| 1480 | + var typeErrorCreate = unconstruct(TypeError); | |
| 1481 | + /** | |
| 1482 | + * Creates a new function that calls the given function with a specified thisArg and arguments. | |
| 1483 | + * | |
| 1484 | + * @param func - The function to be wrapped and called. | |
| 1485 | + * @returns A new function that calls the given function with a specified thisArg and arguments. | |
| 1486 | + */ | |
| 1487 | + function unapply(func) { | |
| 1488 | + return function(thisArg) { | |
| 1489 | + if (thisArg instanceof RegExp) thisArg.lastIndex = 0; | |
| 1490 | + for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3]; | |
| 1491 | + return apply(func, thisArg, args); | |
| 1492 | + }; | |
| 2826 | 1493 | } |
| 2827 | - | |
| 2828 | - return Object(val); | |
| 2829 | -} | |
| 2830 | - | |
| 2831 | -function shouldUseNative() { | |
| 2832 | - try { | |
| 2833 | - if (!Object.assign) { | |
| 2834 | - return false; | |
| 1494 | + /** | |
| 1495 | + * Creates a new function that constructs an instance of the given constructor function with the provided arguments. | |
| 1496 | + * | |
| 1497 | + * @param func - The constructor function to be wrapped and called. | |
| 1498 | + * @returns A new function that constructs an instance of the given constructor function with the provided arguments. | |
| 1499 | + */ | |
| 1500 | + function unconstruct(Func) { | |
| 1501 | + return function() { | |
| 1502 | + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4]; | |
| 1503 | + return construct(Func, args); | |
| 1504 | + }; | |
| 1505 | + } | |
| 1506 | + /** | |
| 1507 | + * Add properties to a lookup table | |
| 1508 | + * | |
| 1509 | + * @param set - The set to which elements will be added. | |
| 1510 | + * @param array - The array containing elements to be added to the set. | |
| 1511 | + * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set. | |
| 1512 | + * @returns The modified set with added elements. | |
| 1513 | + */ | |
| 1514 | + function addToSet(set, array) { | |
| 1515 | + let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase; | |
| 1516 | + if (setPrototypeOf) setPrototypeOf(set, null); | |
| 1517 | + let l = array.length; | |
| 1518 | + while (l--) { | |
| 1519 | + let element = array[l]; | |
| 1520 | + if (typeof element === "string") { | |
| 1521 | + const lcElement = transformCaseFunc(element); | |
| 1522 | + if (lcElement !== element) { | |
| 1523 | + if (!isFrozen(array)) array[l] = lcElement; | |
| 1524 | + element = lcElement; | |
| 1525 | + } | |
| 1526 | + } | |
| 1527 | + set[element] = true; | |
| 2835 | 1528 | } |
| 2836 | - | |
| 2837 | - // Detect buggy property enumeration order in older V8 versions. | |
| 2838 | - | |
| 2839 | - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 | |
| 2840 | - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers | |
| 2841 | - test1[5] = 'de'; | |
| 2842 | - if (Object.getOwnPropertyNames(test1)[0] === '5') { | |
| 2843 | - return false; | |
| 1529 | + return set; | |
| 1530 | + } | |
| 1531 | + /** | |
| 1532 | + * Clean up an array to harden against CSPP | |
| 1533 | + * | |
| 1534 | + * @param array - The array to be cleaned. | |
| 1535 | + * @returns The cleaned version of the array | |
| 1536 | + */ | |
| 1537 | + function cleanArray(array) { | |
| 1538 | + for (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null; | |
| 1539 | + return array; | |
| 1540 | + } | |
| 1541 | + /** | |
| 1542 | + * Shallow clone an object | |
| 1543 | + * | |
| 1544 | + * @param object - The object to be cloned. | |
| 1545 | + * @returns A new object that copies the original. | |
| 1546 | + */ | |
| 1547 | + function clone(object) { | |
| 1548 | + const newObject = create(null); | |
| 1549 | + for (const [property, value] of entries(object)) if (objectHasOwnProperty(object, property)) if (Array.isArray(value)) newObject[property] = cleanArray(value); | |
| 1550 | + else if (value && typeof value === "object" && value.constructor === Object) newObject[property] = clone(value); | |
| 1551 | + else newObject[property] = value; | |
| 1552 | + return newObject; | |
| 1553 | + } | |
| 1554 | + /** | |
| 1555 | + * This method automatically checks if the prop is function or getter and behaves accordingly. | |
| 1556 | + * | |
| 1557 | + * @param object - The object to look up the getter function in its prototype chain. | |
| 1558 | + * @param prop - The property name for which to find the getter function. | |
| 1559 | + * @returns The getter function found in the prototype chain or a fallback function. | |
| 1560 | + */ | |
| 1561 | + function lookupGetter(object, prop) { | |
| 1562 | + while (object !== null) { | |
| 1563 | + const desc = getOwnPropertyDescriptor(object, prop); | |
| 1564 | + if (desc) { | |
| 1565 | + if (desc.get) return unapply(desc.get); | |
| 1566 | + if (typeof desc.value === "function") return unapply(desc.value); | |
| 1567 | + } | |
| 1568 | + object = getPrototypeOf(object); | |
| 2844 | 1569 | } |
| 2845 | - | |
| 2846 | - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 | |
| 2847 | - var test2 = {}; | |
| 2848 | - for (var i = 0; i < 10; i++) { | |
| 2849 | - test2['_' + String.fromCharCode(i)] = i; | |
| 1570 | + function fallbackValue() { | |
| 1571 | + return null; | |
| 2850 | 1572 | } |
| 2851 | - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { | |
| 2852 | - return test2[n]; | |
| 2853 | - }); | |
| 2854 | - if (order2.join('') !== '0123456789') { | |
| 1573 | + return fallbackValue; | |
| 1574 | + } | |
| 1575 | + var html$1 = freeze([ | |
| 1576 | + "a", | |
| 1577 | + "abbr", | |
| 1578 | + "acronym", | |
| 1579 | + "address", | |
| 1580 | + "area", | |
| 1581 | + "article", | |
| 1582 | + "aside", | |
| 1583 | + "audio", | |
| 1584 | + "b", | |
| 1585 | + "bdi", | |
| 1586 | + "bdo", | |
| 1587 | + "big", | |
| 1588 | + "blink", | |
| 1589 | + "blockquote", | |
| 1590 | + "body", | |
| 1591 | + "br", | |
| 1592 | + "button", | |
| 1593 | + "canvas", | |
| 1594 | + "caption", | |
| 1595 | + "center", | |
| 1596 | + "cite", | |
| 1597 | + "code", | |
| 1598 | + "col", | |
| 1599 | + "colgroup", | |
| 1600 | + "content", | |
| 1601 | + "data", | |
| 1602 | + "datalist", | |
| 1603 | + "dd", | |
| 1604 | + "decorator", | |
| 1605 | + "del", | |
| 1606 | + "details", | |
| 1607 | + "dfn", | |
| 1608 | + "dialog", | |
| 1609 | + "dir", | |
| 1610 | + "div", | |
| 1611 | + "dl", | |
| 1612 | + "dt", | |
| 1613 | + "element", | |
| 1614 | + "em", | |
| 1615 | + "fieldset", | |
| 1616 | + "figcaption", | |
| 1617 | + "figure", | |
| 1618 | + "font", | |
| 1619 | + "footer", | |
| 1620 | + "form", | |
| 1621 | + "h1", | |
| 1622 | + "h2", | |
| 1623 | + "h3", | |
| 1624 | + "h4", | |
| 1625 | + "h5", | |
| 1626 | + "h6", | |
| 1627 | + "head", | |
| 1628 | + "header", | |
| 1629 | + "hgroup", | |
| 1630 | + "hr", | |
| 1631 | + "html", | |
| 1632 | + "i", | |
| 1633 | + "img", | |
| 1634 | + "input", | |
| 1635 | + "ins", | |
| 1636 | + "kbd", | |
| 1637 | + "label", | |
| 1638 | + "legend", | |
| 1639 | + "li", | |
| 1640 | + "main", | |
| 1641 | + "map", | |
| 1642 | + "mark", | |
| 1643 | + "marquee", | |
| 1644 | + "menu", | |
| 1645 | + "menuitem", | |
| 1646 | + "meter", | |
| 1647 | + "nav", | |
| 1648 | + "nobr", | |
| 1649 | + "ol", | |
| 1650 | + "optgroup", | |
| 1651 | + "option", | |
| 1652 | + "output", | |
| 1653 | + "p", | |
| 1654 | + "picture", | |
| 1655 | + "pre", | |
| 1656 | + "progress", | |
| 1657 | + "q", | |
| 1658 | + "rp", | |
| 1659 | + "rt", | |
| 1660 | + "ruby", | |
| 1661 | + "s", | |
| 1662 | + "samp", | |
| 1663 | + "search", | |
| 1664 | + "section", | |
| 1665 | + "select", | |
| 1666 | + "shadow", | |
| 1667 | + "slot", | |
| 1668 | + "small", | |
| 1669 | + "source", | |
| 1670 | + "spacer", | |
| 1671 | + "span", | |
| 1672 | + "strike", | |
| 1673 | + "strong", | |
| 1674 | + "style", | |
| 1675 | + "sub", | |
| 1676 | + "summary", | |
| 1677 | + "sup", | |
| 1678 | + "table", | |
| 1679 | + "tbody", | |
| 1680 | + "td", | |
| 1681 | + "template", | |
| 1682 | + "textarea", | |
| 1683 | + "tfoot", | |
| 1684 | + "th", | |
| 1685 | + "thead", | |
| 1686 | + "time", | |
| 1687 | + "tr", | |
| 1688 | + "track", | |
| 1689 | + "tt", | |
| 1690 | + "u", | |
| 1691 | + "ul", | |
| 1692 | + "var", | |
| 1693 | + "video", | |
| 1694 | + "wbr" | |
| 1695 | + ]); | |
| 1696 | + var svg$1 = freeze([ | |
| 1697 | + "svg", | |
| 1698 | + "a", | |
| 1699 | + "altglyph", | |
| 1700 | + "altglyphdef", | |
| 1701 | + "altglyphitem", | |
| 1702 | + "animatecolor", | |
| 1703 | + "animatemotion", | |
| 1704 | + "animatetransform", | |
| 1705 | + "circle", | |
| 1706 | + "clippath", | |
| 1707 | + "defs", | |
| 1708 | + "desc", | |
| 1709 | + "ellipse", | |
| 1710 | + "enterkeyhint", | |
| 1711 | + "exportparts", | |
| 1712 | + "filter", | |
| 1713 | + "font", | |
| 1714 | + "g", | |
| 1715 | + "glyph", | |
| 1716 | + "glyphref", | |
| 1717 | + "hkern", | |
| 1718 | + "image", | |
| 1719 | + "inputmode", | |
| 1720 | + "line", | |
| 1721 | + "lineargradient", | |
| 1722 | + "marker", | |
| 1723 | + "mask", | |
| 1724 | + "metadata", | |
| 1725 | + "mpath", | |
| 1726 | + "part", | |
| 1727 | + "path", | |
| 1728 | + "pattern", | |
| 1729 | + "polygon", | |
| 1730 | + "polyline", | |
| 1731 | + "radialgradient", | |
| 1732 | + "rect", | |
| 1733 | + "stop", | |
| 1734 | + "style", | |
| 1735 | + "switch", | |
| 1736 | + "symbol", | |
| 1737 | + "text", | |
| 1738 | + "textpath", | |
| 1739 | + "title", | |
| 1740 | + "tref", | |
| 1741 | + "tspan", | |
| 1742 | + "view", | |
| 1743 | + "vkern" | |
| 1744 | + ]); | |
| 1745 | + var svgFilters = freeze([ | |
| 1746 | + "feBlend", | |
| 1747 | + "feColorMatrix", | |
| 1748 | + "feComponentTransfer", | |
| 1749 | + "feComposite", | |
| 1750 | + "feConvolveMatrix", | |
| 1751 | + "feDiffuseLighting", | |
| 1752 | + "feDisplacementMap", | |
| 1753 | + "feDistantLight", | |
| 1754 | + "feDropShadow", | |
| 1755 | + "feFlood", | |
| 1756 | + "feFuncA", | |
| 1757 | + "feFuncB", | |
| 1758 | + "feFuncG", | |
| 1759 | + "feFuncR", | |
| 1760 | + "feGaussianBlur", | |
| 1761 | + "feImage", | |
| 1762 | + "feMerge", | |
| 1763 | + "feMergeNode", | |
| 1764 | + "feMorphology", | |
| 1765 | + "feOffset", | |
| 1766 | + "fePointLight", | |
| 1767 | + "feSpecularLighting", | |
| 1768 | + "feSpotLight", | |
| 1769 | + "feTile", | |
| 1770 | + "feTurbulence" | |
| 1771 | + ]); | |
| 1772 | + var svgDisallowed = freeze([ | |
| 1773 | + "animate", | |
| 1774 | + "color-profile", | |
| 1775 | + "cursor", | |
| 1776 | + "discard", | |
| 1777 | + "font-face", | |
| 1778 | + "font-face-format", | |
| 1779 | + "font-face-name", | |
| 1780 | + "font-face-src", | |
| 1781 | + "font-face-uri", | |
| 1782 | + "foreignobject", | |
| 1783 | + "hatch", | |
| 1784 | + "hatchpath", | |
| 1785 | + "mesh", | |
| 1786 | + "meshgradient", | |
| 1787 | + "meshpatch", | |
| 1788 | + "meshrow", | |
| 1789 | + "missing-glyph", | |
| 1790 | + "script", | |
| 1791 | + "set", | |
| 1792 | + "solidcolor", | |
| 1793 | + "unknown", | |
| 1794 | + "use" | |
| 1795 | + ]); | |
| 1796 | + var mathMl$1 = freeze([ | |
| 1797 | + "math", | |
| 1798 | + "menclose", | |
| 1799 | + "merror", | |
| 1800 | + "mfenced", | |
| 1801 | + "mfrac", | |
| 1802 | + "mglyph", | |
| 1803 | + "mi", | |
| 1804 | + "mlabeledtr", | |
| 1805 | + "mmultiscripts", | |
| 1806 | + "mn", | |
| 1807 | + "mo", | |
| 1808 | + "mover", | |
| 1809 | + "mpadded", | |
| 1810 | + "mphantom", | |
| 1811 | + "mroot", | |
| 1812 | + "mrow", | |
| 1813 | + "ms", | |
| 1814 | + "mspace", | |
| 1815 | + "msqrt", | |
| 1816 | + "mstyle", | |
| 1817 | + "msub", | |
| 1818 | + "msup", | |
| 1819 | + "msubsup", | |
| 1820 | + "mtable", | |
| 1821 | + "mtd", | |
| 1822 | + "mtext", | |
| 1823 | + "mtr", | |
| 1824 | + "munder", | |
| 1825 | + "munderover", | |
| 1826 | + "mprescripts" | |
| 1827 | + ]); | |
| 1828 | + var mathMlDisallowed = freeze([ | |
| 1829 | + "maction", | |
| 1830 | + "maligngroup", | |
| 1831 | + "malignmark", | |
| 1832 | + "mlongdiv", | |
| 1833 | + "mscarries", | |
| 1834 | + "mscarry", | |
| 1835 | + "msgroup", | |
| 1836 | + "mstack", | |
| 1837 | + "msline", | |
| 1838 | + "msrow", | |
| 1839 | + "semantics", | |
| 1840 | + "annotation", | |
| 1841 | + "annotation-xml", | |
| 1842 | + "mprescripts", | |
| 1843 | + "none" | |
| 1844 | + ]); | |
| 1845 | + var text = freeze(["#text"]); | |
| 1846 | + var html = freeze([ | |
| 1847 | + "accept", | |
| 1848 | + "action", | |
| 1849 | + "align", | |
| 1850 | + "alt", | |
| 1851 | + "autocapitalize", | |
| 1852 | + "autocomplete", | |
| 1853 | + "autopictureinpicture", | |
| 1854 | + "autoplay", | |
| 1855 | + "background", | |
| 1856 | + "bgcolor", | |
| 1857 | + "border", | |
| 1858 | + "capture", | |
| 1859 | + "cellpadding", | |
| 1860 | + "cellspacing", | |
| 1861 | + "checked", | |
| 1862 | + "cite", | |
| 1863 | + "class", | |
| 1864 | + "clear", | |
| 1865 | + "color", | |
| 1866 | + "cols", | |
| 1867 | + "colspan", | |
| 1868 | + "controls", | |
| 1869 | + "controlslist", | |
| 1870 | + "coords", | |
| 1871 | + "crossorigin", | |
| 1872 | + "datetime", | |
| 1873 | + "decoding", | |
| 1874 | + "default", | |
| 1875 | + "dir", | |
| 1876 | + "disabled", | |
| 1877 | + "disablepictureinpicture", | |
| 1878 | + "disableremoteplayback", | |
| 1879 | + "download", | |
| 1880 | + "draggable", | |
| 1881 | + "enctype", | |
| 1882 | + "enterkeyhint", | |
| 1883 | + "exportparts", | |
| 1884 | + "face", | |
| 1885 | + "for", | |
| 1886 | + "headers", | |
| 1887 | + "height", | |
| 1888 | + "hidden", | |
| 1889 | + "high", | |
| 1890 | + "href", | |
| 1891 | + "hreflang", | |
| 1892 | + "id", | |
| 1893 | + "inert", | |
| 1894 | + "inputmode", | |
| 1895 | + "integrity", | |
| 1896 | + "ismap", | |
| 1897 | + "kind", | |
| 1898 | + "label", | |
| 1899 | + "lang", | |
| 1900 | + "list", | |
| 1901 | + "loading", | |
| 1902 | + "loop", | |
| 1903 | + "low", | |
| 1904 | + "max", | |
| 1905 | + "maxlength", | |
| 1906 | + "media", | |
| 1907 | + "method", | |
| 1908 | + "min", | |
| 1909 | + "minlength", | |
| 1910 | + "multiple", | |
| 1911 | + "muted", | |
| 1912 | + "name", | |
| 1913 | + "nonce", | |
| 1914 | + "noshade", | |
| 1915 | + "novalidate", | |
| 1916 | + "nowrap", | |
| 1917 | + "open", | |
| 1918 | + "optimum", | |
| 1919 | + "part", | |
| 1920 | + "pattern", | |
| 1921 | + "placeholder", | |
| 1922 | + "playsinline", | |
| 1923 | + "popover", | |
| 1924 | + "popovertarget", | |
| 1925 | + "popovertargetaction", | |
| 1926 | + "poster", | |
| 1927 | + "preload", | |
| 1928 | + "pubdate", | |
| 1929 | + "radiogroup", | |
| 1930 | + "readonly", | |
| 1931 | + "rel", | |
| 1932 | + "required", | |
| 1933 | + "rev", | |
| 1934 | + "reversed", | |
| 1935 | + "role", | |
| 1936 | + "rows", | |
| 1937 | + "rowspan", | |
| 1938 | + "spellcheck", | |
| 1939 | + "scope", | |
| 1940 | + "selected", | |
| 1941 | + "shape", | |
| 1942 | + "size", | |
| 1943 | + "sizes", | |
| 1944 | + "slot", | |
| 1945 | + "span", | |
| 1946 | + "srclang", | |
| 1947 | + "start", | |
| 1948 | + "src", | |
| 1949 | + "srcset", | |
| 1950 | + "step", | |
| 1951 | + "style", | |
| 1952 | + "summary", | |
| 1953 | + "tabindex", | |
| 1954 | + "title", | |
| 1955 | + "translate", | |
| 1956 | + "type", | |
| 1957 | + "usemap", | |
| 1958 | + "valign", | |
| 1959 | + "value", | |
| 1960 | + "width", | |
| 1961 | + "wrap", | |
| 1962 | + "xmlns", | |
| 1963 | + "slot" | |
| 1964 | + ]); | |
| 1965 | + var svg = freeze([ | |
| 1966 | + "accent-height", | |
| 1967 | + "accumulate", | |
| 1968 | + "additive", | |
| 1969 | + "alignment-baseline", | |
| 1970 | + "amplitude", | |
| 1971 | + "ascent", | |
| 1972 | + "attributename", | |
| 1973 | + "attributetype", | |
| 1974 | + "azimuth", | |
| 1975 | + "basefrequency", | |
| 1976 | + "baseline-shift", | |
| 1977 | + "begin", | |
| 1978 | + "bias", | |
| 1979 | + "by", | |
| 1980 | + "class", | |
| 1981 | + "clip", | |
| 1982 | + "clippathunits", | |
| 1983 | + "clip-path", | |
| 1984 | + "clip-rule", | |
| 1985 | + "color", | |
| 1986 | + "color-interpolation", | |
| 1987 | + "color-interpolation-filters", | |
| 1988 | + "color-profile", | |
| 1989 | + "color-rendering", | |
| 1990 | + "cx", | |
| 1991 | + "cy", | |
| 1992 | + "d", | |
| 1993 | + "dx", | |
| 1994 | + "dy", | |
| 1995 | + "diffuseconstant", | |
| 1996 | + "direction", | |
| 1997 | + "display", | |
| 1998 | + "divisor", | |
| 1999 | + "dur", | |
| 2000 | + "edgemode", | |
| 2001 | + "elevation", | |
| 2002 | + "end", | |
| 2003 | + "exponent", | |
| 2004 | + "fill", | |
| 2005 | + "fill-opacity", | |
| 2006 | + "fill-rule", | |
| 2007 | + "filter", | |
| 2008 | + "filterunits", | |
| 2009 | + "flood-color", | |
| 2010 | + "flood-opacity", | |
| 2011 | + "font-family", | |
| 2012 | + "font-size", | |
| 2013 | + "font-size-adjust", | |
| 2014 | + "font-stretch", | |
| 2015 | + "font-style", | |
| 2016 | + "font-variant", | |
| 2017 | + "font-weight", | |
| 2018 | + "fx", | |
| 2019 | + "fy", | |
| 2020 | + "g1", | |
| 2021 | + "g2", | |
| 2022 | + "glyph-name", | |
| 2023 | + "glyphref", | |
| 2024 | + "gradientunits", | |
| 2025 | + "gradienttransform", | |
| 2026 | + "height", | |
| 2027 | + "href", | |
| 2028 | + "id", | |
| 2029 | + "image-rendering", | |
| 2030 | + "in", | |
| 2031 | + "in2", | |
| 2032 | + "intercept", | |
| 2033 | + "k", | |
| 2034 | + "k1", | |
| 2035 | + "k2", | |
| 2036 | + "k3", | |
| 2037 | + "k4", | |
| 2038 | + "kerning", | |
| 2039 | + "keypoints", | |
| 2040 | + "keysplines", | |
| 2041 | + "keytimes", | |
| 2042 | + "lang", | |
| 2043 | + "lengthadjust", | |
| 2044 | + "letter-spacing", | |
| 2045 | + "kernelmatrix", | |
| 2046 | + "kernelunitlength", | |
| 2047 | + "lighting-color", | |
| 2048 | + "local", | |
| 2049 | + "marker-end", | |
| 2050 | + "marker-mid", | |
| 2051 | + "marker-start", | |
| 2052 | + "markerheight", | |
| 2053 | + "markerunits", | |
| 2054 | + "markerwidth", | |
| 2055 | + "maskcontentunits", | |
| 2056 | + "maskunits", | |
| 2057 | + "max", | |
| 2058 | + "mask", | |
| 2059 | + "mask-type", | |
| 2060 | + "media", | |
| 2061 | + "method", | |
| 2062 | + "mode", | |
| 2063 | + "min", | |
| 2064 | + "name", | |
| 2065 | + "numoctaves", | |
| 2066 | + "offset", | |
| 2067 | + "operator", | |
| 2068 | + "opacity", | |
| 2069 | + "order", | |
| 2070 | + "orient", | |
| 2071 | + "orientation", | |
| 2072 | + "origin", | |
| 2073 | + "overflow", | |
| 2074 | + "paint-order", | |
| 2075 | + "path", | |
| 2076 | + "pathlength", | |
| 2077 | + "patterncontentunits", | |
| 2078 | + "patterntransform", | |
| 2079 | + "patternunits", | |
| 2080 | + "points", | |
| 2081 | + "preservealpha", | |
| 2082 | + "preserveaspectratio", | |
| 2083 | + "primitiveunits", | |
| 2084 | + "r", | |
| 2085 | + "rx", | |
| 2086 | + "ry", | |
| 2087 | + "radius", | |
| 2088 | + "refx", | |
| 2089 | + "refy", | |
| 2090 | + "repeatcount", | |
| 2091 | + "repeatdur", | |
| 2092 | + "restart", | |
| 2093 | + "result", | |
| 2094 | + "rotate", | |
| 2095 | + "scale", | |
| 2096 | + "seed", | |
| 2097 | + "shape-rendering", | |
| 2098 | + "slope", | |
| 2099 | + "specularconstant", | |
| 2100 | + "specularexponent", | |
| 2101 | + "spreadmethod", | |
| 2102 | + "startoffset", | |
| 2103 | + "stddeviation", | |
| 2104 | + "stitchtiles", | |
| 2105 | + "stop-color", | |
| 2106 | + "stop-opacity", | |
| 2107 | + "stroke-dasharray", | |
| 2108 | + "stroke-dashoffset", | |
| 2109 | + "stroke-linecap", | |
| 2110 | + "stroke-linejoin", | |
| 2111 | + "stroke-miterlimit", | |
| 2112 | + "stroke-opacity", | |
| 2113 | + "stroke", | |
| 2114 | + "stroke-width", | |
| 2115 | + "style", | |
| 2116 | + "surfacescale", | |
| 2117 | + "systemlanguage", | |
| 2118 | + "tabindex", | |
| 2119 | + "tablevalues", | |
| 2120 | + "targetx", | |
| 2121 | + "targety", | |
| 2122 | + "transform", | |
| 2123 | + "transform-origin", | |
| 2124 | + "text-anchor", | |
| 2125 | + "text-decoration", | |
| 2126 | + "text-rendering", | |
| 2127 | + "textlength", | |
| 2128 | + "type", | |
| 2129 | + "u1", | |
| 2130 | + "u2", | |
| 2131 | + "unicode", | |
| 2132 | + "values", | |
| 2133 | + "viewbox", | |
| 2134 | + "visibility", | |
| 2135 | + "version", | |
| 2136 | + "vert-adv-y", | |
| 2137 | + "vert-origin-x", | |
| 2138 | + "vert-origin-y", | |
| 2139 | + "width", | |
| 2140 | + "word-spacing", | |
| 2141 | + "wrap", | |
| 2142 | + "writing-mode", | |
| 2143 | + "xchannelselector", | |
| 2144 | + "ychannelselector", | |
| 2145 | + "x", | |
| 2146 | + "x1", | |
| 2147 | + "x2", | |
| 2148 | + "xmlns", | |
| 2149 | + "y", | |
| 2150 | + "y1", | |
| 2151 | + "y2", | |
| 2152 | + "z", | |
| 2153 | + "zoomandpan" | |
| 2154 | + ]); | |
| 2155 | + var mathMl = freeze([ | |
| 2156 | + "accent", | |
| 2157 | + "accentunder", | |
| 2158 | + "align", | |
| 2159 | + "bevelled", | |
| 2160 | + "close", | |
| 2161 | + "columnsalign", | |
| 2162 | + "columnlines", | |
| 2163 | + "columnspan", | |
| 2164 | + "denomalign", | |
| 2165 | + "depth", | |
| 2166 | + "dir", | |
| 2167 | + "display", | |
| 2168 | + "displaystyle", | |
| 2169 | + "encoding", | |
| 2170 | + "fence", | |
| 2171 | + "frame", | |
| 2172 | + "height", | |
| 2173 | + "href", | |
| 2174 | + "id", | |
| 2175 | + "largeop", | |
| 2176 | + "length", | |
| 2177 | + "linethickness", | |
| 2178 | + "lspace", | |
| 2179 | + "lquote", | |
| 2180 | + "mathbackground", | |
| 2181 | + "mathcolor", | |
| 2182 | + "mathsize", | |
| 2183 | + "mathvariant", | |
| 2184 | + "maxsize", | |
| 2185 | + "minsize", | |
| 2186 | + "movablelimits", | |
| 2187 | + "notation", | |
| 2188 | + "numalign", | |
| 2189 | + "open", | |
| 2190 | + "rowalign", | |
| 2191 | + "rowlines", | |
| 2192 | + "rowspacing", | |
| 2193 | + "rowspan", | |
| 2194 | + "rspace", | |
| 2195 | + "rquote", | |
| 2196 | + "scriptlevel", | |
| 2197 | + "scriptminsize", | |
| 2198 | + "scriptsizemultiplier", | |
| 2199 | + "selection", | |
| 2200 | + "separator", | |
| 2201 | + "separators", | |
| 2202 | + "stretchy", | |
| 2203 | + "subscriptshift", | |
| 2204 | + "supscriptshift", | |
| 2205 | + "symmetric", | |
| 2206 | + "voffset", | |
| 2207 | + "width", | |
| 2208 | + "xmlns" | |
| 2209 | + ]); | |
| 2210 | + var xml = freeze([ | |
| 2211 | + "xlink:href", | |
| 2212 | + "xml:id", | |
| 2213 | + "xlink:title", | |
| 2214 | + "xml:space", | |
| 2215 | + "xmlns:xlink" | |
| 2216 | + ]); | |
| 2217 | + var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); | |
| 2218 | + var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); | |
| 2219 | + var TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); | |
| 2220 | + var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); | |
| 2221 | + var ARIA_ATTR = seal(/^aria-[\-\w]+$/); | |
| 2222 | + var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i); | |
| 2223 | + var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); | |
| 2224 | + var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g); | |
| 2225 | + var DOCTYPE_NAME = seal(/^html$/i); | |
| 2226 | + var CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i); | |
| 2227 | + var EXPRESSIONS = /*#__PURE__*/ Object.freeze({ | |
| 2228 | + __proto__: null, | |
| 2229 | + ARIA_ATTR, | |
| 2230 | + ATTR_WHITESPACE, | |
| 2231 | + CUSTOM_ELEMENT, | |
| 2232 | + DATA_ATTR, | |
| 2233 | + DOCTYPE_NAME, | |
| 2234 | + ERB_EXPR, | |
| 2235 | + IS_ALLOWED_URI, | |
| 2236 | + IS_SCRIPT_OR_DATA, | |
| 2237 | + MUSTACHE_EXPR, | |
| 2238 | + TMPLIT_EXPR | |
| 2239 | + }); | |
| 2240 | + var NODE_TYPE = { | |
| 2241 | + element: 1, | |
| 2242 | + attribute: 2, | |
| 2243 | + text: 3, | |
| 2244 | + cdataSection: 4, | |
| 2245 | + entityReference: 5, | |
| 2246 | + entityNode: 6, | |
| 2247 | + progressingInstruction: 7, | |
| 2248 | + comment: 8, | |
| 2249 | + document: 9, | |
| 2250 | + documentType: 10, | |
| 2251 | + documentFragment: 11, | |
| 2252 | + notation: 12 | |
| 2253 | + }; | |
| 2254 | + var getGlobal = function getGlobal() { | |
| 2255 | + return typeof window === "undefined" ? null : window; | |
| 2256 | + }; | |
| 2257 | + /** | |
| 2258 | + * Creates a no-op policy for internal use only. | |
| 2259 | + * Don't export this function outside this module! | |
| 2260 | + * @param trustedTypes The policy factory. | |
| 2261 | + * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). | |
| 2262 | + * @return The policy created (or null, if Trusted Types | |
| 2263 | + * are not supported or creating the policy failed). | |
| 2264 | + */ | |
| 2265 | + var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) { | |
| 2266 | + if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") return null; | |
| 2267 | + let suffix = null; | |
| 2268 | + const ATTR_NAME = "data-tt-policy-suffix"; | |
| 2269 | + if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME); | |
| 2270 | + const policyName = "dompurify" + (suffix ? "#" + suffix : ""); | |
| 2271 | + try { | |
| 2272 | + return trustedTypes.createPolicy(policyName, { | |
| 2273 | + createHTML(html) { | |
| 2274 | + return html; | |
| 2275 | + }, | |
| 2276 | + createScriptURL(scriptUrl) { | |
| 2277 | + return scriptUrl; | |
| 2278 | + } | |
| 2279 | + }); | |
| 2280 | + } catch (_) { | |
| 2281 | + console.warn("TrustedTypes policy " + policyName + " could not be created."); | |
| 2282 | + return null; | |
| 2283 | + } | |
| 2284 | + }; | |
| 2285 | + var _createHooksMap = function _createHooksMap() { | |
| 2286 | + return { | |
| 2287 | + afterSanitizeAttributes: [], | |
| 2288 | + afterSanitizeElements: [], | |
| 2289 | + afterSanitizeShadowDOM: [], | |
| 2290 | + beforeSanitizeAttributes: [], | |
| 2291 | + beforeSanitizeElements: [], | |
| 2292 | + beforeSanitizeShadowDOM: [], | |
| 2293 | + uponSanitizeAttribute: [], | |
| 2294 | + uponSanitizeElement: [], | |
| 2295 | + uponSanitizeShadowNode: [] | |
| 2296 | + }; | |
| 2297 | + }; | |
| 2298 | + function createDOMPurify() { | |
| 2299 | + let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(); | |
| 2300 | + const DOMPurify = (root) => createDOMPurify(root); | |
| 2301 | + DOMPurify.version = "3.3.0"; | |
| 2302 | + DOMPurify.removed = []; | |
| 2303 | + if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) { | |
| 2304 | + DOMPurify.isSupported = false; | |
| 2305 | + return DOMPurify; | |
| 2306 | + } | |
| 2307 | + let { document } = window; | |
| 2308 | + const originalDocument = document; | |
| 2309 | + const currentScript = originalDocument.currentScript; | |
| 2310 | + const { DocumentFragment, HTMLTemplateElement, Node, Element, NodeFilter, NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap, HTMLFormElement, DOMParser, trustedTypes } = window; | |
| 2311 | + const ElementPrototype = Element.prototype; | |
| 2312 | + const cloneNode = lookupGetter(ElementPrototype, "cloneNode"); | |
| 2313 | + const remove = lookupGetter(ElementPrototype, "remove"); | |
| 2314 | + const getNextSibling = lookupGetter(ElementPrototype, "nextSibling"); | |
| 2315 | + const getChildNodes = lookupGetter(ElementPrototype, "childNodes"); | |
| 2316 | + const getParentNode = lookupGetter(ElementPrototype, "parentNode"); | |
| 2317 | + if (typeof HTMLTemplateElement === "function") { | |
| 2318 | + const template = document.createElement("template"); | |
| 2319 | + if (template.content && template.content.ownerDocument) document = template.content.ownerDocument; | |
| 2320 | + } | |
| 2321 | + let trustedTypesPolicy; | |
| 2322 | + let emptyHTML = ""; | |
| 2323 | + const { implementation, createNodeIterator, createDocumentFragment, getElementsByTagName } = document; | |
| 2324 | + const { importNode } = originalDocument; | |
| 2325 | + let hooks = _createHooksMap(); | |
| 2326 | + /** | |
| 2327 | + * Expose whether this browser supports running the full DOMPurify. | |
| 2328 | + */ | |
| 2329 | + DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0; | |
| 2330 | + const { MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR, DATA_ATTR, ARIA_ATTR, IS_SCRIPT_OR_DATA, ATTR_WHITESPACE, CUSTOM_ELEMENT } = EXPRESSIONS; | |
| 2331 | + let { IS_ALLOWED_URI: IS_ALLOWED_URI$1 } = EXPRESSIONS; | |
| 2332 | + /** | |
| 2333 | + * We consider the elements and attributes below to be safe. Ideally | |
| 2334 | + * don't add any new ones but feel free to remove unwanted ones. | |
| 2335 | + */ | |
| 2336 | + let ALLOWED_TAGS = null; | |
| 2337 | + const DEFAULT_ALLOWED_TAGS = addToSet({}, [ | |
| 2338 | + ...html$1, | |
| 2339 | + ...svg$1, | |
| 2340 | + ...svgFilters, | |
| 2341 | + ...mathMl$1, | |
| 2342 | + ...text | |
| 2343 | + ]); | |
| 2344 | + let ALLOWED_ATTR = null; | |
| 2345 | + const DEFAULT_ALLOWED_ATTR = addToSet({}, [ | |
| 2346 | + ...html, | |
| 2347 | + ...svg, | |
| 2348 | + ...mathMl, | |
| 2349 | + ...xml | |
| 2350 | + ]); | |
| 2351 | + let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, { | |
| 2352 | + tagNameCheck: { | |
| 2353 | + writable: true, | |
| 2354 | + configurable: false, | |
| 2355 | + enumerable: true, | |
| 2356 | + value: null | |
| 2357 | + }, | |
| 2358 | + attributeNameCheck: { | |
| 2359 | + writable: true, | |
| 2360 | + configurable: false, | |
| 2361 | + enumerable: true, | |
| 2362 | + value: null | |
| 2363 | + }, | |
| 2364 | + allowCustomizedBuiltInElements: { | |
| 2365 | + writable: true, | |
| 2366 | + configurable: false, | |
| 2367 | + enumerable: true, | |
| 2368 | + value: false | |
| 2369 | + } | |
| 2370 | + })); | |
| 2371 | + let FORBID_TAGS = null; | |
| 2372 | + let FORBID_ATTR = null; | |
| 2373 | + const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, { | |
| 2374 | + tagCheck: { | |
| 2375 | + writable: true, | |
| 2376 | + configurable: false, | |
| 2377 | + enumerable: true, | |
| 2378 | + value: null | |
| 2379 | + }, | |
| 2380 | + attributeCheck: { | |
| 2381 | + writable: true, | |
| 2382 | + configurable: false, | |
| 2383 | + enumerable: true, | |
| 2384 | + value: null | |
| 2385 | + } | |
| 2386 | + })); | |
| 2387 | + let ALLOW_ARIA_ATTR = true; | |
| 2388 | + let ALLOW_DATA_ATTR = true; | |
| 2389 | + let ALLOW_UNKNOWN_PROTOCOLS = false; | |
| 2390 | + let ALLOW_SELF_CLOSE_IN_ATTR = true; | |
| 2391 | + let SAFE_FOR_TEMPLATES = false; | |
| 2392 | + let SAFE_FOR_XML = true; | |
| 2393 | + let WHOLE_DOCUMENT = false; | |
| 2394 | + let SET_CONFIG = false; | |
| 2395 | + let FORCE_BODY = false; | |
| 2396 | + let RETURN_DOM = false; | |
| 2397 | + let RETURN_DOM_FRAGMENT = false; | |
| 2398 | + let RETURN_TRUSTED_TYPE = false; | |
| 2399 | + let SANITIZE_DOM = true; | |
| 2400 | + let SANITIZE_NAMED_PROPS = false; | |
| 2401 | + const SANITIZE_NAMED_PROPS_PREFIX = "user-content-"; | |
| 2402 | + let KEEP_CONTENT = true; | |
| 2403 | + let IN_PLACE = false; | |
| 2404 | + let USE_PROFILES = {}; | |
| 2405 | + let FORBID_CONTENTS = null; | |
| 2406 | + const DEFAULT_FORBID_CONTENTS = addToSet({}, [ | |
| 2407 | + "annotation-xml", | |
| 2408 | + "audio", | |
| 2409 | + "colgroup", | |
| 2410 | + "desc", | |
| 2411 | + "foreignobject", | |
| 2412 | + "head", | |
| 2413 | + "iframe", | |
| 2414 | + "math", | |
| 2415 | + "mi", | |
| 2416 | + "mn", | |
| 2417 | + "mo", | |
| 2418 | + "ms", | |
| 2419 | + "mtext", | |
| 2420 | + "noembed", | |
| 2421 | + "noframes", | |
| 2422 | + "noscript", | |
| 2423 | + "plaintext", | |
| 2424 | + "script", | |
| 2425 | + "style", | |
| 2426 | + "svg", | |
| 2427 | + "template", | |
| 2428 | + "thead", | |
| 2429 | + "title", | |
| 2430 | + "video", | |
| 2431 | + "xmp" | |
| 2432 | + ]); | |
| 2433 | + let DATA_URI_TAGS = null; | |
| 2434 | + const DEFAULT_DATA_URI_TAGS = addToSet({}, [ | |
| 2435 | + "audio", | |
| 2436 | + "video", | |
| 2437 | + "img", | |
| 2438 | + "source", | |
| 2439 | + "image", | |
| 2440 | + "track" | |
| 2441 | + ]); | |
| 2442 | + let URI_SAFE_ATTRIBUTES = null; | |
| 2443 | + const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [ | |
| 2444 | + "alt", | |
| 2445 | + "class", | |
| 2446 | + "for", | |
| 2447 | + "id", | |
| 2448 | + "label", | |
| 2449 | + "name", | |
| 2450 | + "pattern", | |
| 2451 | + "placeholder", | |
| 2452 | + "role", | |
| 2453 | + "summary", | |
| 2454 | + "title", | |
| 2455 | + "value", | |
| 2456 | + "style", | |
| 2457 | + "xmlns" | |
| 2458 | + ]); | |
| 2459 | + const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML"; | |
| 2460 | + const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; | |
| 2461 | + const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; | |
| 2462 | + let NAMESPACE = HTML_NAMESPACE; | |
| 2463 | + let IS_EMPTY_INPUT = false; | |
| 2464 | + let ALLOWED_NAMESPACES = null; | |
| 2465 | + const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [ | |
| 2466 | + MATHML_NAMESPACE, | |
| 2467 | + SVG_NAMESPACE, | |
| 2468 | + HTML_NAMESPACE | |
| 2469 | + ], stringToString); | |
| 2470 | + let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [ | |
| 2471 | + "mi", | |
| 2472 | + "mo", | |
| 2473 | + "mn", | |
| 2474 | + "ms", | |
| 2475 | + "mtext" | |
| 2476 | + ]); | |
| 2477 | + let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]); | |
| 2478 | + const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [ | |
| 2479 | + "title", | |
| 2480 | + "style", | |
| 2481 | + "font", | |
| 2482 | + "a", | |
| 2483 | + "script" | |
| 2484 | + ]); | |
| 2485 | + let PARSER_MEDIA_TYPE = null; | |
| 2486 | + const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"]; | |
| 2487 | + const DEFAULT_PARSER_MEDIA_TYPE = "text/html"; | |
| 2488 | + let transformCaseFunc = null; | |
| 2489 | + let CONFIG = null; | |
| 2490 | + const formElement = document.createElement("form"); | |
| 2491 | + const isRegexOrFunction = function isRegexOrFunction(testValue) { | |
| 2492 | + return testValue instanceof RegExp || testValue instanceof Function; | |
| 2493 | + }; | |
| 2494 | + /** | |
| 2495 | + * _parseConfig | |
| 2496 | + * | |
| 2497 | + * @param cfg optional config literal | |
| 2498 | + */ | |
| 2499 | + const _parseConfig = function _parseConfig() { | |
| 2500 | + let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 2501 | + if (CONFIG && CONFIG === cfg) return; | |
| 2502 | + if (!cfg || typeof cfg !== "object") cfg = {}; | |
| 2503 | + cfg = clone(cfg); | |
| 2504 | + PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; | |
| 2505 | + transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase; | |
| 2506 | + ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; | |
| 2507 | + ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; | |
| 2508 | + ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; | |
| 2509 | + URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES; | |
| 2510 | + DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS; | |
| 2511 | + FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; | |
| 2512 | + FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({}); | |
| 2513 | + FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({}); | |
| 2514 | + USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false; | |
| 2515 | + ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; | |
| 2516 | + ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; | |
| 2517 | + ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; | |
| 2518 | + ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; | |
| 2519 | + SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; | |
| 2520 | + SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; | |
| 2521 | + WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; | |
| 2522 | + RETURN_DOM = cfg.RETURN_DOM || false; | |
| 2523 | + RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; | |
| 2524 | + RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; | |
| 2525 | + FORCE_BODY = cfg.FORCE_BODY || false; | |
| 2526 | + SANITIZE_DOM = cfg.SANITIZE_DOM !== false; | |
| 2527 | + SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; | |
| 2528 | + KEEP_CONTENT = cfg.KEEP_CONTENT !== false; | |
| 2529 | + IN_PLACE = cfg.IN_PLACE || false; | |
| 2530 | + IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI; | |
| 2531 | + NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; | |
| 2532 | + MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS; | |
| 2533 | + HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS; | |
| 2534 | + CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {}; | |
| 2535 | + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck; | |
| 2536 | + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck; | |
| 2537 | + if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements; | |
| 2538 | + if (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false; | |
| 2539 | + if (RETURN_DOM_FRAGMENT) RETURN_DOM = true; | |
| 2540 | + if (USE_PROFILES) { | |
| 2541 | + ALLOWED_TAGS = addToSet({}, text); | |
| 2542 | + ALLOWED_ATTR = []; | |
| 2543 | + if (USE_PROFILES.html === true) { | |
| 2544 | + addToSet(ALLOWED_TAGS, html$1); | |
| 2545 | + addToSet(ALLOWED_ATTR, html); | |
| 2546 | + } | |
| 2547 | + if (USE_PROFILES.svg === true) { | |
| 2548 | + addToSet(ALLOWED_TAGS, svg$1); | |
| 2549 | + addToSet(ALLOWED_ATTR, svg); | |
| 2550 | + addToSet(ALLOWED_ATTR, xml); | |
| 2551 | + } | |
| 2552 | + if (USE_PROFILES.svgFilters === true) { | |
| 2553 | + addToSet(ALLOWED_TAGS, svgFilters); | |
| 2554 | + addToSet(ALLOWED_ATTR, svg); | |
| 2555 | + addToSet(ALLOWED_ATTR, xml); | |
| 2556 | + } | |
| 2557 | + if (USE_PROFILES.mathMl === true) { | |
| 2558 | + addToSet(ALLOWED_TAGS, mathMl$1); | |
| 2559 | + addToSet(ALLOWED_ATTR, mathMl); | |
| 2560 | + addToSet(ALLOWED_ATTR, xml); | |
| 2561 | + } | |
| 2562 | + } | |
| 2563 | + if (cfg.ADD_TAGS) if (typeof cfg.ADD_TAGS === "function") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS; | |
| 2564 | + else { | |
| 2565 | + if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS); | |
| 2566 | + addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); | |
| 2567 | + } | |
| 2568 | + if (cfg.ADD_ATTR) if (typeof cfg.ADD_ATTR === "function") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR; | |
| 2569 | + else { | |
| 2570 | + if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR); | |
| 2571 | + addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); | |
| 2572 | + } | |
| 2573 | + if (cfg.ADD_URI_SAFE_ATTR) addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); | |
| 2574 | + if (cfg.FORBID_CONTENTS) { | |
| 2575 | + if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS); | |
| 2576 | + addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); | |
| 2577 | + } | |
| 2578 | + if (KEEP_CONTENT) ALLOWED_TAGS["#text"] = true; | |
| 2579 | + if (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [ | |
| 2580 | + "html", | |
| 2581 | + "head", | |
| 2582 | + "body" | |
| 2583 | + ]); | |
| 2584 | + if (ALLOWED_TAGS.table) { | |
| 2585 | + addToSet(ALLOWED_TAGS, ["tbody"]); | |
| 2586 | + delete FORBID_TAGS.tbody; | |
| 2587 | + } | |
| 2588 | + if (cfg.TRUSTED_TYPES_POLICY) { | |
| 2589 | + if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook."); | |
| 2590 | + if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook."); | |
| 2591 | + trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; | |
| 2592 | + emptyHTML = trustedTypesPolicy.createHTML(""); | |
| 2593 | + } else { | |
| 2594 | + if (trustedTypesPolicy === void 0) trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); | |
| 2595 | + if (trustedTypesPolicy !== null && typeof emptyHTML === "string") emptyHTML = trustedTypesPolicy.createHTML(""); | |
| 2596 | + } | |
| 2597 | + if (freeze) freeze(cfg); | |
| 2598 | + CONFIG = cfg; | |
| 2599 | + }; | |
| 2600 | + const ALL_SVG_TAGS = addToSet({}, [ | |
| 2601 | + ...svg$1, | |
| 2602 | + ...svgFilters, | |
| 2603 | + ...svgDisallowed | |
| 2604 | + ]); | |
| 2605 | + const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); | |
| 2606 | + /** | |
| 2607 | + * @param element a DOM element whose namespace is being checked | |
| 2608 | + * @returns Return false if the element has a | |
| 2609 | + * namespace that a spec-compliant parser would never | |
| 2610 | + * return. Return true otherwise. | |
| 2611 | + */ | |
| 2612 | + const _checkValidNamespace = function _checkValidNamespace(element) { | |
| 2613 | + let parent = getParentNode(element); | |
| 2614 | + if (!parent || !parent.tagName) parent = { | |
| 2615 | + namespaceURI: NAMESPACE, | |
| 2616 | + tagName: "template" | |
| 2617 | + }; | |
| 2618 | + const tagName = stringToLowerCase(element.tagName); | |
| 2619 | + const parentTagName = stringToLowerCase(parent.tagName); | |
| 2620 | + if (!ALLOWED_NAMESPACES[element.namespaceURI]) return false; | |
| 2621 | + if (element.namespaceURI === SVG_NAMESPACE) { | |
| 2622 | + if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "svg"; | |
| 2623 | + if (parent.namespaceURI === MATHML_NAMESPACE) return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); | |
| 2624 | + return Boolean(ALL_SVG_TAGS[tagName]); | |
| 2625 | + } | |
| 2626 | + if (element.namespaceURI === MATHML_NAMESPACE) { | |
| 2627 | + if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "math"; | |
| 2628 | + if (parent.namespaceURI === SVG_NAMESPACE) return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName]; | |
| 2629 | + return Boolean(ALL_MATHML_TAGS[tagName]); | |
| 2630 | + } | |
| 2631 | + if (element.namespaceURI === HTML_NAMESPACE) { | |
| 2632 | + if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false; | |
| 2633 | + if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false; | |
| 2634 | + return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); | |
| 2635 | + } | |
| 2636 | + if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) return true; | |
| 2855 | 2637 | return false; |
| 2638 | + }; | |
| 2639 | + /** | |
| 2640 | + * _forceRemove | |
| 2641 | + * | |
| 2642 | + * @param node a DOM node | |
| 2643 | + */ | |
| 2644 | + const _forceRemove = function _forceRemove(node) { | |
| 2645 | + arrayPush(DOMPurify.removed, { element: node }); | |
| 2646 | + try { | |
| 2647 | + getParentNode(node).removeChild(node); | |
| 2648 | + } catch (_) { | |
| 2649 | + remove(node); | |
| 2650 | + } | |
| 2651 | + }; | |
| 2652 | + /** | |
| 2653 | + * _removeAttribute | |
| 2654 | + * | |
| 2655 | + * @param name an Attribute name | |
| 2656 | + * @param element a DOM node | |
| 2657 | + */ | |
| 2658 | + const _removeAttribute = function _removeAttribute(name, element) { | |
| 2659 | + try { | |
| 2660 | + arrayPush(DOMPurify.removed, { | |
| 2661 | + attribute: element.getAttributeNode(name), | |
| 2662 | + from: element | |
| 2663 | + }); | |
| 2664 | + } catch (_) { | |
| 2665 | + arrayPush(DOMPurify.removed, { | |
| 2666 | + attribute: null, | |
| 2667 | + from: element | |
| 2668 | + }); | |
| 2669 | + } | |
| 2670 | + element.removeAttribute(name); | |
| 2671 | + if (name === "is") if (RETURN_DOM || RETURN_DOM_FRAGMENT) try { | |
| 2672 | + _forceRemove(element); | |
| 2673 | + } catch (_) {} | |
| 2674 | + else try { | |
| 2675 | + element.setAttribute(name, ""); | |
| 2676 | + } catch (_) {} | |
| 2677 | + }; | |
| 2678 | + /** | |
| 2679 | + * _initDocument | |
| 2680 | + * | |
| 2681 | + * @param dirty - a string of dirty markup | |
| 2682 | + * @return a DOM, filled with the dirty markup | |
| 2683 | + */ | |
| 2684 | + const _initDocument = function _initDocument(dirty) { | |
| 2685 | + let doc = null; | |
| 2686 | + let leadingWhitespace = null; | |
| 2687 | + if (FORCE_BODY) dirty = "<remove></remove>" + dirty; | |
| 2688 | + else { | |
| 2689 | + const matches = stringMatch(dirty, /^[\r\n\t ]+/); | |
| 2690 | + leadingWhitespace = matches && matches[0]; | |
| 2691 | + } | |
| 2692 | + if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) dirty = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + dirty + "</body></html>"; | |
| 2693 | + const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; | |
| 2694 | + if (NAMESPACE === HTML_NAMESPACE) try { | |
| 2695 | + doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); | |
| 2696 | + } catch (_) {} | |
| 2697 | + if (!doc || !doc.documentElement) { | |
| 2698 | + doc = implementation.createDocument(NAMESPACE, "template", null); | |
| 2699 | + try { | |
| 2700 | + doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; | |
| 2701 | + } catch (_) {} | |
| 2702 | + } | |
| 2703 | + const body = doc.body || doc.documentElement; | |
| 2704 | + if (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null); | |
| 2705 | + if (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0]; | |
| 2706 | + return WHOLE_DOCUMENT ? doc.documentElement : body; | |
| 2707 | + }; | |
| 2708 | + /** | |
| 2709 | + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. | |
| 2710 | + * | |
| 2711 | + * @param root The root element or node to start traversing on. | |
| 2712 | + * @return The created NodeIterator | |
| 2713 | + */ | |
| 2714 | + const _createNodeIterator = function _createNodeIterator(root) { | |
| 2715 | + return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null); | |
| 2716 | + }; | |
| 2717 | + /** | |
| 2718 | + * _isClobbered | |
| 2719 | + * | |
| 2720 | + * @param element element to check for clobbering attacks | |
| 2721 | + * @return true if clobbered, false if safe | |
| 2722 | + */ | |
| 2723 | + const _isClobbered = function _isClobbered(element) { | |
| 2724 | + return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function"); | |
| 2725 | + }; | |
| 2726 | + /** | |
| 2727 | + * Checks whether the given object is a DOM node. | |
| 2728 | + * | |
| 2729 | + * @param value object to check whether it's a DOM node | |
| 2730 | + * @return true is object is a DOM node | |
| 2731 | + */ | |
| 2732 | + const _isNode = function _isNode(value) { | |
| 2733 | + return typeof Node === "function" && value instanceof Node; | |
| 2734 | + }; | |
| 2735 | + function _executeHooks(hooks, currentNode, data) { | |
| 2736 | + arrayForEach(hooks, (hook) => { | |
| 2737 | + hook.call(DOMPurify, currentNode, data, CONFIG); | |
| 2738 | + }); | |
| 2856 | 2739 | } |
| 2740 | + /** | |
| 2741 | + * _sanitizeElements | |
| 2742 | + * | |
| 2743 | + * @protect nodeName | |
| 2744 | + * @protect textContent | |
| 2745 | + * @protect removeChild | |
| 2746 | + * @param currentNode to check for permission to exist | |
| 2747 | + * @return true if node was killed, false if left alive | |
| 2748 | + */ | |
| 2749 | + const _sanitizeElements = function _sanitizeElements(currentNode) { | |
| 2750 | + let content = null; | |
| 2751 | + _executeHooks(hooks.beforeSanitizeElements, currentNode, null); | |
| 2752 | + if (_isClobbered(currentNode)) { | |
| 2753 | + _forceRemove(currentNode); | |
| 2754 | + return true; | |
| 2755 | + } | |
| 2756 | + const tagName = transformCaseFunc(currentNode.nodeName); | |
| 2757 | + _executeHooks(hooks.uponSanitizeElement, currentNode, { | |
| 2758 | + tagName, | |
| 2759 | + allowedTags: ALLOWED_TAGS | |
| 2760 | + }); | |
| 2761 | + if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) { | |
| 2762 | + _forceRemove(currentNode); | |
| 2763 | + return true; | |
| 2764 | + } | |
| 2765 | + if (currentNode.nodeType === NODE_TYPE.progressingInstruction) { | |
| 2766 | + _forceRemove(currentNode); | |
| 2767 | + return true; | |
| 2768 | + } | |
| 2769 | + if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) { | |
| 2770 | + _forceRemove(currentNode); | |
| 2771 | + return true; | |
| 2772 | + } | |
| 2773 | + if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) { | |
| 2774 | + if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { | |
| 2775 | + if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false; | |
| 2776 | + if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) return false; | |
| 2777 | + } | |
| 2778 | + if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { | |
| 2779 | + const parentNode = getParentNode(currentNode) || currentNode.parentNode; | |
| 2780 | + const childNodes = getChildNodes(currentNode) || currentNode.childNodes; | |
| 2781 | + if (childNodes && parentNode) { | |
| 2782 | + const childCount = childNodes.length; | |
| 2783 | + for (let i = childCount - 1; i >= 0; --i) { | |
| 2784 | + const childClone = cloneNode(childNodes[i], true); | |
| 2785 | + childClone.__removalCount = (currentNode.__removalCount || 0) + 1; | |
| 2786 | + parentNode.insertBefore(childClone, getNextSibling(currentNode)); | |
| 2787 | + } | |
| 2788 | + } | |
| 2789 | + } | |
| 2790 | + _forceRemove(currentNode); | |
| 2791 | + return true; | |
| 2792 | + } | |
| 2793 | + if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) { | |
| 2794 | + _forceRemove(currentNode); | |
| 2795 | + return true; | |
| 2796 | + } | |
| 2797 | + if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) { | |
| 2798 | + _forceRemove(currentNode); | |
| 2799 | + return true; | |
| 2800 | + } | |
| 2801 | + if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { | |
| 2802 | + content = currentNode.textContent; | |
| 2803 | + arrayForEach([ | |
| 2804 | + MUSTACHE_EXPR, | |
| 2805 | + ERB_EXPR, | |
| 2806 | + TMPLIT_EXPR | |
| 2807 | + ], (expr) => { | |
| 2808 | + content = stringReplace(content, expr, " "); | |
| 2809 | + }); | |
| 2810 | + if (currentNode.textContent !== content) { | |
| 2811 | + arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() }); | |
| 2812 | + currentNode.textContent = content; | |
| 2813 | + } | |
| 2814 | + } | |
| 2815 | + _executeHooks(hooks.afterSanitizeElements, currentNode, null); | |
| 2816 | + return false; | |
| 2817 | + }; | |
| 2818 | + /** | |
| 2819 | + * _isValidAttribute | |
| 2820 | + * | |
| 2821 | + * @param lcTag Lowercase tag name of containing element. | |
| 2822 | + * @param lcName Lowercase attribute name. | |
| 2823 | + * @param value Attribute value. | |
| 2824 | + * @return Returns true if `value` is valid, otherwise false. | |
| 2825 | + */ | |
| 2826 | + const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) { | |
| 2827 | + if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document || value in formElement)) return false; | |
| 2828 | + if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)); | |
| 2829 | + else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)); | |
| 2830 | + else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)); | |
| 2831 | + else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) if (_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))); | |
| 2832 | + else return false; | |
| 2833 | + else if (URI_SAFE_ATTRIBUTES[lcName]); | |
| 2834 | + else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ""))); | |
| 2835 | + else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]); | |
| 2836 | + else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ""))); | |
| 2837 | + else if (value) return false; | |
| 2838 | + return true; | |
| 2839 | + }; | |
| 2840 | + /** | |
| 2841 | + * _isBasicCustomElement | |
| 2842 | + * checks if at least one dash is included in tagName, and it's not the first char | |
| 2843 | + * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name | |
| 2844 | + * | |
| 2845 | + * @param tagName name of the tag of the node to sanitize | |
| 2846 | + * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false. | |
| 2847 | + */ | |
| 2848 | + const _isBasicCustomElement = function _isBasicCustomElement(tagName) { | |
| 2849 | + return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT); | |
| 2850 | + }; | |
| 2851 | + /** | |
| 2852 | + * _sanitizeAttributes | |
| 2853 | + * | |
| 2854 | + * @protect attributes | |
| 2855 | + * @protect nodeName | |
| 2856 | + * @protect removeAttribute | |
| 2857 | + * @protect setAttribute | |
| 2858 | + * | |
| 2859 | + * @param currentNode to sanitize | |
| 2860 | + */ | |
| 2861 | + const _sanitizeAttributes = function _sanitizeAttributes(currentNode) { | |
| 2862 | + _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null); | |
| 2863 | + const { attributes } = currentNode; | |
| 2864 | + if (!attributes || _isClobbered(currentNode)) return; | |
| 2865 | + const hookEvent = { | |
| 2866 | + attrName: "", | |
| 2867 | + attrValue: "", | |
| 2868 | + keepAttr: true, | |
| 2869 | + allowedAttributes: ALLOWED_ATTR, | |
| 2870 | + forceKeepAttr: void 0 | |
| 2871 | + }; | |
| 2872 | + let l = attributes.length; | |
| 2873 | + while (l--) { | |
| 2874 | + const { name, namespaceURI, value: attrValue } = attributes[l]; | |
| 2875 | + const lcName = transformCaseFunc(name); | |
| 2876 | + const initValue = attrValue; | |
| 2877 | + let value = name === "value" ? initValue : stringTrim(initValue); | |
| 2878 | + hookEvent.attrName = lcName; | |
| 2879 | + hookEvent.attrValue = value; | |
| 2880 | + hookEvent.keepAttr = true; | |
| 2881 | + hookEvent.forceKeepAttr = void 0; | |
| 2882 | + _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent); | |
| 2883 | + value = hookEvent.attrValue; | |
| 2884 | + if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) { | |
| 2885 | + _removeAttribute(name, currentNode); | |
| 2886 | + value = SANITIZE_NAMED_PROPS_PREFIX + value; | |
| 2887 | + } | |
| 2888 | + if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) { | |
| 2889 | + _removeAttribute(name, currentNode); | |
| 2890 | + continue; | |
| 2891 | + } | |
| 2892 | + if (lcName === "attributename" && stringMatch(value, "href")) { | |
| 2893 | + _removeAttribute(name, currentNode); | |
| 2894 | + continue; | |
| 2895 | + } | |
| 2896 | + if (hookEvent.forceKeepAttr) continue; | |
| 2897 | + if (!hookEvent.keepAttr) { | |
| 2898 | + _removeAttribute(name, currentNode); | |
| 2899 | + continue; | |
| 2900 | + } | |
| 2901 | + if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) { | |
| 2902 | + _removeAttribute(name, currentNode); | |
| 2903 | + continue; | |
| 2904 | + } | |
| 2905 | + if (SAFE_FOR_TEMPLATES) arrayForEach([ | |
| 2906 | + MUSTACHE_EXPR, | |
| 2907 | + ERB_EXPR, | |
| 2908 | + TMPLIT_EXPR | |
| 2909 | + ], (expr) => { | |
| 2910 | + value = stringReplace(value, expr, " "); | |
| 2911 | + }); | |
| 2912 | + const lcTag = transformCaseFunc(currentNode.nodeName); | |
| 2913 | + if (!_isValidAttribute(lcTag, lcName, value)) { | |
| 2914 | + _removeAttribute(name, currentNode); | |
| 2915 | + continue; | |
| 2916 | + } | |
| 2917 | + if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") if (namespaceURI); | |
| 2918 | + else switch (trustedTypes.getAttributeType(lcTag, lcName)) { | |
| 2919 | + case "TrustedHTML": | |
| 2920 | + value = trustedTypesPolicy.createHTML(value); | |
| 2921 | + break; | |
| 2922 | + case "TrustedScriptURL": | |
| 2923 | + value = trustedTypesPolicy.createScriptURL(value); | |
| 2924 | + break; | |
| 2925 | + } | |
| 2926 | + if (value !== initValue) try { | |
| 2927 | + if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value); | |
| 2928 | + else currentNode.setAttribute(name, value); | |
| 2929 | + if (_isClobbered(currentNode)) _forceRemove(currentNode); | |
| 2930 | + else arrayPop(DOMPurify.removed); | |
| 2931 | + } catch (_) { | |
| 2932 | + _removeAttribute(name, currentNode); | |
| 2933 | + } | |
| 2934 | + } | |
| 2935 | + _executeHooks(hooks.afterSanitizeAttributes, currentNode, null); | |
| 2936 | + }; | |
| 2937 | + /** | |
| 2938 | + * _sanitizeShadowDOM | |
| 2939 | + * | |
| 2940 | + * @param fragment to iterate over recursively | |
| 2941 | + */ | |
| 2942 | + const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) { | |
| 2943 | + let shadowNode = null; | |
| 2944 | + const shadowIterator = _createNodeIterator(fragment); | |
| 2945 | + _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null); | |
| 2946 | + while (shadowNode = shadowIterator.nextNode()) { | |
| 2947 | + _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null); | |
| 2948 | + _sanitizeElements(shadowNode); | |
| 2949 | + _sanitizeAttributes(shadowNode); | |
| 2950 | + if (shadowNode.content instanceof DocumentFragment) _sanitizeShadowDOM(shadowNode.content); | |
| 2951 | + } | |
| 2952 | + _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null); | |
| 2953 | + }; | |
| 2954 | + DOMPurify.sanitize = function(dirty) { | |
| 2955 | + let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 2956 | + let body = null; | |
| 2957 | + let importedNode = null; | |
| 2958 | + let currentNode = null; | |
| 2959 | + let returnNode = null; | |
| 2960 | + IS_EMPTY_INPUT = !dirty; | |
| 2961 | + if (IS_EMPTY_INPUT) dirty = "<!-->"; | |
| 2962 | + if (typeof dirty !== "string" && !_isNode(dirty)) if (typeof dirty.toString === "function") { | |
| 2963 | + dirty = dirty.toString(); | |
| 2964 | + if (typeof dirty !== "string") throw typeErrorCreate("dirty is not a string, aborting"); | |
| 2965 | + } else throw typeErrorCreate("toString is not a function"); | |
| 2966 | + if (!DOMPurify.isSupported) return dirty; | |
| 2967 | + if (!SET_CONFIG) _parseConfig(cfg); | |
| 2968 | + DOMPurify.removed = []; | |
| 2969 | + if (typeof dirty === "string") IN_PLACE = false; | |
| 2970 | + if (IN_PLACE) { | |
| 2971 | + if (dirty.nodeName) { | |
| 2972 | + const tagName = transformCaseFunc(dirty.nodeName); | |
| 2973 | + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place"); | |
| 2974 | + } | |
| 2975 | + } else if (dirty instanceof Node) { | |
| 2976 | + body = _initDocument("<!---->"); | |
| 2977 | + importedNode = body.ownerDocument.importNode(dirty, true); | |
| 2978 | + if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode; | |
| 2979 | + else if (importedNode.nodeName === "HTML") body = importedNode; | |
| 2980 | + else body.appendChild(importedNode); | |
| 2981 | + } else { | |
| 2982 | + if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty; | |
| 2983 | + body = _initDocument(dirty); | |
| 2984 | + if (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ""; | |
| 2985 | + } | |
| 2986 | + if (body && FORCE_BODY) _forceRemove(body.firstChild); | |
| 2987 | + const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body); | |
| 2988 | + while (currentNode = nodeIterator.nextNode()) { | |
| 2989 | + _sanitizeElements(currentNode); | |
| 2990 | + _sanitizeAttributes(currentNode); | |
| 2991 | + if (currentNode.content instanceof DocumentFragment) _sanitizeShadowDOM(currentNode.content); | |
| 2992 | + } | |
| 2993 | + if (IN_PLACE) return dirty; | |
| 2994 | + if (RETURN_DOM) { | |
| 2995 | + if (RETURN_DOM_FRAGMENT) { | |
| 2996 | + returnNode = createDocumentFragment.call(body.ownerDocument); | |
| 2997 | + while (body.firstChild) returnNode.appendChild(body.firstChild); | |
| 2998 | + } else returnNode = body; | |
| 2999 | + if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true); | |
| 3000 | + return returnNode; | |
| 3001 | + } | |
| 3002 | + let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; | |
| 3003 | + if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML; | |
| 3004 | + if (SAFE_FOR_TEMPLATES) arrayForEach([ | |
| 3005 | + MUSTACHE_EXPR, | |
| 3006 | + ERB_EXPR, | |
| 3007 | + TMPLIT_EXPR | |
| 3008 | + ], (expr) => { | |
| 3009 | + serializedHTML = stringReplace(serializedHTML, expr, " "); | |
| 3010 | + }); | |
| 3011 | + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; | |
| 3012 | + }; | |
| 3013 | + DOMPurify.setConfig = function() { | |
| 3014 | + let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 3015 | + _parseConfig(cfg); | |
| 3016 | + SET_CONFIG = true; | |
| 3017 | + }; | |
| 3018 | + DOMPurify.clearConfig = function() { | |
| 3019 | + CONFIG = null; | |
| 3020 | + SET_CONFIG = false; | |
| 3021 | + }; | |
| 3022 | + DOMPurify.isValidAttribute = function(tag, attr, value) { | |
| 3023 | + if (!CONFIG) _parseConfig({}); | |
| 3024 | + const lcTag = transformCaseFunc(tag); | |
| 3025 | + const lcName = transformCaseFunc(attr); | |
| 3026 | + return _isValidAttribute(lcTag, lcName, value); | |
| 3027 | + }; | |
| 3028 | + DOMPurify.addHook = function(entryPoint, hookFunction) { | |
| 3029 | + if (typeof hookFunction !== "function") return; | |
| 3030 | + arrayPush(hooks[entryPoint], hookFunction); | |
| 3031 | + }; | |
| 3032 | + DOMPurify.removeHook = function(entryPoint, hookFunction) { | |
| 3033 | + if (hookFunction !== void 0) { | |
| 3034 | + const index = arrayLastIndexOf(hooks[entryPoint], hookFunction); | |
| 3035 | + return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0]; | |
| 3036 | + } | |
| 3037 | + return arrayPop(hooks[entryPoint]); | |
| 3038 | + }; | |
| 3039 | + DOMPurify.removeHooks = function(entryPoint) { | |
| 3040 | + hooks[entryPoint] = []; | |
| 3041 | + }; | |
| 3042 | + DOMPurify.removeAllHooks = function() { | |
| 3043 | + hooks = _createHooksMap(); | |
| 3044 | + }; | |
| 3045 | + return DOMPurify; | |
| 3046 | + } | |
| 3047 | + var purify = createDOMPurify(); | |
| 2857 | 3048 | |
| 2858 | - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 | |
| 2859 | - var test3 = {}; | |
| 2860 | - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | |
| 2861 | - test3[letter] = letter; | |
| 2862 | - }); | |
| 2863 | - if (Object.keys(Object.assign({}, test3)).join('') !== | |
| 2864 | - 'abcdefghijklmnopqrst') { | |
| 2865 | - return false; | |
| 3049 | +//#endregion | |
| 3050 | +//#region modules/atomic-opt-in/assets/js/opt-in-page/opt-in-terms.js | |
| 3051 | + var _excluded = [ | |
| 3052 | + "onClose", | |
| 3053 | + "onSubmit", | |
| 3054 | + "isEnrolled" | |
| 3055 | + ]; | |
| 3056 | + var i18n$1 = { | |
| 3057 | + header: (0, _wordpress_i18n.__)("Atomic Editor", "elementor"), | |
| 3058 | + checkboxText: (0, _wordpress_i18n.__)("I’ve read and understood.", "elementor"), | |
| 3059 | + optIn: { | |
| 3060 | + titleText: (0, _wordpress_i18n.__)("You are about to enable Atomic Editor features!", "elementor"), | |
| 3061 | + introText: (0, _wordpress_i18n.__)("By activating, you’ll get access to the next generation of Elementor’s Editor. This is your chance to explore new capabilities and help shape the future of Elementor! ", "elementor"), | |
| 3062 | + details: [(0, _wordpress_i18n.__)("When you activate, you’ll also be activating Containers and Nested Elements. You can turn them back off by going to: WP Admin > Elementor > Settings > Features.", "elementor")], | |
| 3063 | + activateButton: (0, _wordpress_i18n.__)("Activate", "elementor"), | |
| 3064 | + cancelButton: (0, _wordpress_i18n.__)("Cancel", "elementor") | |
| 3065 | + }, | |
| 3066 | + optOut: { | |
| 3067 | + titleText: (0, _wordpress_i18n.__)("You're about to lose all content created with Atomic features", "elementor"), | |
| 3068 | + details: [(0, _wordpress_i18n.__)("By deactivating, you’ll lose all Atomic Elements, Classes and Variables. Any content you created with these features will no longer be available or appear on your site.", "elementor"), (0, _wordpress_i18n.__)("Containers and Nested Elements will stay in their current status.", "elementor")], | |
| 3069 | + activateButton: (0, _wordpress_i18n.__)("Deactivate", "elementor"), | |
| 3070 | + cancelButton: (0, _wordpress_i18n.__)("Cancel", "elementor") | |
| 2866 | 3071 | } |
| 3072 | + }; | |
| 3073 | + var Terms = function Terms(_ref) { | |
| 3074 | + var onClose = _ref.onClose; | |
| 3075 | + var onSubmit = _ref.onSubmit; | |
| 3076 | + var isEnrolled = _ref.isEnrolled; | |
| 3077 | + var props = _objectWithoutProperties(_ref, _excluded); | |
| 3078 | + var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 3079 | + var checked = _useState2[0]; | |
| 3080 | + var setChecked = _useState2[1]; | |
| 3081 | + var handleCheckboxChange = function handleCheckboxChange() { | |
| 3082 | + setChecked(function(prev) { | |
| 3083 | + return !prev; | |
| 3084 | + }); | |
| 3085 | + }; | |
| 3086 | + var handleSubmit = function handleSubmit() { | |
| 3087 | + if (checked) onSubmit(); | |
| 3088 | + }; | |
| 3089 | + var currentState = isEnrolled ? "optOut" : "optIn"; | |
| 3090 | + return /*#__PURE__*/ react.default.createElement(_elementor_ui.Dialog, _extends({}, props, { | |
| 3091 | + open: true, | |
| 3092 | + onClose, | |
| 3093 | + maxWidth: "md" | |
| 3094 | + }), /*#__PURE__*/ react.default.createElement(_elementor_ui_DialogHeader.default, null, /*#__PURE__*/ react.default.createElement(_elementor_ui_DialogHeaderGroup.default, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogTitle, null, i18n$1.header))), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogContent, { dividers: true }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { gap: 2.5 }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 3095 | + gap: 1.5, | |
| 3096 | + sx: { | |
| 3097 | + mx: 2, | |
| 3098 | + maxWidth: "550px" | |
| 3099 | + } | |
| 3100 | + }, /*#__PURE__*/ react.default.createElement(TextNode, { | |
| 3101 | + align: "center", | |
| 3102 | + variant: "h6" | |
| 3103 | + }, i18n$1[currentState].titleText), i18n$1[currentState].introText && /*#__PURE__*/ react.default.createElement(TextNode, { | |
| 3104 | + align: "center", | |
| 3105 | + variant: "body3" | |
| 3106 | + }, i18n$1[currentState].introText)), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, null, /*#__PURE__*/ react.default.createElement(ContentList, { sx: { | |
| 3107 | + mx: 3, | |
| 3108 | + maxWidth: "550px" | |
| 3109 | + } }, i18n$1[currentState].details.map(function(entry, index) { | |
| 3110 | + return /*#__PURE__*/ react.default.createElement(ContentListItem, { | |
| 3111 | + key: index, | |
| 3112 | + variant: "body3" | |
| 3113 | + }, entry); | |
| 3114 | + }))), /*#__PURE__*/ react.default.createElement(_elementor_ui.FormControlLabel, { | |
| 3115 | + control: /*#__PURE__*/ react.default.createElement(_elementor_ui.Checkbox, { | |
| 3116 | + checked: !!checked, | |
| 3117 | + onChange: handleCheckboxChange, | |
| 3118 | + color: "secondary", | |
| 3119 | + size: "small" | |
| 3120 | + }), | |
| 3121 | + label: /*#__PURE__*/ react.default.createElement(TextNode, { variant: "body2" }, i18n$1.checkboxText) | |
| 3122 | + }))), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogActions, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 3123 | + variant: "text", | |
| 3124 | + color: "secondary", | |
| 3125 | + onClick: onClose | |
| 3126 | + }, i18n$1[currentState].cancelButton), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 3127 | + disabled: !checked, | |
| 3128 | + variant: "contained", | |
| 3129 | + onClick: handleSubmit | |
| 3130 | + }, i18n$1[currentState].activateButton))); | |
| 3131 | + }; | |
| 3132 | + Terms.propTypes = { | |
| 3133 | + onClose: import_prop_types.default.func, | |
| 3134 | + onSubmit: import_prop_types.default.func, | |
| 3135 | + isEnrolled: import_prop_types.default.bool | |
| 3136 | + }; | |
| 2867 | 3137 | |
| 2868 | - return true; | |
| 2869 | - } catch (err) { | |
| 2870 | - // We don't expect any of the above to throw, but better to be safe. | |
| 2871 | - return false; | |
| 3138 | +//#endregion | |
| 3139 | +//#region modules/atomic-opt-in/assets/js/opt-in-page/opt-in.js | |
| 3140 | + var _elementorSettingsEdi; | |
| 3141 | + function ownKeys(e, r) { | |
| 3142 | + var t = Object.keys(e); | |
| 3143 | + if (Object.getOwnPropertySymbols) { | |
| 3144 | + var o = Object.getOwnPropertySymbols(e); | |
| 3145 | + r && (o = o.filter(function(r) { | |
| 3146 | + return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 3147 | + })), t.push.apply(t, o); | |
| 3148 | + } | |
| 3149 | + return t; | |
| 2872 | 3150 | } |
| 2873 | -} | |
| 2874 | - | |
| 2875 | -module.exports = shouldUseNative() ? Object.assign : function (target, source) { | |
| 2876 | - var from; | |
| 2877 | - var to = toObject(target); | |
| 2878 | - var symbols; | |
| 2879 | - | |
| 2880 | - for (var s = 1; s < arguments.length; s++) { | |
| 2881 | - from = Object(arguments[s]); | |
| 2882 | - | |
| 2883 | - for (var key in from) { | |
| 2884 | - if (hasOwnProperty.call(from, key)) { | |
| 2885 | - to[key] = from[key]; | |
| 3151 | + function _objectSpread(e) { | |
| 3152 | + for (var r = 1; r < arguments.length; r++) { | |
| 3153 | + var t = null != arguments[r] ? arguments[r] : {}; | |
| 3154 | + r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { | |
| 3155 | + _defineProperty(e, r, t[r]); | |
| 3156 | + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { | |
| 3157 | + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 3158 | + }); | |
| 3159 | + } | |
| 3160 | + return e; | |
| 3161 | + } | |
| 3162 | + var decodeHtmlUrl = function decodeHtmlUrl(html) { | |
| 3163 | + var textarea = document.createElement("textarea"); | |
| 3164 | + textarea.innerHTML = html; | |
| 3165 | + return textarea.value; | |
| 3166 | + }; | |
| 3167 | + var OPT_IN_MSG = "e-editor-v4-opt-in-message"; | |
| 3168 | + var OPT_OUT_MSG = "e-editor-v4-opt-out-message"; | |
| 3169 | + var i18n = { | |
| 3170 | + title: (0, _wordpress_i18n.__)("Activate Atomic Editor features", "elementor"), | |
| 3171 | + welcomeText: (0, _wordpress_i18n.__)("The Atomic Editor presents a new generation of high-performance, flexible building blocks designed for less bloat and precise styling with a unified interface.", "elementor"), | |
| 3172 | + advantages: [ | |
| 3173 | + [(0, _wordpress_i18n.__)("Combine legacy widgets & new elements", "elementor"), (0, _wordpress_i18n.__)("Your current and new workflows work together on the same page.", "elementor")], | |
| 3174 | + [(0, _wordpress_i18n.__)("Build reusable design systems", "elementor"), (0, _wordpress_i18n.__)("Classes, Variables and Components give you a clear path for scale.", "elementor")], | |
| 3175 | + [(0, _wordpress_i18n.__)("Consistent styling experience", "elementor"), (0, _wordpress_i18n.__)("A unified Style tab for all Atomic Elements with full control over responsive design.", "elementor")], | |
| 3176 | + [(0, _wordpress_i18n.__)("Unparalleled performance", "elementor"), (0, _wordpress_i18n.__)("Cleaner code and a lighter CSS footprint with single-div wrappers.", "elementor")] | |
| 3177 | + ], | |
| 3178 | + andMore: (0, _wordpress_i18n.__)("And much more!", "elementor"), | |
| 3179 | + readMore: (0, _wordpress_i18n.__)("Learn more", "elementor"), | |
| 3180 | + feedback: (0, _wordpress_i18n.__)("We’d love your feedback!", "elementor"), | |
| 3181 | + overToGithub: (0, _wordpress_i18n.__)("Head over to Github", "elementor"), | |
| 3182 | + tellUsWhy: (0, _wordpress_i18n.__)("Tell us why", "elementor"), | |
| 3183 | + image: (0, _wordpress_i18n.__)("Editor V4", "elementor"), | |
| 3184 | + buttons: { | |
| 3185 | + tryOut: (0, _wordpress_i18n.__)("Try out the new experience", "elementor"), | |
| 3186 | + optIn: (0, _wordpress_i18n.__)("Activate the new experience", "elementor"), | |
| 3187 | + optOut: (0, _wordpress_i18n.__)("Deactivate", "elementor") | |
| 3188 | + }, | |
| 3189 | + messages: { | |
| 3190 | + optInSuccess: (0, _wordpress_i18n.__)("Welcome! You’ve got the newest version of the editor.", "elementor"), | |
| 3191 | + optOut: (0, _wordpress_i18n.__)("You’ve deactivated the new Editor. Have feedback?", "elementor"), | |
| 3192 | + error: (0, _wordpress_i18n.__)("Ouch, there was a glitch. Try activating again soon.", "elementor") | |
| 3193 | + } | |
| 3194 | + }; | |
| 3195 | + var optInLinks = { | |
| 3196 | + feedbackUrl: "https://go.elementor.com/wp-dash-opt-in-v4-feedback/", | |
| 3197 | + readMoreUrl: "https://go.elementor.com/wp-dash-opt-in-v4-help-center/", | |
| 3198 | + tryOutUrl: purify.sanitize(decodeHtmlUrl((_elementorSettingsEdi = elementorSettingsEditor4OptIn) === null || _elementorSettingsEdi === void 0 || (_elementorSettingsEdi = _elementorSettingsEdi.urls) === null || _elementorSettingsEdi === void 0 ? void 0 : _elementorSettingsEdi.start_building)) || "#" | |
| 3199 | + }; | |
| 3200 | + var optInImages = { | |
| 3201 | + square: { | |
| 3202 | + src: "https://assets.elementor.com/v4-promotion/v1/images/v4_opt_in_500.png", | |
| 3203 | + sx: { | |
| 3204 | + width: "100%", | |
| 3205 | + maxHeight: "507px", | |
| 3206 | + maxWidth: "sm", | |
| 3207 | + height: "auto", | |
| 3208 | + mx: "auto", | |
| 3209 | + borderRadius: 2 | |
| 2886 | 3210 | } |
| 3211 | + }, | |
| 3212 | + landscape: { | |
| 3213 | + src: "https://assets.elementor.com/v4-promotion/v1/images/v4_opt_in_260.png", | |
| 3214 | + sx: { | |
| 3215 | + width: "100%", | |
| 3216 | + height: "auto", | |
| 3217 | + maxHeight: "260px", | |
| 3218 | + mx: "auto", | |
| 3219 | + maxWidth: "sm", | |
| 3220 | + borderRadius: 2 | |
| 3221 | + } | |
| 2887 | 3222 | } |
| 2888 | - | |
| 2889 | - if (getOwnPropertySymbols) { | |
| 2890 | - symbols = getOwnPropertySymbols(from); | |
| 2891 | - for (var i = 0; i < symbols.length; i++) { | |
| 2892 | - if (propIsEnumerable.call(from, symbols[i])) { | |
| 2893 | - to[symbols[i]] = from[symbols[i]]; | |
| 3223 | + }; | |
| 3224 | + var OptIn = function OptIn(_ref) { | |
| 3225 | + var _state$features; | |
| 3226 | + var state = _ref.state; | |
| 3227 | + var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 3228 | + var showTerms = _useState2[0]; | |
| 3229 | + var setShowTerms = _useState2[1]; | |
| 3230 | + var _useState4 = _slicedToArray((0, react.useState)(""), 2); | |
| 3231 | + var optInMessage = _useState4[0]; | |
| 3232 | + var setOptInMessage = _useState4[1]; | |
| 3233 | + var _useState6 = _slicedToArray((0, react.useState)(""), 2); | |
| 3234 | + var optOutMessage = _useState6[0]; | |
| 3235 | + var setOptOutMessage = _useState6[1]; | |
| 3236 | + var _useState8 = _slicedToArray((0, react.useState)(""), 2); | |
| 3237 | + var errorMessage = _useState8[0]; | |
| 3238 | + var setErrorMessage = _useState8[1]; | |
| 3239 | + (0, react.useEffect)(function() { | |
| 3240 | + var optInMsg = sessionStorage.getItem(OPT_IN_MSG); | |
| 3241 | + var optOutMsg = sessionStorage.getItem(OPT_OUT_MSG); | |
| 3242 | + if (optInMsg) { | |
| 3243 | + setTimeout(function() { | |
| 3244 | + setOptInMessage(optInMsg); | |
| 3245 | + }, 100); | |
| 3246 | + sessionStorage.removeItem(OPT_IN_MSG); | |
| 3247 | + } | |
| 3248 | + if (optOutMsg) { | |
| 3249 | + setTimeout(function() { | |
| 3250 | + setOptOutMessage(optOutMsg); | |
| 3251 | + }, 100); | |
| 3252 | + sessionStorage.removeItem(OPT_OUT_MSG); | |
| 3253 | + } | |
| 3254 | + }, []); | |
| 3255 | + var maybeOptIn = function maybeOptIn() { | |
| 3256 | + triggerOptIn().then(function() { | |
| 3257 | + sessionStorage.setItem(OPT_IN_MSG, i18n.messages.optInSuccess); | |
| 3258 | + window.location.reload(); | |
| 3259 | + }).catch(function() { | |
| 3260 | + setErrorMessage(i18n.messages.error); | |
| 3261 | + }); | |
| 3262 | + }; | |
| 3263 | + var maybeOptOut = function maybeOptOut() { | |
| 3264 | + triggerOptOut().then(function() { | |
| 3265 | + sessionStorage.setItem(OPT_OUT_MSG, i18n.messages.optOut); | |
| 3266 | + window.location.reload(); | |
| 3267 | + }).catch(function() { | |
| 3268 | + setErrorMessage(i18n.messages.error); | |
| 3269 | + }); | |
| 3270 | + }; | |
| 3271 | + var handlePopoverClose = function handlePopoverClose() { | |
| 3272 | + setShowTerms(false); | |
| 3273 | + }; | |
| 3274 | + var isEnrolled = !!(state !== null && state !== void 0 && (_state$features = state.features) !== null && _state$features !== void 0 && _state$features.editor_v4); | |
| 3275 | + return /*#__PURE__*/ react.default.createElement(_elementor_ui.Container, { | |
| 3276 | + maxWidth: "xl", | |
| 3277 | + sx: { | |
| 3278 | + marginBlockStart: 2.5, | |
| 3279 | + display: "flex", | |
| 3280 | + flexBasis: "100%", | |
| 3281 | + gap: 3, | |
| 3282 | + flexDirection: { | |
| 3283 | + xs: "column-reverse", | |
| 3284 | + md: "row" | |
| 2894 | 3285 | } |
| 2895 | 3286 | } |
| 2896 | - } | |
| 2897 | - } | |
| 3287 | + }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { sx: { | |
| 3288 | + flex: 1, | |
| 3289 | + maxWidth: { | |
| 3290 | + md: "580px", | |
| 3291 | + sm: "600px" | |
| 3292 | + }, | |
| 3293 | + gap: 2.5, | |
| 3294 | + mx: "auto" | |
| 3295 | + } }, /*#__PURE__*/ react.default.createElement(TextNode, { | |
| 3296 | + variant: "h4", | |
| 3297 | + width: "fit-content" | |
| 3298 | + }, /*#__PURE__*/ react.default.createElement("span", null, i18n.title)), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 3299 | + direction: "column", | |
| 3300 | + gap: 1 | |
| 3301 | + }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, null, /*#__PURE__*/ react.default.createElement(TextNode, null, i18n.welcomeText)), /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, null, /*#__PURE__*/ react.default.createElement(AdvantagesList, { sx: { gap: .5 } }, i18n.advantages.map(function(entry, i) { | |
| 3302 | + return /*#__PURE__*/ react.default.createElement(AdvantagesListItem, { key: i }, /*#__PURE__*/ react.default.createElement("b", null, entry[0]), " - ", entry[1]); | |
| 3303 | + }), /*#__PURE__*/ react.default.createElement(AdvantagesListItem, { key: i18n.advantages.length }, i18n.andMore, " ", /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 3304 | + color: "text.primary", | |
| 3305 | + href: optInLinks.readMoreUrl, | |
| 3306 | + target: "_blank" | |
| 3307 | + }, i18n.readMore))))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 3308 | + direction: "column", | |
| 3309 | + width: "clamp(240px, max(340px, 75%), 340px)", | |
| 3310 | + maxWidth: "100%", | |
| 3311 | + gap: 2 | |
| 3312 | + }, !isEnrolled ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 3313 | + onClick: function onClick() { | |
| 3314 | + setShowTerms(true); | |
| 3315 | + }, | |
| 3316 | + size: "large", | |
| 3317 | + color: "primary", | |
| 3318 | + variant: "contained", | |
| 3319 | + sx: { flexGrow: 1 } | |
| 3320 | + }, i18n.buttons.optIn) : /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 3321 | + onClick: function onClick() { | |
| 3322 | + return window.location.href = optInLinks.tryOutUrl; | |
| 3323 | + }, | |
| 3324 | + size: "large", | |
| 3325 | + color: "primary", | |
| 3326 | + variant: "contained", | |
| 3327 | + sx: { flexGrow: 1 } | |
| 3328 | + }, i18n.buttons.tryOut), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 3329 | + onClick: function onClick() { | |
| 3330 | + setShowTerms(true); | |
| 3331 | + }, | |
| 3332 | + size: "large", | |
| 3333 | + color: "secondary", | |
| 3334 | + variant: "outlined", | |
| 3335 | + sx: { | |
| 3336 | + flexGrow: 1, | |
| 3337 | + visibility: isEnrolled ? "visible" : "hidden" | |
| 3338 | + } | |
| 3339 | + }, i18n.buttons.optOut)), /*#__PURE__*/ react.default.createElement(TextNode, null, i18n.feedback, " ", /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 3340 | + underline: "hover", | |
| 3341 | + href: optInLinks.feedbackUrl, | |
| 3342 | + target: "_blank" | |
| 3343 | + }, i18n.overToGithub))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { sx: { | |
| 3344 | + flex: 1, | |
| 3345 | + px: 0, | |
| 3346 | + maxWidth: { | |
| 3347 | + md: "507px", | |
| 3348 | + sm: "600px" | |
| 3349 | + }, | |
| 3350 | + mx: "auto" | |
| 3351 | + } }, optInImages.square.src ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Image, { | |
| 3352 | + src: optInImages.square.src, | |
| 3353 | + alt: i18n.image, | |
| 3354 | + sx: _objectSpread(_objectSpread({}, optInImages.square.sx), {}, { display: { | |
| 3355 | + xs: "none", | |
| 3356 | + md: "block" | |
| 3357 | + } }) | |
| 3358 | + }) : /*#__PURE__*/ react.default.createElement(ImageSquarePlaceholder, { sx: _objectSpread(_objectSpread({}, optInImages.square.sx), {}, { display: { | |
| 3359 | + xs: "none", | |
| 3360 | + md: "block" | |
| 3361 | + } }) }), optInImages.landscape.src ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Image, { | |
| 3362 | + src: optInImages.landscape.src, | |
| 3363 | + alt: i18n.image, | |
| 3364 | + sx: _objectSpread(_objectSpread({}, optInImages.landscape.sx), {}, { display: { | |
| 3365 | + xs: "block", | |
| 3366 | + md: "none" | |
| 3367 | + } }) | |
| 3368 | + }) : /*#__PURE__*/ react.default.createElement(ImageLandscapePlaceholder, { sx: _objectSpread(_objectSpread({}, optInImages.landscape.sx), {}, { display: { | |
| 3369 | + xs: "block", | |
| 3370 | + md: "none" | |
| 3371 | + } }) })), showTerms && /*#__PURE__*/ react.default.createElement(Terms, { | |
| 3372 | + onClose: handlePopoverClose, | |
| 3373 | + onSubmit: isEnrolled ? maybeOptOut : maybeOptIn, | |
| 3374 | + isEnrolled | |
| 3375 | + }), optInMessage && /*#__PURE__*/ react.default.createElement(Message, { | |
| 3376 | + onClose: function onClose() { | |
| 3377 | + return setOptInMessage(""); | |
| 3378 | + }, | |
| 3379 | + action: /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 3380 | + href: optInLinks.tryOutUrl, | |
| 3381 | + color: "#FFFFFF", | |
| 3382 | + sx: { | |
| 3383 | + cursor: "pointer", | |
| 3384 | + textDecoration: "none", | |
| 3385 | + pl: 3 | |
| 3386 | + } | |
| 3387 | + }, i18n.buttons.tryOut) | |
| 3388 | + }, optInMessage), optOutMessage && /*#__PURE__*/ react.default.createElement(Message, { | |
| 3389 | + onClose: function onClose() { | |
| 3390 | + return setOptOutMessage(""); | |
| 3391 | + }, | |
| 3392 | + action: /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 3393 | + href: optInLinks.feedbackUrl, | |
| 3394 | + target: "_blank", | |
| 3395 | + color: "#FFFFFF", | |
| 3396 | + sx: { | |
| 3397 | + cursor: "pointer", | |
| 3398 | + textDecoration: "none", | |
| 3399 | + pl: 3 | |
| 3400 | + } | |
| 3401 | + }, i18n.tellUsWhy) | |
| 3402 | + }, optOutMessage), errorMessage && /*#__PURE__*/ react.default.createElement(Message, { | |
| 3403 | + severity: "error", | |
| 3404 | + onClose: function onClose() { | |
| 3405 | + return setErrorMessage(""); | |
| 3406 | + } | |
| 3407 | + }, errorMessage)); | |
| 3408 | + }; | |
| 3409 | + OptIn.propTypes = { state: import_prop_types.default.shape({ features: import_prop_types.default.shape({ editor_v4: import_prop_types.default.bool }) }).isRequired }; | |
| 2898 | 3410 | |
| 2899 | - return to; | |
| 2900 | -}; | |
| 3411 | +//#endregion | |
| 3412 | +//#region modules/atomic-opt-in/assets/js/opt-in-page/app.js | |
| 3413 | + var App = function App(props) { | |
| 3414 | + return /*#__PURE__*/ react.default.createElement(_elementor_ui.DirectionProvider, { rtl: props.isRTL }, /*#__PURE__*/ react.default.createElement(_elementor_ui.LocalizationProvider, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.ThemeProvider, { colorScheme: "light" }, /*#__PURE__*/ react.default.createElement(OptIn, { state: props === null || props === void 0 ? void 0 : props.state })))); | |
| 3415 | + }; | |
| 3416 | + App.propTypes = { | |
| 3417 | + isRTL: import_prop_types.default.bool, | |
| 3418 | + state: import_prop_types.default.object | |
| 3419 | + }; | |
| 3420 | + (function init() { | |
| 3421 | + var rootElement = document.querySelector("#page-editor-v4-opt-in"); | |
| 3422 | + if (!rootElement) return; | |
| 3423 | + react_default.render(/*#__PURE__*/ react.default.createElement(App, { | |
| 3424 | + isRTL: !!elementorCommon.config.isRTL, | |
| 3425 | + state: elementorSettingsEditor4OptIn | |
| 3426 | + }), rootElement); | |
| 3427 | + })(); | |
| 2901 | 3428 | |
| 2902 | - | |
| 2903 | -/***/ }), | |
| 2904 | - | |
| 2905 | -/***/ "../node_modules/prop-types/checkPropTypes.js": | |
| 2906 | -/*!****************************************************!*\ | |
| 2907 | - !*** ../node_modules/prop-types/checkPropTypes.js ***! | |
| 2908 | - \****************************************************/ | |
| 2909 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2910 | - | |
| 2911 | -"use strict"; | |
| 2912 | -/** | |
| 2913 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 2914 | - * | |
| 2915 | - * This source code is licensed under the MIT license found in the | |
| 2916 | - * LICENSE file in the root directory of this source tree. | |
| 2917 | - */ | |
| 2918 | - | |
| 2919 | - | |
| 2920 | - | |
| 2921 | -var printWarning = function() {}; | |
| 2922 | - | |
| 2923 | -if (true) { | |
| 2924 | - var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js"); | |
| 2925 | - var loggedTypeFailures = {}; | |
| 2926 | - var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js"); | |
| 2927 | - | |
| 2928 | - printWarning = function(text) { | |
| 2929 | - var message = 'Warning: ' + text; | |
| 2930 | - if (typeof console !== 'undefined') { | |
| 2931 | - console.error(message); | |
| 2932 | - } | |
| 2933 | - try { | |
| 2934 | - // --- Welcome to debugging React --- | |
| 2935 | - // This error was thrown as a convenience so that you can use this stack | |
| 2936 | - // to find the callsite that caused this warning to fire. | |
| 2937 | - throw new Error(message); | |
| 2938 | - } catch (x) { /**/ } | |
| 2939 | - }; | |
| 2940 | -} | |
| 2941 | - | |
| 2942 | -/** | |
| 2943 | - * Assert that the values match with the type specs. | |
| 2944 | - * Error messages are memorized and will only be shown once. | |
| 2945 | - * | |
| 2946 | - * @param {object} typeSpecs Map of name to a ReactPropType | |
| 2947 | - * @param {object} values Runtime values that need to be type-checked | |
| 2948 | - * @param {string} location e.g. "prop", "context", "child context" | |
| 2949 | - * @param {string} componentName Name of the component for error messages. | |
| 2950 | - * @param {?Function} getStack Returns the component stack. | |
| 2951 | - * @private | |
| 2952 | - */ | |
| 2953 | -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { | |
| 2954 | - if (true) { | |
| 2955 | - for (var typeSpecName in typeSpecs) { | |
| 2956 | - if (has(typeSpecs, typeSpecName)) { | |
| 2957 | - var error; | |
| 2958 | - // Prop type validation may throw. In case they do, we don't want to | |
| 2959 | - // fail the render phase where it didn't fail before. So we log it. | |
| 2960 | - // After these have been cleaned up, we'll let them throw. | |
| 2961 | - try { | |
| 2962 | - // This is intentionally an invariant that gets caught. It's the same | |
| 2963 | - // behavior as without this statement except with a better message. | |
| 2964 | - if (typeof typeSpecs[typeSpecName] !== 'function') { | |
| 2965 | - var err = Error( | |
| 2966 | - (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + | |
| 2967 | - 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + | |
| 2968 | - 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' | |
| 2969 | - ); | |
| 2970 | - err.name = 'Invariant Violation'; | |
| 2971 | - throw err; | |
| 2972 | - } | |
| 2973 | - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); | |
| 2974 | - } catch (ex) { | |
| 2975 | - error = ex; | |
| 2976 | - } | |
| 2977 | - if (error && !(error instanceof Error)) { | |
| 2978 | - printWarning( | |
| 2979 | - (componentName || 'React class') + ': type specification of ' + | |
| 2980 | - location + ' `' + typeSpecName + '` is invalid; the type checker ' + | |
| 2981 | - 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + | |
| 2982 | - 'You may have forgotten to pass an argument to the type checker ' + | |
| 2983 | - 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + | |
| 2984 | - 'shape all require an argument).' | |
| 2985 | - ); | |
| 2986 | - } | |
| 2987 | - if (error instanceof Error && !(error.message in loggedTypeFailures)) { | |
| 2988 | - // Only monitor this failure once because there tends to be a lot of the | |
| 2989 | - // same error. | |
| 2990 | - loggedTypeFailures[error.message] = true; | |
| 2991 | - | |
| 2992 | - var stack = getStack ? getStack() : ''; | |
| 2993 | - | |
| 2994 | - printWarning( | |
| 2995 | - 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') | |
| 2996 | - ); | |
| 2997 | - } | |
| 2998 | - } | |
| 2999 | - } | |
| 3000 | - } | |
| 3001 | -} | |
| 3002 | - | |
| 3003 | -/** | |
| 3004 | - * Resets warning cache when testing. | |
| 3005 | - * | |
| 3006 | - * @private | |
| 3007 | - */ | |
| 3008 | -checkPropTypes.resetWarningCache = function() { | |
| 3009 | - if (true) { | |
| 3010 | - loggedTypeFailures = {}; | |
| 3011 | - } | |
| 3012 | -} | |
| 3013 | - | |
| 3014 | -module.exports = checkPropTypes; | |
| 3015 | - | |
| 3016 | - | |
| 3017 | -/***/ }), | |
| 3018 | - | |
| 3019 | -/***/ "../node_modules/prop-types/factoryWithTypeCheckers.js": | |
| 3020 | -/*!*************************************************************!*\ | |
| 3021 | - !*** ../node_modules/prop-types/factoryWithTypeCheckers.js ***! | |
| 3022 | - \*************************************************************/ | |
| 3023 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 3024 | - | |
| 3025 | -"use strict"; | |
| 3026 | -/** | |
| 3027 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 3028 | - * | |
| 3029 | - * This source code is licensed under the MIT license found in the | |
| 3030 | - * LICENSE file in the root directory of this source tree. | |
| 3031 | - */ | |
| 3032 | - | |
| 3033 | - | |
| 3034 | - | |
| 3035 | -var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js"); | |
| 3036 | -var assign = __webpack_require__(/*! object-assign */ "../node_modules/object-assign/index.js"); | |
| 3037 | - | |
| 3038 | -var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js"); | |
| 3039 | -var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js"); | |
| 3040 | -var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../node_modules/prop-types/checkPropTypes.js"); | |
| 3041 | - | |
| 3042 | -var printWarning = function() {}; | |
| 3043 | - | |
| 3044 | -if (true) { | |
| 3045 | - printWarning = function(text) { | |
| 3046 | - var message = 'Warning: ' + text; | |
| 3047 | - if (typeof console !== 'undefined') { | |
| 3048 | - console.error(message); | |
| 3049 | - } | |
| 3050 | - try { | |
| 3051 | - // --- Welcome to debugging React --- | |
| 3052 | - // This error was thrown as a convenience so that you can use this stack | |
| 3053 | - // to find the callsite that caused this warning to fire. | |
| 3054 | - throw new Error(message); | |
| 3055 | - } catch (x) {} | |
| 3056 | - }; | |
| 3057 | -} | |
| 3058 | - | |
| 3059 | -function emptyFunctionThatReturnsNull() { | |
| 3060 | - return null; | |
| 3061 | -} | |
| 3062 | - | |
| 3063 | -module.exports = function(isValidElement, throwOnDirectAccess) { | |
| 3064 | - /* global Symbol */ | |
| 3065 | - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; | |
| 3066 | - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. | |
| 3067 | - | |
| 3068 | - /** | |
| 3069 | - * Returns the iterator method function contained on the iterable object. | |
| 3070 | - * | |
| 3071 | - * Be sure to invoke the function with the iterable as context: | |
| 3072 | - * | |
| 3073 | - * var iteratorFn = getIteratorFn(myIterable); | |
| 3074 | - * if (iteratorFn) { | |
| 3075 | - * var iterator = iteratorFn.call(myIterable); | |
| 3076 | - * ... | |
| 3077 | - * } | |
| 3078 | - * | |
| 3079 | - * @param {?object} maybeIterable | |
| 3080 | - * @return {?function} | |
| 3081 | - */ | |
| 3082 | - function getIteratorFn(maybeIterable) { | |
| 3083 | - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | |
| 3084 | - if (typeof iteratorFn === 'function') { | |
| 3085 | - return iteratorFn; | |
| 3086 | - } | |
| 3087 | - } | |
| 3088 | - | |
| 3089 | - /** | |
| 3090 | - * Collection of methods that allow declaration and validation of props that are | |
| 3091 | - * supplied to React components. Example usage: | |
| 3092 | - * | |
| 3093 | - * var Props = require('ReactPropTypes'); | |
| 3094 | - * var MyArticle = React.createClass({ | |
| 3095 | - * propTypes: { | |
| 3096 | - * // An optional string prop named "description". | |
| 3097 | - * description: Props.string, | |
| 3098 | - * | |
| 3099 | - * // A required enum prop named "category". | |
| 3100 | - * category: Props.oneOf(['News','Photos']).isRequired, | |
| 3101 | - * | |
| 3102 | - * // A prop named "dialog" that requires an instance of Dialog. | |
| 3103 | - * dialog: Props.instanceOf(Dialog).isRequired | |
| 3104 | - * }, | |
| 3105 | - * render: function() { ... } | |
| 3106 | - * }); | |
| 3107 | - * | |
| 3108 | - * A more formal specification of how these methods are used: | |
| 3109 | - * | |
| 3110 | - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) | |
| 3111 | - * decl := ReactPropTypes.{type}(.isRequired)? | |
| 3112 | - * | |
| 3113 | - * Each and every declaration produces a function with the same signature. This | |
| 3114 | - * allows the creation of custom validation functions. For example: | |
| 3115 | - * | |
| 3116 | - * var MyLink = React.createClass({ | |
| 3117 | - * propTypes: { | |
| 3118 | - * // An optional string or URI prop named "href". | |
| 3119 | - * href: function(props, propName, componentName) { | |
| 3120 | - * var propValue = props[propName]; | |
| 3121 | - * if (propValue != null && typeof propValue !== 'string' && | |
| 3122 | - * !(propValue instanceof URI)) { | |
| 3123 | - * return new Error( | |
| 3124 | - * 'Expected a string or an URI for ' + propName + ' in ' + | |
| 3125 | - * componentName | |
| 3126 | - * ); | |
| 3127 | - * } | |
| 3128 | - * } | |
| 3129 | - * }, | |
| 3130 | - * render: function() {...} | |
| 3131 | - * }); | |
| 3132 | - * | |
| 3133 | - * @internal | |
| 3134 | - */ | |
| 3135 | - | |
| 3136 | - var ANONYMOUS = '<<anonymous>>'; | |
| 3137 | - | |
| 3138 | - // Important! | |
| 3139 | - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. | |
| 3140 | - var ReactPropTypes = { | |
| 3141 | - array: createPrimitiveTypeChecker('array'), | |
| 3142 | - bigint: createPrimitiveTypeChecker('bigint'), | |
| 3143 | - bool: createPrimitiveTypeChecker('boolean'), | |
| 3144 | - func: createPrimitiveTypeChecker('function'), | |
| 3145 | - number: createPrimitiveTypeChecker('number'), | |
| 3146 | - object: createPrimitiveTypeChecker('object'), | |
| 3147 | - string: createPrimitiveTypeChecker('string'), | |
| 3148 | - symbol: createPrimitiveTypeChecker('symbol'), | |
| 3149 | - | |
| 3150 | - any: createAnyTypeChecker(), | |
| 3151 | - arrayOf: createArrayOfTypeChecker, | |
| 3152 | - element: createElementTypeChecker(), | |
| 3153 | - elementType: createElementTypeTypeChecker(), | |
| 3154 | - instanceOf: createInstanceTypeChecker, | |
| 3155 | - node: createNodeChecker(), | |
| 3156 | - objectOf: createObjectOfTypeChecker, | |
| 3157 | - oneOf: createEnumTypeChecker, | |
| 3158 | - oneOfType: createUnionTypeChecker, | |
| 3159 | - shape: createShapeTypeChecker, | |
| 3160 | - exact: createStrictShapeTypeChecker, | |
| 3161 | - }; | |
| 3162 | - | |
| 3163 | - /** | |
| 3164 | - * inlined Object.is polyfill to avoid requiring consumers ship their own | |
| 3165 | - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | |
| 3166 | - */ | |
| 3167 | - /*eslint-disable no-self-compare*/ | |
| 3168 | - function is(x, y) { | |
| 3169 | - // SameValue algorithm | |
| 3170 | - if (x === y) { | |
| 3171 | - // Steps 1-5, 7-10 | |
| 3172 | - // Steps 6.b-6.e: +0 != -0 | |
| 3173 | - return x !== 0 || 1 / x === 1 / y; | |
| 3174 | - } else { | |
| 3175 | - // Step 6.a: NaN == NaN | |
| 3176 | - return x !== x && y !== y; | |
| 3177 | - } | |
| 3178 | - } | |
| 3179 | - /*eslint-enable no-self-compare*/ | |
| 3180 | - | |
| 3181 | - /** | |
| 3182 | - * We use an Error-like object for backward compatibility as people may call | |
| 3183 | - * PropTypes directly and inspect their output. However, we don't use real | |
| 3184 | - * Errors anymore. We don't inspect their stack anyway, and creating them | |
| 3185 | - * is prohibitively expensive if they are created too often, such as what | |
| 3186 | - * happens in oneOfType() for any type before the one that matched. | |
| 3187 | - */ | |
| 3188 | - function PropTypeError(message, data) { | |
| 3189 | - this.message = message; | |
| 3190 | - this.data = data && typeof data === 'object' ? data: {}; | |
| 3191 | - this.stack = ''; | |
| 3192 | - } | |
| 3193 | - // Make `instanceof Error` still work for returned errors. | |
| 3194 | - PropTypeError.prototype = Error.prototype; | |
| 3195 | - | |
| 3196 | - function createChainableTypeChecker(validate) { | |
| 3197 | - if (true) { | |
| 3198 | - var manualPropTypeCallCache = {}; | |
| 3199 | - var manualPropTypeWarningCount = 0; | |
| 3200 | - } | |
| 3201 | - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | |
| 3202 | - componentName = componentName || ANONYMOUS; | |
| 3203 | - propFullName = propFullName || propName; | |
| 3204 | - | |
| 3205 | - if (secret !== ReactPropTypesSecret) { | |
| 3206 | - if (throwOnDirectAccess) { | |
| 3207 | - // New behavior only for users of `prop-types` package | |
| 3208 | - var err = new Error( | |
| 3209 | - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + | |
| 3210 | - 'Use `PropTypes.checkPropTypes()` to call them. ' + | |
| 3211 | - 'Read more at http://fb.me/use-check-prop-types' | |
| 3212 | - ); | |
| 3213 | - err.name = 'Invariant Violation'; | |
| 3214 | - throw err; | |
| 3215 | - } else if ( true && typeof console !== 'undefined') { | |
| 3216 | - // Old behavior for people using React.PropTypes | |
| 3217 | - var cacheKey = componentName + ':' + propName; | |
| 3218 | - if ( | |
| 3219 | - !manualPropTypeCallCache[cacheKey] && | |
| 3220 | - // Avoid spamming the console because they are often not actionable except for lib authors | |
| 3221 | - manualPropTypeWarningCount < 3 | |
| 3222 | - ) { | |
| 3223 | - printWarning( | |
| 3224 | - 'You are manually calling a React.PropTypes validation ' + | |
| 3225 | - 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + | |
| 3226 | - 'and will throw in the standalone `prop-types` package. ' + | |
| 3227 | - 'You may be seeing this warning due to a third-party PropTypes ' + | |
| 3228 | - 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' | |
| 3229 | - ); | |
| 3230 | - manualPropTypeCallCache[cacheKey] = true; | |
| 3231 | - manualPropTypeWarningCount++; | |
| 3232 | - } | |
| 3233 | - } | |
| 3234 | - } | |
| 3235 | - if (props[propName] == null) { | |
| 3236 | - if (isRequired) { | |
| 3237 | - if (props[propName] === null) { | |
| 3238 | - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); | |
| 3239 | - } | |
| 3240 | - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); | |
| 3241 | - } | |
| 3242 | - return null; | |
| 3243 | - } else { | |
| 3244 | - return validate(props, propName, componentName, location, propFullName); | |
| 3245 | - } | |
| 3246 | - } | |
| 3247 | - | |
| 3248 | - var chainedCheckType = checkType.bind(null, false); | |
| 3249 | - chainedCheckType.isRequired = checkType.bind(null, true); | |
| 3250 | - | |
| 3251 | - return chainedCheckType; | |
| 3252 | - } | |
| 3253 | - | |
| 3254 | - function createPrimitiveTypeChecker(expectedType) { | |
| 3255 | - function validate(props, propName, componentName, location, propFullName, secret) { | |
| 3256 | - var propValue = props[propName]; | |
| 3257 | - var propType = getPropType(propValue); | |
| 3258 | - if (propType !== expectedType) { | |
| 3259 | - // `propValue` being instance of, say, date/regexp, pass the 'object' | |
| 3260 | - // check, but we can offer a more precise error message here rather than | |
| 3261 | - // 'of type `object`'. | |
| 3262 | - var preciseType = getPreciseType(propValue); | |
| 3263 | - | |
| 3264 | - return new PropTypeError( | |
| 3265 | - 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), | |
| 3266 | - {expectedType: expectedType} | |
| 3267 | - ); | |
| 3268 | - } | |
| 3269 | - return null; | |
| 3270 | - } | |
| 3271 | - return createChainableTypeChecker(validate); | |
| 3272 | - } | |
| 3273 | - | |
| 3274 | - function createAnyTypeChecker() { | |
| 3275 | - return createChainableTypeChecker(emptyFunctionThatReturnsNull); | |
| 3276 | - } | |
| 3277 | - | |
| 3278 | - function createArrayOfTypeChecker(typeChecker) { | |
| 3279 | - function validate(props, propName, componentName, location, propFullName) { | |
| 3280 | - if (typeof typeChecker !== 'function') { | |
| 3281 | - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); | |
| 3282 | - } | |
| 3283 | - var propValue = props[propName]; | |
| 3284 | - if (!Array.isArray(propValue)) { | |
| 3285 | - var propType = getPropType(propValue); | |
| 3286 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); | |
| 3287 | - } | |
| 3288 | - for (var i = 0; i < propValue.length; i++) { | |
| 3289 | - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); | |
| 3290 | - if (error instanceof Error) { | |
| 3291 | - return error; | |
| 3292 | - } | |
| 3293 | - } | |
| 3294 | - return null; | |
| 3295 | - } | |
| 3296 | - return createChainableTypeChecker(validate); | |
| 3297 | - } | |
| 3298 | - | |
| 3299 | - function createElementTypeChecker() { | |
| 3300 | - function validate(props, propName, componentName, location, propFullName) { | |
| 3301 | - var propValue = props[propName]; | |
| 3302 | - if (!isValidElement(propValue)) { | |
| 3303 | - var propType = getPropType(propValue); | |
| 3304 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); | |
| 3305 | - } | |
| 3306 | - return null; | |
| 3307 | - } | |
| 3308 | - return createChainableTypeChecker(validate); | |
| 3309 | - } | |
| 3310 | - | |
| 3311 | - function createElementTypeTypeChecker() { | |
| 3312 | - function validate(props, propName, componentName, location, propFullName) { | |
| 3313 | - var propValue = props[propName]; | |
| 3314 | - if (!ReactIs.isValidElementType(propValue)) { | |
| 3315 | - var propType = getPropType(propValue); | |
| 3316 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); | |
| 3317 | - } | |
| 3318 | - return null; | |
| 3319 | - } | |
| 3320 | - return createChainableTypeChecker(validate); | |
| 3321 | - } | |
| 3322 | - | |
| 3323 | - function createInstanceTypeChecker(expectedClass) { | |
| 3324 | - function validate(props, propName, componentName, location, propFullName) { | |
| 3325 | - if (!(props[propName] instanceof expectedClass)) { | |
| 3326 | - var expectedClassName = expectedClass.name || ANONYMOUS; | |
| 3327 | - var actualClassName = getClassName(props[propName]); | |
| 3328 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); | |
| 3329 | - } | |
| 3330 | - return null; | |
| 3331 | - } | |
| 3332 | - return createChainableTypeChecker(validate); | |
| 3333 | - } | |
| 3334 | - | |
| 3335 | - function createEnumTypeChecker(expectedValues) { | |
| 3336 | - if (!Array.isArray(expectedValues)) { | |
| 3337 | - if (true) { | |
| 3338 | - if (arguments.length > 1) { | |
| 3339 | - printWarning( | |
| 3340 | - 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + | |
| 3341 | - 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' | |
| 3342 | - ); | |
| 3343 | - } else { | |
| 3344 | - printWarning('Invalid argument supplied to oneOf, expected an array.'); | |
| 3345 | - } | |
| 3346 | - } | |
| 3347 | - return emptyFunctionThatReturnsNull; | |
| 3348 | - } | |
| 3349 | - | |
| 3350 | - function validate(props, propName, componentName, location, propFullName) { | |
| 3351 | - var propValue = props[propName]; | |
| 3352 | - for (var i = 0; i < expectedValues.length; i++) { | |
| 3353 | - if (is(propValue, expectedValues[i])) { | |
| 3354 | - return null; | |
| 3355 | - } | |
| 3356 | - } | |
| 3357 | - | |
| 3358 | - var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | |
| 3359 | - var type = getPreciseType(value); | |
| 3360 | - if (type === 'symbol') { | |
| 3361 | - return String(value); | |
| 3362 | - } | |
| 3363 | - return value; | |
| 3364 | - }); | |
| 3365 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); | |
| 3366 | - } | |
| 3367 | - return createChainableTypeChecker(validate); | |
| 3368 | - } | |
| 3369 | - | |
| 3370 | - function createObjectOfTypeChecker(typeChecker) { | |
| 3371 | - function validate(props, propName, componentName, location, propFullName) { | |
| 3372 | - if (typeof typeChecker !== 'function') { | |
| 3373 | - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); | |
| 3374 | - } | |
| 3375 | - var propValue = props[propName]; | |
| 3376 | - var propType = getPropType(propValue); | |
| 3377 | - if (propType !== 'object') { | |
| 3378 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); | |
| 3379 | - } | |
| 3380 | - for (var key in propValue) { | |
| 3381 | - if (has(propValue, key)) { | |
| 3382 | - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 3383 | - if (error instanceof Error) { | |
| 3384 | - return error; | |
| 3385 | - } | |
| 3386 | - } | |
| 3387 | - } | |
| 3388 | - return null; | |
| 3389 | - } | |
| 3390 | - return createChainableTypeChecker(validate); | |
| 3391 | - } | |
| 3392 | - | |
| 3393 | - function createUnionTypeChecker(arrayOfTypeCheckers) { | |
| 3394 | - if (!Array.isArray(arrayOfTypeCheckers)) { | |
| 3395 | - true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0; | |
| 3396 | - return emptyFunctionThatReturnsNull; | |
| 3397 | - } | |
| 3398 | - | |
| 3399 | - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 3400 | - var checker = arrayOfTypeCheckers[i]; | |
| 3401 | - if (typeof checker !== 'function') { | |
| 3402 | - printWarning( | |
| 3403 | - 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + | |
| 3404 | - 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' | |
| 3405 | - ); | |
| 3406 | - return emptyFunctionThatReturnsNull; | |
| 3407 | - } | |
| 3408 | - } | |
| 3409 | - | |
| 3410 | - function validate(props, propName, componentName, location, propFullName) { | |
| 3411 | - var expectedTypes = []; | |
| 3412 | - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 3413 | - var checker = arrayOfTypeCheckers[i]; | |
| 3414 | - var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); | |
| 3415 | - if (checkerResult == null) { | |
| 3416 | - return null; | |
| 3417 | - } | |
| 3418 | - if (checkerResult.data && has(checkerResult.data, 'expectedType')) { | |
| 3419 | - expectedTypes.push(checkerResult.data.expectedType); | |
| 3420 | - } | |
| 3421 | - } | |
| 3422 | - var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; | |
| 3423 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); | |
| 3424 | - } | |
| 3425 | - return createChainableTypeChecker(validate); | |
| 3426 | - } | |
| 3427 | - | |
| 3428 | - function createNodeChecker() { | |
| 3429 | - function validate(props, propName, componentName, location, propFullName) { | |
| 3430 | - if (!isNode(props[propName])) { | |
| 3431 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); | |
| 3432 | - } | |
| 3433 | - return null; | |
| 3434 | - } | |
| 3435 | - return createChainableTypeChecker(validate); | |
| 3436 | - } | |
| 3437 | - | |
| 3438 | - function invalidValidatorError(componentName, location, propFullName, key, type) { | |
| 3439 | - return new PropTypeError( | |
| 3440 | - (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + | |
| 3441 | - 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' | |
| 3442 | - ); | |
| 3443 | - } | |
| 3444 | - | |
| 3445 | - function createShapeTypeChecker(shapeTypes) { | |
| 3446 | - function validate(props, propName, componentName, location, propFullName) { | |
| 3447 | - var propValue = props[propName]; | |
| 3448 | - var propType = getPropType(propValue); | |
| 3449 | - if (propType !== 'object') { | |
| 3450 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | |
| 3451 | - } | |
| 3452 | - for (var key in shapeTypes) { | |
| 3453 | - var checker = shapeTypes[key]; | |
| 3454 | - if (typeof checker !== 'function') { | |
| 3455 | - return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 3456 | - } | |
| 3457 | - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 3458 | - if (error) { | |
| 3459 | - return error; | |
| 3460 | - } | |
| 3461 | - } | |
| 3462 | - return null; | |
| 3463 | - } | |
| 3464 | - return createChainableTypeChecker(validate); | |
| 3465 | - } | |
| 3466 | - | |
| 3467 | - function createStrictShapeTypeChecker(shapeTypes) { | |
| 3468 | - function validate(props, propName, componentName, location, propFullName) { | |
| 3469 | - var propValue = props[propName]; | |
| 3470 | - var propType = getPropType(propValue); | |
| 3471 | - if (propType !== 'object') { | |
| 3472 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | |
| 3473 | - } | |
| 3474 | - // We need to check all keys in case some are required but missing from props. | |
| 3475 | - var allKeys = assign({}, props[propName], shapeTypes); | |
| 3476 | - for (var key in allKeys) { | |
| 3477 | - var checker = shapeTypes[key]; | |
| 3478 | - if (has(shapeTypes, key) && typeof checker !== 'function') { | |
| 3479 | - return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 3480 | - } | |
| 3481 | - if (!checker) { | |
| 3482 | - return new PropTypeError( | |
| 3483 | - 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + | |
| 3484 | - '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + | |
| 3485 | - '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') | |
| 3486 | - ); | |
| 3487 | - } | |
| 3488 | - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 3489 | - if (error) { | |
| 3490 | - return error; | |
| 3491 | - } | |
| 3492 | - } | |
| 3493 | - return null; | |
| 3494 | - } | |
| 3495 | - | |
| 3496 | - return createChainableTypeChecker(validate); | |
| 3497 | - } | |
| 3498 | - | |
| 3499 | - function isNode(propValue) { | |
| 3500 | - switch (typeof propValue) { | |
| 3501 | - case 'number': | |
| 3502 | - case 'string': | |
| 3503 | - case 'undefined': | |
| 3504 | - return true; | |
| 3505 | - case 'boolean': | |
| 3506 | - return !propValue; | |
| 3507 | - case 'object': | |
| 3508 | - if (Array.isArray(propValue)) { | |
| 3509 | - return propValue.every(isNode); | |
| 3510 | - } | |
| 3511 | - if (propValue === null || isValidElement(propValue)) { | |
| 3512 | - return true; | |
| 3513 | - } | |
| 3514 | - | |
| 3515 | - var iteratorFn = getIteratorFn(propValue); | |
| 3516 | - if (iteratorFn) { | |
| 3517 | - var iterator = iteratorFn.call(propValue); | |
| 3518 | - var step; | |
| 3519 | - if (iteratorFn !== propValue.entries) { | |
| 3520 | - while (!(step = iterator.next()).done) { | |
| 3521 | - if (!isNode(step.value)) { | |
| 3522 | - return false; | |
| 3523 | - } | |
| 3524 | - } | |
| 3525 | - } else { | |
| 3526 | - // Iterator will provide entry [k,v] tuples rather than values. | |
| 3527 | - while (!(step = iterator.next()).done) { | |
| 3528 | - var entry = step.value; | |
| 3529 | - if (entry) { | |
| 3530 | - if (!isNode(entry[1])) { | |
| 3531 | - return false; | |
| 3532 | - } | |
| 3533 | - } | |
| 3534 | - } | |
| 3535 | - } | |
| 3536 | - } else { | |
| 3537 | - return false; | |
| 3538 | - } | |
| 3539 | - | |
| 3540 | - return true; | |
| 3541 | - default: | |
| 3542 | - return false; | |
| 3543 | - } | |
| 3544 | - } | |
| 3545 | - | |
| 3546 | - function isSymbol(propType, propValue) { | |
| 3547 | - // Native Symbol. | |
| 3548 | - if (propType === 'symbol') { | |
| 3549 | - return true; | |
| 3550 | - } | |
| 3551 | - | |
| 3552 | - // falsy value can't be a Symbol | |
| 3553 | - if (!propValue) { | |
| 3554 | - return false; | |
| 3555 | - } | |
| 3556 | - | |
| 3557 | - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' | |
| 3558 | - if (propValue['@@toStringTag'] === 'Symbol') { | |
| 3559 | - return true; | |
| 3560 | - } | |
| 3561 | - | |
| 3562 | - // Fallback for non-spec compliant Symbols which are polyfilled. | |
| 3563 | - if (typeof Symbol === 'function' && propValue instanceof Symbol) { | |
| 3564 | - return true; | |
| 3565 | - } | |
| 3566 | - | |
| 3567 | - return false; | |
| 3568 | - } | |
| 3569 | - | |
| 3570 | - // Equivalent of `typeof` but with special handling for array and regexp. | |
| 3571 | - function getPropType(propValue) { | |
| 3572 | - var propType = typeof propValue; | |
| 3573 | - if (Array.isArray(propValue)) { | |
| 3574 | - return 'array'; | |
| 3575 | - } | |
| 3576 | - if (propValue instanceof RegExp) { | |
| 3577 | - // Old webkits (at least until Android 4.0) return 'function' rather than | |
| 3578 | - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ | |
| 3579 | - // passes PropTypes.object. | |
| 3580 | - return 'object'; | |
| 3581 | - } | |
| 3582 | - if (isSymbol(propType, propValue)) { | |
| 3583 | - return 'symbol'; | |
| 3584 | - } | |
| 3585 | - return propType; | |
| 3586 | - } | |
| 3587 | - | |
| 3588 | - // This handles more types than `getPropType`. Only used for error messages. | |
| 3589 | - // See `createPrimitiveTypeChecker`. | |
| 3590 | - function getPreciseType(propValue) { | |
| 3591 | - if (typeof propValue === 'undefined' || propValue === null) { | |
| 3592 | - return '' + propValue; | |
| 3593 | - } | |
| 3594 | - var propType = getPropType(propValue); | |
| 3595 | - if (propType === 'object') { | |
| 3596 | - if (propValue instanceof Date) { | |
| 3597 | - return 'date'; | |
| 3598 | - } else if (propValue instanceof RegExp) { | |
| 3599 | - return 'regexp'; | |
| 3600 | - } | |
| 3601 | - } | |
| 3602 | - return propType; | |
| 3603 | - } | |
| 3604 | - | |
| 3605 | - // Returns a string that is postfixed to a warning about an invalid type. | |
| 3606 | - // For example, "undefined" or "of type array" | |
| 3607 | - function getPostfixForTypeWarning(value) { | |
| 3608 | - var type = getPreciseType(value); | |
| 3609 | - switch (type) { | |
| 3610 | - case 'array': | |
| 3611 | - case 'object': | |
| 3612 | - return 'an ' + type; | |
| 3613 | - case 'boolean': | |
| 3614 | - case 'date': | |
| 3615 | - case 'regexp': | |
| 3616 | - return 'a ' + type; | |
| 3617 | - default: | |
| 3618 | - return type; | |
| 3619 | - } | |
| 3620 | - } | |
| 3621 | - | |
| 3622 | - // Returns class name of the object, if any. | |
| 3623 | - function getClassName(propValue) { | |
| 3624 | - if (!propValue.constructor || !propValue.constructor.name) { | |
| 3625 | - return ANONYMOUS; | |
| 3626 | - } | |
| 3627 | - return propValue.constructor.name; | |
| 3628 | - } | |
| 3629 | - | |
| 3630 | - ReactPropTypes.checkPropTypes = checkPropTypes; | |
| 3631 | - ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | |
| 3632 | - ReactPropTypes.PropTypes = ReactPropTypes; | |
| 3633 | - | |
| 3634 | - return ReactPropTypes; | |
| 3635 | -}; | |
| 3636 | - | |
| 3637 | - | |
| 3638 | -/***/ }), | |
| 3639 | - | |
| 3640 | -/***/ "../node_modules/prop-types/index.js": | |
| 3641 | -/*!*******************************************!*\ | |
| 3642 | - !*** ../node_modules/prop-types/index.js ***! | |
| 3643 | - \*******************************************/ | |
| 3644 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 3645 | - | |
| 3646 | -/** | |
| 3647 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 3648 | - * | |
| 3649 | - * This source code is licensed under the MIT license found in the | |
| 3650 | - * LICENSE file in the root directory of this source tree. | |
| 3651 | - */ | |
| 3652 | - | |
| 3653 | -if (true) { | |
| 3654 | - var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js"); | |
| 3655 | - | |
| 3656 | - // By explicitly using `prop-types` you are opting into new development behavior. | |
| 3657 | - // http://fb.me/prop-types-in-prod | |
| 3658 | - var throwOnDirectAccess = true; | |
| 3659 | - module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); | |
| 3660 | -} else // removed by dead control flow | |
| 3661 | -{} | |
| 3662 | - | |
| 3663 | - | |
| 3664 | -/***/ }), | |
| 3665 | - | |
| 3666 | -/***/ "../node_modules/prop-types/lib/ReactPropTypesSecret.js": | |
| 3667 | -/*!**************************************************************!*\ | |
| 3668 | - !*** ../node_modules/prop-types/lib/ReactPropTypesSecret.js ***! | |
| 3669 | - \**************************************************************/ | |
| 3670 | -/***/ ((module) => { | |
| 3671 | - | |
| 3672 | -"use strict"; | |
| 3673 | -/** | |
| 3674 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 3675 | - * | |
| 3676 | - * This source code is licensed under the MIT license found in the | |
| 3677 | - * LICENSE file in the root directory of this source tree. | |
| 3678 | - */ | |
| 3679 | - | |
| 3680 | - | |
| 3681 | - | |
| 3682 | -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; | |
| 3683 | - | |
| 3684 | -module.exports = ReactPropTypesSecret; | |
| 3685 | - | |
| 3686 | - | |
| 3687 | -/***/ }), | |
| 3688 | - | |
| 3689 | -/***/ "../node_modules/prop-types/lib/has.js": | |
| 3690 | -/*!*********************************************!*\ | |
| 3691 | - !*** ../node_modules/prop-types/lib/has.js ***! | |
| 3692 | - \*********************************************/ | |
| 3693 | -/***/ ((module) => { | |
| 3694 | - | |
| 3695 | -module.exports = Function.call.bind(Object.prototype.hasOwnProperty); | |
| 3696 | - | |
| 3697 | - | |
| 3698 | -/***/ }), | |
| 3699 | - | |
| 3700 | -/***/ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js": | |
| 3701 | -/*!************************************************************************************!*\ | |
| 3702 | - !*** ../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***! | |
| 3703 | - \************************************************************************************/ | |
| 3704 | -/***/ ((__unused_webpack_module, exports) => { | |
| 3705 | - | |
| 3706 | -"use strict"; | |
| 3707 | -/** @license React v16.13.1 | |
| 3708 | - * react-is.development.js | |
| 3709 | - * | |
| 3710 | - * Copyright (c) Facebook, Inc. and its affiliates. | |
| 3711 | - * | |
| 3712 | - * This source code is licensed under the MIT license found in the | |
| 3713 | - * LICENSE file in the root directory of this source tree. | |
| 3714 | - */ | |
| 3715 | - | |
| 3716 | - | |
| 3717 | - | |
| 3718 | - | |
| 3719 | - | |
| 3720 | -if (true) { | |
| 3721 | - (function() { | |
| 3722 | -'use strict'; | |
| 3723 | - | |
| 3724 | -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | |
| 3725 | -// nor polyfill, then a plain number is used for performance. | |
| 3726 | -var hasSymbol = typeof Symbol === 'function' && Symbol.for; | |
| 3727 | -var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; | |
| 3728 | -var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; | |
| 3729 | -var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; | |
| 3730 | -var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; | |
| 3731 | -var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; | |
| 3732 | -var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; | |
| 3733 | -var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | |
| 3734 | -// (unstable) APIs that have been removed. Can we remove the symbols? | |
| 3735 | - | |
| 3736 | -var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; | |
| 3737 | -var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; | |
| 3738 | -var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; | |
| 3739 | -var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; | |
| 3740 | -var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; | |
| 3741 | -var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; | |
| 3742 | -var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; | |
| 3743 | -var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; | |
| 3744 | -var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; | |
| 3745 | -var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; | |
| 3746 | -var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; | |
| 3747 | - | |
| 3748 | -function isValidElementType(type) { | |
| 3749 | - return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | |
| 3750 | - type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | |
| 3751 | -} | |
| 3752 | - | |
| 3753 | -function typeOf(object) { | |
| 3754 | - if (typeof object === 'object' && object !== null) { | |
| 3755 | - var $$typeof = object.$$typeof; | |
| 3756 | - | |
| 3757 | - switch ($$typeof) { | |
| 3758 | - case REACT_ELEMENT_TYPE: | |
| 3759 | - var type = object.type; | |
| 3760 | - | |
| 3761 | - switch (type) { | |
| 3762 | - case REACT_ASYNC_MODE_TYPE: | |
| 3763 | - case REACT_CONCURRENT_MODE_TYPE: | |
| 3764 | - case REACT_FRAGMENT_TYPE: | |
| 3765 | - case REACT_PROFILER_TYPE: | |
| 3766 | - case REACT_STRICT_MODE_TYPE: | |
| 3767 | - case REACT_SUSPENSE_TYPE: | |
| 3768 | - return type; | |
| 3769 | - | |
| 3770 | - default: | |
| 3771 | - var $$typeofType = type && type.$$typeof; | |
| 3772 | - | |
| 3773 | - switch ($$typeofType) { | |
| 3774 | - case REACT_CONTEXT_TYPE: | |
| 3775 | - case REACT_FORWARD_REF_TYPE: | |
| 3776 | - case REACT_LAZY_TYPE: | |
| 3777 | - case REACT_MEMO_TYPE: | |
| 3778 | - case REACT_PROVIDER_TYPE: | |
| 3779 | - return $$typeofType; | |
| 3780 | - | |
| 3781 | - default: | |
| 3782 | - return $$typeof; | |
| 3783 | - } | |
| 3784 | - | |
| 3785 | - } | |
| 3786 | - | |
| 3787 | - case REACT_PORTAL_TYPE: | |
| 3788 | - return $$typeof; | |
| 3789 | - } | |
| 3790 | - } | |
| 3791 | - | |
| 3792 | - return undefined; | |
| 3793 | -} // AsyncMode is deprecated along with isAsyncMode | |
| 3794 | - | |
| 3795 | -var AsyncMode = REACT_ASYNC_MODE_TYPE; | |
| 3796 | -var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | |
| 3797 | -var ContextConsumer = REACT_CONTEXT_TYPE; | |
| 3798 | -var ContextProvider = REACT_PROVIDER_TYPE; | |
| 3799 | -var Element = REACT_ELEMENT_TYPE; | |
| 3800 | -var ForwardRef = REACT_FORWARD_REF_TYPE; | |
| 3801 | -var Fragment = REACT_FRAGMENT_TYPE; | |
| 3802 | -var Lazy = REACT_LAZY_TYPE; | |
| 3803 | -var Memo = REACT_MEMO_TYPE; | |
| 3804 | -var Portal = REACT_PORTAL_TYPE; | |
| 3805 | -var Profiler = REACT_PROFILER_TYPE; | |
| 3806 | -var StrictMode = REACT_STRICT_MODE_TYPE; | |
| 3807 | -var Suspense = REACT_SUSPENSE_TYPE; | |
| 3808 | -var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated | |
| 3809 | - | |
| 3810 | -function isAsyncMode(object) { | |
| 3811 | - { | |
| 3812 | - if (!hasWarnedAboutDeprecatedIsAsyncMode) { | |
| 3813 | - hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint | |
| 3814 | - | |
| 3815 | - console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); | |
| 3816 | - } | |
| 3817 | - } | |
| 3818 | - | |
| 3819 | - return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; | |
| 3820 | -} | |
| 3821 | -function isConcurrentMode(object) { | |
| 3822 | - return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | |
| 3823 | -} | |
| 3824 | -function isContextConsumer(object) { | |
| 3825 | - return typeOf(object) === REACT_CONTEXT_TYPE; | |
| 3826 | -} | |
| 3827 | -function isContextProvider(object) { | |
| 3828 | - return typeOf(object) === REACT_PROVIDER_TYPE; | |
| 3829 | -} | |
| 3830 | -function isElement(object) { | |
| 3831 | - return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | |
| 3832 | -} | |
| 3833 | -function isForwardRef(object) { | |
| 3834 | - return typeOf(object) === REACT_FORWARD_REF_TYPE; | |
| 3835 | -} | |
| 3836 | -function isFragment(object) { | |
| 3837 | - return typeOf(object) === REACT_FRAGMENT_TYPE; | |
| 3838 | -} | |
| 3839 | -function isLazy(object) { | |
| 3840 | - return typeOf(object) === REACT_LAZY_TYPE; | |
| 3841 | -} | |
| 3842 | -function isMemo(object) { | |
| 3843 | - return typeOf(object) === REACT_MEMO_TYPE; | |
| 3844 | -} | |
| 3845 | -function isPortal(object) { | |
| 3846 | - return typeOf(object) === REACT_PORTAL_TYPE; | |
| 3847 | -} | |
| 3848 | -function isProfiler(object) { | |
| 3849 | - return typeOf(object) === REACT_PROFILER_TYPE; | |
| 3850 | -} | |
| 3851 | -function isStrictMode(object) { | |
| 3852 | - return typeOf(object) === REACT_STRICT_MODE_TYPE; | |
| 3853 | -} | |
| 3854 | -function isSuspense(object) { | |
| 3855 | - return typeOf(object) === REACT_SUSPENSE_TYPE; | |
| 3856 | -} | |
| 3857 | - | |
| 3858 | -exports.AsyncMode = AsyncMode; | |
| 3859 | -exports.ConcurrentMode = ConcurrentMode; | |
| 3860 | -exports.ContextConsumer = ContextConsumer; | |
| 3861 | -exports.ContextProvider = ContextProvider; | |
| 3862 | -exports.Element = Element; | |
| 3863 | -exports.ForwardRef = ForwardRef; | |
| 3864 | -exports.Fragment = Fragment; | |
| 3865 | -exports.Lazy = Lazy; | |
| 3866 | -exports.Memo = Memo; | |
| 3867 | -exports.Portal = Portal; | |
| 3868 | -exports.Profiler = Profiler; | |
| 3869 | -exports.StrictMode = StrictMode; | |
| 3870 | -exports.Suspense = Suspense; | |
| 3871 | -exports.isAsyncMode = isAsyncMode; | |
| 3872 | -exports.isConcurrentMode = isConcurrentMode; | |
| 3873 | -exports.isContextConsumer = isContextConsumer; | |
| 3874 | -exports.isContextProvider = isContextProvider; | |
| 3875 | -exports.isElement = isElement; | |
| 3876 | -exports.isForwardRef = isForwardRef; | |
| 3877 | -exports.isFragment = isFragment; | |
| 3878 | -exports.isLazy = isLazy; | |
| 3879 | -exports.isMemo = isMemo; | |
| 3880 | -exports.isPortal = isPortal; | |
| 3881 | -exports.isProfiler = isProfiler; | |
| 3882 | -exports.isStrictMode = isStrictMode; | |
| 3883 | -exports.isSuspense = isSuspense; | |
| 3884 | -exports.isValidElementType = isValidElementType; | |
| 3885 | -exports.typeOf = typeOf; | |
| 3886 | - })(); | |
| 3887 | -} | |
| 3888 | - | |
| 3889 | - | |
| 3890 | -/***/ }), | |
| 3891 | - | |
| 3892 | -/***/ "../node_modules/prop-types/node_modules/react-is/index.js": | |
| 3893 | -/*!*****************************************************************!*\ | |
| 3894 | - !*** ../node_modules/prop-types/node_modules/react-is/index.js ***! | |
| 3895 | - \*****************************************************************/ | |
| 3896 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 3897 | - | |
| 3898 | -"use strict"; | |
| 3899 | - | |
| 3900 | - | |
| 3901 | -if (false) // removed by dead control flow | |
| 3902 | -{} else { | |
| 3903 | - module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"); | |
| 3904 | -} | |
| 3905 | - | |
| 3906 | - | |
| 3907 | -/***/ }), | |
| 3908 | - | |
| 3909 | -/***/ "../node_modules/react-dom/client.js": | |
| 3910 | -/*!*******************************************!*\ | |
| 3911 | - !*** ../node_modules/react-dom/client.js ***! | |
| 3912 | - \*******************************************/ | |
| 3913 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3914 | - | |
| 3915 | -"use strict"; | |
| 3916 | - | |
| 3917 | - | |
| 3918 | -var m = __webpack_require__(/*! react-dom */ "react-dom"); | |
| 3919 | -if (false) // removed by dead control flow | |
| 3920 | -{} else { | |
| 3921 | - var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | |
| 3922 | - exports.createRoot = function(c, o) { | |
| 3923 | - i.usingClientEntryPoint = true; | |
| 3924 | - try { | |
| 3925 | - return m.createRoot(c, o); | |
| 3926 | - } finally { | |
| 3927 | - i.usingClientEntryPoint = false; | |
| 3928 | - } | |
| 3929 | - }; | |
| 3930 | - exports.hydrateRoot = function(c, h, o) { | |
| 3931 | - i.usingClientEntryPoint = true; | |
| 3932 | - try { | |
| 3933 | - return m.hydrateRoot(c, h, o); | |
| 3934 | - } finally { | |
| 3935 | - i.usingClientEntryPoint = false; | |
| 3936 | - } | |
| 3937 | - }; | |
| 3938 | -} | |
| 3939 | - | |
| 3940 | - | |
| 3941 | -/***/ }), | |
| 3942 | - | |
| 3943 | -/***/ "@elementor/icons": | |
| 3944 | -/*!************************************!*\ | |
| 3945 | - !*** external "elementorV2.icons" ***! | |
| 3946 | - \************************************/ | |
| 3947 | -/***/ ((module) => { | |
| 3948 | - | |
| 3949 | -"use strict"; | |
| 3950 | -module.exports = elementorV2.icons; | |
| 3951 | - | |
| 3952 | -/***/ }), | |
| 3953 | - | |
| 3954 | -/***/ "@elementor/ui": | |
| 3955 | -/*!*********************************!*\ | |
| 3956 | - !*** external "elementorV2.ui" ***! | |
| 3957 | - \*********************************/ | |
| 3958 | -/***/ ((module) => { | |
| 3959 | - | |
| 3960 | -"use strict"; | |
| 3961 | -module.exports = elementorV2.ui; | |
| 3962 | - | |
| 3963 | -/***/ }), | |
| 3964 | - | |
| 3965 | -/***/ "@elementor/ui/DialogHeader": | |
| 3966 | -/*!*************************************************!*\ | |
| 3967 | - !*** external "elementorV2.ui['DialogHeader']" ***! | |
| 3968 | - \*************************************************/ | |
| 3969 | -/***/ ((module) => { | |
| 3970 | - | |
| 3971 | -"use strict"; | |
| 3972 | -module.exports = elementorV2.ui['DialogHeader']; | |
| 3973 | - | |
| 3974 | -/***/ }), | |
| 3975 | - | |
| 3976 | -/***/ "@elementor/ui/DialogHeaderGroup": | |
| 3977 | -/*!******************************************************!*\ | |
| 3978 | - !*** external "elementorV2.ui['DialogHeaderGroup']" ***! | |
| 3979 | - \******************************************************/ | |
| 3980 | -/***/ ((module) => { | |
| 3981 | - | |
| 3982 | -"use strict"; | |
| 3983 | -module.exports = elementorV2.ui['DialogHeaderGroup']; | |
| 3984 | - | |
| 3985 | -/***/ }), | |
| 3986 | - | |
| 3987 | -/***/ "@wordpress/i18n": | |
| 3988 | -/*!**************************!*\ | |
| 3989 | - !*** external "wp.i18n" ***! | |
| 3990 | - \**************************/ | |
| 3991 | -/***/ ((module) => { | |
| 3992 | - | |
| 3993 | -"use strict"; | |
| 3994 | -module.exports = wp.i18n; | |
| 3995 | - | |
| 3996 | -/***/ }), | |
| 3997 | - | |
| 3998 | -/***/ "react": | |
| 3999 | -/*!************************!*\ | |
| 4000 | - !*** external "React" ***! | |
| 4001 | - \************************/ | |
| 4002 | -/***/ ((module) => { | |
| 4003 | - | |
| 4004 | -"use strict"; | |
| 4005 | -module.exports = React; | |
| 4006 | - | |
| 4007 | -/***/ }), | |
| 4008 | - | |
| 4009 | -/***/ "react-dom": | |
| 4010 | -/*!***************************!*\ | |
| 4011 | - !*** external "ReactDOM" ***! | |
| 4012 | - \***************************/ | |
| 4013 | -/***/ ((module) => { | |
| 4014 | - | |
| 4015 | -"use strict"; | |
| 4016 | -module.exports = ReactDOM; | |
| 4017 | - | |
| 4018 | -/***/ }) | |
| 4019 | - | |
| 4020 | -/******/ }); | |
| 4021 | -/************************************************************************/ | |
| 4022 | -/******/ // The module cache | |
| 4023 | -/******/ var __webpack_module_cache__ = {}; | |
| 4024 | -/******/ | |
| 4025 | -/******/ // The require function | |
| 4026 | -/******/ function __webpack_require__(moduleId) { | |
| 4027 | -/******/ // Check if module is in cache | |
| 4028 | -/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 4029 | -/******/ if (cachedModule !== undefined) { | |
| 4030 | -/******/ return cachedModule.exports; | |
| 4031 | -/******/ } | |
| 4032 | -/******/ // Create a new module (and put it into the cache) | |
| 4033 | -/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 4034 | -/******/ // no module.id needed | |
| 4035 | -/******/ // no module.loaded needed | |
| 4036 | -/******/ exports: {} | |
| 4037 | -/******/ }; | |
| 4038 | -/******/ | |
| 4039 | -/******/ // Execute the module function | |
| 4040 | -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 4041 | -/******/ | |
| 4042 | -/******/ // Return the exports of the module | |
| 4043 | -/******/ return module.exports; | |
| 4044 | -/******/ } | |
| 4045 | -/******/ | |
| 4046 | -/************************************************************************/ | |
| 4047 | -var __webpack_exports__ = {}; | |
| 4048 | -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. | |
| 4049 | -(() => { | |
| 4050 | -"use strict"; | |
| 4051 | -/*!*************************************************************!*\ | |
| 4052 | - !*** ../modules/atomic-opt-in/assets/js/opt-in-page/app.js ***! | |
| 4053 | - \*************************************************************/ | |
| 4054 | -/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 4055 | - | |
| 4056 | - | |
| 4057 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4058 | -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 4059 | -var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js")); | |
| 4060 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 4061 | -var _optIn = __webpack_require__(/*! ./opt-in */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in.js"); | |
| 4062 | -var App = function App(props) { | |
| 4063 | - return /*#__PURE__*/_react.default.createElement(_ui.DirectionProvider, { | |
| 4064 | - rtl: props.isRTL | |
| 4065 | - }, /*#__PURE__*/_react.default.createElement(_ui.LocalizationProvider, null, /*#__PURE__*/_react.default.createElement(_ui.ThemeProvider, { | |
| 4066 | - colorScheme: 'light' | |
| 4067 | - }, /*#__PURE__*/_react.default.createElement(_optIn.OptIn, { | |
| 4068 | - state: props === null || props === void 0 ? void 0 : props.state | |
| 4069 | - })))); | |
| 4070 | -}; | |
| 4071 | -App.propTypes = { | |
| 4072 | - isRTL: PropTypes.bool, | |
| 4073 | - state: PropTypes.object | |
| 4074 | -}; | |
| 4075 | -var init = function init() { | |
| 4076 | - var rootElement = document.querySelector('#page-editor-v4-opt-in'); | |
| 4077 | - if (!rootElement) { | |
| 4078 | - return; | |
| 4079 | - } | |
| 4080 | - _react2.default.render(/*#__PURE__*/_react.default.createElement(App, { | |
| 4081 | - isRTL: !!elementorCommon.config.isRTL, | |
| 4082 | - state: elementorSettingsEditor4OptIn | |
| 4083 | - }), rootElement); | |
| 4084 | -}; | |
| 4085 | -init(); | |
| 4086 | -})(); | |
| 4087 | - | |
| 4088 | -/******/ })() | |
| 4089 | -; | |
| 3429 | +//#endregion | |
| 3430 | +})(React, ReactDOM, elementorV2.ui, wp.i18n, elementorV2.icons, elementorV2.ui['DialogHeaderGroup'], elementorV2.ui['DialogHeader']); | |
| 4090 | 3431 | //# sourceMappingURL=editor-v4-opt-in.js.map |