PluginProbe
Elementor Website Builder – more than just a page builder / 3.35.0-dev4
Elementor Website Builder – more than just a page builder v3.35.0-dev4
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | assets/js/ai-layout.js +2 -455 4.2.0-beta1 → 3.35.0-dev4 View file →
@@ -1,445 +1,7 @@
1 1 /******/ (() => { // webpackBootstrap
2 2 /******/ var __webpack_modules__ = ({
3 3
4 -/***/ "../assets/dev/js/editor/utils/editor-one-events.js":
5 -/*!**********************************************************!*\
6 - !*** ../assets/dev/js/editor/utils/editor-one-events.js ***!
7 - \**********************************************************/
8 -/***/ ((__unused_webpack_module, 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 -Object.defineProperty(exports, "__esModule", ({
15 - value: true
16 -}));
17 -exports["default"] = exports.createDebouncedWidgetPanelSearch = exports.createDebouncedFinderSearch = exports.EditorOneEventManager = void 0;
18 -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
19 -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
20 -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
21 -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; }
22 -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; }
23 -var EditorOneEventManager = exports.EditorOneEventManager = /*#__PURE__*/function () {
24 - function EditorOneEventManager() {
25 - (0, _classCallCheck2.default)(this, EditorOneEventManager);
26 - }
27 - return (0, _createClass2.default)(EditorOneEventManager, null, [{
28 - key: "getEventsManager",
29 - value: function getEventsManager() {
30 - var _elementorCommon;
31 - return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager;
32 - }
33 - }, {
34 - key: "getConfig",
35 - value: function getConfig() {
36 - var _this$getEventsManage;
37 - return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config;
38 - }
39 - }, {
40 - key: "canSendEvents",
41 - value: function canSendEvents() {
42 - var _elementorCommon2;
43 - 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;
44 - }
45 - }, {
46 - key: "isEventsManagerAvailable",
47 - value: function isEventsManagerAvailable() {
48 - var eventsManager = this.getEventsManager();
49 - return eventsManager && 'function' === typeof eventsManager.dispatchEvent;
50 - }
51 - }, {
52 - key: "dispatchEvent",
53 - value: function dispatchEvent(eventName, payload) {
54 - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) {
55 - return false;
56 - }
57 - try {
58 - return this.getEventsManager().dispatchEvent(eventName, payload);
59 - } catch (error) {
60 - return false;
61 - }
62 - }
63 - }, {
64 - key: "toLowerSnake",
65 - value: function toLowerSnake(value) {
66 - if (!value || 'string' !== typeof value) {
67 - return value;
68 - }
69 - return value.replace(/\s+/g, '_').toLowerCase();
70 - }
71 - }, {
72 - key: "decodeHtmlEntities",
73 - value: function decodeHtmlEntities(text) {
74 - if (!text || 'string' !== typeof text) {
75 - return text;
76 - }
77 - var doc = new DOMParser().parseFromString(text, 'text/html');
78 - return doc.body.textContent || text;
79 - }
80 - }, {
81 - key: "isInEditorContext",
82 - value: function isInEditorContext() {
83 - var _window$elementor;
84 - return 'undefined' !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents);
85 - }
86 - }, {
87 - key: "getFinderContext",
88 - value: function getFinderContext() {
89 - var _config$appTypes, _config$appTypes2, _config$locations, _config$locations2;
90 - var config = this.getConfig();
91 - var isEditor = this.isInEditorContext();
92 - return {
93 - 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,
94 - 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)
95 - };
96 - }
97 - }, {
98 - key: "createBasePayload",
99 - value: function createBasePayload() {
100 - var _config$appTypes$edit, _config$appTypes3, _config$appTypes$edit2, _config$appTypes4;
101 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
102 - var config = this.getConfig();
103 - return _objectSpread({
104 - 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',
105 - 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'
106 - }, overrides);
107 - }
108 - }, {
109 - key: "sendTopBarPublishDropdown",
110 - value: function sendTopBarPublishDropdown(targetName) {
111 - var _config$names, _config$triggers, _config$targetTypes, _config$interactionRe, _config$locations3, _config$secondaryLoca, _config$targetTypes2;
112 - var config = this.getConfig();
113 - 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({
114 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click),
115 - target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem,
116 - target_name: targetName,
117 - interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected,
118 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar),
119 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown),
120 - location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem,
121 - interaction_description: 'User selected an action from the publish dropdown'
122 - }));
123 - }
124 - }, {
125 - key: "sendTopBarPageList",
126 - value: function sendTopBarPageList(targetName) {
127 - var _config$names2, _config$triggers2, _config$targetTypes3, _config$interactionRe2, _config$interactionRe3, _config$locations4, _config$secondaryLoca2, _config$targetTypes4;
128 - var isCreate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
129 - var config = this.getConfig();
130 - 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({
131 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click),
132 - target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem,
133 - target_name: targetName,
134 - 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,
135 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar),
136 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown),
137 - location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem,
138 - interaction_description: 'User selected an action from the page list dropdown'
139 - }));
140 - }
141 - }, {
142 - key: "sendSiteSettingsSession",
143 - value: function sendSiteSettingsSession(_ref) {
144 - var _config$names3, _config$triggers3, _config$interactionRe4, _config$locations5, _config$secondaryLoca3;
145 - var targetType = _ref.targetType,
146 - _ref$visitedItems = _ref.visitedItems,
147 - visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems,
148 - _ref$savedItems = _ref.savedItems,
149 - savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems,
150 - state = _ref.state;
151 - var config = this.getConfig();
152 - 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({
153 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click),
154 - target_type: targetType,
155 - target_name: 'site_settings',
156 - interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd,
157 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel),
158 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings),
159 - interaction_description: 'Records areas visited as part of the site setting session',
160 - metadata: {
161 - visited_items: visitedItems,
162 - saved_items: savedItems
163 - },
164 - state: state
165 - }));
166 - }
167 - }, {
168 - key: "sendELibraryNav",
169 - value: function sendELibraryNav(tabName) {
170 - var _config$names4, _config$triggers4, _config$targetTypes5, _config$interactionRe5, _config$locations6, _config$secondaryLoca4;
171 - var config = this.getConfig();
172 - 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({
173 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect),
174 - target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab,
175 - target_name: this.toLowerSnake(tabName),
176 - interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged,
177 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary),
178 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs),
179 - interaction_description: 'User navigates within elementor library'
180 - }));
181 - }
182 - }, {
183 - key: "sendELibraryInsert",
184 - value: function sendELibraryInsert(_ref2) {
185 - var _config$triggers5, _config$targetTypes6, _config$interactionRe6, _config$locations7, _config$secondaryLoca5, _config$names5;
186 - var assetId = _ref2.assetId,
187 - assetName = _ref2.assetName,
188 - libraryType = _ref2.libraryType,
189 - _ref2$proRequired = _ref2.proRequired,
190 - proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired;
191 - var config = this.getConfig();
192 - var payload = this.createBasePayload({
193 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert),
194 - target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button,
195 - target_name: String(assetId),
196 - interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted,
197 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary),
198 - location_l1: this.toLowerSnake(libraryType),
199 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard),
200 - interaction_description: 'User inserts block/pages from elementor library',
201 - metadata: {
202 - template_id: String(assetId),
203 - template_name: this.decodeHtmlEntities(assetName) || ''
204 - }
205 - });
206 - if (proRequired) {
207 - payload.state = 'pro_plan_required';
208 - }
209 - 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);
210 - }
211 - }, {
212 - key: "sendELibraryFavorite",
213 - value: function sendELibraryFavorite(_ref3) {
214 - var _config$triggers6, _config$targetTypes7, _config$interactionRe7, _config$locations8, _config$secondaryLoca6, _config$names6;
215 - var assetId = _ref3.assetId,
216 - assetName = _ref3.assetName,
217 - libraryType = _ref3.libraryType,
218 - isFavorite = _ref3.isFavorite,
219 - _ref3$proRequired = _ref3.proRequired,
220 - proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired;
221 - var config = this.getConfig();
222 - var payload = this.createBasePayload({
223 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click),
224 - target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle,
225 - target_name: String(assetId),
226 - interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite,
227 - target_value: Boolean(isFavorite),
228 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary),
229 - location_l1: this.toLowerSnake(libraryType),
230 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard),
231 - interaction_description: 'User favorite block/pages from elementor library',
232 - metadata: {
233 - template_id: String(assetId),
234 - template_name: this.decodeHtmlEntities(assetName) || ''
235 - }
236 - });
237 - if (proRequired) {
238 - payload.state = 'pro_plan_required';
239 - }
240 - 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);
241 - }
242 - }, {
243 - key: "sendELibraryGenerateAi",
244 - value: function sendELibraryGenerateAi(_ref4) {
245 - var _config$names7, _config$triggers7, _config$targetTypes8, _config$interactionRe8, _config$locations9, _config$secondaryLoca7;
246 - var assetId = _ref4.assetId,
247 - assetName = _ref4.assetName,
248 - libraryType = _ref4.libraryType;
249 - var config = this.getConfig();
250 - 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({
251 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click),
252 - target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button,
253 - target_name: String(assetId),
254 - interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate,
255 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary),
256 - location_l1: this.toLowerSnake(libraryType),
257 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard),
258 - interaction_description: 'User generated block/page based on a library asset',
259 - metadata: {
260 - template_id: String(assetId),
261 - template_name: this.decodeHtmlEntities(assetName) || ''
262 - }
263 - }));
264 - }
265 - }, {
266 - key: "sendFinderSearchInput",
267 - value: function sendFinderSearchInput(_ref5) {
268 - var _config$triggers8, _config$targetTypes9, _config$interactionRe9, _config$interactionRe0, _config$secondaryLoca8, _config$names8;
269 - var resultsCount = _ref5.resultsCount,
270 - _ref5$searchTerm = _ref5.searchTerm,
271 - searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm;
272 - var config = this.getConfig();
273 - var hasResults = resultsCount > 0;
274 - var finderContext = this.getFinderContext();
275 - var payload = this.createBasePayload({
276 - window_name: finderContext.windowName,
277 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing),
278 - target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput,
279 - target_name: 'finder',
280 - 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,
281 - target_location: finderContext.targetLocation,
282 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder),
283 - interaction_description: 'Finder search input, follows debounce behavior',
284 - metadata: {
285 - results_count: resultsCount
286 - }
287 - });
288 - if (!hasResults && searchTerm) {
289 - payload.metadata.search_term = searchTerm;
290 - }
291 - 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);
292 - }
293 - }, {
294 - key: "sendFinderResultSelect",
295 - value: function sendFinderResultSelect(choice) {
296 - var _config$names9, _config$triggers9, _config$targetTypes0, _config$interactionRe1, _config$secondaryLoca9, _config$secondaryLoca0;
297 - var config = this.getConfig();
298 - var finderContext = this.getFinderContext();
299 - 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({
300 - window_name: finderContext.windowName,
301 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click),
302 - target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult,
303 - target_name: choice,
304 - interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected,
305 - target_location: finderContext.targetLocation,
306 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder),
307 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults),
308 - interaction_description: 'Finder search results was selected'
309 - }));
310 - }
311 - }, {
312 - key: "sendCanvasEmptyBoxAction",
313 - value: function sendCanvasEmptyBoxAction(_ref6) {
314 - var _config$triggers0, _config$targetTypes1, _config$interactionRe10, _config$locations0, _config$secondaryLoca1, _config$names0;
315 - var targetName = _ref6.targetName,
316 - _ref6$metadata = _ref6.metadata,
317 - metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata,
318 - _ref6$containerCreate = _ref6.containerCreated,
319 - containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate;
320 - var config = this.getConfig();
321 - var payload = this.createBasePayload({
322 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click),
323 - target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons,
324 - target_name: targetName,
325 - interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected,
326 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas),
327 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox),
328 - interaction_description: 'Empty box on canvas actions'
329 - });
330 - if (Object.keys(metadata).length > 0) {
331 - payload.metadata = metadata;
332 - }
333 - if (containerCreated !== null) {
334 - payload.state = containerCreated;
335 - }
336 - 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);
337 - }
338 - }, {
339 - key: "sendWidgetPanelSearch",
340 - value: function sendWidgetPanelSearch(_ref7) {
341 - var _config$triggers1, _config$targetTypes10, _config$interactionRe11, _config$interactionRe12, _config$locations1, _config$locations10, _config$secondaryLoca10, _config$names1;
342 - var resultsCount = _ref7.resultsCount,
343 - _ref7$userInput = _ref7.userInput,
344 - userInput = _ref7$userInput === void 0 ? null : _ref7$userInput;
345 - var config = this.getConfig();
346 - var hasResults = resultsCount > 0;
347 - var payload = this.createBasePayload({
348 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing),
349 - target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget,
350 - target_name: 'search_widget',
351 - 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,
352 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel),
353 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel),
354 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar),
355 - interaction_description: 'Widget search input, follows debounce behavior'
356 - });
357 - if (!hasResults && userInput) {
358 - payload.metadata = {
359 - user_input: userInput
360 - };
361 - }
362 - 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);
363 - }
364 - }, {
365 - key: "createWpDashPayload",
366 - value: function createWpDashPayload() {
367 - var _config$appTypes$wpDa, _config$appTypes5, _config$locations11;
368 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
369 - var config = this.getConfig();
370 - return this.createBasePayload(_objectSpread({
371 - window_name: (_config$appTypes$wpDa = config === null || config === void 0 || (_config$appTypes5 = config.appTypes) === null || _config$appTypes5 === void 0 ? void 0 : _config$appTypes5.wpDash) !== null && _config$appTypes$wpDa !== void 0 ? _config$appTypes$wpDa : 'wpdash',
372 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations11 = config.locations) === null || _config$locations11 === void 0 ? void 0 : _config$locations11.wpDashAdmin),
373 - location_l2: ''
374 - }, overrides));
375 - }
376 - }, {
377 - key: "sendWpDashElementorMenuClick",
378 - value: function sendWpDashElementorMenuClick() {
379 - var _config$names10, _config$triggers10, _config$targetTypes11, _config$interactionRe13, _config$secondaryLoca11;
380 - var config = this.getConfig();
381 - return this.dispatchEvent(config === null || config === void 0 || (_config$names10 = config.names) === null || _config$names10 === void 0 || (_config$names10 = _config$names10.editorOne) === null || _config$names10 === void 0 ? void 0 : _config$names10.wpDashElementorMenuClick, this.createWpDashPayload({
382 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers10 = config.triggers) === null || _config$triggers10 === void 0 ? void 0 : _config$triggers10.click),
383 - target_type: config === null || config === void 0 || (_config$targetTypes11 = config.targetTypes) === null || _config$targetTypes11 === void 0 ? void 0 : _config$targetTypes11.wpDashAdminMenuItem,
384 - target_name: 'elementor_menu_item',
385 - interaction_result: config === null || config === void 0 || (_config$interactionRe13 = config.interactionResults) === null || _config$interactionRe13 === void 0 ? void 0 : _config$interactionRe13.elementorSideMenuOpened,
386 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca11 = config.secondaryLocations) === null || _config$secondaryLoca11 === void 0 ? void 0 : _config$secondaryLoca11.wpDashElementorCoreMenu),
387 - interaction_description: 'core_user_clicked_elementor_menu_item'
388 - }));
389 - }
390 - }, {
391 - key: "sendWpDashEditorSubMenuHover",
392 - value: function sendWpDashEditorSubMenuHover() {
393 - var _config$names11, _config$triggers11, _config$targetTypes12, _config$interactionRe14, _config$secondaryLoca12;
394 - var config = this.getConfig();
395 - return this.dispatchEvent(config === null || config === void 0 || (_config$names11 = config.names) === null || _config$names11 === void 0 || (_config$names11 = _config$names11.editorOne) === null || _config$names11 === void 0 ? void 0 : _config$names11.wpDashEditorSubMenuHover, this.createWpDashPayload({
396 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers11 = config.triggers) === null || _config$triggers11 === void 0 ? void 0 : _config$triggers11.hover),
397 - target_type: config === null || config === void 0 || (_config$targetTypes12 = config.targetTypes) === null || _config$targetTypes12 === void 0 ? void 0 : _config$targetTypes12.wpDashEditorMenu,
398 - target_name: 'wpdash_editor_sub_menu',
399 - interaction_result: config === null || config === void 0 || (_config$interactionRe14 = config.interactionResults) === null || _config$interactionRe14 === void 0 ? void 0 : _config$interactionRe14.editorSubMenuOpened,
400 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca12 = config.secondaryLocations) === null || _config$secondaryLoca12 === void 0 ? void 0 : _config$secondaryLoca12.wpDashElementorCoreSubMenu),
401 - interaction_description: 'core_user_hovered_sub_menu'
402 - }));
403 - }
404 - }, {
405 - key: "sendWpDashThemeBuilderClick",
406 - value: function sendWpDashThemeBuilderClick() {
407 - var _config$names12, _config$triggers12, _config$targetTypes13, _config$interactionRe15, _config$secondaryLoca13;
408 - var config = this.getConfig();
409 - return this.dispatchEvent(config === null || config === void 0 || (_config$names12 = config.names) === null || _config$names12 === void 0 || (_config$names12 = _config$names12.editorOne) === null || _config$names12 === void 0 ? void 0 : _config$names12.wpDashThemeBuilderClick, this.createWpDashPayload({
410 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers12 = config.triggers) === null || _config$triggers12 === void 0 ? void 0 : _config$triggers12.click),
411 - target_type: config === null || config === void 0 || (_config$targetTypes13 = config.targetTypes) === null || _config$targetTypes13 === void 0 ? void 0 : _config$targetTypes13.wpDashSubMenuItem,
412 - target_name: 'theme_builder_menu_item',
413 - interaction_result: config === null || config === void 0 || (_config$interactionRe15 = config.interactionResults) === null || _config$interactionRe15 === void 0 ? void 0 : _config$interactionRe15.themeBuilderPromotionWindow,
414 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder),
415 - interaction_description: 'core_user_clicked_theme_builder_menu_item'
416 - }));
417 - }
418 - }]);
419 -}();
420 -var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() {
421 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;
422 - return _.debounce(function (resultsCount, searchTerm) {
423 - EditorOneEventManager.sendFinderSearchInput({
424 - resultsCount: resultsCount,
425 - searchTerm: searchTerm
426 - });
427 - }, delay);
428 -};
429 -var createDebouncedWidgetPanelSearch = exports.createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() {
430 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
431 - return _.debounce(function (resultsCount, userInput) {
432 - EditorOneEventManager.sendWidgetPanelSearch({
433 - resultsCount: resultsCount,
434 - userInput: userInput
435 - });
436 - }, delay);
437 -};
438 -var _default = exports["default"] = EditorOneEventManager;
439 -
440 -/***/ }),
441 -
442 4 /***/ "../assets/dev/js/utils/react.js":
443 5 /*!***************************************!*\
444 6 !*** ../assets/dev/js/utils/react.js ***!
445 7 \***************************************/
@@ -514,9 +76,8 @@
514 76 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
515 77 var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
516 78 var _editorIntegration = __webpack_require__(/*! ./utils/editor-integration */ "../modules/ai/assets/js/editor/utils/editor-integration.js");
517 79 var _config = __webpack_require__(/*! ./pages/form-layout/context/config */ "../modules/ai/assets/js/editor/pages/form-layout/context/config.js");
518 -var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js");
519 80 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)); }
520 81 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
521 82 var AiLayoutBehavior = exports["default"] = /*#__PURE__*/function (_Marionette$Behavior) {
522 83 function AiLayoutBehavior() {
@@ -548,11 +109,8 @@
548 109 }, {
549 110 key: "onAiButtonClick",
550 111 value: function onAiButtonClick(e) {
551 112 e.stopPropagation();
552 - _editorOneEvents.EditorOneEventManager.sendCanvasEmptyBoxAction({
553 - targetName: 'generate_with_ai'
554 - });
555 113 window.elementorAiCurrentContext = this.getOption('context');
556 114 (0, _editorIntegration.renderLayoutApp)({
557 115 parentContainer: elementor.getPreviewContainer(),
558 116 mode: _config.MODE_LAYOUT,
@@ -2585,10 +2143,8 @@
2585 2143 __ = _require3.__;
2586 2144 var _require4 = __webpack_require__(/*! ../../pages/form-layout/components/attachments */ "../modules/ai/assets/js/editor/pages/form-layout/components/attachments.js"),
2587 2145 ATTACHMENT_TYPE_JSON = _require4.ATTACHMENT_TYPE_JSON,
2588 2146 ELEMENTOR_LIBRARY_SOURCE = _require4.ELEMENTOR_LIBRARY_SOURCE;
2589 -var _require5 = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js"),
2590 - EditorOneEventManager = _require5.EditorOneEventManager;
2591 2147 var ApplyTemplateForAiBehavior;
2592 2148 ApplyTemplateForAiBehavior = Marionette.Behavior.extend({
2593 2149 ui: {
2594 2150 applyButton: '.elementor-template-library-template-apply-ai',
@@ -2597,21 +2153,13 @@
2597 2153 events: {
2598 2154 'click @ui.applyButton': 'onApplyButtonClick',
2599 2155 'click @ui.generateVariation': 'onGenerateVariationClick'
2600 2156 },
2601 - trackAiGenerate: function trackAiGenerate(model) {
2602 - EditorOneEventManager.sendELibraryGenerateAi({
2603 - assetId: model.get('template_id'),
2604 - assetName: model.get('title'),
2605 - libraryType: model.get('type') || model.get('source')
2606 - });
2607 - },
2608 2157 onGenerateVariationClick: function onGenerateVariationClick() {
2609 2158 var _libraryComponent$man;
2610 2159 var args = {
2611 2160 model: this.view.model
2612 2161 };
2613 - this.trackAiGenerate(this.view.model);
2614 2162 var libraryComponent = $e.components.get('library');
2615 2163 var at = (_libraryComponent$man = libraryComponent.manager.modalConfig) === null || _libraryComponent$man === void 0 || (_libraryComponent$man = _libraryComponent$man.importOptions) === null || _libraryComponent$man === void 0 ? void 0 : _libraryComponent$man.at;
2616 2164 libraryComponent.downloadTemplate(args, function (data) {
2617 2165 var model = args.model;
@@ -2642,9 +2190,8 @@
2642 2190 onApplyButtonClick: function onApplyButtonClick() {
2643 2191 var args = {
2644 2192 model: this.view.model
2645 2193 };
2646 - this.trackAiGenerate(this.view.model);
2647 2194 this.ui.applyButton.addClass('elementor-disabled');
2648 2195 var activeSource = args.model.get('source');
2649 2196
2650 2197 /**
@@ -2928,9 +2475,9 @@
2928 2475 sx: {
2929 2476 maxWidth: 520,
2930 2477 textAlign: 'center'
2931 2478 }
2932 - }, " ", (0, _i18n.__)('By clicking "Connect", I approve the ', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Link, {
2479 + }, (0, _i18n.__)('By clicking "Connect", I approve the ', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Link, {
2933 2480 href: "https://go.elementor.com/ai-terms/",
2934 2481 target: "_blank",
2935 2482 color: "info.main"
2936 2483 }, (0, _i18n.__)('Terms of Service', 'elementor')), ' & ', /*#__PURE__*/_react.default.createElement(_ui.Link, {
@@ -5636,9 +5183,9 @@
5636 5183 maxWidth: 520
5637 5184 },
5638 5185 component: "label",
5639 5186 htmlFor: "e-ai-terms-approval"
5640 - }, " ", (0, _i18n.__)('I approve the ', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Link, {
5187 + }, (0, _i18n.__)('I approve the ', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Link, {
5641 5188 href: "https://go.elementor.com/ai-terms/",
5642 5189 target: "_blank",
5643 5190 color: "info.main"
5644 5191 }, (0, _i18n.__)('Terms of Service', 'elementor')), ' & ', /*#__PURE__*/_react.default.createElement(_ui.Link, {