packages
1 month ago
00f53f1b378f6c98c043.bundle.min.js
4 months ago
0352e30f394e8e1dd4dc.bundle.js
2 months ago
0982f37bec0944fbcb10.bundle.js
4 months ago
0bc41c4656ca54cf2aca.bundle.min.js
4 months ago
137ba3baf43f287996c2.bundle.min.js
4 months ago
1564d2bfa4591bf857f3.bundle.min.js
4 months ago
197583acd246fea0e25d.bundle.js
5 months ago
1f7fa1d64dd4cef4a3c0.bundle.js
4 months ago
2140afa714e988f1069e.bundle.js
2 months ago
32f7c5e8db4c8976b254.bundle.js
2 months ago
35423d812dc1d52fdb27.bundle.min.js
4 months ago
397f2d183c19202777d6.bundle.min.js
3 months ago
397f2d183c19202777d6.bundle.min.js.LICENSE.txt
3 months ago
3c18b6eb4e735ca7e8bf.bundle.js
4 months ago
3c838288a9b7ddd2aea4.bundle.min.js
4 months ago
3d1613aca86991103452.bundle.min.js
4 months ago
3d410a099008411bb011.bundle.js
5 months ago
3df4dbb5d612dbdab477.bundle.min.js
2 months ago
40d841f4b4ce7b1928f5.bundle.js
4 months ago
4246c56134ca9ba65163.bundle.js
4 months ago
435080452e81c388e779.bundle.min.js
2 months ago
4812775bcbc0ff8a9043.bundle.min.js
4 months ago
4886b33c17731474e197.bundle.min.js
4 months ago
4927500be197e062162e.bundle.min.js
2 months ago
52ff17c2f566e528dc72.bundle.js
2 months ago
5b13d0f77c0ac139c979.bundle.js
4 months ago
5b74c81f4d425912a202.bundle.min.js
2 months ago
6117d083decd13b6ed73.bundle.js
2 months ago
64b3c0850f66b46478fb.bundle.min.js
2 months ago
6844b6c0a66040e3ca12.bundle.js
2 months ago
6a19e86dd8c1f9165dbe.bundle.js
5 months ago
6caa76d2f6eec6c4e665.bundle.js
3 months ago
6cb9e42b9b73a76315e0.bundle.js
4 months ago
6d09ff0398a56a60654b.bundle.min.js
3 months ago
6f779545aaa23e951088.bundle.min.js
2 months ago
72459a35b6570acc77f3.bundle.js
4 months ago
7745b82dc4a05385ef1f.bundle.js
4 months ago
78dd4dee6173d40eb75a.bundle.min.js
2 months ago
7dae73b622bebe8a5d94.bundle.js
4 months ago
7f2c78456ab3f406f3df.bundle.js
4 months ago
8277989eebcfba278cb0.bundle.min.js
7 months ago
84288e5699f5d8b8b23e.bundle.min.js
4 months ago
877227b9d759b63096a9.bundle.js
4 months ago
8ac2c6e532225b54dba2.bundle.js
4 months ago
8b4f35f99eb521b37d0c.bundle.js
4 months ago
8e5b42844d27eada9b53.bundle.min.js
2 months ago
8e80438d29fc79b648e5.bundle.js
2 months ago
8e8b47ad5b4e4d038c80.bundle.js
4 months ago
8ecfd8495b7ec419862a.bundle.js
4 months ago
979a9c03fe10da23400d.bundle.js
2 months ago
9832c866a8fe9b51f9d2.bundle.min.js
4 months ago
9b97a73ee8fdc5fb7dc3.bundle.js
3 months ago
9bd390911e34b349d8cb.bundle.min.js
2 months ago
9dcd9e88237da6496816.bundle.min.js
4 months ago
9e7e356552c03a622b0f.bundle.js
2 months ago
a2ea929f439e819b924b.bundle.min.js
4 months ago
a9f41949787209626737.bundle.min.js
4 months ago
ac53273f887639e3c6ea.bundle.min.js
4 months ago
accordion.8b0db5058afeb74622f5.bundle.min.js
7 months ago
accordion.b9a0ab19c7c872c405d7.bundle.js
5 months ago
admin-feedback.js
7 months ago
admin-feedback.min.js
7 months ago
admin-feedback.strings.js
2 months ago
admin-modules.js
5 months ago
admin-modules.min.js
5 months ago
admin-modules.min.js.LICENSE.txt
10 months ago
admin-modules.strings.js
1 month ago
admin-notifications.js
7 months ago
admin-notifications.min.js
7 months ago
admin-notifications.strings.js
5 months ago
admin-top-bar.js
2 months ago
admin-top-bar.min.js
2 months ago
admin-top-bar.strings.js
5 months ago
admin.js
2 months ago
admin.min.js
2 months ago
admin.min.js.LICENSE.txt
10 months ago
admin.strings.js
5 months ago
aee13673e923469c3275.bundle.min.js
4 months ago
ai-admin.js
5 months ago
ai-admin.min.js
5 months ago
ai-admin.min.js.LICENSE.txt
10 months ago
ai-admin.strings.js
5 months ago
ai-gutenberg.js
5 months ago
ai-gutenberg.min.js
5 months ago
ai-gutenberg.min.js.LICENSE.txt
10 months ago
ai-gutenberg.strings.js
5 months ago
ai-layout.js
3 months ago
ai-layout.min.js
3 months ago
ai-layout.min.js.LICENSE.txt
10 months ago
ai-layout.strings.js
2 months ago
ai-media-library.js
5 months ago
ai-media-library.min.js
5 months ago
ai-media-library.min.js.LICENSE.txt
10 months ago
ai-media-library.strings.js
5 months ago
ai-unify-product-images.js
5 months ago
ai-unify-product-images.min.js
5 months ago
ai-unify-product-images.min.js.LICENSE.txt
10 months ago
ai-unify-product-images.strings.js
5 months ago
ai.js
5 months ago
ai.min.js
5 months ago
ai.min.js.LICENSE.txt
10 months ago
ai.strings.js
1 month ago
alert.42cc1d522ef5c60bf874.bundle.min.js
7 months ago
alert.fd509aa768e7b35a8e32.bundle.js
5 months ago
announcements-app.js
2 months ago
announcements-app.min.js
2 months ago
announcements-app.min.js.LICENSE.txt
10 months ago
announcements-app.strings.js
5 months ago
app-loader.js
5 months ago
app-loader.min.js
7 months ago
app-loader.strings.js
1 month ago
app-packages.js
4 months ago
app-packages.min.js
4 months ago
app-packages.min.js.LICENSE.txt
10 months ago
app-packages.strings.js
1 month ago
app.js
2 months ago
app.min.js
2 months ago
app.min.js.LICENSE.txt
10 months ago
app.strings.js
1 month ago
atomic-widgets-editor.js
1 month ago
atomic-widgets-editor.min.js
1 month ago
atomic-widgets-editor.min.js.LICENSE.txt
4 months ago
atomic-widgets-editor.strings.js
2 months ago
atomic-widgets-frontend-handler.js
1 month ago
atomic-widgets-frontend-handler.min.js
1 month ago
b09b262748a4be8417ce.bundle.js
4 months ago
b668f6906820570e60b5.bundle.min.js
4 months ago
b96d70044d0d67c2df19.bundle.min.js
7 months ago
b97ced1683f62f5686fa.bundle.min.js
4 months ago
bcb5135af6b817bc9708.bundle.min.js
2 months ago
beta-tester.js
7 months ago
beta-tester.min.js
7 months ago
beta-tester.strings.js
5 months ago
bff204c1ab0d15e0a69b.bundle.min.js
4 months ago
c13d205fa26f8af1ce7c.bundle.js
5 months ago
cf6ec600fcf4e08ba6d3.bundle.js
4 months ago
checklist.js
5 months ago
checklist.min.js
5 months ago
checklist.min.js.LICENSE.txt
10 months ago
checklist.strings.js
5 months ago
cloud-library-screenshot.js
5 months ago
cloud-library-screenshot.min.js
5 months ago
cloud-library-screenshot.min.js.LICENSE.txt
7 months ago
cloud-library-screenshot.strings.js
5 months ago
common-modules.js
2 months ago
common-modules.min.js
2 months ago
common-modules.strings.js
5 months ago
common.js
1 month ago
common.min.js
1 month ago
common.min.js.LICENSE.txt
10 months ago
common.strings.js
5 months ago
contact-buttons.086261d3e9c4d8037686.bundle.js
5 months ago
contact-buttons.e98d0220ce8c38404e7e.bundle.min.js
7 months ago
container-converter.js
7 months ago
container-converter.min.js
7 months ago
container-converter.strings.js
5 months ago
container-editor-handlers.a2e8e48d28c5544fb183.bundle.min.js
4 months ago
container-editor-handlers.e7e069c4e656425c51f8.bundle.js
4 months ago
counter.12335f45aaa79d244f24.bundle.min.js
7 months ago
counter.7310c276bc7865a3d438.bundle.js
5 months ago
d245aa80c28d9ec3617d.bundle.js
2 months ago
d42de03ef4a0f50e39ca.bundle.min.js
4 months ago
d4c67aa71d8173f6201f.bundle.js
2 months ago
d52aa05c75af56327744.bundle.js
5 months ago
d67ddd6f08b08392c42f.bundle.js
5 months ago
daedc6797eaad5c82711.bundle.min.js
7 months ago
db27207322ef9be952ee.bundle.js
4 months ago
design-system-sync.js
1 month ago
design-system-sync.min.js
1 month ago
design-system-sync.strings.js
2 months ago
dev-tools.js
7 months ago
dev-tools.min.js
7 months ago
dev-tools.strings.js
5 months ago
df2f2a2ae20e0181ec2d.bundle.js
2 months ago
e-home-screen.js
2 months ago
e-home-screen.min.js
2 months ago
e-home-screen.strings.js
2 months ago
e-react-promotions.js
1 month ago
e-react-promotions.min.js
1 month ago
e-react-promotions.min.js.LICENSE.txt
1 month ago
e-react-promotions.strings.js
5 months ago
e-wc-product-editor.js
5 months ago
e-wc-product-editor.min.js
7 months ago
e-wc-product-editor.min.js.LICENSE.txt
1 year ago
e-wc-product-editor.strings.js
5 months ago
e1cb4d726bb59646c677.bundle.min.js
7 months ago
e3b540e2c02813e75f38.bundle.min.js
4 months ago
e459c6c89c0c0899c850.bundle.js
5 months ago
e7d71f4e1d39edbc1fb6.bundle.js
4 months ago
eb5018119ee87fd6a7fc.bundle.min.js
2 months ago
editor-document.js
5 months ago
editor-document.min.js
7 months ago
editor-document.strings.js
1 month ago
editor-environment-v2.js
7 months ago
editor-environment-v2.min.js
7 months ago
editor-environment-v2.strings.js
5 months ago
editor-interactions.js
2 months ago
editor-interactions.min.js
2 months ago
editor-interactions.strings.js
5 months ago
editor-loader-v1.js
7 months ago
editor-loader-v1.min.js
7 months ago
editor-loader-v1.strings.js
5 months ago
editor-loader-v2.js
7 months ago
editor-loader-v2.min.js
7 months ago
editor-loader-v2.strings.js
5 months ago
editor-modules.js
2 months ago
editor-modules.min.js
2 months ago
editor-modules.min.js.LICENSE.txt
10 months ago
editor-modules.strings.js
1 month ago
editor-notifications.js
7 months ago
editor-notifications.min.js
7 months ago
editor-notifications.strings.js
5 months ago
editor-one-admin.js
5 months ago
editor-one-admin.min.js
5 months ago
editor-one-admin.strings.js
5 months ago
editor-one-menu.js
4 months ago
editor-one-menu.min.js
4 months ago
editor-one-menu.strings.js
5 months ago
editor-one-sidebar-navigation.js
2 months ago
editor-one-sidebar-navigation.min.js
2 months ago
editor-one-sidebar-navigation.min.js.LICENSE.txt
5 months ago
editor-one-sidebar-navigation.strings.js
5 months ago
editor-one-top-bar.js
2 months ago
editor-one-top-bar.min.js
2 months ago
editor-one-top-bar.min.js.LICENSE.txt
4 months ago
editor-one-top-bar.strings.js
4 months ago
editor-v4-opt-in-alphachip.js
2 months ago
editor-v4-opt-in-alphachip.min.js
2 months ago
editor-v4-opt-in-alphachip.strings.js
2 months ago
editor-v4-opt-in.js
2 months ago
editor-v4-opt-in.min.js
2 months ago
editor-v4-opt-in.min.js.LICENSE.txt
5 months ago
editor-v4-opt-in.strings.js
2 months ago
editor.js
1 month ago
editor.min.js
1 month ago
editor.min.js.LICENSE.txt
5 months ago
editor.strings.js
5 months ago
ef2100ac3eda1a957819.bundle.min.js
7 months ago
ef35c83e4628f0a5c328.bundle.js
4 months ago
element-manager-admin.js
2 months ago
element-manager-admin.min.js
2 months ago
element-manager-admin.min.js.LICENSE.txt
10 months ago
element-manager-admin.strings.js
2 months ago
elementor-admin-bar.js
7 months ago
elementor-admin-bar.min.js
7 months ago
elementor-admin-bar.strings.js
5 months ago
f56b0d1257a5346afe64.bundle.min.js
2 months ago
fdda4547e887fbda71b3.bundle.js
2 months ago
fdf69f4e1f300fb27472.bundle.min.js
2 months ago
floating-bars.740d06d17cea5cebdb61.bundle.min.js
7 months ago
floating-bars.a6e6a043444b62f64f82.bundle.js
5 months ago
floating-elements-modal.js
2 months ago
floating-elements-modal.min.js
2 months ago
floating-elements-modal.strings.js
5 months ago
frontend-modules.js
2 months ago
frontend-modules.min.js
2 months ago
frontend.js
3 months ago
frontend.min.js
3 months ago
gutenberg.js
7 months ago
gutenberg.min.js
7 months ago
gutenberg.strings.js
2 months ago
image-carousel.6167d20b95b33386757b.bundle.min.js
7 months ago
image-carousel.8b25f3674c29b829a867.bundle.js
5 months ago
import-export-admin.js
5 months ago
import-export-admin.min.js
5 months ago
import-export-admin.strings.js
1 month ago
import-export-customization-admin.js
2 months ago
import-export-customization-admin.min.js
2 months ago
import-export-customization-admin.min.js.LICENSE.txt
7 months ago
import-export-customization-admin.strings.js
1 month ago
interactions-shared-utils.js
2 months ago
interactions-shared-utils.min.js
2 months ago
interactions-shared-utils.strings.js
2 months ago
interactions.js
1 month ago
interactions.min.js
1 month ago
interactions.strings.js
5 months ago
kit-elements-defaults-editor.js
5 months ago
kit-elements-defaults-editor.min.js
5 months ago
kit-elements-defaults-editor.min.js.LICENSE.txt
10 months ago
kit-elements-defaults-editor.strings.js
5 months ago
kit-library.a394510096bc447f636d.bundle.min.js
2 months ago
kit-library.b768952e1d4177aa68d8.bundle.js
2 months ago
lightbox.570c05c5a283cfb6b223.bundle.min.js
3 months ago
lightbox.d9ea72d232a14f514ee2.bundle.js
3 months ago
media-hints.js
7 months ago
media-hints.min.js
7 months ago
media-hints.strings.js
5 months ago
nested-accordion.294d40984397351fd0f5.bundle.min.js
4 months ago
nested-accordion.4340b64226322f36bcc0.bundle.js
4 months ago
nested-accordion.js
5 months ago
nested-accordion.min.js
5 months ago
nested-accordion.min.js.LICENSE.txt
10 months ago
nested-accordion.strings.js
5 months ago
nested-elements.js
3 months ago
nested-elements.min.js
3 months ago
nested-elements.strings.js
5 months ago
nested-tabs.7a338e6d7e060c473993.bundle.js
5 months ago
nested-tabs.a2401356d329f179475e.bundle.min.js
6 months ago
nested-tabs.js
5 months ago
nested-tabs.min.js
5 months ago
nested-tabs.min.js.LICENSE.txt
10 months ago
nested-tabs.strings.js
5 months ago
nested-title-keyboard-handler.0c2b498e3e0695a1dc19.bundle.js
5 months ago
nested-title-keyboard-handler.2a67d3cc630e11815acc.bundle.min.js
6 months ago
new-template.js
4 months ago
new-template.min.js
4 months ago
new-template.strings.js
5 months ago
notes.js
7 months ago
notes.min.js
7 months ago
notes.strings.js
5 months ago
pro-free-trial-popup.js
7 months ago
pro-free-trial-popup.min.js
7 months ago
pro-free-trial-popup.strings.js
5 months ago
pro-install-events.js
7 months ago
pro-install-events.min.js
7 months ago
pro-install-events.strings.js
5 months ago
progress.0ea083b809812c0e3aa1.bundle.min.js
7 months ago
progress.b1057ba870016558bce1.bundle.js
5 months ago
responsive-bar.js
7 months ago
responsive-bar.min.js
7 months ago
responsive-bar.strings.js
5 months ago
section-editor-handlers.53ffedef32043348b99b.bundle.min.js
7 months ago
section-editor-handlers.d65899d232b5339510d7.bundle.js
5 months ago
section-frontend-handlers.c3950c6b190ca134bc8d.bundle.js
5 months ago
section-frontend-handlers.d85ab872da118940910d.bundle.min.js
7 months ago
shared-editor-handlers.3023894100138e442ab0.bundle.js
4 months ago
shared-editor-handlers.cacdcbed391abf4b48b0.bundle.min.js
4 months ago
shared-frontend-handlers.03caa53373b56d3bab67.bundle.min.js
7 months ago
shared-frontend-handlers.3b079824c37a5fe2bdaa.bundle.js
5 months ago
styleguide-app-initiator.js
5 months ago
styleguide-app-initiator.min.js
5 months ago
styleguide-app-initiator.min.js.LICENSE.txt
10 months ago
styleguide-app-initiator.strings.js
5 months ago
styleguide-app.04340244193733d78622.bundle.min.js
7 months ago
styleguide-app.36ecabae74d9b87fc5a8.bundle.js
5 months ago
styleguide.js
7 months ago
styleguide.min.js
7 months ago
styleguide.strings.js
4 months ago
tabs-handler.js
2 months ago
tabs-handler.min.js
2 months ago
tabs-preview-handler.js
5 months ago
tabs-preview-handler.min.js
5 months ago
tabs.18344b05d8d1ea0702bc.bundle.min.js
7 months ago
tabs.40498fa771d612162c53.bundle.js
5 months ago
text-editor.0c9960167105139d27c9.bundle.js
5 months ago
text-editor.45609661e409413f1cef.bundle.min.js
7 months ago
text-path.6db73cc0a10a70f128eb.bundle.js
3 months ago
text-path.a67c1f3a78d208bc7e1b.bundle.min.js
3 months ago
toggle.2a177a3ef4785d3dfbc5.bundle.min.js
7 months ago
toggle.b75e66d2aca6f6ee742e.bundle.js
5 months ago
video.6e96510afa701d1f2ebc.bundle.js
5 months ago
video.86d44e46e43d0807e708.bundle.min.js
7 months ago
web-cli.js
5 months ago
web-cli.min.js
5 months ago
web-cli.min.js.LICENSE.txt
10 months ago
web-cli.strings.js
5 months ago
webpack.runtime.js
3 months ago
webpack.runtime.min.js
3 months ago
wp-audio.0ba9114964acf4c37ca2.bundle.js
5 months ago
wp-audio.c9624cb6e5dc9de86abd.bundle.min.js
7 months ago
youtube-handler.js
5 months ago
youtube-handler.min.js
5 months ago
atomic-widgets-editor.js
3258 lines
| 1 | /******/ (() => { // webpackBootstrap |
| 2 | /******/ var __webpack_modules__ = ({ |
| 3 | |
| 4 | /***/ "../assets/dev/js/editor/elements/views/behaviors/sortable.js": |
| 5 | /*!********************************************************************!*\ |
| 6 | !*** ../assets/dev/js/editor/elements/views/behaviors/sortable.js ***! |
| 7 | \********************************************************************/ |
| 8 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9 | |
| 10 | "use strict"; |
| 11 | |
| 12 | |
| 13 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 14 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 15 | 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; } |
| 16 | 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; } |
| 17 | var SortableBehavior; |
| 18 | |
| 19 | /** |
| 20 | * @typedef {import('../../../container/container')} Container |
| 21 | */ |
| 22 | SortableBehavior = Marionette.Behavior.extend({ |
| 23 | defaults: { |
| 24 | elChildType: 'widget' |
| 25 | }, |
| 26 | events: { |
| 27 | sortstart: 'onSortStart', |
| 28 | sortreceive: 'onSortReceive', |
| 29 | sortupdate: 'onSortUpdate', |
| 30 | sortover: 'onSortOver', |
| 31 | sortout: 'onSortOut' |
| 32 | }, |
| 33 | initialize: function initialize() { |
| 34 | this.listenTo(elementor.channels.dataEditMode, 'switch', this.onEditModeSwitched).listenTo(this.view.options.model, 'request:sort:start', this.startSort).listenTo(this.view.options.model, 'request:sort:update', this.updateSort).listenTo(this.view.options.model, 'request:sort:receive', this.receiveSort); |
| 35 | }, |
| 36 | onEditModeSwitched: function onEditModeSwitched(activeMode) { |
| 37 | this.onToggleSortMode('edit' === activeMode); |
| 38 | }, |
| 39 | refresh: function refresh() { |
| 40 | this.onEditModeSwitched(elementor.channels.dataEditMode.request('activeMode')); |
| 41 | }, |
| 42 | onRender: function onRender() { |
| 43 | var _this = this; |
| 44 | this.view.collection.on('update', function () { |
| 45 | return _this.refresh(); |
| 46 | }); |
| 47 | _.defer(function () { |
| 48 | return _this.refresh(); |
| 49 | }); |
| 50 | }, |
| 51 | onDestroy: function onDestroy() { |
| 52 | this.deactivate(); |
| 53 | }, |
| 54 | /** |
| 55 | * Create an item placeholder in order to avoid UI jumps due to flex. |
| 56 | * |
| 57 | * @param {Object} $element - jQuery element instance to create placeholder for. |
| 58 | * @param {string} className - Placeholder class. |
| 59 | * @param {boolean} hide - Whether to hide the original element. |
| 60 | * |
| 61 | * @return {void} |
| 62 | */ |
| 63 | createPlaceholder: function createPlaceholder($element) { |
| 64 | var className = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; |
| 65 | var hide = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; |
| 66 | // Get the actual item size. |
| 67 | $element.css('display', ''); |
| 68 | var _$element$ = $element[0], |
| 69 | width = _$element$.clientWidth, |
| 70 | height = _$element$.clientHeight; |
| 71 | if (hide) { |
| 72 | $element.css('display', 'none'); |
| 73 | } |
| 74 | jQuery('<div />').css(_objectSpread(_objectSpread({}, $element.css(['flex-basis', 'flex-grow', 'flex-shrink', 'position'])), {}, { |
| 75 | width: width, |
| 76 | height: height |
| 77 | })).addClass(className).insertAfter($element); |
| 78 | }, |
| 79 | /** |
| 80 | * Return a settings object for jQuery UI sortable to make it swappable. |
| 81 | * |
| 82 | * @return {{stop: Function, start: Function}} options |
| 83 | */ |
| 84 | getSwappableOptions: function getSwappableOptions() { |
| 85 | var _this2 = this; |
| 86 | var $childViewContainer = this.getChildViewContainer(), |
| 87 | placeholderClass = 'e-swappable--item-placeholder'; |
| 88 | return { |
| 89 | start: function start(event, ui) { |
| 90 | $childViewContainer.sortable('refreshPositions'); |
| 91 | |
| 92 | // TODO: Find a better solution than this hack. |
| 93 | // Used in order to prevent dragging a container into itself. |
| 94 | _this2.createPlaceholder(ui.item, placeholderClass); |
| 95 | }, |
| 96 | stop: function stop() { |
| 97 | // Cleanup. |
| 98 | $childViewContainer.find(".".concat(placeholderClass)).remove(); |
| 99 | } |
| 100 | }; |
| 101 | }, |
| 102 | onToggleSortMode: function onToggleSortMode(isActive) { |
| 103 | if (isActive) { |
| 104 | this.activate(); |
| 105 | } else { |
| 106 | this.deactivate(); |
| 107 | } |
| 108 | }, |
| 109 | applySortable: function applySortable() { |
| 110 | if (!elementor.userCan('design')) { |
| 111 | return; |
| 112 | } |
| 113 | var $childViewContainer = this.getChildViewContainer(), |
| 114 | defaultSortableOptions = { |
| 115 | placeholder: 'elementor-sortable-placeholder elementor-' + this.getOption('elChildType') + '-placeholder', |
| 116 | cursorAt: { |
| 117 | top: 20, |
| 118 | left: 25 |
| 119 | }, |
| 120 | helper: this._getSortableHelper.bind(this), |
| 121 | cancel: 'input, textarea, button, select, option, .elementor-inline-editing, .elementor-tab-title', |
| 122 | // Fix: Sortable - Unable to drag and drop sections with huge height. |
| 123 | start: function start() { |
| 124 | $childViewContainer.sortable('refreshPositions'); |
| 125 | } |
| 126 | }; |
| 127 | var sortableOptions = _.extend(defaultSortableOptions, this.view.getSortableOptions()); |
| 128 | |
| 129 | // Add a swappable behavior (used for flex containers). |
| 130 | if (this.isSwappable()) { |
| 131 | $childViewContainer.addClass('e-swappable'); |
| 132 | sortableOptions = _.extend(sortableOptions, this.getSwappableOptions()); |
| 133 | } |
| 134 | |
| 135 | // TODO: Temporary hack for Container. |
| 136 | // Will be removed in the future when the Navigator will use React. |
| 137 | if (sortableOptions.preventInit) { |
| 138 | return; |
| 139 | } |
| 140 | $childViewContainer.sortable(sortableOptions); |
| 141 | }, |
| 142 | /** |
| 143 | * Enable sorting for this element, and generate sortable instance for it unless already generated. |
| 144 | */ |
| 145 | activate: function activate() { |
| 146 | if (!this.getChildViewContainer().sortable('instance')) { |
| 147 | // Generate sortable instance for this element. Since fresh instances of sortable already allowing sorting, |
| 148 | // we can return. |
| 149 | this.applySortable(); |
| 150 | return; |
| 151 | } |
| 152 | this.getChildViewContainer().sortable('enable'); |
| 153 | }, |
| 154 | _getSortableHelper: function _getSortableHelper(event, $item) { |
| 155 | var model = this.view.collection.get({ |
| 156 | cid: $item.data('model-cid') |
| 157 | }); |
| 158 | return '<div style="height: 84px; width: 125px;" class="elementor-sortable-helper elementor-sortable-helper-' + model.get('elType') + '"><div class="icon"><i class="' + model.getIcon() + '"></i></div><div class="title-wrapper"><div class="title">' + model.getTitle() + '</div></div></div>'; |
| 159 | }, |
| 160 | getChildViewContainer: function getChildViewContainer() { |
| 161 | return this.view.getChildViewContainer(this.view); |
| 162 | }, |
| 163 | // The natural widget index in the column is wrong, since there are other elements |
| 164 | // at the beginning of the column (background-overlay, element-overlay, resizeable-handle) |
| 165 | getSortedElementNewIndex: function getSortedElementNewIndex($element) { |
| 166 | var widgets = Object.values($element.parent().find('> .elementor-element')); |
| 167 | return widgets.indexOf($element[0]); |
| 168 | }, |
| 169 | /** |
| 170 | * Disable sorting of the element unless no sortable instance exists, in which case there is already no option to |
| 171 | * sort. |
| 172 | */ |
| 173 | deactivate: function deactivate() { |
| 174 | var childViewContainer = this.getChildViewContainer(); |
| 175 | if (childViewContainer.sortable('instance')) { |
| 176 | childViewContainer.sortable('disable'); |
| 177 | } |
| 178 | }, |
| 179 | /** |
| 180 | * Determine if the current instance of Sortable is swappable. |
| 181 | * |
| 182 | * @return {boolean} is swappable |
| 183 | */ |
| 184 | isSwappable: function isSwappable() { |
| 185 | return !!this.view.getSortableOptions().swappable; |
| 186 | }, |
| 187 | startSort: function startSort(event, ui) { |
| 188 | event.stopPropagation(); |
| 189 | var container = elementor.getContainer(ui.item.attr('data-id')); |
| 190 | elementor.channels.data.reply('dragging:model', container.model).reply('dragging:view', container.view).reply('dragging:parent:view', this.view).trigger('drag:start', container.model).trigger(container.model.get('elType') + ':drag:start'); |
| 191 | }, |
| 192 | // On sorting element |
| 193 | updateSort: function updateSort(ui, newIndex) { |
| 194 | if (undefined === newIndex) { |
| 195 | newIndex = ui.item.index(); |
| 196 | } |
| 197 | var child = elementor.channels.data.request('dragging:view').getContainer(); |
| 198 | var result = this.moveChild(child, newIndex); |
| 199 | if (!result) { |
| 200 | jQuery(ui.sender).sortable('cancel'); |
| 201 | } |
| 202 | }, |
| 203 | // On receiving element from another container |
| 204 | receiveSort: function receiveSort(event, ui, newIndex) { |
| 205 | event.stopPropagation(); |
| 206 | if (this.view.isCollectionFilled()) { |
| 207 | jQuery(ui.sender).sortable('cancel'); |
| 208 | return; |
| 209 | } |
| 210 | var model = elementor.channels.data.request('dragging:model'), |
| 211 | draggedElType = model.get('elType'), |
| 212 | draggedIsInnerSection = 'section' === draggedElType && model.get('isInner'), |
| 213 | targetIsInnerColumn = 'column' === this.view.getElementType() && this.view.isInner(); |
| 214 | if (draggedIsInnerSection && targetIsInnerColumn) { |
| 215 | jQuery(ui.sender).sortable('cancel'); |
| 216 | return; |
| 217 | } |
| 218 | if (undefined === newIndex) { |
| 219 | newIndex = ui.item.index(); |
| 220 | } |
| 221 | var child = elementor.channels.data.request('dragging:view').getContainer(); |
| 222 | var result = this.moveChild(child, newIndex); |
| 223 | if (!result) { |
| 224 | jQuery(ui.sender).sortable('cancel'); |
| 225 | } |
| 226 | }, |
| 227 | onSortStart: function onSortStart(event, ui) { |
| 228 | if ('column' === this.options.elChildType) { |
| 229 | var uiData = ui.item.data('sortableItem'), |
| 230 | uiItems = uiData.items, |
| 231 | itemHeight = 0; |
| 232 | uiItems.forEach(function (item) { |
| 233 | if (item.item[0] === ui.item[0]) { |
| 234 | itemHeight = item.height; |
| 235 | return false; |
| 236 | } |
| 237 | }); |
| 238 | ui.placeholder.height(itemHeight); |
| 239 | } |
| 240 | this.startSort(event, ui); |
| 241 | }, |
| 242 | onSortOver: function onSortOver(event) { |
| 243 | event.stopPropagation(); |
| 244 | var model = elementor.channels.data.request('dragging:model'); |
| 245 | jQuery(event.target).addClass('elementor-draggable-over').attr({ |
| 246 | 'data-dragged-element': model.get('elType'), |
| 247 | 'data-dragged-is-inner': model.get('isInner') |
| 248 | }); |
| 249 | this.$el.addClass('elementor-dragging-on-child'); |
| 250 | }, |
| 251 | onSortOut: function onSortOut(event) { |
| 252 | event.stopPropagation(); |
| 253 | jQuery(event.target).removeClass('elementor-draggable-over').removeAttr('data-dragged-element data-dragged-is-inner'); |
| 254 | this.$el.removeClass('elementor-dragging-on-child'); |
| 255 | }, |
| 256 | onSortReceive: function onSortReceive(event, ui) { |
| 257 | this.receiveSort(event, ui, this.getSortedElementNewIndex(ui.item)); |
| 258 | }, |
| 259 | onSortUpdate: function onSortUpdate(event, ui) { |
| 260 | event.stopPropagation(); |
| 261 | if (this.getChildViewContainer()[0] !== ui.item.parent()[0]) { |
| 262 | return; |
| 263 | } |
| 264 | this.updateSort(ui, this.getSortedElementNewIndex(ui.item)); |
| 265 | }, |
| 266 | onAddChild: function onAddChild(view) { |
| 267 | view.$el.attr('data-model-cid', view.model.cid); |
| 268 | }, |
| 269 | /** |
| 270 | * Move a child container to another position. |
| 271 | * |
| 272 | * @param {Container} child - The child container to move. |
| 273 | * @param {number|string} index - New index. |
| 274 | * |
| 275 | * @return {Container|boolean} |
| 276 | */ |
| 277 | moveChild: function moveChild(child, index) { |
| 278 | return $e.run('document/elements/move', { |
| 279 | container: child, |
| 280 | target: this.view.getContainer(), |
| 281 | options: { |
| 282 | at: index |
| 283 | } |
| 284 | }); |
| 285 | } |
| 286 | }); |
| 287 | module.exports = SortableBehavior; |
| 288 | |
| 289 | /***/ }), |
| 290 | |
| 291 | /***/ "../assets/dev/js/editor/elements/views/container/empty-component.js": |
| 292 | /*!***************************************************************************!*\ |
| 293 | !*** ../assets/dev/js/editor/elements/views/container/empty-component.js ***! |
| 294 | \***************************************************************************/ |
| 295 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 296 | |
| 297 | "use strict"; |
| 298 | |
| 299 | |
| 300 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 301 | Object.defineProperty(exports, "__esModule", ({ |
| 302 | value: true |
| 303 | })); |
| 304 | exports["default"] = EmptyComponent; |
| 305 | var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); |
| 306 | var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js"); |
| 307 | /* eslint-disable jsx-a11y/no-static-element-interactions */ |
| 308 | /* eslint-disable jsx-a11y/click-events-have-key-events */ |
| 309 | |
| 310 | function EmptyComponent() { |
| 311 | var handleClick = function handleClick() { |
| 312 | _editorOneEvents.EditorOneEventManager.sendCanvasEmptyBoxAction({ |
| 313 | targetName: 'add_container' |
| 314 | }); |
| 315 | $e.route('panel/elements/categories'); |
| 316 | }; |
| 317 | return /*#__PURE__*/_react.default.createElement("div", { |
| 318 | className: "elementor-first-add" |
| 319 | }, /*#__PURE__*/_react.default.createElement("div", { |
| 320 | className: "elementor-icon eicon-plus", |
| 321 | onClick: handleClick |
| 322 | })); |
| 323 | } |
| 324 | |
| 325 | /***/ }), |
| 326 | |
| 327 | /***/ "../assets/dev/js/editor/utils/editor-one-events.js": |
| 328 | /*!**********************************************************!*\ |
| 329 | !*** ../assets/dev/js/editor/utils/editor-one-events.js ***! |
| 330 | \**********************************************************/ |
| 331 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 332 | |
| 333 | "use strict"; |
| 334 | |
| 335 | |
| 336 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 337 | Object.defineProperty(exports, "__esModule", ({ |
| 338 | value: true |
| 339 | })); |
| 340 | exports["default"] = exports.createDebouncedWidgetPanelSearch = exports.createDebouncedFinderSearch = exports.EditorOneEventManager = void 0; |
| 341 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 342 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 343 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 344 | 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; } |
| 345 | 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; } |
| 346 | var EditorOneEventManager = exports.EditorOneEventManager = /*#__PURE__*/function () { |
| 347 | function EditorOneEventManager() { |
| 348 | (0, _classCallCheck2.default)(this, EditorOneEventManager); |
| 349 | } |
| 350 | return (0, _createClass2.default)(EditorOneEventManager, null, [{ |
| 351 | key: "getEventsManager", |
| 352 | value: function getEventsManager() { |
| 353 | var _elementorCommon; |
| 354 | return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager; |
| 355 | } |
| 356 | }, { |
| 357 | key: "getConfig", |
| 358 | value: function getConfig() { |
| 359 | var _this$getEventsManage; |
| 360 | return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config; |
| 361 | } |
| 362 | }, { |
| 363 | key: "canSendEvents", |
| 364 | value: function canSendEvents() { |
| 365 | var _elementorCommon2; |
| 366 | return ((_elementorCommon2 = elementorCommon) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.config) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.editor_events) === null || _elementorCommon2 === void 0 ? void 0 : _elementorCommon2.can_send_events) || false; |
| 367 | } |
| 368 | }, { |
| 369 | key: "isEventsManagerAvailable", |
| 370 | value: function isEventsManagerAvailable() { |
| 371 | var eventsManager = this.getEventsManager(); |
| 372 | return eventsManager && 'function' === typeof eventsManager.dispatchEvent; |
| 373 | } |
| 374 | }, { |
| 375 | key: "dispatchEvent", |
| 376 | value: function dispatchEvent(eventName, payload) { |
| 377 | if (!this.isEventsManagerAvailable() || !this.canSendEvents()) { |
| 378 | return false; |
| 379 | } |
| 380 | try { |
| 381 | return this.getEventsManager().dispatchEvent(eventName, payload); |
| 382 | } catch (error) { |
| 383 | return false; |
| 384 | } |
| 385 | } |
| 386 | }, { |
| 387 | key: "toLowerSnake", |
| 388 | value: function toLowerSnake(value) { |
| 389 | if (!value || 'string' !== typeof value) { |
| 390 | return value; |
| 391 | } |
| 392 | return value.replace(/\s+/g, '_').toLowerCase(); |
| 393 | } |
| 394 | }, { |
| 395 | key: "decodeHtmlEntities", |
| 396 | value: function decodeHtmlEntities(text) { |
| 397 | if (!text || 'string' !== typeof text) { |
| 398 | return text; |
| 399 | } |
| 400 | var doc = new DOMParser().parseFromString(text, 'text/html'); |
| 401 | return doc.body.textContent || text; |
| 402 | } |
| 403 | }, { |
| 404 | key: "isInEditorContext", |
| 405 | value: function isInEditorContext() { |
| 406 | var _window$elementor; |
| 407 | return 'undefined' !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents); |
| 408 | } |
| 409 | }, { |
| 410 | key: "getFinderContext", |
| 411 | value: function getFinderContext() { |
| 412 | var _config$appTypes, _config$appTypes2, _config$locations, _config$locations2; |
| 413 | var config = this.getConfig(); |
| 414 | var isEditor = this.isInEditorContext(); |
| 415 | return { |
| 416 | windowName: isEditor ? config === null || config === void 0 || (_config$appTypes = config.appTypes) === null || _config$appTypes === void 0 ? void 0 : _config$appTypes.editor : config === null || config === void 0 || (_config$appTypes2 = config.appTypes) === null || _config$appTypes2 === void 0 ? void 0 : _config$appTypes2.wpAdmin, |
| 417 | targetLocation: this.toLowerSnake(isEditor ? config === null || config === void 0 || (_config$locations = config.locations) === null || _config$locations === void 0 ? void 0 : _config$locations.topBar : config === null || config === void 0 || (_config$locations2 = config.locations) === null || _config$locations2 === void 0 ? void 0 : _config$locations2.sidebar) |
| 418 | }; |
| 419 | } |
| 420 | }, { |
| 421 | key: "createBasePayload", |
| 422 | value: function createBasePayload() { |
| 423 | var _config$appTypes$edit, _config$appTypes3, _config$appTypes$edit2, _config$appTypes4; |
| 424 | var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
| 425 | var config = this.getConfig(); |
| 426 | return _objectSpread({ |
| 427 | app_type: (_config$appTypes$edit = config === null || config === void 0 || (_config$appTypes3 = config.appTypes) === null || _config$appTypes3 === void 0 ? void 0 : _config$appTypes3.editor) !== null && _config$appTypes$edit !== void 0 ? _config$appTypes$edit : 'editor', |
| 428 | window_name: (_config$appTypes$edit2 = config === null || config === void 0 || (_config$appTypes4 = config.appTypes) === null || _config$appTypes4 === void 0 ? void 0 : _config$appTypes4.editor) !== null && _config$appTypes$edit2 !== void 0 ? _config$appTypes$edit2 : 'editor' |
| 429 | }, overrides); |
| 430 | } |
| 431 | }, { |
| 432 | key: "sendTopBarPublishDropdown", |
| 433 | value: function sendTopBarPublishDropdown(targetName) { |
| 434 | var _config$names, _config$triggers, _config$targetTypes, _config$interactionRe, _config$locations3, _config$secondaryLoca, _config$targetTypes2; |
| 435 | var config = this.getConfig(); |
| 436 | return this.dispatchEvent(config === null || config === void 0 || (_config$names = config.names) === null || _config$names === void 0 || (_config$names = _config$names.editorOne) === null || _config$names === void 0 ? void 0 : _config$names.topBarPublishDropdown, this.createBasePayload({ |
| 437 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click), |
| 438 | target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem, |
| 439 | target_name: targetName, |
| 440 | interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected, |
| 441 | target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar), |
| 442 | location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown), |
| 443 | location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem, |
| 444 | interaction_description: 'User selected an action from the publish dropdown' |
| 445 | })); |
| 446 | } |
| 447 | }, { |
| 448 | key: "sendTopBarPageList", |
| 449 | value: function sendTopBarPageList(targetName) { |
| 450 | var _config$names2, _config$triggers2, _config$targetTypes3, _config$interactionRe2, _config$interactionRe3, _config$locations4, _config$secondaryLoca2, _config$targetTypes4; |
| 451 | var isCreate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; |
| 452 | var config = this.getConfig(); |
| 453 | return this.dispatchEvent(config === null || config === void 0 || (_config$names2 = config.names) === null || _config$names2 === void 0 || (_config$names2 = _config$names2.editorOne) === null || _config$names2 === void 0 ? void 0 : _config$names2.topBarPageList, this.createBasePayload({ |
| 454 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click), |
| 455 | target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem, |
| 456 | target_name: targetName, |
| 457 | interaction_result: isCreate ? config === null || config === void 0 || (_config$interactionRe2 = config.interactionResults) === null || _config$interactionRe2 === void 0 ? void 0 : _config$interactionRe2.create : config === null || config === void 0 || (_config$interactionRe3 = config.interactionResults) === null || _config$interactionRe3 === void 0 ? void 0 : _config$interactionRe3.navigate, |
| 458 | target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar), |
| 459 | location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown), |
| 460 | location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem, |
| 461 | interaction_description: 'User selected an action from the page list dropdown' |
| 462 | })); |
| 463 | } |
| 464 | }, { |
| 465 | key: "sendSiteSettingsSession", |
| 466 | value: function sendSiteSettingsSession(_ref) { |
| 467 | var _config$names3, _config$triggers3, _config$interactionRe4, _config$locations5, _config$secondaryLoca3; |
| 468 | var targetType = _ref.targetType, |
| 469 | _ref$visitedItems = _ref.visitedItems, |
| 470 | visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems, |
| 471 | _ref$savedItems = _ref.savedItems, |
| 472 | savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems, |
| 473 | state = _ref.state; |
| 474 | var config = this.getConfig(); |
| 475 | return this.dispatchEvent(config === null || config === void 0 || (_config$names3 = config.names) === null || _config$names3 === void 0 || (_config$names3 = _config$names3.editorOne) === null || _config$names3 === void 0 ? void 0 : _config$names3.siteSettingsSession, this.createBasePayload({ |
| 476 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click), |
| 477 | target_type: targetType, |
| 478 | target_name: 'site_settings', |
| 479 | interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd, |
| 480 | target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel), |
| 481 | location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings), |
| 482 | interaction_description: 'Records areas visited as part of the site setting session', |
| 483 | metadata: { |
| 484 | visited_items: visitedItems, |
| 485 | saved_items: savedItems |
| 486 | }, |
| 487 | state: state |
| 488 | })); |
| 489 | } |
| 490 | }, { |
| 491 | key: "sendELibraryNav", |
| 492 | value: function sendELibraryNav(tabName) { |
| 493 | var _config$names4, _config$triggers4, _config$targetTypes5, _config$interactionRe5, _config$locations6, _config$secondaryLoca4; |
| 494 | var config = this.getConfig(); |
| 495 | return this.dispatchEvent(config === null || config === void 0 || (_config$names4 = config.names) === null || _config$names4 === void 0 || (_config$names4 = _config$names4.editorOne) === null || _config$names4 === void 0 ? void 0 : _config$names4.eLibraryNav, this.createBasePayload({ |
| 496 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect), |
| 497 | target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab, |
| 498 | target_name: this.toLowerSnake(tabName), |
| 499 | interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged, |
| 500 | target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary), |
| 501 | location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs), |
| 502 | interaction_description: 'User navigates within elementor library' |
| 503 | })); |
| 504 | } |
| 505 | }, { |
| 506 | key: "sendELibraryInsert", |
| 507 | value: function sendELibraryInsert(_ref2) { |
| 508 | var _config$triggers5, _config$targetTypes6, _config$interactionRe6, _config$locations7, _config$secondaryLoca5, _config$names5; |
| 509 | var assetId = _ref2.assetId, |
| 510 | assetName = _ref2.assetName, |
| 511 | libraryType = _ref2.libraryType, |
| 512 | _ref2$proRequired = _ref2.proRequired, |
| 513 | proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired; |
| 514 | var config = this.getConfig(); |
| 515 | var payload = this.createBasePayload({ |
| 516 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert), |
| 517 | target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button, |
| 518 | target_name: String(assetId), |
| 519 | interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted, |
| 520 | target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary), |
| 521 | location_l1: this.toLowerSnake(libraryType), |
| 522 | location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard), |
| 523 | interaction_description: 'User inserts block/pages from elementor library', |
| 524 | metadata: { |
| 525 | template_id: String(assetId), |
| 526 | template_name: this.decodeHtmlEntities(assetName) || '' |
| 527 | } |
| 528 | }); |
| 529 | if (proRequired) { |
| 530 | payload.state = 'pro_plan_required'; |
| 531 | } |
| 532 | return this.dispatchEvent(config === null || config === void 0 || (_config$names5 = config.names) === null || _config$names5 === void 0 || (_config$names5 = _config$names5.editorOne) === null || _config$names5 === void 0 ? void 0 : _config$names5.eLibraryInsert, payload); |
| 533 | } |
| 534 | }, { |
| 535 | key: "sendELibraryFavorite", |
| 536 | value: function sendELibraryFavorite(_ref3) { |
| 537 | var _config$triggers6, _config$targetTypes7, _config$interactionRe7, _config$locations8, _config$secondaryLoca6, _config$names6; |
| 538 | var assetId = _ref3.assetId, |
| 539 | assetName = _ref3.assetName, |
| 540 | libraryType = _ref3.libraryType, |
| 541 | isFavorite = _ref3.isFavorite, |
| 542 | _ref3$proRequired = _ref3.proRequired, |
| 543 | proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired; |
| 544 | var config = this.getConfig(); |
| 545 | var payload = this.createBasePayload({ |
| 546 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click), |
| 547 | target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle, |
| 548 | target_name: String(assetId), |
| 549 | interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite, |
| 550 | target_value: Boolean(isFavorite), |
| 551 | target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary), |
| 552 | location_l1: this.toLowerSnake(libraryType), |
| 553 | location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard), |
| 554 | interaction_description: 'User favorite block/pages from elementor library', |
| 555 | metadata: { |
| 556 | template_id: String(assetId), |
| 557 | template_name: this.decodeHtmlEntities(assetName) || '' |
| 558 | } |
| 559 | }); |
| 560 | if (proRequired) { |
| 561 | payload.state = 'pro_plan_required'; |
| 562 | } |
| 563 | return this.dispatchEvent(config === null || config === void 0 || (_config$names6 = config.names) === null || _config$names6 === void 0 || (_config$names6 = _config$names6.editorOne) === null || _config$names6 === void 0 ? void 0 : _config$names6.eLibraryFavorite, payload); |
| 564 | } |
| 565 | }, { |
| 566 | key: "sendELibraryGenerateAi", |
| 567 | value: function sendELibraryGenerateAi(_ref4) { |
| 568 | var _config$names7, _config$triggers7, _config$targetTypes8, _config$interactionRe8, _config$locations9, _config$secondaryLoca7; |
| 569 | var assetId = _ref4.assetId, |
| 570 | assetName = _ref4.assetName, |
| 571 | libraryType = _ref4.libraryType; |
| 572 | var config = this.getConfig(); |
| 573 | return this.dispatchEvent(config === null || config === void 0 || (_config$names7 = config.names) === null || _config$names7 === void 0 || (_config$names7 = _config$names7.editorOne) === null || _config$names7 === void 0 ? void 0 : _config$names7.eLibraryGenerateAi, this.createBasePayload({ |
| 574 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click), |
| 575 | target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button, |
| 576 | target_name: String(assetId), |
| 577 | interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate, |
| 578 | target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary), |
| 579 | location_l1: this.toLowerSnake(libraryType), |
| 580 | location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard), |
| 581 | interaction_description: 'User generated block/page based on a library asset', |
| 582 | metadata: { |
| 583 | template_id: String(assetId), |
| 584 | template_name: this.decodeHtmlEntities(assetName) || '' |
| 585 | } |
| 586 | })); |
| 587 | } |
| 588 | }, { |
| 589 | key: "sendFinderSearchInput", |
| 590 | value: function sendFinderSearchInput(_ref5) { |
| 591 | var _config$triggers8, _config$targetTypes9, _config$interactionRe9, _config$interactionRe0, _config$secondaryLoca8, _config$names8; |
| 592 | var resultsCount = _ref5.resultsCount, |
| 593 | _ref5$searchTerm = _ref5.searchTerm, |
| 594 | searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm; |
| 595 | var config = this.getConfig(); |
| 596 | var hasResults = resultsCount > 0; |
| 597 | var finderContext = this.getFinderContext(); |
| 598 | var payload = this.createBasePayload({ |
| 599 | window_name: finderContext.windowName, |
| 600 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing), |
| 601 | target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput, |
| 602 | target_name: 'finder', |
| 603 | interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe9 = config.interactionResults) === null || _config$interactionRe9 === void 0 ? void 0 : _config$interactionRe9.resultsUpdated : config === null || config === void 0 || (_config$interactionRe0 = config.interactionResults) === null || _config$interactionRe0 === void 0 ? void 0 : _config$interactionRe0.noResults, |
| 604 | target_location: finderContext.targetLocation, |
| 605 | location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder), |
| 606 | interaction_description: 'Finder search input, follows debounce behavior', |
| 607 | metadata: { |
| 608 | results_count: resultsCount |
| 609 | } |
| 610 | }); |
| 611 | if (!hasResults && searchTerm) { |
| 612 | payload.metadata.search_term = searchTerm; |
| 613 | } |
| 614 | return this.dispatchEvent(config === null || config === void 0 || (_config$names8 = config.names) === null || _config$names8 === void 0 || (_config$names8 = _config$names8.editorOne) === null || _config$names8 === void 0 ? void 0 : _config$names8.finderSearchInput, payload); |
| 615 | } |
| 616 | }, { |
| 617 | key: "sendFinderResultSelect", |
| 618 | value: function sendFinderResultSelect(choice) { |
| 619 | var _config$names9, _config$triggers9, _config$targetTypes0, _config$interactionRe1, _config$secondaryLoca9, _config$secondaryLoca0; |
| 620 | var config = this.getConfig(); |
| 621 | var finderContext = this.getFinderContext(); |
| 622 | return this.dispatchEvent(config === null || config === void 0 || (_config$names9 = config.names) === null || _config$names9 === void 0 || (_config$names9 = _config$names9.editorOne) === null || _config$names9 === void 0 ? void 0 : _config$names9.finderResultSelect, this.createBasePayload({ |
| 623 | window_name: finderContext.windowName, |
| 624 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click), |
| 625 | target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult, |
| 626 | target_name: choice, |
| 627 | interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected, |
| 628 | target_location: finderContext.targetLocation, |
| 629 | location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder), |
| 630 | location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults), |
| 631 | interaction_description: 'Finder search results was selected' |
| 632 | })); |
| 633 | } |
| 634 | }, { |
| 635 | key: "sendCanvasEmptyBoxAction", |
| 636 | value: function sendCanvasEmptyBoxAction(_ref6) { |
| 637 | var _config$triggers0, _config$targetTypes1, _config$interactionRe10, _config$locations0, _config$secondaryLoca1, _config$names0; |
| 638 | var targetName = _ref6.targetName, |
| 639 | _ref6$metadata = _ref6.metadata, |
| 640 | metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata, |
| 641 | _ref6$containerCreate = _ref6.containerCreated, |
| 642 | containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate; |
| 643 | var config = this.getConfig(); |
| 644 | var payload = this.createBasePayload({ |
| 645 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click), |
| 646 | target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons, |
| 647 | target_name: targetName, |
| 648 | interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected, |
| 649 | target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas), |
| 650 | location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox), |
| 651 | interaction_description: 'Empty box on canvas actions' |
| 652 | }); |
| 653 | if (Object.keys(metadata).length > 0) { |
| 654 | payload.metadata = metadata; |
| 655 | } |
| 656 | if (containerCreated !== null) { |
| 657 | payload.state = containerCreated; |
| 658 | } |
| 659 | return this.dispatchEvent(config === null || config === void 0 || (_config$names0 = config.names) === null || _config$names0 === void 0 || (_config$names0 = _config$names0.editorOne) === null || _config$names0 === void 0 ? void 0 : _config$names0.canvasEmptyBoxAction, payload); |
| 660 | } |
| 661 | }, { |
| 662 | key: "sendWidgetPanelSearch", |
| 663 | value: function sendWidgetPanelSearch(_ref7) { |
| 664 | var _config$triggers1, _config$targetTypes10, _config$interactionRe11, _config$interactionRe12, _config$locations1, _config$locations10, _config$secondaryLoca10, _config$names1; |
| 665 | var resultsCount = _ref7.resultsCount, |
| 666 | _ref7$userInput = _ref7.userInput, |
| 667 | userInput = _ref7$userInput === void 0 ? null : _ref7$userInput; |
| 668 | var config = this.getConfig(); |
| 669 | var hasResults = resultsCount > 0; |
| 670 | var payload = this.createBasePayload({ |
| 671 | interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing), |
| 672 | target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget, |
| 673 | target_name: 'search_widget', |
| 674 | interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe11 = config.interactionResults) === null || _config$interactionRe11 === void 0 ? void 0 : _config$interactionRe11.resultsUpdated : config === null || config === void 0 || (_config$interactionRe12 = config.interactionResults) === null || _config$interactionRe12 === void 0 ? void 0 : _config$interactionRe12.noResults, |
| 675 | target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel), |
| 676 | location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel), |
| 677 | location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar), |
| 678 | interaction_description: 'Widget search input, follows debounce behavior' |
| 679 | }); |
| 680 | if (!hasResults && userInput) { |
| 681 | payload.metadata = { |
| 682 | user_input: userInput |
| 683 | }; |
| 684 | } |
| 685 | return this.dispatchEvent(config === null || config === void 0 || (_config$names1 = config.names) === null || _config$names1 === void 0 || (_config$names1 = _config$names1.editorOne) === null || _config$names1 === void 0 ? void 0 : _config$names1.widgetPanelSearch, payload); |
| 686 | } |
| 687 | }]); |
| 688 | }(); |
| 689 | var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() { |
| 690 | var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300; |
| 691 | return _.debounce(function (resultsCount, searchTerm) { |
| 692 | EditorOneEventManager.sendFinderSearchInput({ |
| 693 | resultsCount: resultsCount, |
| 694 | searchTerm: searchTerm |
| 695 | }); |
| 696 | }, delay); |
| 697 | }; |
| 698 | var createDebouncedWidgetPanelSearch = exports.createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() { |
| 699 | var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000; |
| 700 | return _.debounce(function (resultsCount, userInput) { |
| 701 | EditorOneEventManager.sendWidgetPanelSearch({ |
| 702 | resultsCount: resultsCount, |
| 703 | userInput: userInput |
| 704 | }); |
| 705 | }, delay); |
| 706 | }; |
| 707 | var _default = exports["default"] = EditorOneEventManager; |
| 708 | |
| 709 | /***/ }), |
| 710 | |
| 711 | /***/ "../assets/dev/js/editor/utils/element-types.js": |
| 712 | /*!******************************************************!*\ |
| 713 | !*** ../assets/dev/js/editor/utils/element-types.js ***! |
| 714 | \******************************************************/ |
| 715 | /***/ ((module) => { |
| 716 | |
| 717 | "use strict"; |
| 718 | |
| 719 | |
| 720 | /** |
| 721 | * Returns an array of all available element types. |
| 722 | * |
| 723 | * @return {string[]} Array of element type strings. |
| 724 | */ |
| 725 | var getAllElementTypes = function getAllElementTypes() { |
| 726 | return Object.keys(elementor.getConfig().elements); |
| 727 | }; |
| 728 | module.exports = { |
| 729 | getAllElementTypes: getAllElementTypes |
| 730 | }; |
| 731 | |
| 732 | /***/ }), |
| 733 | |
| 734 | /***/ "../assets/dev/js/utils/react.js": |
| 735 | /*!***************************************!*\ |
| 736 | !*** ../assets/dev/js/utils/react.js ***! |
| 737 | \***************************************/ |
| 738 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 739 | |
| 740 | "use strict"; |
| 741 | |
| 742 | |
| 743 | var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); |
| 744 | Object.defineProperty(exports, "__esModule", ({ |
| 745 | value: true |
| 746 | })); |
| 747 | exports["default"] = void 0; |
| 748 | var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); |
| 749 | var ReactDOM = _interopRequireWildcard(__webpack_require__(/*! react-dom */ "react-dom")); |
| 750 | var _client = __webpack_require__(/*! react-dom/client */ "../node_modules/react-dom/client.js"); |
| 751 | 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); } |
| 752 | /** |
| 753 | * Support conditional rendering of a React App to the DOM, based on the React version. |
| 754 | * We use `createRoot` when available, but fallback to `ReactDOM.render` for older versions. |
| 755 | * |
| 756 | * @param { React.ReactElement } app The app to render. |
| 757 | * @param { HTMLElement } domElement The DOM element to render the app into. |
| 758 | * |
| 759 | * @return {{ unmount: () => void }} The unmount function. |
| 760 | */ |
| 761 | function render(app, domElement) { |
| 762 | var unmountFunction; |
| 763 | try { |
| 764 | var root = (0, _client.createRoot)(domElement); |
| 765 | root.render(app); |
| 766 | unmountFunction = function unmountFunction() { |
| 767 | root.unmount(); |
| 768 | }; |
| 769 | } catch (e) { |
| 770 | // eslint-disable-next-line react/no-deprecated |
| 771 | ReactDOM.render(app, domElement); |
| 772 | unmountFunction = function unmountFunction() { |
| 773 | // eslint-disable-next-line react/no-deprecated |
| 774 | ReactDOM.unmountComponentAtNode(domElement); |
| 775 | }; |
| 776 | } |
| 777 | return { |
| 778 | unmount: unmountFunction |
| 779 | }; |
| 780 | } |
| 781 | var _default = exports["default"] = { |
| 782 | render: render |
| 783 | }; |
| 784 | |
| 785 | /***/ }), |
| 786 | |
| 787 | /***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js": |
| 788 | /*!*******************************************************************************!*\ |
| 789 | !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js ***! |
| 790 | \*******************************************************************************/ |
| 791 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 792 | |
| 793 | "use strict"; |
| 794 | |
| 795 | |
| 796 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 797 | Object.defineProperty(exports, "__esModule", ({ |
| 798 | value: true |
| 799 | })); |
| 800 | exports["default"] = void 0; |
| 801 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 802 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 803 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 804 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 805 | var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); |
| 806 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 807 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 808 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 809 | function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } |
| 810 | var AtomicElementBaseModel = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) { |
| 811 | function AtomicElementBaseModel() { |
| 812 | (0, _classCallCheck2.default)(this, AtomicElementBaseModel); |
| 813 | return _callSuper(this, AtomicElementBaseModel, arguments); |
| 814 | } |
| 815 | (0, _inherits2.default)(AtomicElementBaseModel, _elementor$modules$el); |
| 816 | return (0, _createClass2.default)(AtomicElementBaseModel, [{ |
| 817 | key: "isValidChild", |
| 818 | value: |
| 819 | /** |
| 820 | * Do not allow section, column or container be placed in the Atomic container. |
| 821 | * |
| 822 | * @param {*} childModel |
| 823 | */ |
| 824 | function isValidChild(childModel) { |
| 825 | var elType = childModel.get('elType'); |
| 826 | return 'section' !== elType && 'column' !== elType; |
| 827 | } |
| 828 | }, { |
| 829 | key: "initialize", |
| 830 | value: function initialize(attributes, options) { |
| 831 | var elementType = this.get('elType'); |
| 832 | this.config = elementor.config.elements[elementType]; |
| 833 | var isNewElementCreate = 0 === this.get('elements').length && $e.commands.currentTrace.includes('document/elements/create'); |
| 834 | if (isNewElementCreate) { |
| 835 | this.onElementCreate(); |
| 836 | } |
| 837 | _superPropGet(AtomicElementBaseModel, "initialize", this, 3)([attributes, options]); |
| 838 | } |
| 839 | }, { |
| 840 | key: "getDefaultChildren", |
| 841 | value: function getDefaultChildren() { |
| 842 | var defaultChildren = this.config.default_children; |
| 843 | return this.modifyDefaultChildren(defaultChildren); |
| 844 | } |
| 845 | }, { |
| 846 | key: "onElementCreate", |
| 847 | value: function onElementCreate() { |
| 848 | var _this = this; |
| 849 | this.set('elements', this.getDefaultChildren().map(function (element) { |
| 850 | return _this.buildElement(element); |
| 851 | })); |
| 852 | } |
| 853 | }, { |
| 854 | key: "modifyDefaultChildren", |
| 855 | value: function modifyDefaultChildren(element) { |
| 856 | return element; |
| 857 | } |
| 858 | }, { |
| 859 | key: "buildElement", |
| 860 | value: function buildElement(element) { |
| 861 | var _this2 = this, |
| 862 | _element$settings; |
| 863 | var id = elementorCommon.helpers.getUniqueId(); |
| 864 | var elements = (element.elements || []).map(function (el) { |
| 865 | return _this2.buildElement(el); |
| 866 | }); |
| 867 | return { |
| 868 | elType: element.elType, |
| 869 | widgetType: element.widgetType, |
| 870 | id: id, |
| 871 | settings: (_element$settings = element.settings) !== null && _element$settings !== void 0 ? _element$settings : {}, |
| 872 | elements: elements, |
| 873 | isLocked: element.isLocked || false, |
| 874 | editor_settings: element.editor_settings || {} |
| 875 | }; |
| 876 | } |
| 877 | }]); |
| 878 | }(elementor.modules.elements.models.Element); |
| 879 | |
| 880 | /***/ }), |
| 881 | |
| 882 | /***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js": |
| 883 | /*!******************************************************************************!*\ |
| 884 | !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js ***! |
| 885 | \******************************************************************************/ |
| 886 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 887 | |
| 888 | "use strict"; |
| 889 | |
| 890 | |
| 891 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 892 | Object.defineProperty(exports, "__esModule", ({ |
| 893 | value: true |
| 894 | })); |
| 895 | exports["default"] = void 0; |
| 896 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 897 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 898 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 899 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 900 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 901 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 902 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 903 | var AtomicElementBaseType = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) { |
| 904 | function AtomicElementBaseType(elementType, viewClass) { |
| 905 | var _this; |
| 906 | var modelClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; |
| 907 | var emptyViewClass = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; |
| 908 | (0, _classCallCheck2.default)(this, AtomicElementBaseType); |
| 909 | _this = _callSuper(this, AtomicElementBaseType); |
| 910 | _this.elementType = elementType; |
| 911 | _this.viewClass = viewClass; |
| 912 | _this.modelClass = modelClass; |
| 913 | _this.emptyViewClass = emptyViewClass; |
| 914 | return _this; |
| 915 | } |
| 916 | (0, _inherits2.default)(AtomicElementBaseType, _elementor$modules$el); |
| 917 | return (0, _createClass2.default)(AtomicElementBaseType, [{ |
| 918 | key: "getType", |
| 919 | value: function getType() { |
| 920 | return this.elementType; |
| 921 | } |
| 922 | }, { |
| 923 | key: "getView", |
| 924 | value: function getView() { |
| 925 | return this.viewClass; |
| 926 | } |
| 927 | }, { |
| 928 | key: "getEmptyView", |
| 929 | value: function getEmptyView() { |
| 930 | return this.emptyViewClass || elementor.modules.elements.views.EmptyComponent; |
| 931 | } |
| 932 | }, { |
| 933 | key: "getModel", |
| 934 | value: function getModel() { |
| 935 | return this.modelClass || elementor.modules.elements.models.AtomicElementBase; |
| 936 | } |
| 937 | }]); |
| 938 | }(elementor.modules.elements.types.Base); |
| 939 | |
| 940 | /***/ }), |
| 941 | |
| 942 | /***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js": |
| 943 | /*!************************************************************************************************!*\ |
| 944 | !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js ***! |
| 945 | \************************************************************************************************/ |
| 946 | /***/ ((__unused_webpack_module, exports) => { |
| 947 | |
| 948 | "use strict"; |
| 949 | |
| 950 | |
| 951 | Object.defineProperty(exports, "__esModule", ({ |
| 952 | value: true |
| 953 | })); |
| 954 | exports["default"] = void 0; |
| 955 | var createDivBlockType = function createDivBlockType() { |
| 956 | var DivBlockView = elementor.modules.elements.views.createAtomicElementBase('e-div-block'); |
| 957 | return new elementor.modules.elements.types.AtomicElementBase('e-div-block', DivBlockView); |
| 958 | }; |
| 959 | var _default = exports["default"] = createDivBlockType; |
| 960 | |
| 961 | /***/ }), |
| 962 | |
| 963 | /***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js": |
| 964 | /*!**********************************************************************************************!*\ |
| 965 | !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js ***! |
| 966 | \**********************************************************************************************/ |
| 967 | /***/ ((__unused_webpack_module, exports) => { |
| 968 | |
| 969 | "use strict"; |
| 970 | |
| 971 | |
| 972 | Object.defineProperty(exports, "__esModule", ({ |
| 973 | value: true |
| 974 | })); |
| 975 | exports["default"] = void 0; |
| 976 | var createFlexboxType = function createFlexboxType() { |
| 977 | var FlexboxView = elementor.modules.elements.views.createAtomicElementBase('e-flexbox'); |
| 978 | return new elementor.modules.elements.types.AtomicElementBase('e-flexbox', FlexboxView); |
| 979 | }; |
| 980 | var _default = exports["default"] = createFlexboxType; |
| 981 | |
| 982 | /***/ }), |
| 983 | |
| 984 | /***/ "../modules/atomic-widgets/assets/js/editor/component.js": |
| 985 | /*!***************************************************************!*\ |
| 986 | !*** ../modules/atomic-widgets/assets/js/editor/component.js ***! |
| 987 | \***************************************************************/ |
| 988 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 989 | |
| 990 | "use strict"; |
| 991 | |
| 992 | |
| 993 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 994 | var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); |
| 995 | Object.defineProperty(exports, "__esModule", ({ |
| 996 | value: true |
| 997 | })); |
| 998 | exports["default"] = void 0; |
| 999 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1000 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1001 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1002 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1003 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1004 | var hooks = _interopRequireWildcard(__webpack_require__(/*! ./hooks */ "../modules/atomic-widgets/assets/js/editor/hooks/index.js")); |
| 1005 | 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); } |
| 1006 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 1007 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1008 | var Component = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) { |
| 1009 | function Component() { |
| 1010 | (0, _classCallCheck2.default)(this, Component); |
| 1011 | return _callSuper(this, Component, arguments); |
| 1012 | } |
| 1013 | (0, _inherits2.default)(Component, _$e$modules$Component); |
| 1014 | return (0, _createClass2.default)(Component, [{ |
| 1015 | key: "getNamespace", |
| 1016 | value: function getNamespace() { |
| 1017 | return 'document/atomic-widgets'; |
| 1018 | } |
| 1019 | }, { |
| 1020 | key: "defaultHooks", |
| 1021 | value: function defaultHooks() { |
| 1022 | return this.importHooks(hooks); |
| 1023 | } |
| 1024 | }]); |
| 1025 | }($e.modules.ComponentBase); |
| 1026 | |
| 1027 | /***/ }), |
| 1028 | |
| 1029 | /***/ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js": |
| 1030 | /*!*****************************************************************************************!*\ |
| 1031 | !*** ../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js ***! |
| 1032 | \*****************************************************************************************/ |
| 1033 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1034 | |
| 1035 | "use strict"; |
| 1036 | |
| 1037 | |
| 1038 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1039 | Object.defineProperty(exports, "__esModule", ({ |
| 1040 | value: true |
| 1041 | })); |
| 1042 | exports["default"] = void 0; |
| 1043 | var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); |
| 1044 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1045 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1046 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1047 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1048 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1049 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 1050 | var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js")); |
| 1051 | var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js")); |
| 1052 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 1053 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1054 | var AtomicElementEmptyView = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) { |
| 1055 | function AtomicElementEmptyView() { |
| 1056 | var _this; |
| 1057 | (0, _classCallCheck2.default)(this, AtomicElementEmptyView); |
| 1058 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
| 1059 | args[_key] = arguments[_key]; |
| 1060 | } |
| 1061 | _this = _callSuper(this, AtomicElementEmptyView, [].concat(args)); |
| 1062 | (0, _defineProperty2.default)(_this, "template", '<div></div>'); |
| 1063 | (0, _defineProperty2.default)(_this, "className", 'elementor-empty-view'); |
| 1064 | (0, _defineProperty2.default)(_this, "unmount", null); |
| 1065 | return _this; |
| 1066 | } |
| 1067 | (0, _inherits2.default)(AtomicElementEmptyView, _Marionette$ItemView); |
| 1068 | return (0, _createClass2.default)(AtomicElementEmptyView, [{ |
| 1069 | key: "renderReactDefaultElement", |
| 1070 | value: function renderReactDefaultElement(container) { |
| 1071 | var _ReactUtils$render = _react2.default.render(/*#__PURE__*/_react.default.createElement(_emptyComponent.default, { |
| 1072 | container: container |
| 1073 | }), this.el), |
| 1074 | unmount = _ReactUtils$render.unmount; |
| 1075 | this.unmount = unmount; |
| 1076 | } |
| 1077 | }, { |
| 1078 | key: "onBeforeRender", |
| 1079 | value: function onBeforeRender() { |
| 1080 | // In case the element is being rendered again, we need to unmount the previous React component. |
| 1081 | if (this.unmount) { |
| 1082 | this.unmount(); |
| 1083 | this.unmount = null; |
| 1084 | } |
| 1085 | } |
| 1086 | }, { |
| 1087 | key: "onRender", |
| 1088 | value: function onRender() { |
| 1089 | this.$el.addClass(this.className); |
| 1090 | this.renderReactDefaultElement(); |
| 1091 | } |
| 1092 | }, { |
| 1093 | key: "onDestroy", |
| 1094 | value: function onDestroy() { |
| 1095 | var _this$unmount; |
| 1096 | (_this$unmount = this.unmount) === null || _this$unmount === void 0 || _this$unmount.call(this); |
| 1097 | } |
| 1098 | }]); |
| 1099 | }(Marionette.ItemView); |
| 1100 | |
| 1101 | /***/ }), |
| 1102 | |
| 1103 | /***/ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js": |
| 1104 | /*!*************************************************************************************!*\ |
| 1105 | !*** ../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js ***! |
| 1106 | \*************************************************************************************/ |
| 1107 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1108 | |
| 1109 | "use strict"; |
| 1110 | /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; |
| 1111 | /* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"]; |
| 1112 | |
| 1113 | |
| 1114 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1115 | Object.defineProperty(exports, "__esModule", ({ |
| 1116 | value: true |
| 1117 | })); |
| 1118 | exports["default"] = createAtomicElementBaseView; |
| 1119 | var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); |
| 1120 | var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); |
| 1121 | var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); |
| 1122 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 1123 | var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); |
| 1124 | var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); |
| 1125 | var _elementTypes = __webpack_require__(/*! elementor-editor/utils/element-types */ "../assets/dev/js/editor/utils/element-types.js"); |
| 1126 | var _atomicElementEmptyView = _interopRequireDefault(__webpack_require__(/*! ./container/atomic-element-empty-view */ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js")); |
| 1127 | 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; } |
| 1128 | 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; } |
| 1129 | var BaseElementView = elementor.modules.elements.views.BaseElement; |
| 1130 | function createAtomicElementBaseView(type) { |
| 1131 | var resolvedTagCache = new WeakMap(); |
| 1132 | var AtomicElementView = BaseElementView.extend({ |
| 1133 | template: Marionette.TemplateCache.get("#tmpl-elementor-".concat(type, "-content")), |
| 1134 | emptyView: _atomicElementEmptyView.default, |
| 1135 | _childrenRenderPromises: [], |
| 1136 | _createElement: function _createElement(tag) { |
| 1137 | var _elementor$$preview; |
| 1138 | var previewDocument = (_elementor$$preview = elementor.$preview) === null || _elementor$$preview === void 0 || (_elementor$$preview = _elementor$$preview[0]) === null || _elementor$$preview === void 0 ? void 0 : _elementor$$preview.contentDocument; |
| 1139 | if (previewDocument) { |
| 1140 | return previewDocument.createElement(tag); |
| 1141 | } |
| 1142 | return document.createElement(tag); |
| 1143 | }, |
| 1144 | tagName: function tagName() { |
| 1145 | var _resolvedTagCache$get; |
| 1146 | return (_resolvedTagCache$get = resolvedTagCache.get(this.model)) !== null && _resolvedTagCache$get !== void 0 ? _resolvedTagCache$get : this._resolveTag(); |
| 1147 | }, |
| 1148 | _resolveTag: function _resolveTag() { |
| 1149 | var _this$getResolverRend, _linkSetting$value, _resolvedLinkTag$valu, _resolvedTag$value; |
| 1150 | var renderContext = (_this$getResolverRend = this.getResolverRenderContext) === null || _this$getResolverRend === void 0 ? void 0 : _this$getResolverRend.call(this); |
| 1151 | var tagSetting = this.model.getSetting('tag'); |
| 1152 | var resolvedTag = this._resolvePropValue(tagSetting, renderContext); |
| 1153 | var linkSetting = this.model.getSetting('link'); |
| 1154 | var resolvedLinkTag = this._resolvePropValue(linkSetting === null || linkSetting === void 0 || (_linkSetting$value = linkSetting.value) === null || _linkSetting$value === void 0 ? void 0 : _linkSetting$value.tag, renderContext); |
| 1155 | var linkTag = (_resolvedLinkTag$valu = resolvedLinkTag === null || resolvedLinkTag === void 0 ? void 0 : resolvedLinkTag.value) !== null && _resolvedLinkTag$valu !== void 0 ? _resolvedLinkTag$valu : resolvedLinkTag; |
| 1156 | var baseTag = (_resolvedTag$value = resolvedTag === null || resolvedTag === void 0 ? void 0 : resolvedTag.value) !== null && _resolvedTag$value !== void 0 ? _resolvedTag$value : resolvedTag; |
| 1157 | var resultTag = linkTag !== null && linkTag !== void 0 ? linkTag : baseTag; |
| 1158 | return resultTag || this.model.config.default_html_tag || 'div'; |
| 1159 | }, |
| 1160 | getChildViewContainer: function getChildViewContainer() { |
| 1161 | this.childViewContainer = ''; |
| 1162 | return Marionette.CompositeView.prototype.getChildViewContainer.apply(this, arguments); |
| 1163 | }, |
| 1164 | getChildType: function getChildType() { |
| 1165 | var atomicElements = Object.entries(elementor.config.elements).filter(function (_ref) { |
| 1166 | var _ref2 = (0, _slicedToArray2.default)(_ref, 2), |
| 1167 | element = _ref2[1]; |
| 1168 | return !!(element !== null && element !== void 0 && element.atomic_props_schema); |
| 1169 | }).map(function (_ref3) { |
| 1170 | var _ref4 = (0, _slicedToArray2.default)(_ref3, 1), |
| 1171 | elType = _ref4[0]; |
| 1172 | return elType; |
| 1173 | }); |
| 1174 | return ['widget', 'container'].concat((0, _toConsumableArray2.default)(atomicElements)); |
| 1175 | }, |
| 1176 | getRenderContext: function getRenderContext() { |
| 1177 | var _this$_parent, _this$_parent$getRend; |
| 1178 | return (_this$_parent = this._parent) === null || _this$_parent === void 0 || (_this$_parent$getRend = _this$_parent.getRenderContext) === null || _this$_parent$getRend === void 0 ? void 0 : _this$_parent$getRend.call(_this$_parent); |
| 1179 | }, |
| 1180 | getResolverRenderContext: function getResolverRenderContext() { |
| 1181 | var _this$_parent2, _this$_parent2$getRes; |
| 1182 | return (_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || (_this$_parent2$getRes = _this$_parent2.getResolverRenderContext) === null || _this$_parent2$getRes === void 0 ? void 0 : _this$_parent2$getRes.call(_this$_parent2); |
| 1183 | }, |
| 1184 | className: function className() { |
| 1185 | var generatedClasses = this.getGeneratedClasses(); |
| 1186 | return "".concat(BaseElementView.prototype.className.apply(this), " e-con e-atomic-element ").concat(this.getClassString(), " ").concat(generatedClasses); |
| 1187 | }, |
| 1188 | getGeneratedClasses: function getGeneratedClasses() { |
| 1189 | var _this = this; |
| 1190 | var propsSchema = this.model.config.atomic_props_schema || {}; |
| 1191 | var generatedClasses = []; |
| 1192 | Object.keys(propsSchema).forEach(function (key) { |
| 1193 | var _propsSchema$key; |
| 1194 | var propMeta = (_propsSchema$key = propsSchema[key]) === null || _propsSchema$key === void 0 ? void 0 : _propsSchema$key.meta; |
| 1195 | if (propMeta !== null && propMeta !== void 0 && propMeta.generates_class) { |
| 1196 | var _settingValue$value; |
| 1197 | var classPattern = propMeta.generates_class; |
| 1198 | var settingValue = _this.model.getSetting(key); |
| 1199 | var value = (_settingValue$value = settingValue === null || settingValue === void 0 ? void 0 : settingValue.value) !== null && _settingValue$value !== void 0 ? _settingValue$value : settingValue; |
| 1200 | if (value && 'string' === typeof value) { |
| 1201 | var className = classPattern.replace('{value}', value); |
| 1202 | generatedClasses.push(className); |
| 1203 | } |
| 1204 | } |
| 1205 | }); |
| 1206 | return generatedClasses.join(' '); |
| 1207 | }, |
| 1208 | // TODO: Copied from `views/column.js`. |
| 1209 | ui: function ui() { |
| 1210 | var ui = BaseElementView.prototype.ui.apply(this, arguments); |
| 1211 | ui.percentsTooltip = '> .elementor-element-overlay .elementor-column-percents-tooltip'; |
| 1212 | return ui; |
| 1213 | }, |
| 1214 | attributes: function attributes() { |
| 1215 | var _this$model$getSettin, _this$model$getSettin2, _this$model$config$in, _this$model; |
| 1216 | var attr = BaseElementView.prototype.attributes.apply(this); |
| 1217 | var local = {}; |
| 1218 | var cssId = this.model.getSetting('_cssid'); |
| 1219 | var customAttributes = (_this$model$getSettin = (_this$model$getSettin2 = this.model.getSetting('attributes')) === null || _this$model$getSettin2 === void 0 ? void 0 : _this$model$getSettin2.value) !== null && _this$model$getSettin !== void 0 ? _this$model$getSettin : []; |
| 1220 | var initialAttributes = (_this$model$config$in = this === null || this === void 0 || (_this$model = this.model) === null || _this$model === void 0 || (_this$model = _this$model.config) === null || _this$model === void 0 ? void 0 : _this$model.initial_attributes) !== null && _this$model$config$in !== void 0 ? _this$model$config$in : {}; |
| 1221 | if (cssId) { |
| 1222 | local.id = cssId.value; |
| 1223 | } |
| 1224 | local['data-interaction-id'] = this.getInteractionId(); |
| 1225 | customAttributes.forEach(function (attribute) { |
| 1226 | var _attribute$value, _attribute$value2; |
| 1227 | var key = (_attribute$value = attribute.value) === null || _attribute$value === void 0 || (_attribute$value = _attribute$value.key) === null || _attribute$value === void 0 ? void 0 : _attribute$value.value; |
| 1228 | var value = (_attribute$value2 = attribute.value) === null || _attribute$value2 === void 0 || (_attribute$value2 = _attribute$value2.value) === null || _attribute$value2 === void 0 ? void 0 : _attribute$value2.value; |
| 1229 | if (key && value) { |
| 1230 | local[key] = value; |
| 1231 | } |
| 1232 | }); |
| 1233 | return _objectSpread(_objectSpread(_objectSpread({}, attr), initialAttributes), local); |
| 1234 | }, |
| 1235 | // TODO: Copied from `views/column.js`. |
| 1236 | attachElContent: function attachElContent() { |
| 1237 | BaseElementView.prototype.attachElContent.apply(this, arguments); |
| 1238 | var $tooltip = jQuery('<div>', { |
| 1239 | class: 'elementor-column-percents-tooltip', |
| 1240 | 'data-side': elementorCommon.config.isRTL ? 'right' : 'left' |
| 1241 | }); |
| 1242 | this.$el.children('.elementor-element-overlay').append($tooltip); |
| 1243 | }, |
| 1244 | // TODO: Copied from `views/column.js`. |
| 1245 | getPercentSize: function getPercentSize(size) { |
| 1246 | if (!size) { |
| 1247 | size = this.el.getBoundingClientRect().width; |
| 1248 | } |
| 1249 | return +(size / this.$el.parent().width() * 100).toFixed(3); |
| 1250 | }, |
| 1251 | // TODO: Copied from `views/column.js`. |
| 1252 | getPercentsForDisplay: function getPercentsForDisplay() { |
| 1253 | var width = +this.model.getSetting('width') || this.getPercentSize(); |
| 1254 | return width.toFixed(1) + '%'; |
| 1255 | }, |
| 1256 | renderOnChange: function renderOnChange(settings) { |
| 1257 | var _this2 = this; |
| 1258 | var changed = settings.changedAttributes(); |
| 1259 | setTimeout(function () { |
| 1260 | _this2.updateHandlesPosition(); |
| 1261 | }); |
| 1262 | if (!changed) { |
| 1263 | return; |
| 1264 | } |
| 1265 | BaseElementView.prototype.renderOnChange.apply(this, settings); |
| 1266 | if (changed.attributes) { |
| 1267 | var $elAttrs = this.$el[0].attributes; |
| 1268 | for (var i = $elAttrs.length - 1; i >= 0; i--) { |
| 1269 | var attrName = $elAttrs[i].name; |
| 1270 | if (attrName !== 'class') { |
| 1271 | this.$el.removeAttr(attrName); |
| 1272 | } |
| 1273 | } |
| 1274 | var newAttrs = this.attributes(); |
| 1275 | Object.entries(newAttrs).forEach(function (_ref5) { |
| 1276 | var _ref6 = (0, _slicedToArray2.default)(_ref5, 2), |
| 1277 | key = _ref6[0], |
| 1278 | value = _ref6[1]; |
| 1279 | if (key !== 'class' && value !== undefined) { |
| 1280 | _this2.$el.attr(key, value); |
| 1281 | } |
| 1282 | }); |
| 1283 | return; |
| 1284 | } |
| 1285 | |
| 1286 | // Check if classes changed OR if any setting with generates_class metadata changed |
| 1287 | var propsSchema = this.model.config.atomic_props_schema || {}; |
| 1288 | var hasGeneratesClassChange = Object.keys(changed).some(function (key) { |
| 1289 | var _propsSchema$key2; |
| 1290 | return (_propsSchema$key2 = propsSchema[key]) === null || _propsSchema$key2 === void 0 || (_propsSchema$key2 = _propsSchema$key2.meta) === null || _propsSchema$key2 === void 0 ? void 0 : _propsSchema$key2.generates_class; |
| 1291 | }); |
| 1292 | if (changed.classes || hasGeneratesClassChange) { |
| 1293 | // Preserve runtime state classes (e.g., e--selected) that are managed by Alpine |
| 1294 | // and would be lost when replacing the class attribute. |
| 1295 | var preservedClasses = Array.from(this.$el[0].classList).filter(function (cls) { |
| 1296 | return cls.startsWith('e--'); |
| 1297 | }); |
| 1298 | this.$el.attr('class', this.className()); |
| 1299 | preservedClasses.forEach(function (cls) { |
| 1300 | return _this2.$el[0].classList.add(cls); |
| 1301 | }); |
| 1302 | return; |
| 1303 | } |
| 1304 | if (changed._cssid) { |
| 1305 | if (changed._cssid.value) { |
| 1306 | this.$el.attr('id', changed._cssid.value); |
| 1307 | } else { |
| 1308 | this.$el.removeAttr('id'); |
| 1309 | } |
| 1310 | return; |
| 1311 | } |
| 1312 | this.$el.addClass(this.getClasses()); |
| 1313 | if (this.isTagChanged(changed)) { |
| 1314 | this.rerenderEntireView(); |
| 1315 | } |
| 1316 | }, |
| 1317 | isTagChanged: function isTagChanged(changed) { |
| 1318 | return ((changed === null || changed === void 0 ? void 0 : changed.tag) !== undefined || (changed === null || changed === void 0 ? void 0 : changed.link) !== undefined) && this._parent && this.tagName() !== this.el.tagName; |
| 1319 | }, |
| 1320 | rerenderEntireView: function rerenderEntireView() { |
| 1321 | var parent = this._parent; |
| 1322 | this._parent.removeChildView(this); |
| 1323 | parent.addChild(this.model, AtomicElementView, this._index); |
| 1324 | }, |
| 1325 | render: function render() { |
| 1326 | var _this3 = this; |
| 1327 | this._currentRenderPromise = new Promise(function (resolve) { |
| 1328 | // Optimize rendering by reusing existing child views instead of recreating them. |
| 1329 | if (_this3._shouldSkipFullRender()) { |
| 1330 | _this3._renderWithoutDomRecreation(resolve); |
| 1331 | } else { |
| 1332 | _this3._renderWithDomRecreation(resolve); |
| 1333 | } |
| 1334 | }); |
| 1335 | return this; |
| 1336 | }, |
| 1337 | _shouldSkipFullRender: function _shouldSkipFullRender() { |
| 1338 | return this.isRendered && this._hasConnectedChildren(); |
| 1339 | }, |
| 1340 | _hasConnectedChildren: function _hasConnectedChildren() { |
| 1341 | var _this$children, _firstChild$$el$get$i, _firstChild$$el; |
| 1342 | if (!((_this$children = this.children) !== null && _this$children !== void 0 && _this$children.length)) { |
| 1343 | return false; |
| 1344 | } |
| 1345 | |
| 1346 | // If the parent's innerHTML was replaced, all children are detached together. |
| 1347 | var firstChild = this.children.findByIndex(0); |
| 1348 | return (_firstChild$$el$get$i = firstChild === null || firstChild === void 0 || (_firstChild$$el = firstChild.$el) === null || _firstChild$$el === void 0 || (_firstChild$$el = _firstChild$$el.get(0)) === null || _firstChild$$el === void 0 ? void 0 : _firstChild$$el.isConnected) !== null && _firstChild$$el$get$i !== void 0 ? _firstChild$$el$get$i : false; |
| 1349 | }, |
| 1350 | _renderWithoutDomRecreation: function _renderWithoutDomRecreation(resolve) { |
| 1351 | var _this4 = this; |
| 1352 | this._beforeRender(); |
| 1353 | this._renderChildren(); |
| 1354 | this._waitForChildrenToComplete().then(function () { |
| 1355 | _this4._afterRender(); |
| 1356 | resolve(); |
| 1357 | }); |
| 1358 | }, |
| 1359 | _renderWithDomRecreation: function _renderWithDomRecreation(resolve) { |
| 1360 | var _this5 = this; |
| 1361 | BaseElementView.prototype.render.apply(this, arguments); |
| 1362 | this._waitForChildrenToComplete().then(function () { |
| 1363 | _this5._applyResolvedAttributes(); |
| 1364 | resolve(); |
| 1365 | }); |
| 1366 | }, |
| 1367 | _beforeRender: function _beforeRender() { |
| 1368 | this._isRendering = true; |
| 1369 | this._invalidateTagCache(); |
| 1370 | this.triggerMethod('before:render', this); |
| 1371 | }, |
| 1372 | _invalidateTagCache: function _invalidateTagCache() { |
| 1373 | resolvedTagCache.delete(this.model); |
| 1374 | }, |
| 1375 | _cacheResolvedTag: function _cacheResolvedTag(tag) { |
| 1376 | resolvedTagCache.set(this.model, tag); |
| 1377 | }, |
| 1378 | _afterRender: function _afterRender() { |
| 1379 | this._isRendering = false; |
| 1380 | this.isRendered = true; |
| 1381 | this.triggerMethod('render', this); |
| 1382 | this._applyResolvedAttributes(); |
| 1383 | }, |
| 1384 | _applyResolvedAttributes: function _applyResolvedAttributes() { |
| 1385 | if (!this._parent) { |
| 1386 | return; |
| 1387 | } |
| 1388 | if (this._shouldRecreateForTagChange()) { |
| 1389 | return; |
| 1390 | } |
| 1391 | this._applyLinkAttributes(); |
| 1392 | }, |
| 1393 | _shouldRecreateForTagChange: function _shouldRecreateForTagChange() { |
| 1394 | var resolvedTag = this.tagName(); |
| 1395 | var currentTag = this.el.tagName.toLowerCase(); |
| 1396 | if (resolvedTag === currentTag) { |
| 1397 | return false; |
| 1398 | } |
| 1399 | this._cacheResolvedTag(resolvedTag); |
| 1400 | this.rerenderEntireView(); |
| 1401 | return true; |
| 1402 | }, |
| 1403 | _applyLinkAttributes: function _applyLinkAttributes() { |
| 1404 | var _this6 = this; |
| 1405 | this.$el.removeAttr('href'); |
| 1406 | this.$el.removeAttr('data-action-link'); |
| 1407 | var link = this.getLinkAttributes(); |
| 1408 | if (!link) { |
| 1409 | return; |
| 1410 | } |
| 1411 | Object.entries(link).forEach(function (_ref7) { |
| 1412 | var _ref8 = (0, _slicedToArray2.default)(_ref7, 2), |
| 1413 | key = _ref8[0], |
| 1414 | value = _ref8[1]; |
| 1415 | _this6.$el.attr(key, value); |
| 1416 | }); |
| 1417 | }, |
| 1418 | _waitForChildrenToComplete: function _waitForChildrenToComplete() { |
| 1419 | var _this7 = this; |
| 1420 | return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() { |
| 1421 | return _regenerator.default.wrap(function (_context) { |
| 1422 | while (1) switch (_context.prev = _context.next) { |
| 1423 | case 0: |
| 1424 | if (!(_this7._childrenRenderPromises.length > 0)) { |
| 1425 | _context.next = 1; |
| 1426 | break; |
| 1427 | } |
| 1428 | _context.next = 1; |
| 1429 | return Promise.all(_this7._childrenRenderPromises); |
| 1430 | case 1: |
| 1431 | case "end": |
| 1432 | return _context.stop(); |
| 1433 | } |
| 1434 | }, _callee); |
| 1435 | }))(); |
| 1436 | }, |
| 1437 | _renderChildren: function _renderChildren() { |
| 1438 | if (this._shouldSkipFullRender()) { |
| 1439 | var _this$children2; |
| 1440 | (_this$children2 = this.children) === null || _this$children2 === void 0 || _this$children2.each(function (childView) { |
| 1441 | return childView.render(); |
| 1442 | }); |
| 1443 | } else { |
| 1444 | BaseElementView.prototype._renderChildren.apply(this, arguments); |
| 1445 | } |
| 1446 | this._collectChildrenRenderPromises(); |
| 1447 | }, |
| 1448 | _collectChildrenRenderPromises: function _collectChildrenRenderPromises() { |
| 1449 | var _this$children3, |
| 1450 | _this8 = this; |
| 1451 | this._childrenRenderPromises = []; |
| 1452 | (_this$children3 = this.children) === null || _this$children3 === void 0 || _this$children3.each(function (childView) { |
| 1453 | if (childView._currentRenderPromise) { |
| 1454 | _this8._childrenRenderPromises.push(childView._currentRenderPromise); |
| 1455 | } |
| 1456 | }); |
| 1457 | }, |
| 1458 | onRender: function onRender() { |
| 1459 | var _this9 = this; |
| 1460 | this.dispatchPreviewEvent('elementor/element/render'); |
| 1461 | BaseElementView.prototype.onRender.apply(this, arguments); |
| 1462 | |
| 1463 | // Defer to wait for everything to render. |
| 1464 | setTimeout(function () { |
| 1465 | _this9.droppableInitialize(); |
| 1466 | _this9.updateHandlesPosition(); |
| 1467 | }); |
| 1468 | }, |
| 1469 | onDestroy: function onDestroy() { |
| 1470 | BaseElementView.prototype.onDestroy.apply(this, arguments); |
| 1471 | this.dispatchPreviewEvent('elementor/element/destroy'); |
| 1472 | }, |
| 1473 | dispatchPreviewEvent: function dispatchPreviewEvent(eventType) { |
| 1474 | var _elementor; |
| 1475 | (_elementor = elementor) === null || _elementor === void 0 || (_elementor = _elementor.$preview) === null || _elementor === void 0 || (_elementor = _elementor[0]) === null || _elementor === void 0 || _elementor.contentWindow.dispatchEvent(new CustomEvent(eventType, { |
| 1476 | detail: { |
| 1477 | id: this.model.get('id'), |
| 1478 | type: this.model.get('elType'), |
| 1479 | element: this.getDomElement().get(0) |
| 1480 | } |
| 1481 | })); |
| 1482 | }, |
| 1483 | _hasLink: function _hasLink(renderContext) { |
| 1484 | var _resolvedLink$value; |
| 1485 | var linkSetting = this.model.getSetting('link'); |
| 1486 | var resolvedLink = this._resolvePropValue(linkSetting, renderContext); |
| 1487 | if ('link' !== (resolvedLink === null || resolvedLink === void 0 ? void 0 : resolvedLink.$$type)) { |
| 1488 | return false; |
| 1489 | } |
| 1490 | var destination = this._resolvePropValue((_resolvedLink$value = resolvedLink.value) === null || _resolvedLink$value === void 0 ? void 0 : _resolvedLink$value.destination, renderContext); |
| 1491 | return !!(destination !== null && destination !== void 0 && destination.value); |
| 1492 | }, |
| 1493 | getLinkAttributes: function getLinkAttributes() { |
| 1494 | var _this$getResolverRend2, _resolvedLink$value2; |
| 1495 | var renderContext = (_this$getResolverRend2 = this.getResolverRenderContext) === null || _this$getResolverRend2 === void 0 ? void 0 : _this$getResolverRend2.call(this); |
| 1496 | var linkSetting = this.model.getSetting('link'); |
| 1497 | var resolvedLink = this._resolvePropValue(linkSetting, renderContext); |
| 1498 | if ('link' !== (resolvedLink === null || resolvedLink === void 0 ? void 0 : resolvedLink.$$type)) { |
| 1499 | return null; |
| 1500 | } |
| 1501 | var destination = this._resolvePropValue((_resolvedLink$value2 = resolvedLink.value) === null || _resolvedLink$value2 === void 0 ? void 0 : _resolvedLink$value2.destination, renderContext); |
| 1502 | if (!(destination !== null && destination !== void 0 && destination.value)) { |
| 1503 | return null; |
| 1504 | } |
| 1505 | var $$type = destination.$$type, |
| 1506 | value = destination.value; |
| 1507 | if ('dynamic' === $$type) { |
| 1508 | var resolvedValue = this.handleDynamicLink(value); |
| 1509 | if (!resolvedValue) { |
| 1510 | return null; |
| 1511 | } |
| 1512 | var attributeKey = 'action' === (value === null || value === void 0 ? void 0 : value.group) ? 'data-action-link' : 'href'; |
| 1513 | return (0, _defineProperty2.default)({}, attributeKey, resolvedValue); |
| 1514 | } |
| 1515 | var isPostId = 'number' === $$type; |
| 1516 | var hrefPrefix = isPostId ? elementor.config.home_url + '/?p=' : ''; |
| 1517 | return { |
| 1518 | href: hrefPrefix + value |
| 1519 | }; |
| 1520 | }, |
| 1521 | droppableInitialize: function droppableInitialize() { |
| 1522 | this.$el.html5Droppable(this.getDroppableOptions()); |
| 1523 | }, |
| 1524 | /** |
| 1525 | * Add a `Save as a Template` button to the context menu. |
| 1526 | * |
| 1527 | * @return {Object} groups |
| 1528 | */ |
| 1529 | getContextMenuGroups: function getContextMenuGroups() { |
| 1530 | var _this0 = this, |
| 1531 | _elementorCommon$conf; |
| 1532 | var saveActions = [{ |
| 1533 | name: 'save', |
| 1534 | title: __('Save as a template', 'elementor'), |
| 1535 | callback: this.saveAsTemplate.bind(this), |
| 1536 | isEnabled: function isEnabled() { |
| 1537 | return !_this0.getContainer().isLocked(); |
| 1538 | } |
| 1539 | }]; |
| 1540 | var isAdministrator = elementor.config.user.is_administrator; |
| 1541 | var isExperimentalFeaturesEnabled = (_elementorCommon$conf = elementorCommon.config.experimentalFeatures) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.e_components; |
| 1542 | if (isExperimentalFeaturesEnabled && isAdministrator) { |
| 1543 | var _window$elementorV2$u, _window$elementorV, _window$elementorV$is, _window$elementorV2$u2, _window$elementorV2, _window$elementorV2$h, _window$elementorV2$u3, _window$elementorV3, _window$elementorV3$i; |
| 1544 | var isProActive = (_window$elementorV2$u = (_window$elementorV = window.elementorV2) === null || _window$elementorV === void 0 || (_window$elementorV = _window$elementorV.utils) === null || _window$elementorV === void 0 || (_window$elementorV$is = _window$elementorV.isProActive) === null || _window$elementorV$is === void 0 ? void 0 : _window$elementorV$is.call(_window$elementorV)) !== null && _window$elementorV2$u !== void 0 ? _window$elementorV2$u : true; |
| 1545 | var hasProInstalled = (_window$elementorV2$u2 = (_window$elementorV2 = window.elementorV2) === null || _window$elementorV2 === void 0 || (_window$elementorV2 = _window$elementorV2.utils) === null || _window$elementorV2 === void 0 || (_window$elementorV2$h = _window$elementorV2.hasProInstalled) === null || _window$elementorV2$h === void 0 ? void 0 : _window$elementorV2$h.call(_window$elementorV2)) !== null && _window$elementorV2$u2 !== void 0 ? _window$elementorV2$u2 : false; |
| 1546 | var isProOutdated = hasProInstalled && !((_window$elementorV2$u3 = (_window$elementorV3 = window.elementorV2) === null || _window$elementorV3 === void 0 || (_window$elementorV3 = _window$elementorV3.utils) === null || _window$elementorV3 === void 0 || (_window$elementorV3$i = _window$elementorV3.isProAtLeast) === null || _window$elementorV3$i === void 0 ? void 0 : _window$elementorV3$i.call(_window$elementorV3, '4.0')) !== null && _window$elementorV2$u3 !== void 0 ? _window$elementorV2$u3 : false); |
| 1547 | var showPromoBadge = !isProActive && !isProOutdated; |
| 1548 | var newBadge = "<span class=\"elementor-context-menu-list__item__shortcut__new-badge\">".concat(__('New', 'elementor'), "</span>"); |
| 1549 | var badgeClass = 'elementor-context-menu-list__item__shortcut__promotion-badge'; |
| 1550 | var proBadge = "<a href=\"https://go.elementor.com/go-pro-components-Instance-create-context-menu/\" target=\"_blank\" onclick=\"event.stopPropagation()\" class=\"".concat(badgeClass, "\"><i class=\"eicon-upgrade-crown\"></i></a>"); |
| 1551 | saveActions.unshift({ |
| 1552 | name: 'save-component', |
| 1553 | title: __('Create component', 'elementor'), |
| 1554 | shortcut: isProActive || isProOutdated ? newBadge : proBadge, |
| 1555 | hasShortcutAction: showPromoBadge, |
| 1556 | callback: this.saveAsComponent.bind(this), |
| 1557 | isEnabled: function isEnabled() { |
| 1558 | return (isProActive || isProOutdated) && !_this0.getContainer().isLocked(); |
| 1559 | } |
| 1560 | }); |
| 1561 | } |
| 1562 | var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments), |
| 1563 | transferGroupClipboardIndex = groups.indexOf(_.findWhere(groups, { |
| 1564 | name: 'clipboard' |
| 1565 | })); |
| 1566 | groups.splice(transferGroupClipboardIndex + 1, 0, { |
| 1567 | name: 'save', |
| 1568 | actions: saveActions |
| 1569 | }); |
| 1570 | return groups; |
| 1571 | }, |
| 1572 | saveAsTemplate: function saveAsTemplate() { |
| 1573 | elementor.templates.eventManager.sendNewSaveTemplateClickedEvent(); |
| 1574 | $e.route('library/save-template', { |
| 1575 | model: this.model |
| 1576 | }); |
| 1577 | }, |
| 1578 | saveAsComponent: function saveAsComponent(openContextMenuEvent, options) { |
| 1579 | var _window$elementorV2$u4, _window$elementorV4, _window$elementorV4$h, _window$elementorV2$u5, _window$elementorV5, _window$elementorV5$i, _window$elementorV2$u6, _window$elementorV7, _window$elementorV7$i; |
| 1580 | var hasProInstalled = (_window$elementorV2$u4 = (_window$elementorV4 = window.elementorV2) === null || _window$elementorV4 === void 0 || (_window$elementorV4 = _window$elementorV4.utils) === null || _window$elementorV4 === void 0 || (_window$elementorV4$h = _window$elementorV4.hasProInstalled) === null || _window$elementorV4$h === void 0 ? void 0 : _window$elementorV4$h.call(_window$elementorV4)) !== null && _window$elementorV2$u4 !== void 0 ? _window$elementorV2$u4 : false; |
| 1581 | var isProOutdated = hasProInstalled && !((_window$elementorV2$u5 = (_window$elementorV5 = window.elementorV2) === null || _window$elementorV5 === void 0 || (_window$elementorV5 = _window$elementorV5.utils) === null || _window$elementorV5 === void 0 || (_window$elementorV5$i = _window$elementorV5.isProAtLeast) === null || _window$elementorV5$i === void 0 ? void 0 : _window$elementorV5$i.call(_window$elementorV5, '4.0')) !== null && _window$elementorV2$u5 !== void 0 ? _window$elementorV2$u5 : false); |
| 1582 | if (isProOutdated) { |
| 1583 | var _window$elementorV6, _window$elementorV6$n; |
| 1584 | (_window$elementorV6 = window.elementorV2) === null || _window$elementorV6 === void 0 || (_window$elementorV6 = _window$elementorV6.editorNotifications) === null || _window$elementorV6 === void 0 || (_window$elementorV6$n = _window$elementorV6.notify) === null || _window$elementorV6$n === void 0 || _window$elementorV6$n.call(_window$elementorV6, { |
| 1585 | type: 'info', |
| 1586 | id: 'component-create-update', |
| 1587 | message: __('To create new components, update Elementor Pro to the latest version.', 'elementor'), |
| 1588 | additionalActionProps: [{ |
| 1589 | size: 'small', |
| 1590 | variant: 'contained', |
| 1591 | color: 'info', |
| 1592 | href: '/wp-admin/plugins.php', |
| 1593 | target: '_blank', |
| 1594 | children: __('Update Now', 'elementor') |
| 1595 | }] |
| 1596 | }); |
| 1597 | return; |
| 1598 | } |
| 1599 | var isProActive = (_window$elementorV2$u6 = (_window$elementorV7 = window.elementorV2) === null || _window$elementorV7 === void 0 || (_window$elementorV7 = _window$elementorV7.utils) === null || _window$elementorV7 === void 0 || (_window$elementorV7$i = _window$elementorV7.isProActive) === null || _window$elementorV7$i === void 0 ? void 0 : _window$elementorV7$i.call(_window$elementorV7)) !== null && _window$elementorV2$u6 !== void 0 ? _window$elementorV2$u6 : true; |
| 1600 | if (!isProActive) { |
| 1601 | return; |
| 1602 | } |
| 1603 | |
| 1604 | // Calculate the absolute position where the context menu was opened. |
| 1605 | var openMenuOriginalEvent = openContextMenuEvent.originalEvent; |
| 1606 | var iframeRect = elementor.$preview[0].getBoundingClientRect(); |
| 1607 | var anchorPosition = { |
| 1608 | left: openMenuOriginalEvent.clientX + iframeRect.left, |
| 1609 | top: openMenuOriginalEvent.clientY + iframeRect.top |
| 1610 | }; |
| 1611 | window.dispatchEvent(new CustomEvent('elementor/editor/open-save-as-component-form', { |
| 1612 | detail: { |
| 1613 | element: elementor.getContainer(this.model.id).model.toJSON({ |
| 1614 | remove: ['default'] |
| 1615 | }), |
| 1616 | anchorPosition: anchorPosition, |
| 1617 | options: options |
| 1618 | } |
| 1619 | })); |
| 1620 | }, |
| 1621 | isDroppingAllowed: function isDroppingAllowed() { |
| 1622 | return this.getContainer().isEditable(); |
| 1623 | }, |
| 1624 | behaviors: function behaviors() { |
| 1625 | var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments); |
| 1626 | _.extend(behaviors, { |
| 1627 | Sortable: { |
| 1628 | behaviorClass: __webpack_require__(/*! elementor-behaviors/sortable */ "../assets/dev/js/editor/elements/views/behaviors/sortable.js"), |
| 1629 | elChildType: 'widget' |
| 1630 | } |
| 1631 | }); |
| 1632 | return elementor.hooks.applyFilters("elements/".concat(type, "/behaviors"), behaviors, this); |
| 1633 | }, |
| 1634 | /** |
| 1635 | * @return {{}} options |
| 1636 | */ |
| 1637 | getSortableOptions: function getSortableOptions() { |
| 1638 | return { |
| 1639 | preventInit: true |
| 1640 | }; |
| 1641 | }, |
| 1642 | getDroppableOptions: function getDroppableOptions() { |
| 1643 | var _this1 = this; |
| 1644 | var items = '> .elementor-element, > .elementor-empty-view .elementor-first-add'; |
| 1645 | return { |
| 1646 | axis: null, |
| 1647 | items: items, |
| 1648 | groups: ['elementor-element'], |
| 1649 | horizontalThreshold: 0, |
| 1650 | isDroppingAllowed: this.isDroppingAllowed.bind(this), |
| 1651 | currentElementClass: 'elementor-html5dnd-current-element', |
| 1652 | placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder', |
| 1653 | hasDraggingOnChildClass: 'e-dragging-over', |
| 1654 | getDropContainer: function getDropContainer() { |
| 1655 | return _this1.getContainer(); |
| 1656 | }, |
| 1657 | onDropping: function onDropping(side, event) { |
| 1658 | event.stopPropagation(); |
| 1659 | |
| 1660 | // Triggering the drag end manually, since it won't fire above the iframe |
| 1661 | elementor.getPreviewView().onPanelElementDragEnd(); |
| 1662 | var draggedView = elementor.channels.editor.request('element:dragged'), |
| 1663 | draggedElement = draggedView === null || draggedView === void 0 ? void 0 : draggedView.getContainer().view.el, |
| 1664 | containerElement = event.currentTarget.parentElement, |
| 1665 | elements = Array.from((containerElement === null || containerElement === void 0 ? void 0 : containerElement.querySelectorAll(':scope > .elementor-element')) || []); |
| 1666 | var targetIndex = elements.indexOf(event.currentTarget); |
| 1667 | if (_this1.isPanelElement(draggedView, draggedElement)) { |
| 1668 | var _elementorCommon; |
| 1669 | if (_this1.draggingOnBottomOrRightSide(side) && !_this1.emptyViewIsCurrentlyBeingDraggedOver()) { |
| 1670 | targetIndex++; |
| 1671 | } |
| 1672 | _this1.onDrop(event, { |
| 1673 | at: targetIndex |
| 1674 | }); |
| 1675 | if ((_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.eventsManager) !== null && _elementorCommon !== void 0 && _elementorCommon.dispatchEvent) { |
| 1676 | var selectedElement = elementor.channels.panelElements.request('element:selected'); |
| 1677 | if (selectedElement) { |
| 1678 | var _selectedElement$mode, _selectedElement$mode2, _selectedElement$mode3, _selectedElement$mode4; |
| 1679 | var elType = (_selectedElement$mode = (_selectedElement$mode2 = selectedElement.model) === null || _selectedElement$mode2 === void 0 ? void 0 : _selectedElement$mode2.get('elType')) !== null && _selectedElement$mode !== void 0 ? _selectedElement$mode : ''; |
| 1680 | var widgetType = (_selectedElement$mode3 = (_selectedElement$mode4 = selectedElement.model) === null || _selectedElement$mode4 === void 0 ? void 0 : _selectedElement$mode4.get('widgetType')) !== null && _selectedElement$mode3 !== void 0 ? _selectedElement$mode3 : ''; |
| 1681 | var elementName = 'widget' === elType ? widgetType : elType; |
| 1682 | elementorCommon.eventsManager.dispatchEvent('add_element', { |
| 1683 | location: 'editor_panel', |
| 1684 | element_name: elementName, |
| 1685 | element_type: elType, |
| 1686 | widget_type: widgetType |
| 1687 | }); |
| 1688 | } |
| 1689 | } |
| 1690 | return; |
| 1691 | } |
| 1692 | if (_this1.isParentElement(draggedView.getContainer().id)) { |
| 1693 | return; |
| 1694 | } |
| 1695 | if (_this1.emptyViewIsCurrentlyBeingDraggedOver()) { |
| 1696 | _this1.moveDroppedItem(draggedView, 0); |
| 1697 | return; |
| 1698 | } |
| 1699 | _this1.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement); |
| 1700 | } |
| 1701 | }; |
| 1702 | }, |
| 1703 | moveExistingElement: function moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement) { |
| 1704 | var selfIndex = elements.indexOf(draggedElement); |
| 1705 | if (targetIndex === selfIndex) { |
| 1706 | return; |
| 1707 | } |
| 1708 | var dropIndex = this.getDropIndex(containerElement, side, targetIndex, selfIndex); |
| 1709 | this.moveDroppedItem(draggedView, dropIndex); |
| 1710 | }, |
| 1711 | isPanelElement: function isPanelElement(draggedView, draggedElement) { |
| 1712 | return !draggedView || !draggedElement; |
| 1713 | }, |
| 1714 | isParentElement: function isParentElement(draggedId) { |
| 1715 | var current = this.container; |
| 1716 | while (current) { |
| 1717 | if (current.id === draggedId) { |
| 1718 | return true; |
| 1719 | } |
| 1720 | current = current.parent; |
| 1721 | } |
| 1722 | return false; |
| 1723 | }, |
| 1724 | getDropIndex: function getDropIndex(container, side, index, selfIndex) { |
| 1725 | var styles = window.getComputedStyle(container); |
| 1726 | var isFlex = ['flex', 'inline-flex'].includes(styles.display); |
| 1727 | var isFlexReverse = isFlex && ['column-reverse', 'row-reverse'].includes(styles.flexDirection); |
| 1728 | var isRow = isFlex && ['row-reverse', 'row'].includes(styles.flexDirection); |
| 1729 | var isRtl = elementorCommon.config.isRTL; |
| 1730 | var isReverse = isRow ? isFlexReverse !== isRtl : isFlexReverse; |
| 1731 | |
| 1732 | // The element should be placed BEFORE the current target |
| 1733 | // if is reversed + side is bottom/right OR not is reversed + side is top/left |
| 1734 | if (isReverse === this.draggingOnBottomOrRightSide(side)) { |
| 1735 | if (-1 === selfIndex || selfIndex >= index - 1) { |
| 1736 | return index; |
| 1737 | } |
| 1738 | return index > 0 ? index - 1 : 0; |
| 1739 | } |
| 1740 | if (0 <= selfIndex && selfIndex < index) { |
| 1741 | return index; |
| 1742 | } |
| 1743 | return index + 1; |
| 1744 | }, |
| 1745 | moveDroppedItem: function moveDroppedItem(draggedView, dropIndex) { |
| 1746 | // Reset the dragged element cache. |
| 1747 | elementor.channels.editor.reply('element:dragged', null); |
| 1748 | $e.run('document/elements/move', { |
| 1749 | container: draggedView.getContainer(), |
| 1750 | target: this.getContainer(), |
| 1751 | options: { |
| 1752 | at: dropIndex |
| 1753 | } |
| 1754 | }); |
| 1755 | }, |
| 1756 | getEditButtons: function getEditButtons() { |
| 1757 | var elementData = elementor.getElementData(this.model), |
| 1758 | editTools = {}; |
| 1759 | if ($e.components.get('document/elements').utils.allowAddingWidgets()) { |
| 1760 | editTools.add = { |
| 1761 | /* Translators: %s: Element Name. */ |
| 1762 | title: sprintf(__('Add %s', 'elementor'), elementData.title), |
| 1763 | icon: 'plus' |
| 1764 | }; |
| 1765 | editTools.edit = { |
| 1766 | /* Translators: %s: Element Name. */ |
| 1767 | title: sprintf(__('Edit %s', 'elementor'), elementData.title), |
| 1768 | icon: 'handle' |
| 1769 | }; |
| 1770 | } |
| 1771 | if (!this.getContainer().isLocked()) { |
| 1772 | if (elementor.getPreferences('edit_buttons') && $e.components.get('document/elements').utils.allowAddingWidgets()) { |
| 1773 | editTools.duplicate = { |
| 1774 | /* Translators: %s: Element Name. */ |
| 1775 | title: sprintf(__('Duplicate %s', 'elementor'), elementData.title), |
| 1776 | icon: 'clone' |
| 1777 | }; |
| 1778 | } |
| 1779 | editTools.remove = { |
| 1780 | /* Translators: %s: Element Name. */ |
| 1781 | title: sprintf(__('Delete %s', 'elementor'), elementData.title), |
| 1782 | icon: 'close' |
| 1783 | }; |
| 1784 | } |
| 1785 | return editTools; |
| 1786 | }, |
| 1787 | draggingOnBottomOrRightSide: function draggingOnBottomOrRightSide(side) { |
| 1788 | return ['bottom', 'right'].includes(side); |
| 1789 | }, |
| 1790 | emptyViewIsCurrentlyBeingDraggedOver: function emptyViewIsCurrentlyBeingDraggedOver() { |
| 1791 | return this.$el.find('> .elementor-empty-view > .elementor-first-add.elementor-html5dnd-current-element').length > 0; |
| 1792 | }, |
| 1793 | /** |
| 1794 | * Toggle the `New Section` view when clicking the `add` button in the edit tools. |
| 1795 | * |
| 1796 | * @return {void} |
| 1797 | */ |
| 1798 | onAddButtonClick: function onAddButtonClick() { |
| 1799 | if (this.addSectionView && !this.addSectionView.isDestroyed) { |
| 1800 | this.addSectionView.fadeToDeath(); |
| 1801 | return; |
| 1802 | } |
| 1803 | var addSectionView = new elementor.modules.elements.components.AddSectionView({ |
| 1804 | at: this.model.collection.indexOf(this.model) |
| 1805 | }); |
| 1806 | addSectionView.render(); |
| 1807 | this.$el.before(addSectionView.$el); |
| 1808 | addSectionView.$el.hide(); |
| 1809 | |
| 1810 | // Delaying the slide down for slow-render browsers (such as FF) |
| 1811 | setTimeout(function () { |
| 1812 | addSectionView.$el.slideDown(null, function () { |
| 1813 | // Remove inline style, for preview mode. |
| 1814 | jQuery(this).css('display', ''); |
| 1815 | }); |
| 1816 | }); |
| 1817 | this.addSectionView = addSectionView; |
| 1818 | }, |
| 1819 | getClasses: function getClasses() { |
| 1820 | var _window, _window$get, _this$options; |
| 1821 | var transformer = (_window = window) === null || _window === void 0 || (_window = _window.elementorV2) === null || _window === void 0 || (_window = _window.editorCanvas) === null || _window === void 0 || (_window = _window.settingsTransformersRegistry) === null || _window === void 0 || (_window$get = _window.get) === null || _window$get === void 0 ? void 0 : _window$get.call(_window, 'classes'); |
| 1822 | if (!transformer) { |
| 1823 | return []; |
| 1824 | } |
| 1825 | return transformer(((_this$options = this.options) === null || _this$options === void 0 || (_this$options = _this$options.model) === null || _this$options === void 0 || (_this$options = _this$options.getSetting('classes')) === null || _this$options === void 0 ? void 0 : _this$options.value) || []); |
| 1826 | }, |
| 1827 | getClassString: function getClassString() { |
| 1828 | var classes = this.getClasses(); |
| 1829 | var base = this.getBaseClass(); |
| 1830 | return [base].concat((0, _toConsumableArray2.default)(classes)).join(' '); |
| 1831 | }, |
| 1832 | getBaseClass: function getBaseClass() { |
| 1833 | var _this$options2, _Object$keys$; |
| 1834 | var baseStyles = elementor.helpers.getAtomicWidgetBaseStyles((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.model); |
| 1835 | return (_Object$keys$ = Object.keys(baseStyles !== null && baseStyles !== void 0 ? baseStyles : {})[0]) !== null && _Object$keys$ !== void 0 ? _Object$keys$ : ''; |
| 1836 | }, |
| 1837 | isOverflowHidden: function isOverflowHidden() { |
| 1838 | var elementStyles = window.getComputedStyle(this.el); |
| 1839 | var overflowStyles = [elementStyles.overflowX, elementStyles.overflowY, elementStyles.overflow]; |
| 1840 | return overflowStyles.includes('hidden') || overflowStyles.includes('auto'); |
| 1841 | }, |
| 1842 | updateHandlesPosition: function updateHandlesPosition() { |
| 1843 | var elementType = this.$el.data('element_type'); |
| 1844 | var isElement = (0, _elementTypes.getAllElementTypes)().includes(elementType); |
| 1845 | if (!isElement) { |
| 1846 | return; |
| 1847 | } |
| 1848 | var shouldPlaceInside = this.isOverflowHidden(); |
| 1849 | if (!shouldPlaceInside && this.isTopLevelElement() && this.isFirstElementInStructure()) { |
| 1850 | shouldPlaceInside = true; |
| 1851 | } |
| 1852 | this.$el.toggleClass('e-handles-inside', shouldPlaceInside); |
| 1853 | }, |
| 1854 | isTopLevelElement: function isTopLevelElement() { |
| 1855 | return this.container.parent && 'document' === this.container.parent.id; |
| 1856 | }, |
| 1857 | isFirstElementInStructure: function isFirstElementInStructure() { |
| 1858 | if (!this.model.collection) { |
| 1859 | return true; |
| 1860 | } |
| 1861 | return 0 === this.model.collection.indexOf(this.model); |
| 1862 | }, |
| 1863 | getDynamicLinkValue: function getDynamicLinkValue(name, settings) { |
| 1864 | var simpleTransform = function simpleTransform(props) { |
| 1865 | var transformed = Object.entries(props).map(function (_ref0) { |
| 1866 | var _ref1 = (0, _slicedToArray2.default)(_ref0, 2), |
| 1867 | settingKey = _ref1[0], |
| 1868 | settingValue = _ref1[1]; |
| 1869 | var value = 'object' === (0, _typeof2.default)(settingValue) && 'value' in settingValue ? settingValue.value : settingValue; |
| 1870 | return [settingKey, value]; |
| 1871 | }); |
| 1872 | return Object.fromEntries(transformed); |
| 1873 | }; |
| 1874 | var getTagValue = function getTagValue() { |
| 1875 | var _elementor$dynamicTag; |
| 1876 | var tag = elementor.dynamicTags.createTag('v4-dynamic-tag', name, simpleTransform(settings)); |
| 1877 | if (!tag) { |
| 1878 | return null; |
| 1879 | } |
| 1880 | return (_elementor$dynamicTag = elementor.dynamicTags.loadTagDataFromCache(tag)) !== null && _elementor$dynamicTag !== void 0 ? _elementor$dynamicTag : null; |
| 1881 | }; |
| 1882 | var tagValue = getTagValue(); |
| 1883 | if (tagValue !== null) { |
| 1884 | return tagValue; |
| 1885 | } |
| 1886 | return new Promise(function (resolve) { |
| 1887 | elementor.dynamicTags.refreshCacheFromServer(function () { |
| 1888 | resolve(getTagValue()); |
| 1889 | }); |
| 1890 | }); |
| 1891 | }, |
| 1892 | handleDynamicLink: function handleDynamicLink(linkValue) { |
| 1893 | var _this10 = this; |
| 1894 | var result = this.getDynamicLinkValue(linkValue.name, linkValue.settings); |
| 1895 | if (!result) { |
| 1896 | return null; |
| 1897 | } |
| 1898 | if ('string' === typeof result) { |
| 1899 | return result; |
| 1900 | } |
| 1901 | result.then(function (href) { |
| 1902 | _this10.el.removeAttribute('href'); |
| 1903 | var attribute = 'action' === linkValue.group ? 'data-action-link' : 'href'; |
| 1904 | _this10.el.setAttribute(attribute, href); |
| 1905 | }).then(function () { |
| 1906 | return _this10.dispatchPreviewEvent('elementor/element/render'); |
| 1907 | }); |
| 1908 | return null; |
| 1909 | }, |
| 1910 | _resolvePropValue: function _resolvePropValue(prop, renderContext) { |
| 1911 | var _window2, _registry$get; |
| 1912 | if (!prop || (0, _typeof2.default)(prop) !== 'object') { |
| 1913 | return prop; |
| 1914 | } |
| 1915 | if ('overridable' !== prop.$$type) { |
| 1916 | return prop; |
| 1917 | } |
| 1918 | var registry = (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.elementorV2) === null || _window2 === void 0 || (_window2 = _window2.editorCanvas) === null || _window2 === void 0 ? void 0 : _window2.settingsTransformersRegistry; |
| 1919 | var transformer = registry === null || registry === void 0 || (_registry$get = registry.get) === null || _registry$get === void 0 ? void 0 : _registry$get.call(registry, 'overridable'); |
| 1920 | if (!transformer) { |
| 1921 | var _prop$value; |
| 1922 | return (_prop$value = prop.value) === null || _prop$value === void 0 ? void 0 : _prop$value.origin_value; |
| 1923 | } |
| 1924 | var transformed = transformer(prop.value, { |
| 1925 | key: 'overridable', |
| 1926 | renderContext: renderContext |
| 1927 | }); |
| 1928 | return this._resolvePropValue(transformed, renderContext); |
| 1929 | }, |
| 1930 | getInteractionId: function getInteractionId() { |
| 1931 | var originId = this.model.get('originId'); |
| 1932 | var id = this.model.get('id'); |
| 1933 | return originId !== null && originId !== void 0 ? originId : id; |
| 1934 | } |
| 1935 | }); |
| 1936 | return AtomicElementView; |
| 1937 | } |
| 1938 | |
| 1939 | /***/ }), |
| 1940 | |
| 1941 | /***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js": |
| 1942 | /*!*************************************************************************************************************!*\ |
| 1943 | !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js ***! |
| 1944 | \*************************************************************************************************************/ |
| 1945 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1946 | |
| 1947 | "use strict"; |
| 1948 | |
| 1949 | |
| 1950 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1951 | Object.defineProperty(exports, "__esModule", ({ |
| 1952 | value: true |
| 1953 | })); |
| 1954 | exports.DuplicateElement = void 0; |
| 1955 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 1956 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 1957 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1958 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1959 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1960 | var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js"); |
| 1961 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 1962 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 1963 | var DuplicateElement = exports.DuplicateElement = /*#__PURE__*/function (_$e$modules$hookData$) { |
| 1964 | function DuplicateElement() { |
| 1965 | (0, _classCallCheck2.default)(this, DuplicateElement); |
| 1966 | return _callSuper(this, DuplicateElement, arguments); |
| 1967 | } |
| 1968 | (0, _inherits2.default)(DuplicateElement, _$e$modules$hookData$); |
| 1969 | return (0, _createClass2.default)(DuplicateElement, [{ |
| 1970 | key: "getCommand", |
| 1971 | value: function getCommand() { |
| 1972 | return 'document/elements/duplicate'; |
| 1973 | } |
| 1974 | }, { |
| 1975 | key: "getId", |
| 1976 | value: function getId() { |
| 1977 | return 'regenerate-local-style-ids--document/elements/duplicate'; |
| 1978 | } |
| 1979 | }, { |
| 1980 | key: "apply", |
| 1981 | value: function apply(args, result) { |
| 1982 | var containers = Array.isArray(result) ? result : [result]; |
| 1983 | containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds); |
| 1984 | } |
| 1985 | }]); |
| 1986 | }($e.modules.hookData.After); |
| 1987 | |
| 1988 | /***/ }), |
| 1989 | |
| 1990 | /***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js": |
| 1991 | /*!**********************************************************************************************************!*\ |
| 1992 | !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js ***! |
| 1993 | \**********************************************************************************************************/ |
| 1994 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1995 | |
| 1996 | "use strict"; |
| 1997 | |
| 1998 | |
| 1999 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 2000 | Object.defineProperty(exports, "__esModule", ({ |
| 2001 | value: true |
| 2002 | })); |
| 2003 | exports.ImportElement = void 0; |
| 2004 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 2005 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 2006 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 2007 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 2008 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 2009 | var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js"); |
| 2010 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 2011 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 2012 | var ImportElement = exports.ImportElement = /*#__PURE__*/function (_$e$modules$hookData$) { |
| 2013 | function ImportElement() { |
| 2014 | (0, _classCallCheck2.default)(this, ImportElement); |
| 2015 | return _callSuper(this, ImportElement, arguments); |
| 2016 | } |
| 2017 | (0, _inherits2.default)(ImportElement, _$e$modules$hookData$); |
| 2018 | return (0, _createClass2.default)(ImportElement, [{ |
| 2019 | key: "getCommand", |
| 2020 | value: function getCommand() { |
| 2021 | return 'document/elements/import'; |
| 2022 | } |
| 2023 | }, { |
| 2024 | key: "getId", |
| 2025 | value: function getId() { |
| 2026 | return 'regenerate-local-style-ids--document/elements/import'; |
| 2027 | } |
| 2028 | }, { |
| 2029 | key: "apply", |
| 2030 | value: function apply(args, result) { |
| 2031 | var containers = Array.isArray(result) ? result : [result]; |
| 2032 | containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds); |
| 2033 | } |
| 2034 | }]); |
| 2035 | }($e.modules.hookData.After); |
| 2036 | |
| 2037 | /***/ }), |
| 2038 | |
| 2039 | /***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js": |
| 2040 | /*!*********************************************************************************************************!*\ |
| 2041 | !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js ***! |
| 2042 | \*********************************************************************************************************/ |
| 2043 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 2044 | |
| 2045 | "use strict"; |
| 2046 | |
| 2047 | |
| 2048 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 2049 | Object.defineProperty(exports, "__esModule", ({ |
| 2050 | value: true |
| 2051 | })); |
| 2052 | exports.PasteElement = void 0; |
| 2053 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 2054 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 2055 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 2056 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 2057 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 2058 | var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js"); |
| 2059 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 2060 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 2061 | var PasteElement = exports.PasteElement = /*#__PURE__*/function (_$e$modules$hookData$) { |
| 2062 | function PasteElement() { |
| 2063 | (0, _classCallCheck2.default)(this, PasteElement); |
| 2064 | return _callSuper(this, PasteElement, arguments); |
| 2065 | } |
| 2066 | (0, _inherits2.default)(PasteElement, _$e$modules$hookData$); |
| 2067 | return (0, _createClass2.default)(PasteElement, [{ |
| 2068 | key: "getCommand", |
| 2069 | value: function getCommand() { |
| 2070 | return 'document/elements/paste'; |
| 2071 | } |
| 2072 | }, { |
| 2073 | key: "getId", |
| 2074 | value: function getId() { |
| 2075 | return 'regenerate-local-style-ids--document/elements/paste'; |
| 2076 | } |
| 2077 | }, { |
| 2078 | key: "apply", |
| 2079 | value: function apply(args, result) { |
| 2080 | var containers = Array.isArray(result) ? result : [result]; |
| 2081 | containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds); |
| 2082 | } |
| 2083 | }]); |
| 2084 | }($e.modules.hookData.After); |
| 2085 | |
| 2086 | /***/ }), |
| 2087 | |
| 2088 | /***/ "../modules/atomic-widgets/assets/js/editor/hooks/index.js": |
| 2089 | /*!*****************************************************************!*\ |
| 2090 | !*** ../modules/atomic-widgets/assets/js/editor/hooks/index.js ***! |
| 2091 | \*****************************************************************/ |
| 2092 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 2093 | |
| 2094 | "use strict"; |
| 2095 | |
| 2096 | |
| 2097 | Object.defineProperty(exports, "__esModule", ({ |
| 2098 | value: true |
| 2099 | })); |
| 2100 | Object.defineProperty(exports, "DuplicateElement", ({ |
| 2101 | enumerable: true, |
| 2102 | get: function get() { |
| 2103 | return _duplicateElement.DuplicateElement; |
| 2104 | } |
| 2105 | })); |
| 2106 | Object.defineProperty(exports, "ImportElement", ({ |
| 2107 | enumerable: true, |
| 2108 | get: function get() { |
| 2109 | return _importElement.ImportElement; |
| 2110 | } |
| 2111 | })); |
| 2112 | Object.defineProperty(exports, "PasteElement", ({ |
| 2113 | enumerable: true, |
| 2114 | get: function get() { |
| 2115 | return _pasteElement.PasteElement; |
| 2116 | } |
| 2117 | })); |
| 2118 | var _duplicateElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/duplicate-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js"); |
| 2119 | var _pasteElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/paste-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js"); |
| 2120 | var _importElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/import-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js"); |
| 2121 | |
| 2122 | /***/ }), |
| 2123 | |
| 2124 | /***/ "../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js": |
| 2125 | /*!********************************************************************************!*\ |
| 2126 | !*** ../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js ***! |
| 2127 | \********************************************************************************/ |
| 2128 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 2129 | |
| 2130 | "use strict"; |
| 2131 | |
| 2132 | |
| 2133 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 2134 | Object.defineProperty(exports, "__esModule", ({ |
| 2135 | value: true |
| 2136 | })); |
| 2137 | exports.getElementChildren = getElementChildren; |
| 2138 | var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); |
| 2139 | function getElementChildren(model) { |
| 2140 | var _model$get$models, _model$get; |
| 2141 | var childModels = (_model$get$models = model === null || model === void 0 || (_model$get = model.get('elements')) === null || _model$get === void 0 ? void 0 : _model$get.models) !== null && _model$get$models !== void 0 ? _model$get$models : []; |
| 2142 | var children = childModels.flatMap(getElementChildren); |
| 2143 | return [model].concat((0, _toConsumableArray2.default)(children)); |
| 2144 | } |
| 2145 | |
| 2146 | /***/ }), |
| 2147 | |
| 2148 | /***/ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js": |
| 2149 | /*!*******************************************************************************!*\ |
| 2150 | !*** ../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js ***! |
| 2151 | \*******************************************************************************/ |
| 2152 | /***/ ((__unused_webpack_module, exports) => { |
| 2153 | |
| 2154 | "use strict"; |
| 2155 | |
| 2156 | |
| 2157 | Object.defineProperty(exports, "__esModule", ({ |
| 2158 | value: true |
| 2159 | })); |
| 2160 | exports.getRandomStyleId = getRandomStyleId; |
| 2161 | /** |
| 2162 | * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container |
| 2163 | */ |
| 2164 | |
| 2165 | /** |
| 2166 | * @param {Container} container |
| 2167 | * @param {Object} existingStyleIds |
| 2168 | * @return {string} |
| 2169 | */ |
| 2170 | function getRandomStyleId(container) { |
| 2171 | var existingStyleIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
| 2172 | var id; |
| 2173 | do { |
| 2174 | id = "e-".concat(container.id, "-").concat(elementorCommon.helpers.getUniqueId()); |
| 2175 | } while (existingStyleIds.hasOwnProperty(id)); |
| 2176 | return id; |
| 2177 | } |
| 2178 | |
| 2179 | /***/ }), |
| 2180 | |
| 2181 | /***/ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js": |
| 2182 | /*!**************************************************************************************!*\ |
| 2183 | !*** ../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js ***! |
| 2184 | \**************************************************************************************/ |
| 2185 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 2186 | |
| 2187 | "use strict"; |
| 2188 | |
| 2189 | |
| 2190 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 2191 | Object.defineProperty(exports, "__esModule", ({ |
| 2192 | value: true |
| 2193 | })); |
| 2194 | exports.regenerateLocalStyleIds = regenerateLocalStyleIds; |
| 2195 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 2196 | var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); |
| 2197 | var _getElementChildren = __webpack_require__(/*! ./get-element-children */ "../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js"); |
| 2198 | var _getRandomStyleId = __webpack_require__(/*! ./get-random-style-id */ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js"); |
| 2199 | 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; } |
| 2200 | 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; } |
| 2201 | function regenerateLocalStyleIds(container) { |
| 2202 | var allElements = (0, _getElementChildren.getElementChildren)(container.model); |
| 2203 | var styledElements = allElements.filter(function (model) { |
| 2204 | var _model$get; |
| 2205 | return Object.keys((_model$get = model.get('styles')) !== null && _model$get !== void 0 ? _model$get : {}).length > 0; |
| 2206 | }); |
| 2207 | updateElementsStyleIdsInsideOut(styledElements); |
| 2208 | } |
| 2209 | function isClassesProp(prop) { |
| 2210 | return prop.$$type && 'classes' === prop.$$type && Array.isArray(prop.value) && prop.value.length > 0; |
| 2211 | } |
| 2212 | function calculateNewStylesAndSettings(element, model, settings) { |
| 2213 | var _settings$toJSON; |
| 2214 | var originalStyles = model.get('styles'); |
| 2215 | var settingsJson = (_settings$toJSON = settings === null || settings === void 0 ? void 0 : settings.toJSON()) !== null && _settings$toJSON !== void 0 ? _settings$toJSON : {}; |
| 2216 | var classesProps = Object.entries(settingsJson).filter(function (_ref) { |
| 2217 | var _ref2 = (0, _slicedToArray2.default)(_ref, 2), |
| 2218 | propValue = _ref2[1]; |
| 2219 | return isClassesProp(propValue); |
| 2220 | }); |
| 2221 | var newStyles = {}; |
| 2222 | var changedIds = {}; |
| 2223 | Object.entries(originalStyles).forEach(function (_ref3) { |
| 2224 | var _ref4 = (0, _slicedToArray2.default)(_ref3, 2), |
| 2225 | originalStyleId = _ref4[0], |
| 2226 | style = _ref4[1]; |
| 2227 | var newStyleId = (0, _getRandomStyleId.getRandomStyleId)(element, newStyles); |
| 2228 | newStyles[newStyleId] = structuredClone(_objectSpread(_objectSpread({}, style), {}, { |
| 2229 | id: newStyleId |
| 2230 | })); |
| 2231 | changedIds[originalStyleId] = newStyleId; |
| 2232 | }); |
| 2233 | var newClassesProps = classesProps.map(function (_ref5) { |
| 2234 | var _ref6 = (0, _slicedToArray2.default)(_ref5, 2), |
| 2235 | key = _ref6[0], |
| 2236 | value = _ref6[1]; |
| 2237 | return [key, _objectSpread(_objectSpread({}, value), {}, { |
| 2238 | value: value.value.map(function (className) { |
| 2239 | var _changedIds$className; |
| 2240 | return (_changedIds$className = changedIds[className]) !== null && _changedIds$className !== void 0 ? _changedIds$className : className; |
| 2241 | }) |
| 2242 | })]; |
| 2243 | }, {}); |
| 2244 | return { |
| 2245 | newStyles: newStyles, |
| 2246 | newSettings: Object.fromEntries(newClassesProps) |
| 2247 | }; |
| 2248 | } |
| 2249 | function updateStyleIdForContainer(container) { |
| 2250 | var model = container.model, |
| 2251 | settings = container.settings; |
| 2252 | var _calculateNewStylesAn = calculateNewStylesAndSettings(container, model, settings), |
| 2253 | newStyles = _calculateNewStylesAn.newStyles, |
| 2254 | newSettings = _calculateNewStylesAn.newSettings; |
| 2255 | $e.internal('document/elements/set-settings', { |
| 2256 | container: container, |
| 2257 | settings: newSettings |
| 2258 | }); |
| 2259 | model.set('styles', newStyles); |
| 2260 | } |
| 2261 | function updateStyleIdForModel(model) { |
| 2262 | var settings = model.get('settings'); |
| 2263 | var _calculateNewStylesAn2 = calculateNewStylesAndSettings(model, model, settings), |
| 2264 | newStyles = _calculateNewStylesAn2.newStyles, |
| 2265 | newSettings = _calculateNewStylesAn2.newSettings; |
| 2266 | settings.set(newSettings); |
| 2267 | model.set('styles', newStyles); |
| 2268 | } |
| 2269 | function updateStyleId(model) { |
| 2270 | var container = window.elementor.getContainer(model.get('id')); |
| 2271 | |
| 2272 | // If view exists, update the styles via the container |
| 2273 | if (container) { |
| 2274 | updateStyleIdForContainer(container); |
| 2275 | return; |
| 2276 | } |
| 2277 | updateStyleIdForModel(model); |
| 2278 | } |
| 2279 | function updateElementsStyleIdsInsideOut(styledElements) { |
| 2280 | styledElements === null || styledElements === void 0 || styledElements.reverse().forEach(updateStyleId); |
| 2281 | } |
| 2282 | |
| 2283 | /***/ }), |
| 2284 | |
| 2285 | /***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js": |
| 2286 | /*!***************************************************************!*\ |
| 2287 | !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***! |
| 2288 | \***************************************************************/ |
| 2289 | /***/ ((module) => { |
| 2290 | |
| 2291 | function _OverloadYield(e, d) { |
| 2292 | this.v = e, this.k = d; |
| 2293 | } |
| 2294 | module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2295 | |
| 2296 | /***/ }), |
| 2297 | |
| 2298 | /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": |
| 2299 | /*!******************************************************************!*\ |
| 2300 | !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! |
| 2301 | \******************************************************************/ |
| 2302 | /***/ ((module) => { |
| 2303 | |
| 2304 | function _arrayLikeToArray(r, a) { |
| 2305 | (null == a || a > r.length) && (a = r.length); |
| 2306 | for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 2307 | return n; |
| 2308 | } |
| 2309 | module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2310 | |
| 2311 | /***/ }), |
| 2312 | |
| 2313 | /***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": |
| 2314 | /*!****************************************************************!*\ |
| 2315 | !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! |
| 2316 | \****************************************************************/ |
| 2317 | /***/ ((module) => { |
| 2318 | |
| 2319 | function _arrayWithHoles(r) { |
| 2320 | if (Array.isArray(r)) return r; |
| 2321 | } |
| 2322 | module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2323 | |
| 2324 | /***/ }), |
| 2325 | |
| 2326 | /***/ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js": |
| 2327 | /*!*******************************************************************!*\ |
| 2328 | !*** ../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***! |
| 2329 | \*******************************************************************/ |
| 2330 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2331 | |
| 2332 | var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); |
| 2333 | function _arrayWithoutHoles(r) { |
| 2334 | if (Array.isArray(r)) return arrayLikeToArray(r); |
| 2335 | } |
| 2336 | module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2337 | |
| 2338 | /***/ }), |
| 2339 | |
| 2340 | /***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": |
| 2341 | /*!***********************************************************************!*\ |
| 2342 | !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! |
| 2343 | \***********************************************************************/ |
| 2344 | /***/ ((module) => { |
| 2345 | |
| 2346 | function _assertThisInitialized(e) { |
| 2347 | if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 2348 | return e; |
| 2349 | } |
| 2350 | module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2351 | |
| 2352 | /***/ }), |
| 2353 | |
| 2354 | /***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js": |
| 2355 | /*!******************************************************************!*\ |
| 2356 | !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! |
| 2357 | \******************************************************************/ |
| 2358 | /***/ ((module) => { |
| 2359 | |
| 2360 | function asyncGeneratorStep(n, t, e, r, o, a, c) { |
| 2361 | try { |
| 2362 | var i = n[a](c), |
| 2363 | u = i.value; |
| 2364 | } catch (n) { |
| 2365 | return void e(n); |
| 2366 | } |
| 2367 | i.done ? t(u) : Promise.resolve(u).then(r, o); |
| 2368 | } |
| 2369 | function _asyncToGenerator(n) { |
| 2370 | return function () { |
| 2371 | var t = this, |
| 2372 | e = arguments; |
| 2373 | return new Promise(function (r, o) { |
| 2374 | var a = n.apply(t, e); |
| 2375 | function _next(n) { |
| 2376 | asyncGeneratorStep(a, r, o, _next, _throw, "next", n); |
| 2377 | } |
| 2378 | function _throw(n) { |
| 2379 | asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); |
| 2380 | } |
| 2381 | _next(void 0); |
| 2382 | }); |
| 2383 | }; |
| 2384 | } |
| 2385 | module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2386 | |
| 2387 | /***/ }), |
| 2388 | |
| 2389 | /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": |
| 2390 | /*!****************************************************************!*\ |
| 2391 | !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! |
| 2392 | \****************************************************************/ |
| 2393 | /***/ ((module) => { |
| 2394 | |
| 2395 | function _classCallCheck(a, n) { |
| 2396 | if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); |
| 2397 | } |
| 2398 | module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2399 | |
| 2400 | /***/ }), |
| 2401 | |
| 2402 | /***/ "../node_modules/@babel/runtime/helpers/createClass.js": |
| 2403 | /*!*************************************************************!*\ |
| 2404 | !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! |
| 2405 | \*************************************************************/ |
| 2406 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2407 | |
| 2408 | var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); |
| 2409 | function _defineProperties(e, r) { |
| 2410 | for (var t = 0; t < r.length; t++) { |
| 2411 | var o = r[t]; |
| 2412 | o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); |
| 2413 | } |
| 2414 | } |
| 2415 | function _createClass(e, r, t) { |
| 2416 | return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { |
| 2417 | writable: !1 |
| 2418 | }), e; |
| 2419 | } |
| 2420 | module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2421 | |
| 2422 | /***/ }), |
| 2423 | |
| 2424 | /***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": |
| 2425 | /*!****************************************************************!*\ |
| 2426 | !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! |
| 2427 | \****************************************************************/ |
| 2428 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2429 | |
| 2430 | var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); |
| 2431 | function _defineProperty(e, r, t) { |
| 2432 | return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { |
| 2433 | value: t, |
| 2434 | enumerable: !0, |
| 2435 | configurable: !0, |
| 2436 | writable: !0 |
| 2437 | }) : e[r] = t, e; |
| 2438 | } |
| 2439 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2440 | |
| 2441 | /***/ }), |
| 2442 | |
| 2443 | /***/ "../node_modules/@babel/runtime/helpers/get.js": |
| 2444 | /*!*****************************************************!*\ |
| 2445 | !*** ../node_modules/@babel/runtime/helpers/get.js ***! |
| 2446 | \*****************************************************/ |
| 2447 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2448 | |
| 2449 | var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); |
| 2450 | function _get() { |
| 2451 | return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { |
| 2452 | var p = superPropBase(e, t); |
| 2453 | if (p) { |
| 2454 | var n = Object.getOwnPropertyDescriptor(p, t); |
| 2455 | return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; |
| 2456 | } |
| 2457 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments); |
| 2458 | } |
| 2459 | module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2460 | |
| 2461 | /***/ }), |
| 2462 | |
| 2463 | /***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": |
| 2464 | /*!****************************************************************!*\ |
| 2465 | !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! |
| 2466 | \****************************************************************/ |
| 2467 | /***/ ((module) => { |
| 2468 | |
| 2469 | function _getPrototypeOf(t) { |
| 2470 | return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { |
| 2471 | return t.__proto__ || Object.getPrototypeOf(t); |
| 2472 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t); |
| 2473 | } |
| 2474 | module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2475 | |
| 2476 | /***/ }), |
| 2477 | |
| 2478 | /***/ "../node_modules/@babel/runtime/helpers/inherits.js": |
| 2479 | /*!**********************************************************!*\ |
| 2480 | !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! |
| 2481 | \**********************************************************/ |
| 2482 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2483 | |
| 2484 | var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); |
| 2485 | function _inherits(t, e) { |
| 2486 | if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); |
| 2487 | t.prototype = Object.create(e && e.prototype, { |
| 2488 | constructor: { |
| 2489 | value: t, |
| 2490 | writable: !0, |
| 2491 | configurable: !0 |
| 2492 | } |
| 2493 | }), Object.defineProperty(t, "prototype", { |
| 2494 | writable: !1 |
| 2495 | }), e && setPrototypeOf(t, e); |
| 2496 | } |
| 2497 | module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2498 | |
| 2499 | /***/ }), |
| 2500 | |
| 2501 | /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": |
| 2502 | /*!***********************************************************************!*\ |
| 2503 | !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! |
| 2504 | \***********************************************************************/ |
| 2505 | /***/ ((module) => { |
| 2506 | |
| 2507 | function _interopRequireDefault(e) { |
| 2508 | return e && e.__esModule ? e : { |
| 2509 | "default": e |
| 2510 | }; |
| 2511 | } |
| 2512 | module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2513 | |
| 2514 | /***/ }), |
| 2515 | |
| 2516 | /***/ "../node_modules/@babel/runtime/helpers/iterableToArray.js": |
| 2517 | /*!*****************************************************************!*\ |
| 2518 | !*** ../node_modules/@babel/runtime/helpers/iterableToArray.js ***! |
| 2519 | \*****************************************************************/ |
| 2520 | /***/ ((module) => { |
| 2521 | |
| 2522 | function _iterableToArray(r) { |
| 2523 | if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); |
| 2524 | } |
| 2525 | module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2526 | |
| 2527 | /***/ }), |
| 2528 | |
| 2529 | /***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": |
| 2530 | /*!**********************************************************************!*\ |
| 2531 | !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! |
| 2532 | \**********************************************************************/ |
| 2533 | /***/ ((module) => { |
| 2534 | |
| 2535 | function _iterableToArrayLimit(r, l) { |
| 2536 | var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 2537 | if (null != t) { |
| 2538 | var e, |
| 2539 | n, |
| 2540 | i, |
| 2541 | u, |
| 2542 | a = [], |
| 2543 | f = !0, |
| 2544 | o = !1; |
| 2545 | try { |
| 2546 | if (i = (t = t.call(r)).next, 0 === l) { |
| 2547 | if (Object(t) !== t) return; |
| 2548 | f = !1; |
| 2549 | } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); |
| 2550 | } catch (r) { |
| 2551 | o = !0, n = r; |
| 2552 | } finally { |
| 2553 | try { |
| 2554 | if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; |
| 2555 | } finally { |
| 2556 | if (o) throw n; |
| 2557 | } |
| 2558 | } |
| 2559 | return a; |
| 2560 | } |
| 2561 | } |
| 2562 | module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2563 | |
| 2564 | /***/ }), |
| 2565 | |
| 2566 | /***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": |
| 2567 | /*!*****************************************************************!*\ |
| 2568 | !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! |
| 2569 | \*****************************************************************/ |
| 2570 | /***/ ((module) => { |
| 2571 | |
| 2572 | function _nonIterableRest() { |
| 2573 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 2574 | } |
| 2575 | module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2576 | |
| 2577 | /***/ }), |
| 2578 | |
| 2579 | /***/ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js": |
| 2580 | /*!*******************************************************************!*\ |
| 2581 | !*** ../node_modules/@babel/runtime/helpers/nonIterableSpread.js ***! |
| 2582 | \*******************************************************************/ |
| 2583 | /***/ ((module) => { |
| 2584 | |
| 2585 | function _nonIterableSpread() { |
| 2586 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 2587 | } |
| 2588 | module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2589 | |
| 2590 | /***/ }), |
| 2591 | |
| 2592 | /***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": |
| 2593 | /*!***************************************************************************!*\ |
| 2594 | !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! |
| 2595 | \***************************************************************************/ |
| 2596 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2597 | |
| 2598 | var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); |
| 2599 | var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); |
| 2600 | function _possibleConstructorReturn(t, e) { |
| 2601 | if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; |
| 2602 | if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); |
| 2603 | return assertThisInitialized(t); |
| 2604 | } |
| 2605 | module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2606 | |
| 2607 | /***/ }), |
| 2608 | |
| 2609 | /***/ "../node_modules/@babel/runtime/helpers/regenerator.js": |
| 2610 | /*!*************************************************************!*\ |
| 2611 | !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***! |
| 2612 | \*************************************************************/ |
| 2613 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2614 | |
| 2615 | var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js"); |
| 2616 | function _regenerator() { |
| 2617 | /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ |
| 2618 | var e, |
| 2619 | t, |
| 2620 | r = "function" == typeof Symbol ? Symbol : {}, |
| 2621 | n = r.iterator || "@@iterator", |
| 2622 | o = r.toStringTag || "@@toStringTag"; |
| 2623 | function i(r, n, o, i) { |
| 2624 | var c = n && n.prototype instanceof Generator ? n : Generator, |
| 2625 | u = Object.create(c.prototype); |
| 2626 | return regeneratorDefine(u, "_invoke", function (r, n, o) { |
| 2627 | var i, |
| 2628 | c, |
| 2629 | u, |
| 2630 | f = 0, |
| 2631 | p = o || [], |
| 2632 | y = !1, |
| 2633 | G = { |
| 2634 | p: 0, |
| 2635 | n: 0, |
| 2636 | v: e, |
| 2637 | a: d, |
| 2638 | f: d.bind(e, 4), |
| 2639 | d: function d(t, r) { |
| 2640 | return i = t, c = 0, u = e, G.n = r, a; |
| 2641 | } |
| 2642 | }; |
| 2643 | function d(r, n) { |
| 2644 | for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { |
| 2645 | var o, |
| 2646 | i = p[t], |
| 2647 | d = G.p, |
| 2648 | l = i[2]; |
| 2649 | 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)); |
| 2650 | } |
| 2651 | if (o || r > 1) return a; |
| 2652 | throw y = !0, n; |
| 2653 | } |
| 2654 | return function (o, p, l) { |
| 2655 | if (f > 1) throw TypeError("Generator is already running"); |
| 2656 | for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { |
| 2657 | i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); |
| 2658 | try { |
| 2659 | if (f = 2, i) { |
| 2660 | if (c || (o = "next"), t = i[o]) { |
| 2661 | if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); |
| 2662 | if (!t.done) return t; |
| 2663 | u = t.value, c < 2 && (c = 0); |
| 2664 | } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); |
| 2665 | i = e; |
| 2666 | } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; |
| 2667 | } catch (t) { |
| 2668 | i = e, c = 1, u = t; |
| 2669 | } finally { |
| 2670 | f = 1; |
| 2671 | } |
| 2672 | } |
| 2673 | return { |
| 2674 | value: t, |
| 2675 | done: y |
| 2676 | }; |
| 2677 | }; |
| 2678 | }(r, o, i), !0), u; |
| 2679 | } |
| 2680 | var a = {}; |
| 2681 | function Generator() {} |
| 2682 | function GeneratorFunction() {} |
| 2683 | function GeneratorFunctionPrototype() {} |
| 2684 | t = Object.getPrototypeOf; |
| 2685 | var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () { |
| 2686 | return this; |
| 2687 | }), t), |
| 2688 | u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); |
| 2689 | function f(e) { |
| 2690 | return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; |
| 2691 | } |
| 2692 | 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 () { |
| 2693 | return this; |
| 2694 | }), regeneratorDefine(u, "toString", function () { |
| 2695 | return "[object Generator]"; |
| 2696 | }), (module.exports = _regenerator = function _regenerator() { |
| 2697 | return { |
| 2698 | w: i, |
| 2699 | m: f |
| 2700 | }; |
| 2701 | }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); |
| 2702 | } |
| 2703 | module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2704 | |
| 2705 | /***/ }), |
| 2706 | |
| 2707 | /***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js": |
| 2708 | /*!******************************************************************!*\ |
| 2709 | !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***! |
| 2710 | \******************************************************************/ |
| 2711 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2712 | |
| 2713 | var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"); |
| 2714 | function _regeneratorAsync(n, e, r, t, o) { |
| 2715 | var a = regeneratorAsyncGen(n, e, r, t, o); |
| 2716 | return a.next().then(function (n) { |
| 2717 | return n.done ? n.value : a.next(); |
| 2718 | }); |
| 2719 | } |
| 2720 | module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2721 | |
| 2722 | /***/ }), |
| 2723 | |
| 2724 | /***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js": |
| 2725 | /*!*********************************************************************!*\ |
| 2726 | !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***! |
| 2727 | \*********************************************************************/ |
| 2728 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2729 | |
| 2730 | var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js"); |
| 2731 | var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"); |
| 2732 | function _regeneratorAsyncGen(r, e, t, o, n) { |
| 2733 | return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); |
| 2734 | } |
| 2735 | module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2736 | |
| 2737 | /***/ }), |
| 2738 | |
| 2739 | /***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js": |
| 2740 | /*!**************************************************************************!*\ |
| 2741 | !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***! |
| 2742 | \**************************************************************************/ |
| 2743 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2744 | |
| 2745 | var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js"); |
| 2746 | var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js"); |
| 2747 | function AsyncIterator(t, e) { |
| 2748 | function n(r, o, i, f) { |
| 2749 | try { |
| 2750 | var c = t[r](o), |
| 2751 | u = c.value; |
| 2752 | return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) { |
| 2753 | n("next", t, i, f); |
| 2754 | }, function (t) { |
| 2755 | n("throw", t, i, f); |
| 2756 | }) : e.resolve(u).then(function (t) { |
| 2757 | c.value = t, i(c); |
| 2758 | }, function (t) { |
| 2759 | return n("throw", t, i, f); |
| 2760 | }); |
| 2761 | } catch (t) { |
| 2762 | f(t); |
| 2763 | } |
| 2764 | } |
| 2765 | var r; |
| 2766 | this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { |
| 2767 | return this; |
| 2768 | })), regeneratorDefine(this, "_invoke", function (t, o, i) { |
| 2769 | function f() { |
| 2770 | return new e(function (e, r) { |
| 2771 | n(t, i, e, r); |
| 2772 | }); |
| 2773 | } |
| 2774 | return r = r ? r.then(f, f) : f(); |
| 2775 | }, !0); |
| 2776 | } |
| 2777 | module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2778 | |
| 2779 | /***/ }), |
| 2780 | |
| 2781 | /***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js": |
| 2782 | /*!*******************************************************************!*\ |
| 2783 | !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***! |
| 2784 | \*******************************************************************/ |
| 2785 | /***/ ((module) => { |
| 2786 | |
| 2787 | function _regeneratorDefine(e, r, n, t) { |
| 2788 | var i = Object.defineProperty; |
| 2789 | try { |
| 2790 | i({}, "", {}); |
| 2791 | } catch (e) { |
| 2792 | i = 0; |
| 2793 | } |
| 2794 | module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { |
| 2795 | function o(r, n) { |
| 2796 | _regeneratorDefine(e, r, function (e) { |
| 2797 | return this._invoke(r, n, e); |
| 2798 | }); |
| 2799 | } |
| 2800 | r ? i ? i(e, r, { |
| 2801 | value: n, |
| 2802 | enumerable: !t, |
| 2803 | configurable: !t, |
| 2804 | writable: !t |
| 2805 | }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); |
| 2806 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); |
| 2807 | } |
| 2808 | module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2809 | |
| 2810 | /***/ }), |
| 2811 | |
| 2812 | /***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js": |
| 2813 | /*!*****************************************************************!*\ |
| 2814 | !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***! |
| 2815 | \*****************************************************************/ |
| 2816 | /***/ ((module) => { |
| 2817 | |
| 2818 | function _regeneratorKeys(e) { |
| 2819 | var n = Object(e), |
| 2820 | r = []; |
| 2821 | for (var t in n) r.unshift(t); |
| 2822 | return function e() { |
| 2823 | for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; |
| 2824 | return e.done = !0, e; |
| 2825 | }; |
| 2826 | } |
| 2827 | module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2828 | |
| 2829 | /***/ }), |
| 2830 | |
| 2831 | /***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js": |
| 2832 | /*!********************************************************************!*\ |
| 2833 | !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! |
| 2834 | \********************************************************************/ |
| 2835 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2836 | |
| 2837 | var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js"); |
| 2838 | var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js"); |
| 2839 | var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js"); |
| 2840 | var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"); |
| 2841 | var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"); |
| 2842 | var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js"); |
| 2843 | var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js"); |
| 2844 | function _regeneratorRuntime() { |
| 2845 | "use strict"; |
| 2846 | |
| 2847 | var r = regenerator(), |
| 2848 | e = r.m(_regeneratorRuntime), |
| 2849 | t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; |
| 2850 | function n(r) { |
| 2851 | var e = "function" == typeof r && r.constructor; |
| 2852 | return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); |
| 2853 | } |
| 2854 | var o = { |
| 2855 | "throw": 1, |
| 2856 | "return": 2, |
| 2857 | "break": 3, |
| 2858 | "continue": 3 |
| 2859 | }; |
| 2860 | function a(r) { |
| 2861 | var e, t; |
| 2862 | return function (n) { |
| 2863 | e || (e = { |
| 2864 | stop: function stop() { |
| 2865 | return t(n.a, 2); |
| 2866 | }, |
| 2867 | "catch": function _catch() { |
| 2868 | return n.v; |
| 2869 | }, |
| 2870 | abrupt: function abrupt(r, e) { |
| 2871 | return t(n.a, o[r], e); |
| 2872 | }, |
| 2873 | delegateYield: function delegateYield(r, o, a) { |
| 2874 | return e.resultName = o, t(n.d, regeneratorValues(r), a); |
| 2875 | }, |
| 2876 | finish: function finish(r) { |
| 2877 | return t(n.f, r); |
| 2878 | } |
| 2879 | }, t = function t(r, _t, o) { |
| 2880 | n.p = e.prev, n.n = e.next; |
| 2881 | try { |
| 2882 | return r(_t, o); |
| 2883 | } finally { |
| 2884 | e.next = n.n; |
| 2885 | } |
| 2886 | }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; |
| 2887 | try { |
| 2888 | return r.call(this, e); |
| 2889 | } finally { |
| 2890 | n.p = e.prev, n.n = e.next; |
| 2891 | } |
| 2892 | }; |
| 2893 | } |
| 2894 | return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { |
| 2895 | return { |
| 2896 | wrap: function wrap(e, t, n, o) { |
| 2897 | return r.w(a(e), t, n, o && o.reverse()); |
| 2898 | }, |
| 2899 | isGeneratorFunction: n, |
| 2900 | mark: r.m, |
| 2901 | awrap: function awrap(r, e) { |
| 2902 | return new OverloadYield(r, e); |
| 2903 | }, |
| 2904 | AsyncIterator: regeneratorAsyncIterator, |
| 2905 | async: function async(r, e, t, o, u) { |
| 2906 | return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); |
| 2907 | }, |
| 2908 | keys: regeneratorKeys, |
| 2909 | values: regeneratorValues |
| 2910 | }; |
| 2911 | }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); |
| 2912 | } |
| 2913 | module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2914 | |
| 2915 | /***/ }), |
| 2916 | |
| 2917 | /***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js": |
| 2918 | /*!*******************************************************************!*\ |
| 2919 | !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***! |
| 2920 | \*******************************************************************/ |
| 2921 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2922 | |
| 2923 | var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); |
| 2924 | function _regeneratorValues(e) { |
| 2925 | if (null != e) { |
| 2926 | var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], |
| 2927 | r = 0; |
| 2928 | if (t) return t.call(e); |
| 2929 | if ("function" == typeof e.next) return e; |
| 2930 | if (!isNaN(e.length)) return { |
| 2931 | next: function next() { |
| 2932 | return e && r >= e.length && (e = void 0), { |
| 2933 | value: e && e[r++], |
| 2934 | done: !e |
| 2935 | }; |
| 2936 | } |
| 2937 | }; |
| 2938 | } |
| 2939 | throw new TypeError(_typeof(e) + " is not iterable"); |
| 2940 | } |
| 2941 | module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2942 | |
| 2943 | /***/ }), |
| 2944 | |
| 2945 | /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": |
| 2946 | /*!****************************************************************!*\ |
| 2947 | !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! |
| 2948 | \****************************************************************/ |
| 2949 | /***/ ((module) => { |
| 2950 | |
| 2951 | function _setPrototypeOf(t, e) { |
| 2952 | return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { |
| 2953 | return t.__proto__ = e, t; |
| 2954 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e); |
| 2955 | } |
| 2956 | module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2957 | |
| 2958 | /***/ }), |
| 2959 | |
| 2960 | /***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": |
| 2961 | /*!***************************************************************!*\ |
| 2962 | !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! |
| 2963 | \***************************************************************/ |
| 2964 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2965 | |
| 2966 | var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); |
| 2967 | var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); |
| 2968 | var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); |
| 2969 | var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); |
| 2970 | function _slicedToArray(r, e) { |
| 2971 | return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); |
| 2972 | } |
| 2973 | module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2974 | |
| 2975 | /***/ }), |
| 2976 | |
| 2977 | /***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": |
| 2978 | /*!***************************************************************!*\ |
| 2979 | !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! |
| 2980 | \***************************************************************/ |
| 2981 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2982 | |
| 2983 | var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); |
| 2984 | function _superPropBase(t, o) { |
| 2985 | for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t));); |
| 2986 | return t; |
| 2987 | } |
| 2988 | module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2989 | |
| 2990 | /***/ }), |
| 2991 | |
| 2992 | /***/ "../node_modules/@babel/runtime/helpers/toConsumableArray.js": |
| 2993 | /*!*******************************************************************!*\ |
| 2994 | !*** ../node_modules/@babel/runtime/helpers/toConsumableArray.js ***! |
| 2995 | \*******************************************************************/ |
| 2996 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2997 | |
| 2998 | var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"); |
| 2999 | var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ "../node_modules/@babel/runtime/helpers/iterableToArray.js"); |
| 3000 | var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); |
| 3001 | var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js"); |
| 3002 | function _toConsumableArray(r) { |
| 3003 | return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread(); |
| 3004 | } |
| 3005 | module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 3006 | |
| 3007 | /***/ }), |
| 3008 | |
| 3009 | /***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": |
| 3010 | /*!*************************************************************!*\ |
| 3011 | !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! |
| 3012 | \*************************************************************/ |
| 3013 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3014 | |
| 3015 | var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); |
| 3016 | function toPrimitive(t, r) { |
| 3017 | if ("object" != _typeof(t) || !t) return t; |
| 3018 | var e = t[Symbol.toPrimitive]; |
| 3019 | if (void 0 !== e) { |
| 3020 | var i = e.call(t, r || "default"); |
| 3021 | if ("object" != _typeof(i)) return i; |
| 3022 | throw new TypeError("@@toPrimitive must return a primitive value."); |
| 3023 | } |
| 3024 | return ("string" === r ? String : Number)(t); |
| 3025 | } |
| 3026 | module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 3027 | |
| 3028 | /***/ }), |
| 3029 | |
| 3030 | /***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": |
| 3031 | /*!***************************************************************!*\ |
| 3032 | !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! |
| 3033 | \***************************************************************/ |
| 3034 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3035 | |
| 3036 | var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); |
| 3037 | var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); |
| 3038 | function toPropertyKey(t) { |
| 3039 | var i = toPrimitive(t, "string"); |
| 3040 | return "symbol" == _typeof(i) ? i : i + ""; |
| 3041 | } |
| 3042 | module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 3043 | |
| 3044 | /***/ }), |
| 3045 | |
| 3046 | /***/ "../node_modules/@babel/runtime/helpers/typeof.js": |
| 3047 | /*!********************************************************!*\ |
| 3048 | !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! |
| 3049 | \********************************************************/ |
| 3050 | /***/ ((module) => { |
| 3051 | |
| 3052 | function _typeof(o) { |
| 3053 | "@babel/helpers - typeof"; |
| 3054 | |
| 3055 | return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { |
| 3056 | return typeof o; |
| 3057 | } : function (o) { |
| 3058 | return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 3059 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); |
| 3060 | } |
| 3061 | module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 3062 | |
| 3063 | /***/ }), |
| 3064 | |
| 3065 | /***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": |
| 3066 | /*!****************************************************************************!*\ |
| 3067 | !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! |
| 3068 | \****************************************************************************/ |
| 3069 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3070 | |
| 3071 | var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); |
| 3072 | function _unsupportedIterableToArray(r, a) { |
| 3073 | if (r) { |
| 3074 | if ("string" == typeof r) return arrayLikeToArray(r, a); |
| 3075 | var t = {}.toString.call(r).slice(8, -1); |
| 3076 | 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; |
| 3077 | } |
| 3078 | } |
| 3079 | module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 3080 | |
| 3081 | /***/ }), |
| 3082 | |
| 3083 | /***/ "../node_modules/@babel/runtime/regenerator/index.js": |
| 3084 | /*!***********************************************************!*\ |
| 3085 | !*** ../node_modules/@babel/runtime/regenerator/index.js ***! |
| 3086 | \***********************************************************/ |
| 3087 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3088 | |
| 3089 | // TODO(Babel 8): Remove this file. |
| 3090 | |
| 3091 | var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); |
| 3092 | module.exports = runtime; |
| 3093 | |
| 3094 | // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= |
| 3095 | try { |
| 3096 | regeneratorRuntime = runtime; |
| 3097 | } catch (accidentalStrictMode) { |
| 3098 | if (typeof globalThis === "object") { |
| 3099 | globalThis.regeneratorRuntime = runtime; |
| 3100 | } else { |
| 3101 | Function("r", "regeneratorRuntime = r")(runtime); |
| 3102 | } |
| 3103 | } |
| 3104 | |
| 3105 | |
| 3106 | /***/ }), |
| 3107 | |
| 3108 | /***/ "../node_modules/react-dom/client.js": |
| 3109 | /*!*******************************************!*\ |
| 3110 | !*** ../node_modules/react-dom/client.js ***! |
| 3111 | \*******************************************/ |
| 3112 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 3113 | |
| 3114 | "use strict"; |
| 3115 | |
| 3116 | |
| 3117 | var m = __webpack_require__(/*! react-dom */ "react-dom"); |
| 3118 | if (false) // removed by dead control flow |
| 3119 | {} else { |
| 3120 | var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; |
| 3121 | exports.createRoot = function(c, o) { |
| 3122 | i.usingClientEntryPoint = true; |
| 3123 | try { |
| 3124 | return m.createRoot(c, o); |
| 3125 | } finally { |
| 3126 | i.usingClientEntryPoint = false; |
| 3127 | } |
| 3128 | }; |
| 3129 | exports.hydrateRoot = function(c, h, o) { |
| 3130 | i.usingClientEntryPoint = true; |
| 3131 | try { |
| 3132 | return m.hydrateRoot(c, h, o); |
| 3133 | } finally { |
| 3134 | i.usingClientEntryPoint = false; |
| 3135 | } |
| 3136 | }; |
| 3137 | } |
| 3138 | |
| 3139 | |
| 3140 | /***/ }), |
| 3141 | |
| 3142 | /***/ "@wordpress/i18n": |
| 3143 | /*!**************************!*\ |
| 3144 | !*** external "wp.i18n" ***! |
| 3145 | \**************************/ |
| 3146 | /***/ ((module) => { |
| 3147 | |
| 3148 | "use strict"; |
| 3149 | module.exports = wp.i18n; |
| 3150 | |
| 3151 | /***/ }), |
| 3152 | |
| 3153 | /***/ "react": |
| 3154 | /*!************************!*\ |
| 3155 | !*** external "React" ***! |
| 3156 | \************************/ |
| 3157 | /***/ ((module) => { |
| 3158 | |
| 3159 | "use strict"; |
| 3160 | module.exports = React; |
| 3161 | |
| 3162 | /***/ }), |
| 3163 | |
| 3164 | /***/ "react-dom": |
| 3165 | /*!***************************!*\ |
| 3166 | !*** external "ReactDOM" ***! |
| 3167 | \***************************/ |
| 3168 | /***/ ((module) => { |
| 3169 | |
| 3170 | "use strict"; |
| 3171 | module.exports = ReactDOM; |
| 3172 | |
| 3173 | /***/ }) |
| 3174 | |
| 3175 | /******/ }); |
| 3176 | /************************************************************************/ |
| 3177 | /******/ // The module cache |
| 3178 | /******/ var __webpack_module_cache__ = {}; |
| 3179 | /******/ |
| 3180 | /******/ // The require function |
| 3181 | /******/ function __webpack_require__(moduleId) { |
| 3182 | /******/ // Check if module is in cache |
| 3183 | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| 3184 | /******/ if (cachedModule !== undefined) { |
| 3185 | /******/ return cachedModule.exports; |
| 3186 | /******/ } |
| 3187 | /******/ // Create a new module (and put it into the cache) |
| 3188 | /******/ var module = __webpack_module_cache__[moduleId] = { |
| 3189 | /******/ // no module.id needed |
| 3190 | /******/ // no module.loaded needed |
| 3191 | /******/ exports: {} |
| 3192 | /******/ }; |
| 3193 | /******/ |
| 3194 | /******/ // Execute the module function |
| 3195 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| 3196 | /******/ |
| 3197 | /******/ // Return the exports of the module |
| 3198 | /******/ return module.exports; |
| 3199 | /******/ } |
| 3200 | /******/ |
| 3201 | /************************************************************************/ |
| 3202 | var __webpack_exports__ = {}; |
| 3203 | // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. |
| 3204 | (() => { |
| 3205 | "use strict"; |
| 3206 | /*!************************************************************!*\ |
| 3207 | !*** ../modules/atomic-widgets/assets/js/editor/module.js ***! |
| 3208 | \************************************************************/ |
| 3209 | |
| 3210 | |
| 3211 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 3212 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); |
| 3213 | var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); |
| 3214 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 3215 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 3216 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 3217 | var _component = _interopRequireDefault(__webpack_require__(/*! ./component */ "../modules/atomic-widgets/assets/js/editor/component.js")); |
| 3218 | var _atomicElementBaseType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js")); |
| 3219 | var _createAtomicElementBaseView = _interopRequireDefault(__webpack_require__(/*! ./create-atomic-element-base-view */ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js")); |
| 3220 | var _atomicElementBaseModel = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-model */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js")); |
| 3221 | var _createDivBlockType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-div-block-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js")); |
| 3222 | var _createFlexboxType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-flexbox-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js")); |
| 3223 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| 3224 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 3225 | var Module = /*#__PURE__*/function (_elementorModules$edi) { |
| 3226 | function Module() { |
| 3227 | (0, _classCallCheck2.default)(this, Module); |
| 3228 | return _callSuper(this, Module, arguments); |
| 3229 | } |
| 3230 | (0, _inherits2.default)(Module, _elementorModules$edi); |
| 3231 | return (0, _createClass2.default)(Module, [{ |
| 3232 | key: "onInit", |
| 3233 | value: function onInit() { |
| 3234 | $e.components.register(new _component.default()); |
| 3235 | this.exposeAtomicElementClasses(); |
| 3236 | this.registerAtomicElements(); |
| 3237 | } |
| 3238 | }, { |
| 3239 | key: "exposeAtomicElementClasses", |
| 3240 | value: function exposeAtomicElementClasses() { |
| 3241 | elementor.modules.elements.types.AtomicElementBase = _atomicElementBaseType.default; |
| 3242 | elementor.modules.elements.views.createAtomicElementBase = _createAtomicElementBaseView.default; |
| 3243 | elementor.modules.elements.models.AtomicElementBase = _atomicElementBaseModel.default; |
| 3244 | } |
| 3245 | }, { |
| 3246 | key: "registerAtomicElements", |
| 3247 | value: function registerAtomicElements() { |
| 3248 | elementor.elementsManager.registerElementType((0, _createDivBlockType.default)()); |
| 3249 | elementor.elementsManager.registerElementType((0, _createFlexboxType.default)()); |
| 3250 | } |
| 3251 | }]); |
| 3252 | }(elementorModules.editor.utils.Module); |
| 3253 | new Module(); |
| 3254 | })(); |
| 3255 | |
| 3256 | /******/ })() |
| 3257 | ; |
| 3258 | //# sourceMappingURL=atomic-widgets-editor.js.map |