PluginProbe
Elementor Website Builder – more than just a page builder / 4.0.2
Elementor Website Builder – more than just a page builder v4.0.2
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / assets / js / editor-v4-opt-in.js

editor-v4-opt-in.js in Elementor Website Builder – more than just a page builder 4.0.2, at assets/js/editor-v4-opt-in.js

4,089 lines 166.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "../assets/dev/js/utils/react.js":
5 /*!***************************************!*\
6 !*** ../assets/dev/js/utils/react.js ***!
7 \***************************************/
8 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9
10 "use strict";
11
12
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 };
54
55 /***/ }),
56
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__) => {
62
63 "use strict";
64
65
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 }();
105
106 /***/ }),
107
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__) => {
113
114 "use strict";
115 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
116
117
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 };
192
193 /***/ }),
194
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__) => {
200
201 "use strict";
202
203
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 };
234
235 /***/ }),
236
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__) => {
242
243 "use strict";
244 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
245
246
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 };
298
299 /***/ }),
300
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__) => {
306
307 "use strict";
308 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
309
310
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 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'),
334 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')],
335 activateButton: (0, _i18n.__)('Activate', 'elementor'),
336 cancelButton: (0, _i18n.__)('Cancel', 'elementor')
337 },
338 optOut: {
339 titleText: (0, _i18n.__)('You\'re about to lose all content created with Atomic features', 'elementor'),
340 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')],
341 activateButton: (0, _i18n.__)('Deactivate', 'elementor'),
342 cancelButton: (0, _i18n.__)('Cancel', 'elementor')
343 }
344 };
345 var Terms = exports.Terms = function Terms(_ref) {
346 var onClose = _ref.onClose,
347 onSubmit = _ref.onSubmit,
348 isEnrolled = _ref.isEnrolled,
349 props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
350 var _useState = (0, _react.useState)(false),
351 _useState2 = (0, _slicedToArray2.default)(_useState, 2),
352 checked = _useState2[0],
353 setChecked = _useState2[1];
354 var handleCheckboxChange = function handleCheckboxChange() {
355 setChecked(function (prev) {
356 return !prev;
357 });
358 };
359 var handleSubmit = function handleSubmit() {
360 if (checked) {
361 onSubmit();
362 }
363 };
364 var currentState = isEnrolled ? 'optOut' : 'optIn';
365 return /*#__PURE__*/_react.default.createElement(_ui.Dialog, (0, _extends2.default)({}, props, {
366 open: true,
367 onClose: onClose,
368 maxWidth: "md"
369 }), /*#__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, {
370 dividers: true
371 }, /*#__PURE__*/_react.default.createElement(_ui.Stack, {
372 gap: 2.5
373 }, /*#__PURE__*/_react.default.createElement(_ui.Stack, {
374 gap: 1.5,
375 sx: {
376 mx: 2,
377 maxWidth: '550px'
378 }
379 }, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, {
380 align: "center",
381 variant: "h6"
382 }, i18n[currentState].titleText), i18n[currentState].introText && /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, {
383 align: "center",
384 variant: "body3"
385 }, i18n[currentState].introText)), /*#__PURE__*/_react.default.createElement(_ui.Stack, null, /*#__PURE__*/_react.default.createElement(_optInContent.ContentList, {
386 sx: {
387 mx: 3,
388 maxWidth: '550px'
389 }
390 }, i18n[currentState].details.map(function (entry, index) {
391 return /*#__PURE__*/_react.default.createElement(_optInContent.ContentListItem, {
392 key: index,
393 variant: "body3"
394 }, entry);
395 }))), /*#__PURE__*/_react.default.createElement(_ui.FormControlLabel, {
396 control: /*#__PURE__*/_react.default.createElement(_ui.Checkbox, {
397 checked: !!checked,
398 onChange: handleCheckboxChange,
399 color: "secondary",
400 size: "small"
401 }),
402 label: /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, {
403 variant: "body2"
404 }, i18n.checkboxText)
405 }))), /*#__PURE__*/_react.default.createElement(_ui.DialogActions, null, /*#__PURE__*/_react.default.createElement(_ui.Button, {
406 variant: "text",
407 color: "secondary",
408 onClick: onClose
409 }, i18n[currentState].cancelButton), /*#__PURE__*/_react.default.createElement(_ui.Button, {
410 disabled: !checked,
411 variant: "contained",
412 onClick: handleSubmit
413 }, i18n[currentState].activateButton)));
414 };
415 Terms.propTypes = {
416 onClose: PropTypes.func,
417 onSubmit: PropTypes.func,
418 isEnrolled: PropTypes.bool
419 };
420
421 /***/ }),
422
423 /***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in.js":
424 /*!****************************************************************!*\
425 !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in.js ***!
426 \****************************************************************/
427 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
428
429 "use strict";
430 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
431
432
433 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
434 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
435 Object.defineProperty(exports, "__esModule", ({
436 value: true
437 }));
438 exports.OptIn = void 0;
439 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
440 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
441 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
442 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
443 var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
444 var _optInContent = __webpack_require__(/*! ./opt-in-content */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js");
445 var _optInImgPlaceholders = __webpack_require__(/*! ./opt-in-img-placeholders */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-img-placeholders.js");
446 var _optInMessage = __webpack_require__(/*! ./opt-in-message */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-message.js");
447 var _optInApi = __webpack_require__(/*! ./opt-in-api */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-api.js");
448 var _dompurify = _interopRequireDefault(__webpack_require__(/*! dompurify */ "../node_modules/dompurify/dist/purify.cjs.js"));
449 var _optInTerms = __webpack_require__(/*! ./opt-in-terms */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-terms.js");
450 var _elementorSettingsEdi;
451 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); }
452 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; }
453 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; }
454 var decodeHtmlUrl = function decodeHtmlUrl(html) {
455 var textarea = document.createElement('textarea');
456 textarea.innerHTML = html;
457 return textarea.value;
458 };
459 var OPT_IN_MSG = 'e-editor-v4-opt-in-message';
460 var OPT_OUT_MSG = 'e-editor-v4-opt-out-message';
461 var i18n = {
462 title: (0, _i18n.__)('Activate Atomic Editor features', 'elementor'),
463 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'),
464 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')]],
465 andMore: (0, _i18n.__)('And much more!', 'elementor'),
466 readMore: (0, _i18n.__)('Learn more', 'elementor'),
467 feedback: (0, _i18n.__)('We’d love your feedback!', 'elementor'),
468 overToGithub: (0, _i18n.__)('Head over to Github', 'elementor'),
469 tellUsWhy: (0, _i18n.__)('Tell us why', 'elementor'),
470 image: (0, _i18n.__)('Editor V4', 'elementor'),
471 buttons: {
472 tryOut: (0, _i18n.__)('Try out the new experience', 'elementor'),
473 optIn: (0, _i18n.__)('Activate the new experience', 'elementor'),
474 optOut: (0, _i18n.__)('Deactivate', 'elementor')
475 },
476 messages: {
477 optInSuccess: (0, _i18n.__)('Welcome! You’ve got the newest version of the editor.', 'elementor'),
478 optOut: (0, _i18n.__)('You’ve deactivated the new Editor. Have feedback?', 'elementor'),
479 error: (0, _i18n.__)('Ouch, there was a glitch. Try activating again soon.', 'elementor')
480 }
481 };
482 var optInLinks = {
483 feedbackUrl: 'https://go.elementor.com/wp-dash-opt-in-v4-feedback/',
484 readMoreUrl: 'https://go.elementor.com/wp-dash-opt-in-v4-help-center/',
485 tryOutUrl: _dompurify.default.sanitize(decodeHtmlUrl((_elementorSettingsEdi = elementorSettingsEditor4OptIn) === null || _elementorSettingsEdi === void 0 || (_elementorSettingsEdi = _elementorSettingsEdi.urls) === null || _elementorSettingsEdi === void 0 ? void 0 : _elementorSettingsEdi.start_building)) || '#'
486 };
487 var optInImages = {
488 square: {
489 src: 'https://assets.elementor.com/v4-promotion/v1/images/v4_opt_in_500.png',
490 sx: {
491 width: '100%',
492 maxHeight: '507px',
493 maxWidth: 'sm',
494 height: 'auto',
495 mx: 'auto',
496 borderRadius: 2
497 }
498 },
499 landscape: {
500 src: 'https://assets.elementor.com/v4-promotion/v1/images/v4_opt_in_260.png',
501 sx: {
502 width: '100%',
503 height: 'auto',
504 maxHeight: '260px',
505 mx: 'auto',
506 maxWidth: 'sm',
507 borderRadius: 2
508 }
509 }
510 };
511 var OptIn = exports.OptIn = function OptIn(_ref) {
512 var _state$features;
513 var state = _ref.state;
514 var _useState = (0, _react.useState)(false),
515 _useState2 = (0, _slicedToArray2.default)(_useState, 2),
516 showTerms = _useState2[0],
517 setShowTerms = _useState2[1];
518 var _useState3 = (0, _react.useState)(''),
519 _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
520 optInMessage = _useState4[0],
521 setOptInMessage = _useState4[1];
522 var _useState5 = (0, _react.useState)(''),
523 _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
524 optOutMessage = _useState6[0],
525 setOptOutMessage = _useState6[1];
526 var _useState7 = (0, _react.useState)(''),
527 _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
528 errorMessage = _useState8[0],
529 setErrorMessage = _useState8[1];
530 (0, _react.useEffect)(function () {
531 var optInMsg = sessionStorage.getItem(OPT_IN_MSG);
532 var optOutMsg = sessionStorage.getItem(OPT_OUT_MSG);
533 if (optInMsg) {
534 setTimeout(function () {
535 setOptInMessage(optInMsg);
536 }, 100);
537 sessionStorage.removeItem(OPT_IN_MSG);
538 }
539 if (optOutMsg) {
540 setTimeout(function () {
541 setOptOutMessage(optOutMsg);
542 }, 100);
543 sessionStorage.removeItem(OPT_OUT_MSG);
544 }
545 }, []);
546 var maybeOptIn = function maybeOptIn() {
547 (0, _optInApi.triggerOptIn)().then(function () {
548 sessionStorage.setItem(OPT_IN_MSG, i18n.messages.optInSuccess);
549 window.location.reload();
550 }).catch(function () {
551 setErrorMessage(i18n.messages.error);
552 });
553 };
554 var maybeOptOut = function maybeOptOut() {
555 (0, _optInApi.triggerOptOut)().then(function () {
556 sessionStorage.setItem(OPT_OUT_MSG, i18n.messages.optOut);
557 window.location.reload();
558 }).catch(function () {
559 setErrorMessage(i18n.messages.error);
560 });
561 };
562 var handlePopoverClose = function handlePopoverClose() {
563 setShowTerms(false);
564 };
565 var isEnrolled = !!(state !== null && state !== void 0 && (_state$features = state.features) !== null && _state$features !== void 0 && _state$features.editor_v4);
566 return /*#__PURE__*/_react.default.createElement(_ui.Container, {
567 maxWidth: "xl",
568 sx: {
569 marginBlockStart: 2.5,
570 display: 'flex',
571 flexBasis: '100%',
572 gap: 3,
573 flexDirection: {
574 xs: 'column-reverse',
575 md: 'row'
576 }
577 }
578 }, /*#__PURE__*/_react.default.createElement(_ui.Stack, {
579 sx: {
580 flex: 1,
581 maxWidth: {
582 md: '580px',
583 sm: '600px'
584 },
585 gap: 2.5,
586 mx: 'auto'
587 }
588 }, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, {
589 variant: "h4",
590 width: "fit-content"
591 }, /*#__PURE__*/_react.default.createElement("span", null, i18n.title)), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
592 direction: "column",
593 gap: 1
594 }, /*#__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, {
595 sx: {
596 gap: 0.5
597 }
598 }, i18n.advantages.map(function (entry, i) {
599 return /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesListItem, {
600 key: i
601 }, /*#__PURE__*/_react.default.createElement("b", null, entry[0]), " - ", entry[1]);
602 }), /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesListItem, {
603 key: i18n.advantages.length
604 }, i18n.andMore, " ", /*#__PURE__*/_react.default.createElement(_ui.Link, {
605 color: "text.primary",
606 href: optInLinks.readMoreUrl,
607 target: "_blank"
608 }, i18n.readMore))))), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
609 direction: "column",
610 width: "clamp(240px, max(340px, 75%), 340px)",
611 maxWidth: "100%",
612 gap: 2
613 }, !isEnrolled ? /*#__PURE__*/_react.default.createElement(_ui.Button, {
614 onClick: function onClick() {
615 setShowTerms(true);
616 },
617 size: "large",
618 color: "primary",
619 variant: "contained",
620 sx: {
621 flexGrow: 1
622 }
623 }, i18n.buttons.optIn) : /*#__PURE__*/_react.default.createElement(_ui.Button, {
624 onClick: function onClick() {
625 return window.location.href = optInLinks.tryOutUrl;
626 },
627 size: "large",
628 color: "primary",
629 variant: "contained",
630 sx: {
631 flexGrow: 1
632 }
633 }, i18n.buttons.tryOut), /*#__PURE__*/_react.default.createElement(_ui.Button, {
634 onClick: function onClick() {
635 setShowTerms(true);
636 },
637 size: "large",
638 color: "secondary",
639 variant: "outlined",
640 sx: {
641 flexGrow: 1,
642 visibility: isEnrolled ? 'visible' : 'hidden'
643 }
644 }, i18n.buttons.optOut)), /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, null, i18n.feedback, " ", /*#__PURE__*/_react.default.createElement(_ui.Link, {
645 underline: "hover",
646 href: optInLinks.feedbackUrl,
647 target: "_blank"
648 }, i18n.overToGithub))), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
649 sx: {
650 flex: 1,
651 px: 0,
652 maxWidth: {
653 md: '507px',
654 sm: '600px'
655 },
656 mx: 'auto'
657 }
658 }, optInImages.square.src ? /*#__PURE__*/_react.default.createElement(_ui.Image, {
659 src: optInImages.square.src,
660 alt: i18n.image,
661 sx: _objectSpread(_objectSpread({}, optInImages.square.sx), {}, {
662 display: {
663 xs: 'none',
664 md: 'block'
665 }
666 })
667 }) : /*#__PURE__*/_react.default.createElement(_optInImgPlaceholders.ImageSquarePlaceholder, {
668 sx: _objectSpread(_objectSpread({}, optInImages.square.sx), {}, {
669 display: {
670 xs: 'none',
671 md: 'block'
672 }
673 })
674 }), optInImages.landscape.src ? /*#__PURE__*/_react.default.createElement(_ui.Image, {
675 src: optInImages.landscape.src,
676 alt: i18n.image,
677 sx: _objectSpread(_objectSpread({}, optInImages.landscape.sx), {}, {
678 display: {
679 xs: 'block',
680 md: 'none'
681 }
682 })
683 }) : /*#__PURE__*/_react.default.createElement(_optInImgPlaceholders.ImageLandscapePlaceholder, {
684 sx: _objectSpread(_objectSpread({}, optInImages.landscape.sx), {}, {
685 display: {
686 xs: 'block',
687 md: 'none'
688 }
689 })
690 })), showTerms && /*#__PURE__*/_react.default.createElement(_optInTerms.Terms, {
691 onClose: handlePopoverClose,
692 onSubmit: isEnrolled ? maybeOptOut : maybeOptIn,
693 isEnrolled: isEnrolled
694 }), optInMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, {
695 onClose: function onClose() {
696 return setOptInMessage('');
697 },
698 action: /*#__PURE__*/_react.default.createElement(_ui.Link, {
699 href: optInLinks.tryOutUrl,
700 color: "#FFFFFF",
701 sx: {
702 cursor: 'pointer',
703 textDecoration: 'none',
704 pl: 3
705 }
706 }, i18n.buttons.tryOut)
707 }, optInMessage), optOutMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, {
708 onClose: function onClose() {
709 return setOptOutMessage('');
710 },
711 action: /*#__PURE__*/_react.default.createElement(_ui.Link, {
712 href: optInLinks.feedbackUrl,
713 target: "_blank",
714 color: "#FFFFFF",
715 sx: {
716 cursor: 'pointer',
717 textDecoration: 'none',
718 pl: 3
719 }
720 }, i18n.tellUsWhy)
721 }, optOutMessage), errorMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, {
722 severity: "error",
723 onClose: function onClose() {
724 return setErrorMessage('');
725 }
726 }, errorMessage));
727 };
728 OptIn.propTypes = {
729 state: PropTypes.shape({
730 features: PropTypes.shape({
731 editor_v4: PropTypes.bool
732 })
733 }).isRequired
734 };
735
736 /***/ }),
737
738 /***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js":
739 /*!***************************************************************!*\
740 !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***!
741 \***************************************************************/
742 /***/ ((module) => {
743
744 function _OverloadYield(e, d) {
745 this.v = e, this.k = d;
746 }
747 module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
748
749 /***/ }),
750
751 /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
752 /*!******************************************************************!*\
753 !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
754 \******************************************************************/
755 /***/ ((module) => {
756
757 function _arrayLikeToArray(r, a) {
758 (null == a || a > r.length) && (a = r.length);
759 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
760 return n;
761 }
762 module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
763
764 /***/ }),
765
766 /***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js":
767 /*!****************************************************************!*\
768 !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
769 \****************************************************************/
770 /***/ ((module) => {
771
772 function _arrayWithHoles(r) {
773 if (Array.isArray(r)) return r;
774 }
775 module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
776
777 /***/ }),
778
779 /***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
780 /*!******************************************************************!*\
781 !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
782 \******************************************************************/
783 /***/ ((module) => {
784
785 function asyncGeneratorStep(n, t, e, r, o, a, c) {
786 try {
787 var i = n[a](c),
788 u = i.value;
789 } catch (n) {
790 return void e(n);
791 }
792 i.done ? t(u) : Promise.resolve(u).then(r, o);
793 }
794 function _asyncToGenerator(n) {
795 return function () {
796 var t = this,
797 e = arguments;
798 return new Promise(function (r, o) {
799 var a = n.apply(t, e);
800 function _next(n) {
801 asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
802 }
803 function _throw(n) {
804 asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
805 }
806 _next(void 0);
807 });
808 };
809 }
810 module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
811
812 /***/ }),
813
814 /***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
815 /*!****************************************************************!*\
816 !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
817 \****************************************************************/
818 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
819
820 var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
821 function _defineProperty(e, r, t) {
822 return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
823 value: t,
824 enumerable: !0,
825 configurable: !0,
826 writable: !0
827 }) : e[r] = t, e;
828 }
829 module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
830
831 /***/ }),
832
833 /***/ "../node_modules/@babel/runtime/helpers/extends.js":
834 /*!*********************************************************!*\
835 !*** ../node_modules/@babel/runtime/helpers/extends.js ***!
836 \*********************************************************/
837 /***/ ((module) => {
838
839 function _extends() {
840 return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {
841 for (var e = 1; e < arguments.length; e++) {
842 var t = arguments[e];
843 for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
844 }
845 return n;
846 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments);
847 }
848 module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
849
850 /***/ }),
851
852 /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
853 /*!***********************************************************************!*\
854 !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
855 \***********************************************************************/
856 /***/ ((module) => {
857
858 function _interopRequireDefault(e) {
859 return e && e.__esModule ? e : {
860 "default": e
861 };
862 }
863 module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
864
865 /***/ }),
866
867 /***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
868 /*!**********************************************************************!*\
869 !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
870 \**********************************************************************/
871 /***/ ((module) => {
872
873 function _iterableToArrayLimit(r, l) {
874 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
875 if (null != t) {
876 var e,
877 n,
878 i,
879 u,
880 a = [],
881 f = !0,
882 o = !1;
883 try {
884 if (i = (t = t.call(r)).next, 0 === l) {
885 if (Object(t) !== t) return;
886 f = !1;
887 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
888 } catch (r) {
889 o = !0, n = r;
890 } finally {
891 try {
892 if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
893 } finally {
894 if (o) throw n;
895 }
896 }
897 return a;
898 }
899 }
900 module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
901
902 /***/ }),
903
904 /***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js":
905 /*!*****************************************************************!*\
906 !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
907 \*****************************************************************/
908 /***/ ((module) => {
909
910 function _nonIterableRest() {
911 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
912 }
913 module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
914
915 /***/ }),
916
917 /***/ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js":
918 /*!*************************************************************************!*\
919 !*** ../node_modules/@babel/runtime/helpers/objectWithoutProperties.js ***!
920 \*************************************************************************/
921 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
922
923 var objectWithoutPropertiesLoose = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js");
924 function _objectWithoutProperties(e, t) {
925 if (null == e) return {};
926 var o,
927 r,
928 i = objectWithoutPropertiesLoose(e, t);
929 if (Object.getOwnPropertySymbols) {
930 var n = Object.getOwnPropertySymbols(e);
931 for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
932 }
933 return i;
934 }
935 module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
936
937 /***/ }),
938
939 /***/ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":
940 /*!******************************************************************************!*\
941 !*** ../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***!
942 \******************************************************************************/
943 /***/ ((module) => {
944
945 function _objectWithoutPropertiesLoose(r, e) {
946 if (null == r) return {};
947 var t = {};
948 for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
949 if (-1 !== e.indexOf(n)) continue;
950 t[n] = r[n];
951 }
952 return t;
953 }
954 module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
955
956 /***/ }),
957
958 /***/ "../node_modules/@babel/runtime/helpers/regenerator.js":
959 /*!*************************************************************!*\
960 !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***!
961 \*************************************************************/
962 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
963
964 var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
965 function _regenerator() {
966 /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
967 var e,
968 t,
969 r = "function" == typeof Symbol ? Symbol : {},
970 n = r.iterator || "@@iterator",
971 o = r.toStringTag || "@@toStringTag";
972 function i(r, n, o, i) {
973 var c = n && n.prototype instanceof Generator ? n : Generator,
974 u = Object.create(c.prototype);
975 return regeneratorDefine(u, "_invoke", function (r, n, o) {
976 var i,
977 c,
978 u,
979 f = 0,
980 p = o || [],
981 y = !1,
982 G = {
983 p: 0,
984 n: 0,
985 v: e,
986 a: d,
987 f: d.bind(e, 4),
988 d: function d(t, r) {
989 return i = t, c = 0, u = e, G.n = r, a;
990 }
991 };
992 function d(r, n) {
993 for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
994 var o,
995 i = p[t],
996 d = G.p,
997 l = i[2];
998 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));
999 }
1000 if (o || r > 1) return a;
1001 throw y = !0, n;
1002 }
1003 return function (o, p, l) {
1004 if (f > 1) throw TypeError("Generator is already running");
1005 for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
1006 i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
1007 try {
1008 if (f = 2, i) {
1009 if (c || (o = "next"), t = i[o]) {
1010 if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
1011 if (!t.done) return t;
1012 u = t.value, c < 2 && (c = 0);
1013 } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
1014 i = e;
1015 } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
1016 } catch (t) {
1017 i = e, c = 1, u = t;
1018 } finally {
1019 f = 1;
1020 }
1021 }
1022 return {
1023 value: t,
1024 done: y
1025 };
1026 };
1027 }(r, o, i), !0), u;
1028 }
1029 var a = {};
1030 function Generator() {}
1031 function GeneratorFunction() {}
1032 function GeneratorFunctionPrototype() {}
1033 t = Object.getPrototypeOf;
1034 var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
1035 return this;
1036 }), t),
1037 u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
1038 function f(e) {
1039 return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
1040 }
1041 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 () {
1042 return this;
1043 }), regeneratorDefine(u, "toString", function () {
1044 return "[object Generator]";
1045 }), (module.exports = _regenerator = function _regenerator() {
1046 return {
1047 w: i,
1048 m: f
1049 };
1050 }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
1051 }
1052 module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
1053
1054 /***/ }),
1055
1056 /***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js":
1057 /*!******************************************************************!*\
1058 !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
1059 \******************************************************************/
1060 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1061
1062 var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
1063 function _regeneratorAsync(n, e, r, t, o) {
1064 var a = regeneratorAsyncGen(n, e, r, t, o);
1065 return a.next().then(function (n) {
1066 return n.done ? n.value : a.next();
1067 });
1068 }
1069 module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
1070
1071 /***/ }),
1072
1073 /***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js":
1074 /*!*********************************************************************!*\
1075 !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
1076 \*********************************************************************/
1077 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1078
1079 var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
1080 var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
1081 function _regeneratorAsyncGen(r, e, t, o, n) {
1082 return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
1083 }
1084 module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
1085
1086 /***/ }),
1087
1088 /***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js":
1089 /*!**************************************************************************!*\
1090 !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
1091 \**************************************************************************/
1092 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1093
1094 var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
1095 var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
1096 function AsyncIterator(t, e) {
1097 function n(r, o, i, f) {
1098 try {
1099 var c = t[r](o),
1100 u = c.value;
1101 return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
1102 n("next", t, i, f);
1103 }, function (t) {
1104 n("throw", t, i, f);
1105 }) : e.resolve(u).then(function (t) {
1106 c.value = t, i(c);
1107 }, function (t) {
1108 return n("throw", t, i, f);
1109 });
1110 } catch (t) {
1111 f(t);
1112 }
1113 }
1114 var r;
1115 this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
1116 return this;
1117 })), regeneratorDefine(this, "_invoke", function (t, o, i) {
1118 function f() {
1119 return new e(function (e, r) {
1120 n(t, i, e, r);
1121 });
1122 }
1123 return r = r ? r.then(f, f) : f();
1124 }, !0);
1125 }
1126 module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
1127
1128 /***/ }),
1129
1130 /***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js":
1131 /*!*******************************************************************!*\
1132 !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
1133 \*******************************************************************/
1134 /***/ ((module) => {
1135
1136 function _regeneratorDefine(e, r, n, t) {
1137 var i = Object.defineProperty;
1138 try {
1139 i({}, "", {});
1140 } catch (e) {
1141 i = 0;
1142 }
1143 module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
1144 function o(r, n) {
1145 _regeneratorDefine(e, r, function (e) {
1146 return this._invoke(r, n, e);
1147 });
1148 }
1149 r ? i ? i(e, r, {
1150 value: n,
1151 enumerable: !t,
1152 configurable: !t,
1153 writable: !t
1154 }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
1155 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
1156 }
1157 module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
1158
1159 /***/ }),
1160
1161 /***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js":
1162 /*!*****************************************************************!*\
1163 !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
1164 \*****************************************************************/
1165 /***/ ((module) => {
1166
1167 function _regeneratorKeys(e) {
1168 var n = Object(e),
1169 r = [];
1170 for (var t in n) r.unshift(t);
1171 return function e() {
1172 for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
1173 return e.done = !0, e;
1174 };
1175 }
1176 module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
1177
1178 /***/ }),
1179
1180 /***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
1181 /*!********************************************************************!*\
1182 !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
1183 \********************************************************************/
1184 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1185
1186 var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
1187 var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
1188 var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js");
1189 var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
1190 var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
1191 var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js");
1192 var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js");
1193 function _regeneratorRuntime() {
1194 "use strict";
1195
1196 var r = regenerator(),
1197 e = r.m(_regeneratorRuntime),
1198 t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
1199 function n(r) {
1200 var e = "function" == typeof r && r.constructor;
1201 return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
1202 }
1203 var o = {
1204 "throw": 1,
1205 "return": 2,
1206 "break": 3,
1207 "continue": 3
1208 };
1209 function a(r) {
1210 var e, t;
1211 return function (n) {
1212 e || (e = {
1213 stop: function stop() {
1214 return t(n.a, 2);
1215 },
1216 "catch": function _catch() {
1217 return n.v;
1218 },
1219 abrupt: function abrupt(r, e) {
1220 return t(n.a, o[r], e);
1221 },
1222 delegateYield: function delegateYield(r, o, a) {
1223 return e.resultName = o, t(n.d, regeneratorValues(r), a);
1224 },
1225 finish: function finish(r) {
1226 return t(n.f, r);
1227 }
1228 }, t = function t(r, _t, o) {
1229 n.p = e.prev, n.n = e.next;
1230 try {
1231 return r(_t, o);
1232 } finally {
1233 e.next = n.n;
1234 }
1235 }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
1236 try {
1237 return r.call(this, e);
1238 } finally {
1239 n.p = e.prev, n.n = e.next;
1240 }
1241 };
1242 }
1243 return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
1244 return {
1245 wrap: function wrap(e, t, n, o) {
1246 return r.w(a(e), t, n, o && o.reverse());
1247 },
1248 isGeneratorFunction: n,
1249 mark: r.m,
1250 awrap: function awrap(r, e) {
1251 return new OverloadYield(r, e);
1252 },
1253 AsyncIterator: regeneratorAsyncIterator,
1254 async: function async(r, e, t, o, u) {
1255 return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
1256 },
1257 keys: regeneratorKeys,
1258 values: regeneratorValues
1259 };
1260 }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
1261 }
1262 module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
1263
1264 /***/ }),
1265
1266 /***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js":
1267 /*!*******************************************************************!*\
1268 !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
1269 \*******************************************************************/
1270 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1271
1272 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
1273 function _regeneratorValues(e) {
1274 if (null != e) {
1275 var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
1276 r = 0;
1277 if (t) return t.call(e);
1278 if ("function" == typeof e.next) return e;
1279 if (!isNaN(e.length)) return {
1280 next: function next() {
1281 return e && r >= e.length && (e = void 0), {
1282 value: e && e[r++],
1283 done: !e
1284 };
1285 }
1286 };
1287 }
1288 throw new TypeError(_typeof(e) + " is not iterable");
1289 }
1290 module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
1291
1292 /***/ }),
1293
1294 /***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js":
1295 /*!***************************************************************!*\
1296 !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
1297 \***************************************************************/
1298 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1299
1300 var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
1301 var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
1302 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
1303 var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
1304 function _slicedToArray(r, e) {
1305 return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();
1306 }
1307 module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
1308
1309 /***/ }),
1310
1311 /***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
1312 /*!*************************************************************!*\
1313 !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
1314 \*************************************************************/
1315 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1316
1317 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
1318 function toPrimitive(t, r) {
1319 if ("object" != _typeof(t) || !t) return t;
1320 var e = t[Symbol.toPrimitive];
1321 if (void 0 !== e) {
1322 var i = e.call(t, r || "default");
1323 if ("object" != _typeof(i)) return i;
1324 throw new TypeError("@@toPrimitive must return a primitive value.");
1325 }
1326 return ("string" === r ? String : Number)(t);
1327 }
1328 module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
1329
1330 /***/ }),
1331
1332 /***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
1333 /*!***************************************************************!*\
1334 !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
1335 \***************************************************************/
1336 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1337
1338 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
1339 var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
1340 function toPropertyKey(t) {
1341 var i = toPrimitive(t, "string");
1342 return "symbol" == _typeof(i) ? i : i + "";
1343 }
1344 module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
1345
1346 /***/ }),
1347
1348 /***/ "../node_modules/@babel/runtime/helpers/typeof.js":
1349 /*!********************************************************!*\
1350 !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
1351 \********************************************************/
1352 /***/ ((module) => {
1353
1354 function _typeof(o) {
1355 "@babel/helpers - typeof";
1356
1357 return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
1358 return typeof o;
1359 } : function (o) {
1360 return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
1361 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
1362 }
1363 module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
1364
1365 /***/ }),
1366
1367 /***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
1368 /*!****************************************************************************!*\
1369 !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
1370 \****************************************************************************/
1371 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1372
1373 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
1374 function _unsupportedIterableToArray(r, a) {
1375 if (r) {
1376 if ("string" == typeof r) return arrayLikeToArray(r, a);
1377 var t = {}.toString.call(r).slice(8, -1);
1378 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;
1379 }
1380 }
1381 module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
1382
1383 /***/ }),
1384
1385 /***/ "../node_modules/@babel/runtime/regenerator/index.js":
1386 /*!***********************************************************!*\
1387 !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
1388 \***********************************************************/
1389 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1390
1391 // TODO(Babel 8): Remove this file.
1392
1393 var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
1394 module.exports = runtime;
1395
1396 // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
1397 try {
1398 regeneratorRuntime = runtime;
1399 } catch (accidentalStrictMode) {
1400 if (typeof globalThis === "object") {
1401 globalThis.regeneratorRuntime = runtime;
1402 } else {
1403 Function("r", "regeneratorRuntime = r")(runtime);
1404 }
1405 }
1406
1407
1408 /***/ }),
1409
1410 /***/ "../node_modules/dompurify/dist/purify.cjs.js":
1411 /*!****************************************************!*\
1412 !*** ../node_modules/dompurify/dist/purify.cjs.js ***!
1413 \****************************************************/
1414 /***/ ((module) => {
1415
1416 "use strict";
1417 /*! @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 */
1418
1419
1420
1421 const {
1422 entries,
1423 setPrototypeOf,
1424 isFrozen,
1425 getPrototypeOf,
1426 getOwnPropertyDescriptor
1427 } = Object;
1428 let {
1429 freeze,
1430 seal,
1431 create
1432 } = Object; // eslint-disable-line import/no-mutable-exports
1433 let {
1434 apply,
1435 construct
1436 } = typeof Reflect !== 'undefined' && Reflect;
1437 if (!freeze) {
1438 freeze = function freeze(x) {
1439 return x;
1440 };
1441 }
1442 if (!seal) {
1443 seal = function seal(x) {
1444 return x;
1445 };
1446 }
1447 if (!apply) {
1448 apply = function apply(func, thisArg) {
1449 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1450 args[_key - 2] = arguments[_key];
1451 }
1452 return func.apply(thisArg, args);
1453 };
1454 }
1455 if (!construct) {
1456 construct = function construct(Func) {
1457 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1458 args[_key2 - 1] = arguments[_key2];
1459 }
1460 return new Func(...args);
1461 };
1462 }
1463 const arrayForEach = unapply(Array.prototype.forEach);
1464 const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
1465 const arrayPop = unapply(Array.prototype.pop);
1466 const arrayPush = unapply(Array.prototype.push);
1467 const arraySplice = unapply(Array.prototype.splice);
1468 const stringToLowerCase = unapply(String.prototype.toLowerCase);
1469 const stringToString = unapply(String.prototype.toString);
1470 const stringMatch = unapply(String.prototype.match);
1471 const stringReplace = unapply(String.prototype.replace);
1472 const stringIndexOf = unapply(String.prototype.indexOf);
1473 const stringTrim = unapply(String.prototype.trim);
1474 const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
1475 const regExpTest = unapply(RegExp.prototype.test);
1476 const typeErrorCreate = unconstruct(TypeError);
1477 /**
1478 * Creates a new function that calls the given function with a specified thisArg and arguments.
1479 *
1480 * @param func - The function to be wrapped and called.
1481 * @returns A new function that calls the given function with a specified thisArg and arguments.
1482 */
1483 function unapply(func) {
1484 return function (thisArg) {
1485 if (thisArg instanceof RegExp) {
1486 thisArg.lastIndex = 0;
1487 }
1488 for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
1489 args[_key3 - 1] = arguments[_key3];
1490 }
1491 return apply(func, thisArg, args);
1492 };
1493 }
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++) {
1503 args[_key4] = arguments[_key4];
1504 }
1505 return construct(Func, args);
1506 };
1507 }
1508 /**
1509 * Add properties to a lookup table
1510 *
1511 * @param set - The set to which elements will be added.
1512 * @param array - The array containing elements to be added to the set.
1513 * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
1514 * @returns The modified set with added elements.
1515 */
1516 function addToSet(set, array) {
1517 let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
1518 if (setPrototypeOf) {
1519 // Make 'in' and truthy checks like Boolean(set.constructor)
1520 // independent of any properties defined on Object.prototype.
1521 // Prevent prototype setters from intercepting set as a this value.
1522 setPrototypeOf(set, null);
1523 }
1524 let l = array.length;
1525 while (l--) {
1526 let element = array[l];
1527 if (typeof element === 'string') {
1528 const lcElement = transformCaseFunc(element);
1529 if (lcElement !== element) {
1530 // Config presets (e.g. tags.js, attrs.js) are immutable.
1531 if (!isFrozen(array)) {
1532 array[l] = lcElement;
1533 }
1534 element = lcElement;
1535 }
1536 }
1537 set[element] = true;
1538 }
1539 return set;
1540 }
1541 /**
1542 * Clean up an array to harden against CSPP
1543 *
1544 * @param array - The array to be cleaned.
1545 * @returns The cleaned version of the array
1546 */
1547 function cleanArray(array) {
1548 for (let index = 0; index < array.length; index++) {
1549 const isPropertyExist = objectHasOwnProperty(array, index);
1550 if (!isPropertyExist) {
1551 array[index] = null;
1552 }
1553 }
1554 return array;
1555 }
1556 /**
1557 * Shallow clone an object
1558 *
1559 * @param object - The object to be cloned.
1560 * @returns A new object that copies the original.
1561 */
1562 function clone(object) {
1563 const newObject = create(null);
1564 for (const [property, value] of entries(object)) {
1565 const isPropertyExist = objectHasOwnProperty(object, property);
1566 if (isPropertyExist) {
1567 if (Array.isArray(value)) {
1568 newObject[property] = cleanArray(value);
1569 } else if (value && typeof value === 'object' && value.constructor === Object) {
1570 newObject[property] = clone(value);
1571 } else {
1572 newObject[property] = value;
1573 }
1574 }
1575 }
1576 return newObject;
1577 }
1578 /**
1579 * This method automatically checks if the prop is function or getter and behaves accordingly.
1580 *
1581 * @param object - The object to look up the getter function in its prototype chain.
1582 * @param prop - The property name for which to find the getter function.
1583 * @returns The getter function found in the prototype chain or a fallback function.
1584 */
1585 function lookupGetter(object, prop) {
1586 while (object !== null) {
1587 const desc = getOwnPropertyDescriptor(object, prop);
1588 if (desc) {
1589 if (desc.get) {
1590 return unapply(desc.get);
1591 }
1592 if (typeof desc.value === 'function') {
1593 return unapply(desc.value);
1594 }
1595 }
1596 object = getPrototypeOf(object);
1597 }
1598 function fallbackValue() {
1599 return null;
1600 }
1601 return fallbackValue;
1602 }
1603
1604 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']);
1605 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']);
1606 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']);
1607 // List of SVG elements that are disallowed by default.
1608 // We still need to know them so that we can do namespace
1609 // checks properly in case one wants to add them to
1610 // allow-list.
1611 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']);
1612 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']);
1613 // Similarly to SVG, we want to know all MathML elements,
1614 // even those that we disallow by default.
1615 const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
1616 const text = freeze(['#text']);
1617
1618 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']);
1619 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']);
1620 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']);
1621 const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
1622
1623 // eslint-disable-next-line unicorn/better-regex
1624 const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
1625 const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
1626 const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
1627 const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
1628 const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
1629 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
1630 );
1631 const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
1632 const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
1633 );
1634 const DOCTYPE_NAME = seal(/^html$/i);
1635 const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
1636
1637 var EXPRESSIONS = /*#__PURE__*/Object.freeze({
1638 __proto__: null,
1639 ARIA_ATTR: ARIA_ATTR,
1640 ATTR_WHITESPACE: ATTR_WHITESPACE,
1641 CUSTOM_ELEMENT: CUSTOM_ELEMENT,
1642 DATA_ATTR: DATA_ATTR,
1643 DOCTYPE_NAME: DOCTYPE_NAME,
1644 ERB_EXPR: ERB_EXPR,
1645 IS_ALLOWED_URI: IS_ALLOWED_URI,
1646 IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
1647 MUSTACHE_EXPR: MUSTACHE_EXPR,
1648 TMPLIT_EXPR: TMPLIT_EXPR
1649 });
1650
1651 /* eslint-disable @typescript-eslint/indent */
1652 // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
1653 const NODE_TYPE = {
1654 element: 1,
1655 attribute: 2,
1656 text: 3,
1657 cdataSection: 4,
1658 entityReference: 5,
1659 // Deprecated
1660 entityNode: 6,
1661 // Deprecated
1662 progressingInstruction: 7,
1663 comment: 8,
1664 document: 9,
1665 documentType: 10,
1666 documentFragment: 11,
1667 notation: 12 // Deprecated
1668 };
1669 const getGlobal = function getGlobal() {
1670 return typeof window === 'undefined' ? null : window;
1671 };
1672 /**
1673 * Creates a no-op policy for internal use only.
1674 * Don't export this function outside this module!
1675 * @param trustedTypes The policy factory.
1676 * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
1677 * @return The policy created (or null, if Trusted Types
1678 * are not supported or creating the policy failed).
1679 */
1680 const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
1681 if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
1682 return null;
1683 }
1684 // Allow the callers to control the unique policy name
1685 // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
1686 // Policy creation with duplicate names throws in Trusted Types.
1687 let suffix = null;
1688 const ATTR_NAME = 'data-tt-policy-suffix';
1689 if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
1690 suffix = purifyHostElement.getAttribute(ATTR_NAME);
1691 }
1692 const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
1693 try {
1694 return trustedTypes.createPolicy(policyName, {
1695 createHTML(html) {
1696 return html;
1697 },
1698 createScriptURL(scriptUrl) {
1699 return scriptUrl;
1700 }
1701 });
1702 } catch (_) {
1703 // Policy creation failed (most likely another DOMPurify script has
1704 // already run). Skip creating the policy, as this will only cause errors
1705 // if TT are enforced.
1706 console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
1707 return null;
1708 }
1709 };
1710 const _createHooksMap = function _createHooksMap() {
1711 return {
1712 afterSanitizeAttributes: [],
1713 afterSanitizeElements: [],
1714 afterSanitizeShadowDOM: [],
1715 beforeSanitizeAttributes: [],
1716 beforeSanitizeElements: [],
1717 beforeSanitizeShadowDOM: [],
1718 uponSanitizeAttribute: [],
1719 uponSanitizeElement: [],
1720 uponSanitizeShadowNode: []
1721 };
1722 };
1723 function createDOMPurify() {
1724 let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
1725 const DOMPurify = root => createDOMPurify(root);
1726 DOMPurify.version = '3.3.0';
1727 DOMPurify.removed = [];
1728 if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
1729 // Not running in a browser, provide a factory function
1730 // so that you can pass your own Window
1731 DOMPurify.isSupported = false;
1732 return DOMPurify;
1733 }
1734 let {
1735 document
1736 } = window;
1737 const originalDocument = document;
1738 const currentScript = originalDocument.currentScript;
1739 const {
1740 DocumentFragment,
1741 HTMLTemplateElement,
1742 Node,
1743 Element,
1744 NodeFilter,
1745 NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
1746 HTMLFormElement,
1747 DOMParser,
1748 trustedTypes
1749 } = window;
1750 const ElementPrototype = Element.prototype;
1751 const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
1752 const remove = lookupGetter(ElementPrototype, 'remove');
1753 const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
1754 const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
1755 const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
1756 // As per issue #47, the web-components registry is inherited by a
1757 // new document created via createHTMLDocument. As per the spec
1758 // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
1759 // a new empty registry is used when creating a template contents owner
1760 // document, so we use that as our parent document to ensure nothing
1761 // is inherited.
1762 if (typeof HTMLTemplateElement === 'function') {
1763 const template = document.createElement('template');
1764 if (template.content && template.content.ownerDocument) {
1765 document = template.content.ownerDocument;
1766 }
1767 }
1768 let trustedTypesPolicy;
1769 let emptyHTML = '';
1770 const {
1771 implementation,
1772 createNodeIterator,
1773 createDocumentFragment,
1774 getElementsByTagName
1775 } = document;
1776 const {
1777 importNode
1778 } = originalDocument;
1779 let hooks = _createHooksMap();
1780 /**
1781 * Expose whether this browser supports running the full DOMPurify.
1782 */
1783 DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
1784 const {
1785 MUSTACHE_EXPR,
1786 ERB_EXPR,
1787 TMPLIT_EXPR,
1788 DATA_ATTR,
1789 ARIA_ATTR,
1790 IS_SCRIPT_OR_DATA,
1791 ATTR_WHITESPACE,
1792 CUSTOM_ELEMENT
1793 } = EXPRESSIONS;
1794 let {
1795 IS_ALLOWED_URI: IS_ALLOWED_URI$1
1796 } = EXPRESSIONS;
1797 /**
1798 * We consider the elements and attributes below to be safe. Ideally
1799 * don't add any new ones but feel free to remove unwanted ones.
1800 */
1801 /* allowed element names */
1802 let ALLOWED_TAGS = null;
1803 const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
1804 /* Allowed attribute names */
1805 let ALLOWED_ATTR = null;
1806 const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
1807 /*
1808 * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
1809 * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
1810 * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
1811 * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
1812 */
1813 let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
1814 tagNameCheck: {
1815 writable: true,
1816 configurable: false,
1817 enumerable: true,
1818 value: null
1819 },
1820 attributeNameCheck: {
1821 writable: true,
1822 configurable: false,
1823 enumerable: true,
1824 value: null
1825 },
1826 allowCustomizedBuiltInElements: {
1827 writable: true,
1828 configurable: false,
1829 enumerable: true,
1830 value: false
1831 }
1832 }));
1833 /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
1834 let FORBID_TAGS = null;
1835 /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
1836 let FORBID_ATTR = null;
1837 /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
1838 const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
1839 tagCheck: {
1840 writable: true,
1841 configurable: false,
1842 enumerable: true,
1843 value: null
1844 },
1845 attributeCheck: {
1846 writable: true,
1847 configurable: false,
1848 enumerable: true,
1849 value: null
1850 }
1851 }));
1852 /* Decide if ARIA attributes are okay */
1853 let ALLOW_ARIA_ATTR = true;
1854 /* Decide if custom data attributes are okay */
1855 let ALLOW_DATA_ATTR = true;
1856 /* Decide if unknown protocols are okay */
1857 let ALLOW_UNKNOWN_PROTOCOLS = false;
1858 /* Decide if self-closing tags in attributes are allowed.
1859 * Usually removed due to a mXSS issue in jQuery 3.0 */
1860 let ALLOW_SELF_CLOSE_IN_ATTR = true;
1861 /* Output should be safe for common template engines.
1862 * This means, DOMPurify removes data attributes, mustaches and ERB
1863 */
1864 let SAFE_FOR_TEMPLATES = false;
1865 /* Output should be safe even for XML used within HTML and alike.
1866 * This means, DOMPurify removes comments when containing risky content.
1867 */
1868 let SAFE_FOR_XML = true;
1869 /* Decide if document with <html>... should be returned */
1870 let WHOLE_DOCUMENT = false;
1871 /* Track whether config is already set on this instance of DOMPurify. */
1872 let SET_CONFIG = false;
1873 /* Decide if all elements (e.g. style, script) must be children of
1874 * document.body. By default, browsers might move them to document.head */
1875 let FORCE_BODY = false;
1876 /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
1877 * string (or a TrustedHTML object if Trusted Types are supported).
1878 * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
1879 */
1880 let RETURN_DOM = false;
1881 /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
1882 * string (or a TrustedHTML object if Trusted Types are supported) */
1883 let RETURN_DOM_FRAGMENT = false;
1884 /* Try to return a Trusted Type object instead of a string, return a string in
1885 * case Trusted Types are not supported */
1886 let RETURN_TRUSTED_TYPE = false;
1887 /* Output should be free from DOM clobbering attacks?
1888 * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
1889 */
1890 let SANITIZE_DOM = true;
1891 /* Achieve full DOM Clobbering protection by isolating the namespace of named
1892 * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
1893 *
1894 * HTML/DOM spec rules that enable DOM Clobbering:
1895 * - Named Access on Window (§7.3.3)
1896 * - DOM Tree Accessors (§3.1.5)
1897 * - Form Element Parent-Child Relations (§4.10.3)
1898 * - Iframe srcdoc / Nested WindowProxies (§4.8.5)
1899 * - HTMLCollection (§4.2.10.2)
1900 *
1901 * Namespace isolation is implemented by prefixing `id` and `name` attributes
1902 * with a constant string, i.e., `user-content-`
1903 */
1904 let SANITIZE_NAMED_PROPS = false;
1905 const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
1906 /* Keep element content when removing element? */
1907 let KEEP_CONTENT = true;
1908 /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
1909 * of importing it into a new Document and returning a sanitized copy */
1910 let IN_PLACE = false;
1911 /* Allow usage of profiles like html, svg and mathMl */
1912 let USE_PROFILES = {};
1913 /* Tags to ignore content of when KEEP_CONTENT is true */
1914 let FORBID_CONTENTS = null;
1915 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']);
1916 /* Tags that are safe for data: URIs */
1917 let DATA_URI_TAGS = null;
1918 const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
1919 /* Attributes safe for values like "javascript:" */
1920 let URI_SAFE_ATTRIBUTES = null;
1921 const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
1922 const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
1923 const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
1924 const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
1925 /* Document namespace */
1926 let NAMESPACE = HTML_NAMESPACE;
1927 let IS_EMPTY_INPUT = false;
1928 /* Allowed XHTML+XML namespaces */
1929 let ALLOWED_NAMESPACES = null;
1930 const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
1931 let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
1932 let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
1933 // Certain elements are allowed in both SVG and HTML
1934 // namespace. We need to specify them explicitly
1935 // so that they don't get erroneously deleted from
1936 // HTML namespace.
1937 const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
1938 /* Parsing of strict XHTML documents */
1939 let PARSER_MEDIA_TYPE = null;
1940 const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
1941 const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
1942 let transformCaseFunc = null;
1943 /* Keep a reference to config to pass to hooks */
1944 let CONFIG = null;
1945 /* Ideally, do not touch anything below this line */
1946 /* ______________________________________________ */
1947 const formElement = document.createElement('form');
1948 const isRegexOrFunction = function isRegexOrFunction(testValue) {
1949 return testValue instanceof RegExp || testValue instanceof Function;
1950 };
1951 /**
1952 * _parseConfig
1953 *
1954 * @param cfg optional config literal
1955 */
1956 // eslint-disable-next-line complexity
1957 const _parseConfig = function _parseConfig() {
1958 let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1959 if (CONFIG && CONFIG === cfg) {
1960 return;
1961 }
1962 /* Shield configuration object from tampering */
1963 if (!cfg || typeof cfg !== 'object') {
1964 cfg = {};
1965 }
1966 /* Shield configuration object from prototype pollution */
1967 cfg = clone(cfg);
1968 PARSER_MEDIA_TYPE =
1969 // eslint-disable-next-line unicorn/prefer-includes
1970 SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
1971 // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
1972 transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
1973 /* Set configuration parameters */
1974 ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
1975 ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
1976 ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
1977 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;
1978 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;
1979 FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
1980 FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
1981 FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
1982 USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
1983 ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
1984 ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
1985 ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
1986 ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
1987 SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
1988 SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
1989 WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
1990 RETURN_DOM = cfg.RETURN_DOM || false; // Default false
1991 RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
1992 RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
1993 FORCE_BODY = cfg.FORCE_BODY || false; // Default false
1994 SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
1995 SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
1996 KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
1997 IN_PLACE = cfg.IN_PLACE || false; // Default false
1998 IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
1999 NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
2000 MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
2001 HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
2002 CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
2003 if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
2004 CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
2005 }
2006 if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
2007 CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
2008 }
2009 if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
2010 CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
2011 }
2012 if (SAFE_FOR_TEMPLATES) {
2013 ALLOW_DATA_ATTR = false;
2014 }
2015 if (RETURN_DOM_FRAGMENT) {
2016 RETURN_DOM = true;
2017 }
2018 /* Parse profile info */
2019 if (USE_PROFILES) {
2020 ALLOWED_TAGS = addToSet({}, text);
2021 ALLOWED_ATTR = [];
2022 if (USE_PROFILES.html === true) {
2023 addToSet(ALLOWED_TAGS, html$1);
2024 addToSet(ALLOWED_ATTR, html);
2025 }
2026 if (USE_PROFILES.svg === true) {
2027 addToSet(ALLOWED_TAGS, svg$1);
2028 addToSet(ALLOWED_ATTR, svg);
2029 addToSet(ALLOWED_ATTR, xml);
2030 }
2031 if (USE_PROFILES.svgFilters === true) {
2032 addToSet(ALLOWED_TAGS, svgFilters);
2033 addToSet(ALLOWED_ATTR, svg);
2034 addToSet(ALLOWED_ATTR, xml);
2035 }
2036 if (USE_PROFILES.mathMl === true) {
2037 addToSet(ALLOWED_TAGS, mathMl$1);
2038 addToSet(ALLOWED_ATTR, mathMl);
2039 addToSet(ALLOWED_ATTR, xml);
2040 }
2041 }
2042 /* Merge configuration parameters */
2043 if (cfg.ADD_TAGS) {
2044 if (typeof cfg.ADD_TAGS === 'function') {
2045 EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
2046 } else {
2047 if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
2048 ALLOWED_TAGS = clone(ALLOWED_TAGS);
2049 }
2050 addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
2051 }
2052 }
2053 if (cfg.ADD_ATTR) {
2054 if (typeof cfg.ADD_ATTR === 'function') {
2055 EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
2056 } else {
2057 if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
2058 ALLOWED_ATTR = clone(ALLOWED_ATTR);
2059 }
2060 addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
2061 }
2062 }
2063 if (cfg.ADD_URI_SAFE_ATTR) {
2064 addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
2065 }
2066 if (cfg.FORBID_CONTENTS) {
2067 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
2068 FORBID_CONTENTS = clone(FORBID_CONTENTS);
2069 }
2070 addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
2071 }
2072 /* Add #text in case KEEP_CONTENT is set to true */
2073 if (KEEP_CONTENT) {
2074 ALLOWED_TAGS['#text'] = true;
2075 }
2076 /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
2077 if (WHOLE_DOCUMENT) {
2078 addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
2079 }
2080 /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
2081 if (ALLOWED_TAGS.table) {
2082 addToSet(ALLOWED_TAGS, ['tbody']);
2083 delete FORBID_TAGS.tbody;
2084 }
2085 if (cfg.TRUSTED_TYPES_POLICY) {
2086 if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
2087 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2088 }
2089 if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
2090 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2091 }
2092 // Overwrite existing TrustedTypes policy.
2093 trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
2094 // Sign local variables required by `sanitize`.
2095 emptyHTML = trustedTypesPolicy.createHTML('');
2096 } else {
2097 // Uninitialized policy, attempt to initialize the internal dompurify policy.
2098 if (trustedTypesPolicy === undefined) {
2099 trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
2100 }
2101 // If creating the internal policy succeeded sign internal variables.
2102 if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
2103 emptyHTML = trustedTypesPolicy.createHTML('');
2104 }
2105 }
2106 // Prevent further manipulation of configuration.
2107 // Not available in IE8, Safari 5, etc.
2108 if (freeze) {
2109 freeze(cfg);
2110 }
2111 CONFIG = cfg;
2112 };
2113 /* Keep track of all possible SVG and MathML tags
2114 * so that we can perform the namespace checks
2115 * correctly. */
2116 const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
2117 const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
2118 /**
2119 * @param element a DOM element whose namespace is being checked
2120 * @returns Return false if the element has a
2121 * namespace that a spec-compliant parser would never
2122 * return. Return true otherwise.
2123 */
2124 const _checkValidNamespace = function _checkValidNamespace(element) {
2125 let parent = getParentNode(element);
2126 // In JSDOM, if we're inside shadow DOM, then parentNode
2127 // can be null. We just simulate parent in this case.
2128 if (!parent || !parent.tagName) {
2129 parent = {
2130 namespaceURI: NAMESPACE,
2131 tagName: 'template'
2132 };
2133 }
2134 const tagName = stringToLowerCase(element.tagName);
2135 const parentTagName = stringToLowerCase(parent.tagName);
2136 if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
2137 return false;
2138 }
2139 if (element.namespaceURI === SVG_NAMESPACE) {
2140 // The only way to switch from HTML namespace to SVG
2141 // is via <svg>. If it happens via any other tag, then
2142 // it should be killed.
2143 if (parent.namespaceURI === HTML_NAMESPACE) {
2144 return tagName === 'svg';
2145 }
2146 // The only way to switch from MathML to SVG is via`
2147 // svg if parent is either <annotation-xml> or MathML
2148 // text integration points.
2149 if (parent.namespaceURI === MATHML_NAMESPACE) {
2150 return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
2151 }
2152 // We only allow elements that are defined in SVG
2153 // spec. All others are disallowed in SVG namespace.
2154 return Boolean(ALL_SVG_TAGS[tagName]);
2155 }
2156 if (element.namespaceURI === MATHML_NAMESPACE) {
2157 // The only way to switch from HTML namespace to MathML
2158 // is via <math>. If it happens via any other tag, then
2159 // it should be killed.
2160 if (parent.namespaceURI === HTML_NAMESPACE) {
2161 return tagName === 'math';
2162 }
2163 // The only way to switch from SVG to MathML is via
2164 // <math> and HTML integration points
2165 if (parent.namespaceURI === SVG_NAMESPACE) {
2166 return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
2167 }
2168 // We only allow elements that are defined in MathML
2169 // spec. All others are disallowed in MathML namespace.
2170 return Boolean(ALL_MATHML_TAGS[tagName]);
2171 }
2172 if (element.namespaceURI === HTML_NAMESPACE) {
2173 // The only way to switch from SVG to HTML is via
2174 // HTML integration points, and from MathML to HTML
2175 // is via MathML text integration points
2176 if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
2177 return false;
2178 }
2179 if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
2180 return false;
2181 }
2182 // We disallow tags that are specific for MathML
2183 // or SVG and should never appear in HTML namespace
2184 return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
2185 }
2186 // For XHTML and XML documents that support custom namespaces
2187 if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
2188 return true;
2189 }
2190 // The code should never reach this place (this means
2191 // that the element somehow got namespace that is not
2192 // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
2193 // Return false just in case.
2194 return false;
2195 };
2196 /**
2197 * _forceRemove
2198 *
2199 * @param node a DOM node
2200 */
2201 const _forceRemove = function _forceRemove(node) {
2202 arrayPush(DOMPurify.removed, {
2203 element: node
2204 });
2205 try {
2206 // eslint-disable-next-line unicorn/prefer-dom-node-remove
2207 getParentNode(node).removeChild(node);
2208 } catch (_) {
2209 remove(node);
2210 }
2211 };
2212 /**
2213 * _removeAttribute
2214 *
2215 * @param name an Attribute name
2216 * @param element a DOM node
2217 */
2218 const _removeAttribute = function _removeAttribute(name, element) {
2219 try {
2220 arrayPush(DOMPurify.removed, {
2221 attribute: element.getAttributeNode(name),
2222 from: element
2223 });
2224 } catch (_) {
2225 arrayPush(DOMPurify.removed, {
2226 attribute: null,
2227 from: element
2228 });
2229 }
2230 element.removeAttribute(name);
2231 // We void attribute values for unremovable "is" attributes
2232 if (name === 'is') {
2233 if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
2234 try {
2235 _forceRemove(element);
2236 } catch (_) {}
2237 } else {
2238 try {
2239 element.setAttribute(name, '');
2240 } catch (_) {}
2241 }
2242 }
2243 };
2244 /**
2245 * _initDocument
2246 *
2247 * @param dirty - a string of dirty markup
2248 * @return a DOM, filled with the dirty markup
2249 */
2250 const _initDocument = function _initDocument(dirty) {
2251 /* Create a HTML document */
2252 let doc = null;
2253 let leadingWhitespace = null;
2254 if (FORCE_BODY) {
2255 dirty = '<remove></remove>' + dirty;
2256 } else {
2257 /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
2258 const matches = stringMatch(dirty, /^[\r\n\t ]+/);
2259 leadingWhitespace = matches && matches[0];
2260 }
2261 if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
2262 // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
2263 dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
2264 }
2265 const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
2266 /*
2267 * Use the DOMParser API by default, fallback later if needs be
2268 * DOMParser not work for svg when has multiple root element.
2269 */
2270 if (NAMESPACE === HTML_NAMESPACE) {
2271 try {
2272 doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
2273 } catch (_) {}
2274 }
2275 /* Use createHTMLDocument in case DOMParser is not available */
2276 if (!doc || !doc.documentElement) {
2277 doc = implementation.createDocument(NAMESPACE, 'template', null);
2278 try {
2279 doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
2280 } catch (_) {
2281 // Syntax error if dirtyPayload is invalid xml
2282 }
2283 }
2284 const body = doc.body || doc.documentElement;
2285 if (dirty && leadingWhitespace) {
2286 body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
2287 }
2288 /* Work on whole document or just its body */
2289 if (NAMESPACE === HTML_NAMESPACE) {
2290 return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
2291 }
2292 return WHOLE_DOCUMENT ? doc.documentElement : body;
2293 };
2294 /**
2295 * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
2296 *
2297 * @param root The root element or node to start traversing on.
2298 * @return The created NodeIterator
2299 */
2300 const _createNodeIterator = function _createNodeIterator(root) {
2301 return createNodeIterator.call(root.ownerDocument || root, root,
2302 // eslint-disable-next-line no-bitwise
2303 NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
2304 };
2305 /**
2306 * _isClobbered
2307 *
2308 * @param element element to check for clobbering attacks
2309 * @return true if clobbered, false if safe
2310 */
2311 const _isClobbered = function _isClobbered(element) {
2312 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');
2313 };
2314 /**
2315 * Checks whether the given object is a DOM node.
2316 *
2317 * @param value object to check whether it's a DOM node
2318 * @return true is object is a DOM node
2319 */
2320 const _isNode = function _isNode(value) {
2321 return typeof Node === 'function' && value instanceof Node;
2322 };
2323 function _executeHooks(hooks, currentNode, data) {
2324 arrayForEach(hooks, hook => {
2325 hook.call(DOMPurify, currentNode, data, CONFIG);
2326 });
2327 }
2328 /**
2329 * _sanitizeElements
2330 *
2331 * @protect nodeName
2332 * @protect textContent
2333 * @protect removeChild
2334 * @param currentNode to check for permission to exist
2335 * @return true if node was killed, false if left alive
2336 */
2337 const _sanitizeElements = function _sanitizeElements(currentNode) {
2338 let content = null;
2339 /* Execute a hook if present */
2340 _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
2341 /* Check if element is clobbered or can clobber */
2342 if (_isClobbered(currentNode)) {
2343 _forceRemove(currentNode);
2344 return true;
2345 }
2346 /* Now let's check the element's type and name */
2347 const tagName = transformCaseFunc(currentNode.nodeName);
2348 /* Execute a hook if present */
2349 _executeHooks(hooks.uponSanitizeElement, currentNode, {
2350 tagName,
2351 allowedTags: ALLOWED_TAGS
2352 });
2353 /* Detect mXSS attempts abusing namespace confusion */
2354 if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
2355 _forceRemove(currentNode);
2356 return true;
2357 }
2358 /* Remove any occurrence of processing instructions */
2359 if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
2360 _forceRemove(currentNode);
2361 return true;
2362 }
2363 /* Remove any kind of possibly harmful comments */
2364 if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
2365 _forceRemove(currentNode);
2366 return true;
2367 }
2368 /* Remove element if anything forbids its presence */
2369 if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
2370 /* Check if we have a custom element to handle */
2371 if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
2372 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
2373 return false;
2374 }
2375 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
2376 return false;
2377 }
2378 }
2379 /* Keep content except for bad-listed elements */
2380 if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
2381 const parentNode = getParentNode(currentNode) || currentNode.parentNode;
2382 const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
2383 if (childNodes && parentNode) {
2384 const childCount = childNodes.length;
2385 for (let i = childCount - 1; i >= 0; --i) {
2386 const childClone = cloneNode(childNodes[i], true);
2387 childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
2388 parentNode.insertBefore(childClone, getNextSibling(currentNode));
2389 }
2390 }
2391 }
2392 _forceRemove(currentNode);
2393 return true;
2394 }
2395 /* Check whether element has a valid namespace */
2396 if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
2397 _forceRemove(currentNode);
2398 return true;
2399 }
2400 /* Make sure that older browsers don't get fallback-tag mXSS */
2401 if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
2402 _forceRemove(currentNode);
2403 return true;
2404 }
2405 /* Sanitize element content to be template-safe */
2406 if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
2407 /* Get the element's text content */
2408 content = currentNode.textContent;
2409 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
2410 content = stringReplace(content, expr, ' ');
2411 });
2412 if (currentNode.textContent !== content) {
2413 arrayPush(DOMPurify.removed, {
2414 element: currentNode.cloneNode()
2415 });
2416 currentNode.textContent = content;
2417 }
2418 }
2419 /* Execute a hook if present */
2420 _executeHooks(hooks.afterSanitizeElements, currentNode, null);
2421 return false;
2422 };
2423 /**
2424 * _isValidAttribute
2425 *
2426 * @param lcTag Lowercase tag name of containing element.
2427 * @param lcName Lowercase attribute name.
2428 * @param value Attribute value.
2429 * @return Returns true if `value` is valid, otherwise false.
2430 */
2431 // eslint-disable-next-line complexity
2432 const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
2433 /* Make sure attribute cannot clobber */
2434 if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
2435 return false;
2436 }
2437 /* Allow valid data-* attributes: At least one character after "-"
2438 (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
2439 XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
2440 We don't need to check the value; it's always URI safe. */
2441 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]) {
2442 if (
2443 // First condition does a very basic check if a) it's basically a valid custom element tagname AND
2444 // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
2445 // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
2446 _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)) ||
2447 // Alternative, second condition checks if it's an `is`-attribute, AND
2448 // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
2449 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 {
2450 return false;
2451 }
2452 /* Check value is safe. First, is attr inert? If so, is safe */
2453 } 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) {
2454 return false;
2455 } else ;
2456 return true;
2457 };
2458 /**
2459 * _isBasicCustomElement
2460 * checks if at least one dash is included in tagName, and it's not the first char
2461 * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
2462 *
2463 * @param tagName name of the tag of the node to sanitize
2464 * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
2465 */
2466 const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
2467 return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
2468 };
2469 /**
2470 * _sanitizeAttributes
2471 *
2472 * @protect attributes
2473 * @protect nodeName
2474 * @protect removeAttribute
2475 * @protect setAttribute
2476 *
2477 * @param currentNode to sanitize
2478 */
2479 const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
2480 /* Execute a hook if present */
2481 _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
2482 const {
2483 attributes
2484 } = currentNode;
2485 /* Check if we have attributes; if not we might have a text node */
2486 if (!attributes || _isClobbered(currentNode)) {
2487 return;
2488 }
2489 const hookEvent = {
2490 attrName: '',
2491 attrValue: '',
2492 keepAttr: true,
2493 allowedAttributes: ALLOWED_ATTR,
2494 forceKeepAttr: undefined
2495 };
2496 let l = attributes.length;
2497 /* Go backwards over all attributes; safely remove bad ones */
2498 while (l--) {
2499 const attr = attributes[l];
2500 const {
2501 name,
2502 namespaceURI,
2503 value: attrValue
2504 } = attr;
2505 const lcName = transformCaseFunc(name);
2506 const initValue = attrValue;
2507 let value = name === 'value' ? initValue : stringTrim(initValue);
2508 /* Execute a hook if present */
2509 hookEvent.attrName = lcName;
2510 hookEvent.attrValue = value;
2511 hookEvent.keepAttr = true;
2512 hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
2513 _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
2514 value = hookEvent.attrValue;
2515 /* Full DOM Clobbering protection via namespace isolation,
2516 * Prefix id and name attributes with `user-content-`
2517 */
2518 if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
2519 // Remove the attribute with this value
2520 _removeAttribute(name, currentNode);
2521 // Prefix the value and later re-create the attribute with the sanitized value
2522 value = SANITIZE_NAMED_PROPS_PREFIX + value;
2523 }
2524 /* Work around a security issue with comments inside attributes */
2525 if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
2526 _removeAttribute(name, currentNode);
2527 continue;
2528 }
2529 /* Make sure we cannot easily use animated hrefs, even if animations are allowed */
2530 if (lcName === 'attributename' && stringMatch(value, 'href')) {
2531 _removeAttribute(name, currentNode);
2532 continue;
2533 }
2534 /* Did the hooks approve of the attribute? */
2535 if (hookEvent.forceKeepAttr) {
2536 continue;
2537 }
2538 /* Did the hooks approve of the attribute? */
2539 if (!hookEvent.keepAttr) {
2540 _removeAttribute(name, currentNode);
2541 continue;
2542 }
2543 /* Work around a security issue in jQuery 3.0 */
2544 if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
2545 _removeAttribute(name, currentNode);
2546 continue;
2547 }
2548 /* Sanitize attribute content to be template-safe */
2549 if (SAFE_FOR_TEMPLATES) {
2550 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
2551 value = stringReplace(value, expr, ' ');
2552 });
2553 }
2554 /* Is `value` valid for this attribute? */
2555 const lcTag = transformCaseFunc(currentNode.nodeName);
2556 if (!_isValidAttribute(lcTag, lcName, value)) {
2557 _removeAttribute(name, currentNode);
2558 continue;
2559 }
2560 /* Handle attributes that require Trusted Types */
2561 if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
2562 if (namespaceURI) ; else {
2563 switch (trustedTypes.getAttributeType(lcTag, lcName)) {
2564 case 'TrustedHTML':
2565 {
2566 value = trustedTypesPolicy.createHTML(value);
2567 break;
2568 }
2569 case 'TrustedScriptURL':
2570 {
2571 value = trustedTypesPolicy.createScriptURL(value);
2572 break;
2573 }
2574 }
2575 }
2576 }
2577 /* Handle invalid data-* attribute set by try-catching it */
2578 if (value !== initValue) {
2579 try {
2580 if (namespaceURI) {
2581 currentNode.setAttributeNS(namespaceURI, name, value);
2582 } else {
2583 /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
2584 currentNode.setAttribute(name, value);
2585 }
2586 if (_isClobbered(currentNode)) {
2587 _forceRemove(currentNode);
2588 } else {
2589 arrayPop(DOMPurify.removed);
2590 }
2591 } catch (_) {
2592 _removeAttribute(name, currentNode);
2593 }
2594 }
2595 }
2596 /* Execute a hook if present */
2597 _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
2598 };
2599 /**
2600 * _sanitizeShadowDOM
2601 *
2602 * @param fragment to iterate over recursively
2603 */
2604 const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
2605 let shadowNode = null;
2606 const shadowIterator = _createNodeIterator(fragment);
2607 /* Execute a hook if present */
2608 _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
2609 while (shadowNode = shadowIterator.nextNode()) {
2610 /* Execute a hook if present */
2611 _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
2612 /* Sanitize tags and elements */
2613 _sanitizeElements(shadowNode);
2614 /* Check attributes next */
2615 _sanitizeAttributes(shadowNode);
2616 /* Deep shadow DOM detected */
2617 if (shadowNode.content instanceof DocumentFragment) {
2618 _sanitizeShadowDOM(shadowNode.content);
2619 }
2620 }
2621 /* Execute a hook if present */
2622 _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
2623 };
2624 // eslint-disable-next-line complexity
2625 DOMPurify.sanitize = function (dirty) {
2626 let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2627 let body = null;
2628 let importedNode = null;
2629 let currentNode = null;
2630 let returnNode = null;
2631 /* Make sure we have a string to sanitize.
2632 DO NOT return early, as this will return the wrong type if
2633 the user has requested a DOM object rather than a string */
2634 IS_EMPTY_INPUT = !dirty;
2635 if (IS_EMPTY_INPUT) {
2636 dirty = '<!-->';
2637 }
2638 /* Stringify, in case dirty is an object */
2639 if (typeof dirty !== 'string' && !_isNode(dirty)) {
2640 if (typeof dirty.toString === 'function') {
2641 dirty = dirty.toString();
2642 if (typeof dirty !== 'string') {
2643 throw typeErrorCreate('dirty is not a string, aborting');
2644 }
2645 } else {
2646 throw typeErrorCreate('toString is not a function');
2647 }
2648 }
2649 /* Return dirty HTML if DOMPurify cannot run */
2650 if (!DOMPurify.isSupported) {
2651 return dirty;
2652 }
2653 /* Assign config vars */
2654 if (!SET_CONFIG) {
2655 _parseConfig(cfg);
2656 }
2657 /* Clean up removed elements */
2658 DOMPurify.removed = [];
2659 /* Check if dirty is correctly typed for IN_PLACE */
2660 if (typeof dirty === 'string') {
2661 IN_PLACE = false;
2662 }
2663 if (IN_PLACE) {
2664 /* Do some early pre-sanitization to avoid unsafe root nodes */
2665 if (dirty.nodeName) {
2666 const tagName = transformCaseFunc(dirty.nodeName);
2667 if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
2668 throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
2669 }
2670 }
2671 } else if (dirty instanceof Node) {
2672 /* If dirty is a DOM element, append to an empty document to avoid
2673 elements being stripped by the parser */
2674 body = _initDocument('<!---->');
2675 importedNode = body.ownerDocument.importNode(dirty, true);
2676 if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
2677 /* Node is already a body, use as is */
2678 body = importedNode;
2679 } else if (importedNode.nodeName === 'HTML') {
2680 body = importedNode;
2681 } else {
2682 // eslint-disable-next-line unicorn/prefer-dom-node-append
2683 body.appendChild(importedNode);
2684 }
2685 } else {
2686 /* Exit directly if we have nothing to do */
2687 if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
2688 // eslint-disable-next-line unicorn/prefer-includes
2689 dirty.indexOf('<') === -1) {
2690 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
2691 }
2692 /* Initialize the document to work on */
2693 body = _initDocument(dirty);
2694 /* Check we have a DOM node from the data */
2695 if (!body) {
2696 return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
2697 }
2698 }
2699 /* Remove first element node (ours) if FORCE_BODY is set */
2700 if (body && FORCE_BODY) {
2701 _forceRemove(body.firstChild);
2702 }
2703 /* Get node iterator */
2704 const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
2705 /* Now start iterating over the created document */
2706 while (currentNode = nodeIterator.nextNode()) {
2707 /* Sanitize tags and elements */
2708 _sanitizeElements(currentNode);
2709 /* Check attributes next */
2710 _sanitizeAttributes(currentNode);
2711 /* Shadow DOM detected, sanitize it */
2712 if (currentNode.content instanceof DocumentFragment) {
2713 _sanitizeShadowDOM(currentNode.content);
2714 }
2715 }
2716 /* If we sanitized `dirty` in-place, return it. */
2717 if (IN_PLACE) {
2718 return dirty;
2719 }
2720 /* Return sanitized string or DOM */
2721 if (RETURN_DOM) {
2722 if (RETURN_DOM_FRAGMENT) {
2723 returnNode = createDocumentFragment.call(body.ownerDocument);
2724 while (body.firstChild) {
2725 // eslint-disable-next-line unicorn/prefer-dom-node-append
2726 returnNode.appendChild(body.firstChild);
2727 }
2728 } else {
2729 returnNode = body;
2730 }
2731 if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
2732 /*
2733 AdoptNode() is not used because internal state is not reset
2734 (e.g. the past names map of a HTMLFormElement), this is safe
2735 in theory but we would rather not risk another attack vector.
2736 The state that is cloned by importNode() is explicitly defined
2737 by the specs.
2738 */
2739 returnNode = importNode.call(originalDocument, returnNode, true);
2740 }
2741 return returnNode;
2742 }
2743 let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
2744 /* Serialize doctype if allowed */
2745 if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
2746 serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
2747 }
2748 /* Sanitize final string template-safe */
2749 if (SAFE_FOR_TEMPLATES) {
2750 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
2751 serializedHTML = stringReplace(serializedHTML, expr, ' ');
2752 });
2753 }
2754 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
2755 };
2756 DOMPurify.setConfig = function () {
2757 let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2758 _parseConfig(cfg);
2759 SET_CONFIG = true;
2760 };
2761 DOMPurify.clearConfig = function () {
2762 CONFIG = null;
2763 SET_CONFIG = false;
2764 };
2765 DOMPurify.isValidAttribute = function (tag, attr, value) {
2766 /* Initialize shared config vars if necessary. */
2767 if (!CONFIG) {
2768 _parseConfig({});
2769 }
2770 const lcTag = transformCaseFunc(tag);
2771 const lcName = transformCaseFunc(attr);
2772 return _isValidAttribute(lcTag, lcName, value);
2773 };
2774 DOMPurify.addHook = function (entryPoint, hookFunction) {
2775 if (typeof hookFunction !== 'function') {
2776 return;
2777 }
2778 arrayPush(hooks[entryPoint], hookFunction);
2779 };
2780 DOMPurify.removeHook = function (entryPoint, hookFunction) {
2781 if (hookFunction !== undefined) {
2782 const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
2783 return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
2784 }
2785 return arrayPop(hooks[entryPoint]);
2786 };
2787 DOMPurify.removeHooks = function (entryPoint) {
2788 hooks[entryPoint] = [];
2789 };
2790 DOMPurify.removeAllHooks = function () {
2791 hooks = _createHooksMap();
2792 };
2793 return DOMPurify;
2794 }
2795 var purify = createDOMPurify();
2796
2797 module.exports = purify;
2798 //# sourceMappingURL=purify.cjs.js.map
2799
2800
2801 /***/ }),
2802
2803 /***/ "../node_modules/object-assign/index.js":
2804 /*!**********************************************!*\
2805 !*** ../node_modules/object-assign/index.js ***!
2806 \**********************************************/
2807 /***/ ((module) => {
2808
2809 "use strict";
2810 /*
2811 object-assign
2812 (c) Sindre Sorhus
2813 @license MIT
2814 */
2815
2816
2817 /* eslint-disable no-unused-vars */
2818 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
2819 var hasOwnProperty = Object.prototype.hasOwnProperty;
2820 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
2821
2822 function toObject(val) {
2823 if (val === null || val === undefined) {
2824 throw new TypeError('Object.assign cannot be called with null or undefined');
2825 }
2826
2827 return Object(val);
2828 }
2829
2830 function shouldUseNative() {
2831 try {
2832 if (!Object.assign) {
2833 return false;
2834 }
2835
2836 // Detect buggy property enumeration order in older V8 versions.
2837
2838 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
2839 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
2840 test1[5] = 'de';
2841 if (Object.getOwnPropertyNames(test1)[0] === '5') {
2842 return false;
2843 }
2844
2845 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
2846 var test2 = {};
2847 for (var i = 0; i < 10; i++) {
2848 test2['_' + String.fromCharCode(i)] = i;
2849 }
2850 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
2851 return test2[n];
2852 });
2853 if (order2.join('') !== '0123456789') {
2854 return false;
2855 }
2856
2857 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
2858 var test3 = {};
2859 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
2860 test3[letter] = letter;
2861 });
2862 if (Object.keys(Object.assign({}, test3)).join('') !==
2863 'abcdefghijklmnopqrst') {
2864 return false;
2865 }
2866
2867 return true;
2868 } catch (err) {
2869 // We don't expect any of the above to throw, but better to be safe.
2870 return false;
2871 }
2872 }
2873
2874 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
2875 var from;
2876 var to = toObject(target);
2877 var symbols;
2878
2879 for (var s = 1; s < arguments.length; s++) {
2880 from = Object(arguments[s]);
2881
2882 for (var key in from) {
2883 if (hasOwnProperty.call(from, key)) {
2884 to[key] = from[key];
2885 }
2886 }
2887
2888 if (getOwnPropertySymbols) {
2889 symbols = getOwnPropertySymbols(from);
2890 for (var i = 0; i < symbols.length; i++) {
2891 if (propIsEnumerable.call(from, symbols[i])) {
2892 to[symbols[i]] = from[symbols[i]];
2893 }
2894 }
2895 }
2896 }
2897
2898 return to;
2899 };
2900
2901
2902 /***/ }),
2903
2904 /***/ "../node_modules/prop-types/checkPropTypes.js":
2905 /*!****************************************************!*\
2906 !*** ../node_modules/prop-types/checkPropTypes.js ***!
2907 \****************************************************/
2908 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2909
2910 "use strict";
2911 /**
2912 * Copyright (c) 2013-present, Facebook, Inc.
2913 *
2914 * This source code is licensed under the MIT license found in the
2915 * LICENSE file in the root directory of this source tree.
2916 */
2917
2918
2919
2920 var printWarning = function() {};
2921
2922 if (true) {
2923 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js");
2924 var loggedTypeFailures = {};
2925 var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js");
2926
2927 printWarning = function(text) {
2928 var message = 'Warning: ' + text;
2929 if (typeof console !== 'undefined') {
2930 console.error(message);
2931 }
2932 try {
2933 // --- Welcome to debugging React ---
2934 // This error was thrown as a convenience so that you can use this stack
2935 // to find the callsite that caused this warning to fire.
2936 throw new Error(message);
2937 } catch (x) { /**/ }
2938 };
2939 }
2940
2941 /**
2942 * Assert that the values match with the type specs.
2943 * Error messages are memorized and will only be shown once.
2944 *
2945 * @param {object} typeSpecs Map of name to a ReactPropType
2946 * @param {object} values Runtime values that need to be type-checked
2947 * @param {string} location e.g. "prop", "context", "child context"
2948 * @param {string} componentName Name of the component for error messages.
2949 * @param {?Function} getStack Returns the component stack.
2950 * @private
2951 */
2952 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
2953 if (true) {
2954 for (var typeSpecName in typeSpecs) {
2955 if (has(typeSpecs, typeSpecName)) {
2956 var error;
2957 // Prop type validation may throw. In case they do, we don't want to
2958 // fail the render phase where it didn't fail before. So we log it.
2959 // After these have been cleaned up, we'll let them throw.
2960 try {
2961 // This is intentionally an invariant that gets caught. It's the same
2962 // behavior as without this statement except with a better message.
2963 if (typeof typeSpecs[typeSpecName] !== 'function') {
2964 var err = Error(
2965 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
2966 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
2967 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
2968 );
2969 err.name = 'Invariant Violation';
2970 throw err;
2971 }
2972 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
2973 } catch (ex) {
2974 error = ex;
2975 }
2976 if (error && !(error instanceof Error)) {
2977 printWarning(
2978 (componentName || 'React class') + ': type specification of ' +
2979 location + ' `' + typeSpecName + '` is invalid; the type checker ' +
2980 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
2981 'You may have forgotten to pass an argument to the type checker ' +
2982 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
2983 'shape all require an argument).'
2984 );
2985 }
2986 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
2987 // Only monitor this failure once because there tends to be a lot of the
2988 // same error.
2989 loggedTypeFailures[error.message] = true;
2990
2991 var stack = getStack ? getStack() : '';
2992
2993 printWarning(
2994 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
2995 );
2996 }
2997 }
2998 }
2999 }
3000 }
3001
3002 /**
3003 * Resets warning cache when testing.
3004 *
3005 * @private
3006 */
3007 checkPropTypes.resetWarningCache = function() {
3008 if (true) {
3009 loggedTypeFailures = {};
3010 }
3011 }
3012
3013 module.exports = checkPropTypes;
3014
3015
3016 /***/ }),
3017
3018 /***/ "../node_modules/prop-types/factoryWithTypeCheckers.js":
3019 /*!*************************************************************!*\
3020 !*** ../node_modules/prop-types/factoryWithTypeCheckers.js ***!
3021 \*************************************************************/
3022 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3023
3024 "use strict";
3025 /**
3026 * Copyright (c) 2013-present, Facebook, Inc.
3027 *
3028 * This source code is licensed under the MIT license found in the
3029 * LICENSE file in the root directory of this source tree.
3030 */
3031
3032
3033
3034 var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js");
3035 var assign = __webpack_require__(/*! object-assign */ "../node_modules/object-assign/index.js");
3036
3037 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js");
3038 var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js");
3039 var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../node_modules/prop-types/checkPropTypes.js");
3040
3041 var printWarning = function() {};
3042
3043 if (true) {
3044 printWarning = function(text) {
3045 var message = 'Warning: ' + text;
3046 if (typeof console !== 'undefined') {
3047 console.error(message);
3048 }
3049 try {
3050 // --- Welcome to debugging React ---
3051 // This error was thrown as a convenience so that you can use this stack
3052 // to find the callsite that caused this warning to fire.
3053 throw new Error(message);
3054 } catch (x) {}
3055 };
3056 }
3057
3058 function emptyFunctionThatReturnsNull() {
3059 return null;
3060 }
3061
3062 module.exports = function(isValidElement, throwOnDirectAccess) {
3063 /* global Symbol */
3064 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
3065 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
3066
3067 /**
3068 * Returns the iterator method function contained on the iterable object.
3069 *
3070 * Be sure to invoke the function with the iterable as context:
3071 *
3072 * var iteratorFn = getIteratorFn(myIterable);
3073 * if (iteratorFn) {
3074 * var iterator = iteratorFn.call(myIterable);
3075 * ...
3076 * }
3077 *
3078 * @param {?object} maybeIterable
3079 * @return {?function}
3080 */
3081 function getIteratorFn(maybeIterable) {
3082 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
3083 if (typeof iteratorFn === 'function') {
3084 return iteratorFn;
3085 }
3086 }
3087
3088 /**
3089 * Collection of methods that allow declaration and validation of props that are
3090 * supplied to React components. Example usage:
3091 *
3092 * var Props = require('ReactPropTypes');
3093 * var MyArticle = React.createClass({
3094 * propTypes: {
3095 * // An optional string prop named "description".
3096 * description: Props.string,
3097 *
3098 * // A required enum prop named "category".
3099 * category: Props.oneOf(['News','Photos']).isRequired,
3100 *
3101 * // A prop named "dialog" that requires an instance of Dialog.
3102 * dialog: Props.instanceOf(Dialog).isRequired
3103 * },
3104 * render: function() { ... }
3105 * });
3106 *
3107 * A more formal specification of how these methods are used:
3108 *
3109 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
3110 * decl := ReactPropTypes.{type}(.isRequired)?
3111 *
3112 * Each and every declaration produces a function with the same signature. This
3113 * allows the creation of custom validation functions. For example:
3114 *
3115 * var MyLink = React.createClass({
3116 * propTypes: {
3117 * // An optional string or URI prop named "href".
3118 * href: function(props, propName, componentName) {
3119 * var propValue = props[propName];
3120 * if (propValue != null && typeof propValue !== 'string' &&
3121 * !(propValue instanceof URI)) {
3122 * return new Error(
3123 * 'Expected a string or an URI for ' + propName + ' in ' +
3124 * componentName
3125 * );
3126 * }
3127 * }
3128 * },
3129 * render: function() {...}
3130 * });
3131 *
3132 * @internal
3133 */
3134
3135 var ANONYMOUS = '<<anonymous>>';
3136
3137 // Important!
3138 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
3139 var ReactPropTypes = {
3140 array: createPrimitiveTypeChecker('array'),
3141 bigint: createPrimitiveTypeChecker('bigint'),
3142 bool: createPrimitiveTypeChecker('boolean'),
3143 func: createPrimitiveTypeChecker('function'),
3144 number: createPrimitiveTypeChecker('number'),
3145 object: createPrimitiveTypeChecker('object'),
3146 string: createPrimitiveTypeChecker('string'),
3147 symbol: createPrimitiveTypeChecker('symbol'),
3148
3149 any: createAnyTypeChecker(),
3150 arrayOf: createArrayOfTypeChecker,
3151 element: createElementTypeChecker(),
3152 elementType: createElementTypeTypeChecker(),
3153 instanceOf: createInstanceTypeChecker,
3154 node: createNodeChecker(),
3155 objectOf: createObjectOfTypeChecker,
3156 oneOf: createEnumTypeChecker,
3157 oneOfType: createUnionTypeChecker,
3158 shape: createShapeTypeChecker,
3159 exact: createStrictShapeTypeChecker,
3160 };
3161
3162 /**
3163 * inlined Object.is polyfill to avoid requiring consumers ship their own
3164 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
3165 */
3166 /*eslint-disable no-self-compare*/
3167 function is(x, y) {
3168 // SameValue algorithm
3169 if (x === y) {
3170 // Steps 1-5, 7-10
3171 // Steps 6.b-6.e: +0 != -0
3172 return x !== 0 || 1 / x === 1 / y;
3173 } else {
3174 // Step 6.a: NaN == NaN
3175 return x !== x && y !== y;
3176 }
3177 }
3178 /*eslint-enable no-self-compare*/
3179
3180 /**
3181 * We use an Error-like object for backward compatibility as people may call
3182 * PropTypes directly and inspect their output. However, we don't use real
3183 * Errors anymore. We don't inspect their stack anyway, and creating them
3184 * is prohibitively expensive if they are created too often, such as what
3185 * happens in oneOfType() for any type before the one that matched.
3186 */
3187 function PropTypeError(message, data) {
3188 this.message = message;
3189 this.data = data && typeof data === 'object' ? data: {};
3190 this.stack = '';
3191 }
3192 // Make `instanceof Error` still work for returned errors.
3193 PropTypeError.prototype = Error.prototype;
3194
3195 function createChainableTypeChecker(validate) {
3196 if (true) {
3197 var manualPropTypeCallCache = {};
3198 var manualPropTypeWarningCount = 0;
3199 }
3200 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
3201 componentName = componentName || ANONYMOUS;
3202 propFullName = propFullName || propName;
3203
3204 if (secret !== ReactPropTypesSecret) {
3205 if (throwOnDirectAccess) {
3206 // New behavior only for users of `prop-types` package
3207 var err = new Error(
3208 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
3209 'Use `PropTypes.checkPropTypes()` to call them. ' +
3210 'Read more at http://fb.me/use-check-prop-types'
3211 );
3212 err.name = 'Invariant Violation';
3213 throw err;
3214 } else if ( true && typeof console !== 'undefined') {
3215 // Old behavior for people using React.PropTypes
3216 var cacheKey = componentName + ':' + propName;
3217 if (
3218 !manualPropTypeCallCache[cacheKey] &&
3219 // Avoid spamming the console because they are often not actionable except for lib authors
3220 manualPropTypeWarningCount < 3
3221 ) {
3222 printWarning(
3223 'You are manually calling a React.PropTypes validation ' +
3224 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
3225 'and will throw in the standalone `prop-types` package. ' +
3226 'You may be seeing this warning due to a third-party PropTypes ' +
3227 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
3228 );
3229 manualPropTypeCallCache[cacheKey] = true;
3230 manualPropTypeWarningCount++;
3231 }
3232 }
3233 }
3234 if (props[propName] == null) {
3235 if (isRequired) {
3236 if (props[propName] === null) {
3237 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
3238 }
3239 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
3240 }
3241 return null;
3242 } else {
3243 return validate(props, propName, componentName, location, propFullName);
3244 }
3245 }
3246
3247 var chainedCheckType = checkType.bind(null, false);
3248 chainedCheckType.isRequired = checkType.bind(null, true);
3249
3250 return chainedCheckType;
3251 }
3252
3253 function createPrimitiveTypeChecker(expectedType) {
3254 function validate(props, propName, componentName, location, propFullName, secret) {
3255 var propValue = props[propName];
3256 var propType = getPropType(propValue);
3257 if (propType !== expectedType) {
3258 // `propValue` being instance of, say, date/regexp, pass the 'object'
3259 // check, but we can offer a more precise error message here rather than
3260 // 'of type `object`'.
3261 var preciseType = getPreciseType(propValue);
3262
3263 return new PropTypeError(
3264 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
3265 {expectedType: expectedType}
3266 );
3267 }
3268 return null;
3269 }
3270 return createChainableTypeChecker(validate);
3271 }
3272
3273 function createAnyTypeChecker() {
3274 return createChainableTypeChecker(emptyFunctionThatReturnsNull);
3275 }
3276
3277 function createArrayOfTypeChecker(typeChecker) {
3278 function validate(props, propName, componentName, location, propFullName) {
3279 if (typeof typeChecker !== 'function') {
3280 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
3281 }
3282 var propValue = props[propName];
3283 if (!Array.isArray(propValue)) {
3284 var propType = getPropType(propValue);
3285 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
3286 }
3287 for (var i = 0; i < propValue.length; i++) {
3288 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
3289 if (error instanceof Error) {
3290 return error;
3291 }
3292 }
3293 return null;
3294 }
3295 return createChainableTypeChecker(validate);
3296 }
3297
3298 function createElementTypeChecker() {
3299 function validate(props, propName, componentName, location, propFullName) {
3300 var propValue = props[propName];
3301 if (!isValidElement(propValue)) {
3302 var propType = getPropType(propValue);
3303 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
3304 }
3305 return null;
3306 }
3307 return createChainableTypeChecker(validate);
3308 }
3309
3310 function createElementTypeTypeChecker() {
3311 function validate(props, propName, componentName, location, propFullName) {
3312 var propValue = props[propName];
3313 if (!ReactIs.isValidElementType(propValue)) {
3314 var propType = getPropType(propValue);
3315 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
3316 }
3317 return null;
3318 }
3319 return createChainableTypeChecker(validate);
3320 }
3321
3322 function createInstanceTypeChecker(expectedClass) {
3323 function validate(props, propName, componentName, location, propFullName) {
3324 if (!(props[propName] instanceof expectedClass)) {
3325 var expectedClassName = expectedClass.name || ANONYMOUS;
3326 var actualClassName = getClassName(props[propName]);
3327 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
3328 }
3329 return null;
3330 }
3331 return createChainableTypeChecker(validate);
3332 }
3333
3334 function createEnumTypeChecker(expectedValues) {
3335 if (!Array.isArray(expectedValues)) {
3336 if (true) {
3337 if (arguments.length > 1) {
3338 printWarning(
3339 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
3340 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
3341 );
3342 } else {
3343 printWarning('Invalid argument supplied to oneOf, expected an array.');
3344 }
3345 }
3346 return emptyFunctionThatReturnsNull;
3347 }
3348
3349 function validate(props, propName, componentName, location, propFullName) {
3350 var propValue = props[propName];
3351 for (var i = 0; i < expectedValues.length; i++) {
3352 if (is(propValue, expectedValues[i])) {
3353 return null;
3354 }
3355 }
3356
3357 var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
3358 var type = getPreciseType(value);
3359 if (type === 'symbol') {
3360 return String(value);
3361 }
3362 return value;
3363 });
3364 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
3365 }
3366 return createChainableTypeChecker(validate);
3367 }
3368
3369 function createObjectOfTypeChecker(typeChecker) {
3370 function validate(props, propName, componentName, location, propFullName) {
3371 if (typeof typeChecker !== 'function') {
3372 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
3373 }
3374 var propValue = props[propName];
3375 var propType = getPropType(propValue);
3376 if (propType !== 'object') {
3377 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
3378 }
3379 for (var key in propValue) {
3380 if (has(propValue, key)) {
3381 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
3382 if (error instanceof Error) {
3383 return error;
3384 }
3385 }
3386 }
3387 return null;
3388 }
3389 return createChainableTypeChecker(validate);
3390 }
3391
3392 function createUnionTypeChecker(arrayOfTypeCheckers) {
3393 if (!Array.isArray(arrayOfTypeCheckers)) {
3394 true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
3395 return emptyFunctionThatReturnsNull;
3396 }
3397
3398 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
3399 var checker = arrayOfTypeCheckers[i];
3400 if (typeof checker !== 'function') {
3401 printWarning(
3402 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
3403 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
3404 );
3405 return emptyFunctionThatReturnsNull;
3406 }
3407 }
3408
3409 function validate(props, propName, componentName, location, propFullName) {
3410 var expectedTypes = [];
3411 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
3412 var checker = arrayOfTypeCheckers[i];
3413 var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
3414 if (checkerResult == null) {
3415 return null;
3416 }
3417 if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
3418 expectedTypes.push(checkerResult.data.expectedType);
3419 }
3420 }
3421 var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
3422 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
3423 }
3424 return createChainableTypeChecker(validate);
3425 }
3426
3427 function createNodeChecker() {
3428 function validate(props, propName, componentName, location, propFullName) {
3429 if (!isNode(props[propName])) {
3430 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
3431 }
3432 return null;
3433 }
3434 return createChainableTypeChecker(validate);
3435 }
3436
3437 function invalidValidatorError(componentName, location, propFullName, key, type) {
3438 return new PropTypeError(
3439 (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
3440 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
3441 );
3442 }
3443
3444 function createShapeTypeChecker(shapeTypes) {
3445 function validate(props, propName, componentName, location, propFullName) {
3446 var propValue = props[propName];
3447 var propType = getPropType(propValue);
3448 if (propType !== 'object') {
3449 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
3450 }
3451 for (var key in shapeTypes) {
3452 var checker = shapeTypes[key];
3453 if (typeof checker !== 'function') {
3454 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
3455 }
3456 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
3457 if (error) {
3458 return error;
3459 }
3460 }
3461 return null;
3462 }
3463 return createChainableTypeChecker(validate);
3464 }
3465
3466 function createStrictShapeTypeChecker(shapeTypes) {
3467 function validate(props, propName, componentName, location, propFullName) {
3468 var propValue = props[propName];
3469 var propType = getPropType(propValue);
3470 if (propType !== 'object') {
3471 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
3472 }
3473 // We need to check all keys in case some are required but missing from props.
3474 var allKeys = assign({}, props[propName], shapeTypes);
3475 for (var key in allKeys) {
3476 var checker = shapeTypes[key];
3477 if (has(shapeTypes, key) && typeof checker !== 'function') {
3478 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
3479 }
3480 if (!checker) {
3481 return new PropTypeError(
3482 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
3483 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
3484 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
3485 );
3486 }
3487 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
3488 if (error) {
3489 return error;
3490 }
3491 }
3492 return null;
3493 }
3494
3495 return createChainableTypeChecker(validate);
3496 }
3497
3498 function isNode(propValue) {
3499 switch (typeof propValue) {
3500 case 'number':
3501 case 'string':
3502 case 'undefined':
3503 return true;
3504 case 'boolean':
3505 return !propValue;
3506 case 'object':
3507 if (Array.isArray(propValue)) {
3508 return propValue.every(isNode);
3509 }
3510 if (propValue === null || isValidElement(propValue)) {
3511 return true;
3512 }
3513
3514 var iteratorFn = getIteratorFn(propValue);
3515 if (iteratorFn) {
3516 var iterator = iteratorFn.call(propValue);
3517 var step;
3518 if (iteratorFn !== propValue.entries) {
3519 while (!(step = iterator.next()).done) {
3520 if (!isNode(step.value)) {
3521 return false;
3522 }
3523 }
3524 } else {
3525 // Iterator will provide entry [k,v] tuples rather than values.
3526 while (!(step = iterator.next()).done) {
3527 var entry = step.value;
3528 if (entry) {
3529 if (!isNode(entry[1])) {
3530 return false;
3531 }
3532 }
3533 }
3534 }
3535 } else {
3536 return false;
3537 }
3538
3539 return true;
3540 default:
3541 return false;
3542 }
3543 }
3544
3545 function isSymbol(propType, propValue) {
3546 // Native Symbol.
3547 if (propType === 'symbol') {
3548 return true;
3549 }
3550
3551 // falsy value can't be a Symbol
3552 if (!propValue) {
3553 return false;
3554 }
3555
3556 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
3557 if (propValue['@@toStringTag'] === 'Symbol') {
3558 return true;
3559 }
3560
3561 // Fallback for non-spec compliant Symbols which are polyfilled.
3562 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
3563 return true;
3564 }
3565
3566 return false;
3567 }
3568
3569 // Equivalent of `typeof` but with special handling for array and regexp.
3570 function getPropType(propValue) {
3571 var propType = typeof propValue;
3572 if (Array.isArray(propValue)) {
3573 return 'array';
3574 }
3575 if (propValue instanceof RegExp) {
3576 // Old webkits (at least until Android 4.0) return 'function' rather than
3577 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
3578 // passes PropTypes.object.
3579 return 'object';
3580 }
3581 if (isSymbol(propType, propValue)) {
3582 return 'symbol';
3583 }
3584 return propType;
3585 }
3586
3587 // This handles more types than `getPropType`. Only used for error messages.
3588 // See `createPrimitiveTypeChecker`.
3589 function getPreciseType(propValue) {
3590 if (typeof propValue === 'undefined' || propValue === null) {
3591 return '' + propValue;
3592 }
3593 var propType = getPropType(propValue);
3594 if (propType === 'object') {
3595 if (propValue instanceof Date) {
3596 return 'date';
3597 } else if (propValue instanceof RegExp) {
3598 return 'regexp';
3599 }
3600 }
3601 return propType;
3602 }
3603
3604 // Returns a string that is postfixed to a warning about an invalid type.
3605 // For example, "undefined" or "of type array"
3606 function getPostfixForTypeWarning(value) {
3607 var type = getPreciseType(value);
3608 switch (type) {
3609 case 'array':
3610 case 'object':
3611 return 'an ' + type;
3612 case 'boolean':
3613 case 'date':
3614 case 'regexp':
3615 return 'a ' + type;
3616 default:
3617 return type;
3618 }
3619 }
3620
3621 // Returns class name of the object, if any.
3622 function getClassName(propValue) {
3623 if (!propValue.constructor || !propValue.constructor.name) {
3624 return ANONYMOUS;
3625 }
3626 return propValue.constructor.name;
3627 }
3628
3629 ReactPropTypes.checkPropTypes = checkPropTypes;
3630 ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
3631 ReactPropTypes.PropTypes = ReactPropTypes;
3632
3633 return ReactPropTypes;
3634 };
3635
3636
3637 /***/ }),
3638
3639 /***/ "../node_modules/prop-types/index.js":
3640 /*!*******************************************!*\
3641 !*** ../node_modules/prop-types/index.js ***!
3642 \*******************************************/
3643 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3644
3645 /**
3646 * Copyright (c) 2013-present, Facebook, Inc.
3647 *
3648 * This source code is licensed under the MIT license found in the
3649 * LICENSE file in the root directory of this source tree.
3650 */
3651
3652 if (true) {
3653 var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js");
3654
3655 // By explicitly using `prop-types` you are opting into new development behavior.
3656 // http://fb.me/prop-types-in-prod
3657 var throwOnDirectAccess = true;
3658 module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
3659 } else // removed by dead control flow
3660 {}
3661
3662
3663 /***/ }),
3664
3665 /***/ "../node_modules/prop-types/lib/ReactPropTypesSecret.js":
3666 /*!**************************************************************!*\
3667 !*** ../node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
3668 \**************************************************************/
3669 /***/ ((module) => {
3670
3671 "use strict";
3672 /**
3673 * Copyright (c) 2013-present, Facebook, Inc.
3674 *
3675 * This source code is licensed under the MIT license found in the
3676 * LICENSE file in the root directory of this source tree.
3677 */
3678
3679
3680
3681 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
3682
3683 module.exports = ReactPropTypesSecret;
3684
3685
3686 /***/ }),
3687
3688 /***/ "../node_modules/prop-types/lib/has.js":
3689 /*!*********************************************!*\
3690 !*** ../node_modules/prop-types/lib/has.js ***!
3691 \*********************************************/
3692 /***/ ((module) => {
3693
3694 module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
3695
3696
3697 /***/ }),
3698
3699 /***/ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js":
3700 /*!************************************************************************************!*\
3701 !*** ../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***!
3702 \************************************************************************************/
3703 /***/ ((__unused_webpack_module, exports) => {
3704
3705 "use strict";
3706 /** @license React v16.13.1
3707 * react-is.development.js
3708 *
3709 * Copyright (c) Facebook, Inc. and its affiliates.
3710 *
3711 * This source code is licensed under the MIT license found in the
3712 * LICENSE file in the root directory of this source tree.
3713 */
3714
3715
3716
3717
3718
3719 if (true) {
3720 (function() {
3721 'use strict';
3722
3723 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
3724 // nor polyfill, then a plain number is used for performance.
3725 var hasSymbol = typeof Symbol === 'function' && Symbol.for;
3726 var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
3727 var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
3728 var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
3729 var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
3730 var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
3731 var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
3732 var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
3733 // (unstable) APIs that have been removed. Can we remove the symbols?
3734
3735 var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
3736 var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
3737 var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
3738 var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
3739 var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
3740 var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
3741 var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
3742 var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
3743 var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
3744 var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
3745 var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
3746
3747 function isValidElementType(type) {
3748 return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
3749 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);
3750 }
3751
3752 function typeOf(object) {
3753 if (typeof object === 'object' && object !== null) {
3754 var $$typeof = object.$$typeof;
3755
3756 switch ($$typeof) {
3757 case REACT_ELEMENT_TYPE:
3758 var type = object.type;
3759
3760 switch (type) {
3761 case REACT_ASYNC_MODE_TYPE:
3762 case REACT_CONCURRENT_MODE_TYPE:
3763 case REACT_FRAGMENT_TYPE:
3764 case REACT_PROFILER_TYPE:
3765 case REACT_STRICT_MODE_TYPE:
3766 case REACT_SUSPENSE_TYPE:
3767 return type;
3768
3769 default:
3770 var $$typeofType = type && type.$$typeof;
3771
3772 switch ($$typeofType) {
3773 case REACT_CONTEXT_TYPE:
3774 case REACT_FORWARD_REF_TYPE:
3775 case REACT_LAZY_TYPE:
3776 case REACT_MEMO_TYPE:
3777 case REACT_PROVIDER_TYPE:
3778 return $$typeofType;
3779
3780 default:
3781 return $$typeof;
3782 }
3783
3784 }
3785
3786 case REACT_PORTAL_TYPE:
3787 return $$typeof;
3788 }
3789 }
3790
3791 return undefined;
3792 } // AsyncMode is deprecated along with isAsyncMode
3793
3794 var AsyncMode = REACT_ASYNC_MODE_TYPE;
3795 var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
3796 var ContextConsumer = REACT_CONTEXT_TYPE;
3797 var ContextProvider = REACT_PROVIDER_TYPE;
3798 var Element = REACT_ELEMENT_TYPE;
3799 var ForwardRef = REACT_FORWARD_REF_TYPE;
3800 var Fragment = REACT_FRAGMENT_TYPE;
3801 var Lazy = REACT_LAZY_TYPE;
3802 var Memo = REACT_MEMO_TYPE;
3803 var Portal = REACT_PORTAL_TYPE;
3804 var Profiler = REACT_PROFILER_TYPE;
3805 var StrictMode = REACT_STRICT_MODE_TYPE;
3806 var Suspense = REACT_SUSPENSE_TYPE;
3807 var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
3808
3809 function isAsyncMode(object) {
3810 {
3811 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
3812 hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
3813
3814 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.');
3815 }
3816 }
3817
3818 return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
3819 }
3820 function isConcurrentMode(object) {
3821 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
3822 }
3823 function isContextConsumer(object) {
3824 return typeOf(object) === REACT_CONTEXT_TYPE;
3825 }
3826 function isContextProvider(object) {
3827 return typeOf(object) === REACT_PROVIDER_TYPE;
3828 }
3829 function isElement(object) {
3830 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
3831 }
3832 function isForwardRef(object) {
3833 return typeOf(object) === REACT_FORWARD_REF_TYPE;
3834 }
3835 function isFragment(object) {
3836 return typeOf(object) === REACT_FRAGMENT_TYPE;
3837 }
3838 function isLazy(object) {
3839 return typeOf(object) === REACT_LAZY_TYPE;
3840 }
3841 function isMemo(object) {
3842 return typeOf(object) === REACT_MEMO_TYPE;
3843 }
3844 function isPortal(object) {
3845 return typeOf(object) === REACT_PORTAL_TYPE;
3846 }
3847 function isProfiler(object) {
3848 return typeOf(object) === REACT_PROFILER_TYPE;
3849 }
3850 function isStrictMode(object) {
3851 return typeOf(object) === REACT_STRICT_MODE_TYPE;
3852 }
3853 function isSuspense(object) {
3854 return typeOf(object) === REACT_SUSPENSE_TYPE;
3855 }
3856
3857 exports.AsyncMode = AsyncMode;
3858 exports.ConcurrentMode = ConcurrentMode;
3859 exports.ContextConsumer = ContextConsumer;
3860 exports.ContextProvider = ContextProvider;
3861 exports.Element = Element;
3862 exports.ForwardRef = ForwardRef;
3863 exports.Fragment = Fragment;
3864 exports.Lazy = Lazy;
3865 exports.Memo = Memo;
3866 exports.Portal = Portal;
3867 exports.Profiler = Profiler;
3868 exports.StrictMode = StrictMode;
3869 exports.Suspense = Suspense;
3870 exports.isAsyncMode = isAsyncMode;
3871 exports.isConcurrentMode = isConcurrentMode;
3872 exports.isContextConsumer = isContextConsumer;
3873 exports.isContextProvider = isContextProvider;
3874 exports.isElement = isElement;
3875 exports.isForwardRef = isForwardRef;
3876 exports.isFragment = isFragment;
3877 exports.isLazy = isLazy;
3878 exports.isMemo = isMemo;
3879 exports.isPortal = isPortal;
3880 exports.isProfiler = isProfiler;
3881 exports.isStrictMode = isStrictMode;
3882 exports.isSuspense = isSuspense;
3883 exports.isValidElementType = isValidElementType;
3884 exports.typeOf = typeOf;
3885 })();
3886 }
3887
3888
3889 /***/ }),
3890
3891 /***/ "../node_modules/prop-types/node_modules/react-is/index.js":
3892 /*!*****************************************************************!*\
3893 !*** ../node_modules/prop-types/node_modules/react-is/index.js ***!
3894 \*****************************************************************/
3895 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3896
3897 "use strict";
3898
3899
3900 if (false) // removed by dead control flow
3901 {} else {
3902 module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js");
3903 }
3904
3905
3906 /***/ }),
3907
3908 /***/ "../node_modules/react-dom/client.js":
3909 /*!*******************************************!*\
3910 !*** ../node_modules/react-dom/client.js ***!
3911 \*******************************************/
3912 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3913
3914 "use strict";
3915
3916
3917 var m = __webpack_require__(/*! react-dom */ "react-dom");
3918 if (false) // removed by dead control flow
3919 {} else {
3920 var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3921 exports.createRoot = function(c, o) {
3922 i.usingClientEntryPoint = true;
3923 try {
3924 return m.createRoot(c, o);
3925 } finally {
3926 i.usingClientEntryPoint = false;
3927 }
3928 };
3929 exports.hydrateRoot = function(c, h, o) {
3930 i.usingClientEntryPoint = true;
3931 try {
3932 return m.hydrateRoot(c, h, o);
3933 } finally {
3934 i.usingClientEntryPoint = false;
3935 }
3936 };
3937 }
3938
3939
3940 /***/ }),
3941
3942 /***/ "@elementor/icons":
3943 /*!************************************!*\
3944 !*** external "elementorV2.icons" ***!
3945 \************************************/
3946 /***/ ((module) => {
3947
3948 "use strict";
3949 module.exports = elementorV2.icons;
3950
3951 /***/ }),
3952
3953 /***/ "@elementor/ui":
3954 /*!*********************************!*\
3955 !*** external "elementorV2.ui" ***!
3956 \*********************************/
3957 /***/ ((module) => {
3958
3959 "use strict";
3960 module.exports = elementorV2.ui;
3961
3962 /***/ }),
3963
3964 /***/ "@elementor/ui/DialogHeader":
3965 /*!*************************************************!*\
3966 !*** external "elementorV2.ui['DialogHeader']" ***!
3967 \*************************************************/
3968 /***/ ((module) => {
3969
3970 "use strict";
3971 module.exports = elementorV2.ui['DialogHeader'];
3972
3973 /***/ }),
3974
3975 /***/ "@elementor/ui/DialogHeaderGroup":
3976 /*!******************************************************!*\
3977 !*** external "elementorV2.ui['DialogHeaderGroup']" ***!
3978 \******************************************************/
3979 /***/ ((module) => {
3980
3981 "use strict";
3982 module.exports = elementorV2.ui['DialogHeaderGroup'];
3983
3984 /***/ }),
3985
3986 /***/ "@wordpress/i18n":
3987 /*!**************************!*\
3988 !*** external "wp.i18n" ***!
3989 \**************************/
3990 /***/ ((module) => {
3991
3992 "use strict";
3993 module.exports = wp.i18n;
3994
3995 /***/ }),
3996
3997 /***/ "react":
3998 /*!************************!*\
3999 !*** external "React" ***!
4000 \************************/
4001 /***/ ((module) => {
4002
4003 "use strict";
4004 module.exports = React;
4005
4006 /***/ }),
4007
4008 /***/ "react-dom":
4009 /*!***************************!*\
4010 !*** external "ReactDOM" ***!
4011 \***************************/
4012 /***/ ((module) => {
4013
4014 "use strict";
4015 module.exports = ReactDOM;
4016
4017 /***/ })
4018
4019 /******/ });
4020 /************************************************************************/
4021 /******/ // The module cache
4022 /******/ var __webpack_module_cache__ = {};
4023 /******/
4024 /******/ // The require function
4025 /******/ function __webpack_require__(moduleId) {
4026 /******/ // Check if module is in cache
4027 /******/ var cachedModule = __webpack_module_cache__[moduleId];
4028 /******/ if (cachedModule !== undefined) {
4029 /******/ return cachedModule.exports;
4030 /******/ }
4031 /******/ // Create a new module (and put it into the cache)
4032 /******/ var module = __webpack_module_cache__[moduleId] = {
4033 /******/ // no module.id needed
4034 /******/ // no module.loaded needed
4035 /******/ exports: {}
4036 /******/ };
4037 /******/
4038 /******/ // Execute the module function
4039 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
4040 /******/
4041 /******/ // Return the exports of the module
4042 /******/ return module.exports;
4043 /******/ }
4044 /******/
4045 /************************************************************************/
4046 var __webpack_exports__ = {};
4047 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
4048 (() => {
4049 "use strict";
4050 /*!*************************************************************!*\
4051 !*** ../modules/atomic-opt-in/assets/js/opt-in-page/app.js ***!
4052 \*************************************************************/
4053 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
4054
4055
4056 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4057 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
4058 var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js"));
4059 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
4060 var _optIn = __webpack_require__(/*! ./opt-in */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in.js");
4061 var App = function App(props) {
4062 return /*#__PURE__*/_react.default.createElement(_ui.DirectionProvider, {
4063 rtl: props.isRTL
4064 }, /*#__PURE__*/_react.default.createElement(_ui.LocalizationProvider, null, /*#__PURE__*/_react.default.createElement(_ui.ThemeProvider, {
4065 colorScheme: 'light'
4066 }, /*#__PURE__*/_react.default.createElement(_optIn.OptIn, {
4067 state: props === null || props === void 0 ? void 0 : props.state
4068 }))));
4069 };
4070 App.propTypes = {
4071 isRTL: PropTypes.bool,
4072 state: PropTypes.object
4073 };
4074 var init = function init() {
4075 var rootElement = document.querySelector('#page-editor-v4-opt-in');
4076 if (!rootElement) {
4077 return;
4078 }
4079 _react2.default.render(/*#__PURE__*/_react.default.createElement(App, {
4080 isRTL: !!elementorCommon.config.isRTL,
4081 state: elementorSettingsEditor4OptIn
4082 }), rootElement);
4083 };
4084 init();
4085 })();
4086
4087 /******/ })()
4088 ;
4089 //# sourceMappingURL=editor-v4-opt-in.js.map