/*! For license information please see editor-documents.js.LICENSE.txt */
!function(){"use strict";var t={react:function(t){t.exports=window.React},"@elementor/editor":function(t){t.exports=window.elementorV2.editor},"@elementor/editor-v1-adapters":function(t){t.exports=window.elementorV2.editorV1Adapters},"@elementor/store":function(t){t.exports=window.elementorV2.store},"@wordpress/i18n":function(t){t.exports=window.wp.i18n}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,n),a.exports}n.d=function(t,e){for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};!function(){n.r(i),n.d(i,{__useActiveDocument:function(){return u},__useActiveDocumentActions:function(){return y},__useHostDocument:function(){return l},__useNavigateToDocument:function(){return S},slice:function(){return v}});var t=n("@elementor/editor"),e=n("@elementor/store"),o=n("react"),a=n("@wordpress/i18n"),r=n("@elementor/editor-v1-adapters"),s=t=>t.documents.entities,c=(0,e.__createSelector)(s,(t=>t.documents.activeId),((t,e)=>e&&t[e]?t[e]:null)),d=(0,e.__createSelector)(s,(t=>t.documents.hostId),((t,e)=>e&&t[e]?t[e]:null));function u(){return(0,e.__useSelector)(c)}function l(){return(0,e.__useSelector)(d)}function m(t){return!(!t.activeId||!t.entities[t.activeId])}var v=(0,e.__createSlice)({name:"documents",initialState:{entities:{},activeId:null,hostId:null},reducers:{init(t,{payload:e}){t.entities=e.entities,t.hostId=e.hostId,t.activeId=e.activeId},activateDocument(t,e){t.entities[e.payload.id]=e.payload,t.activeId=e.payload.id},setAsHost(t,e){t.hostId=e.payload},updateActiveDocument(t,e){m(t)&&(t.entities[t.activeId]={...t.entities[t.activeId],...e.payload})},startSaving(t){m(t)&&(t.entities[t.activeId].isSaving=!0)},endSaving(t,e){m(t)&&(t.entities[t.activeId]={...e.payload,isSaving:!1})},startSavingDraft:t=>{m(t)&&(t.entities[t.activeId].isSavingDraft=!0)},endSavingDraft(t,e){m(t)&&(t.entities[t.activeId]={...e.payload,isSavingDraft:!1})},markAsDirty(t){m(t)&&(t.entities[t.activeId].isDirty=!0)},markAsPristine(t){m(t)&&(t.entities[t.activeId].isDirty=!1)}}});function p(){const t=window.elementor?.documents;if(!t)throw new Error("Elementor Editor V1 documents manager not found");return t}function _(t){switch(window.elementor?.getPreferences?.("exit_to")||"this_post"){case"dashboard":return t.config.urls.main_dashboard;case"all_posts":return t.config.urls.all_post_type;default:return t.config.urls.exit_to_dashboard}}function f(t){return t?.config?.panel?.show_copy_and_share??!1}function g(t){return t.config.urls.permalink??""}function h(t){const e=t.config.revisions.current_id!==t.id,n=_(t);return{id:t.id,title:t.container.settings.get("post_title"),type:{value:t.config.type,label:t.config.panel.title},status:{value:t.config.status.value,label:t.config.status.label},links:{permalink:g(t),platformEdit:n},isDirty:t.editor.isChanged||e,isSaving:t.editor.isSaving,isSavingDraft:!1,permissions:{allowAddingWidgets:t.config.panel?.allow_adding_widgets??!0,showCopyAndShare:f(t)},userCan:{publish:t.config.user.can_publish}}}function w(t,e){let n;return(...i)=>{clearTimeout(n),n=setTimeout((()=>{t(...i)}),e)}}function y(){const t=u(),e=t?.links?.permalink??"";return{save:(0,o.useCallback)((()=>(0,r.__privateRunCommand)("document/save/default")),[]),saveDraft:(0,o.useCallback)((()=>(0,r.__privateRunCommand)("document/save/draft")),[]),saveTemplate:(0,o.useCallback)((()=>(0,r.__privateOpenRoute)("library/save-template")),[]),copyAndShare:(0,o.useCallback)((()=>{navigator.clipboard.writeText(e)}),[e])}}function S(){return(0,o.useCallback)((async t=>{await(0,r.__privateRunCommand)("editor/documents/switch",{id:t,setAsInitial:!0});const e=new URL(window.location.href);e.searchParams.set("post",t.toString()),e.searchParams.delete("active-document"),history.replaceState({},"",e)}),[])}(0,e.__registerSlice)(v),function(){const{init:t}=v.actions;(0,r.__privateListenTo)((0,r.v1ReadyEvent)(),(()=>{const n=p(),i=Object.entries(n.documents).reduce(((t,[e,n])=>(t[e]=h(n),t)),{});(0,e.__dispatch)(t({entities:i,hostId:n.getInitialId(),activeId:n.getCurrentId()}))}))}(),function(){const{activateDocument:t,setAsHost:n}=v.actions;(0,r.__privateListenTo)((0,r.commandEndEvent)("editor/documents/open"),(()=>{const i=p(),o=h(i.getCurrent());(0,e.__dispatch)(t(o)),i.getInitialId()===o.id&&(0,e.__dispatch)(n(o.id))}))}(),function(){const{startSaving:t,endSaving:n,startSavingDraft:i,endSavingDraft:o}=v.actions,a=t=>{const e=t;return"autosave"===e.args?.status};(0,r.__privateListenTo)((0,r.commandStartEvent)("document/save/save"),(n=>{a(n)?(0,e.__dispatch)(i()):(0,e.__dispatch)(t())})),(0,r.__privateListenTo)((0,r.commandEndEvent)("document/save/save"),(t=>{const i=h(p().getCurrent());a(t)?(0,e.__dispatch)(o(i)):(0,e.__dispatch)(n(i))}))}(),function(){const{updateActiveDocument:t}=v.actions,n=w((n=>{const i=n;if(!("post_title"in i.args?.settings))return;const o=p().getCurrent().container.settings.get("post_title");(0,e.__dispatch)(t({title:o}))}),400);(0,r.__privateListenTo)((0,r.commandEndEvent)("document/elements/settings"),n)}(),function(){const{markAsDirty:t,markAsPristine:n}=v.actions;(0,r.__privateListenTo)((0,r.commandEndEvent)("document/save/set-is-modified"),(()=>{p().getCurrent().editor.isChanged?(0,e.__dispatch)(t()):(0,e.__dispatch)(n())}))}(),function(){const{updateActiveDocument:t}=v.actions,n=w((n=>{const i=n;if(!("exit_to"in i.args?.settings))return;const o=p().getCurrent(),a=_(o),r=g(o);(0,e.__dispatch)(t({links:{platformEdit:a,permalink:r}}))}),400);(0,r.__privateListenTo)((0,r.commandEndEvent)("document/elements/settings"),n)}(),(0,t.injectIntoLogic)({id:"documents-hooks",component:function(){return function(){const t=u(),e=l(),n=t&&"kit"!==t.type.value?t:e;(0,o.useEffect)((()=>{if(void 0===n?.title)return;const t=(0,a.__)('Edit "%s" with Elementor',"elementor").replace("%s",n.title);window.document.title=t}),[n?.title])}(),null}})}(),(window.elementorV2=window.elementorV2||{}).editorDocuments=i}();/*! elementor - v3.27.0 - 18-02-2025 */
"use strict";
(self["webpackChunkelementorFrontend"] = self["webpackChunkelementorFrontend"] || []).push([["toggle"],{
/***/ "../assets/dev/js/frontend/handlers/base-tabs.js":
/*!*******************************************************!*\
!*** ../assets/dev/js/frontend/handlers/base-tabs.js ***!
\*******************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
__webpack_require__(/*! core-js/modules/es.array.includes.js */ "../node_modules/core-js/modules/es.array.includes.js");
__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js");
__webpack_require__(/*! core-js/modules/esnext.iterator.filter.js */ "../node_modules/core-js/modules/esnext.iterator.filter.js");
__webpack_require__(/*! core-js/modules/esnext.iterator.find.js */ "../node_modules/core-js/modules/esnext.iterator.find.js");
class baseTabs extends elementorModules.frontend.handlers.Base {
getDefaultSettings() {
return {
selectors: {
tablist: '[role="tablist"]',
tabTitle: '.elementor-tab-title',
tabContent: '.elementor-tab-content'
},
classes: {
active: 'elementor-active'
},
showTabFn: 'show',
hideTabFn: 'hide',
toggleSelf: true,
hidePrevious: true,
autoExpand: true,
keyDirection: {
ArrowLeft: elementorFrontendConfig.is_rtl ? 1 : -1,
ArrowUp: -1,
ArrowRight: elementorFrontendConfig.is_rtl ? -1 : 1,
ArrowDown: 1
}
};
}
getDefaultElements() {
const selectors = this.getSettings('selectors');
return {
$tabTitles: this.findElement(selectors.tabTitle),
$tabContents: this.findElement(selectors.tabContent)
};
}
activateDefaultTab() {
const settings = this.getSettings();
if (!settings.autoExpand || 'editor' === settings.autoExpand && !this.isEdit) {
return;
}
const defaultActiveTab = this.getEditSettings('activeItemIndex') || 1,
originalToggleMethods = {
showTabFn: settings.showTabFn,
hideTabFn: settings.hideTabFn
};
// Toggle tabs without animation to avoid jumping
this.setSettings({
showTabFn: 'show',
hideTabFn: 'hide'
});
this.changeActiveTab(defaultActiveTab);
// Return back original toggle effects
this.setSettings(originalToggleMethods);
}
handleKeyboardNavigation(event) {
const tab = event.currentTarget,
$tabList = jQuery(tab.closest(this.getSettings('selectors').tablist)),
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
$tabs = $tabList.find(this.getSettings('selectors').tabTitle),
isVertical = 'vertical' === $tabList.attr('aria-orientation');
switch (event.key) {
case 'ArrowLeft':
case 'ArrowRight':
if (isVertical) {
return;
}
break;
case 'ArrowUp':
case 'ArrowDown':
if (!isVertical) {
return;
}
event.preventDefault();
break;
case 'Home':
event.preventDefault();
$tabs.first().trigger('focus');
return;
case 'End':
event.preventDefault();
$tabs.last().trigger('focus');
return;
default:
return;
}
const tabIndex = tab.getAttribute('data-tab') - 1,
direction = this.getSettings('keyDirection')[event.key],
nextTab = $tabs[tabIndex + direction];
if (nextTab) {
nextTab.focus();
} else if (-1 === tabIndex + direction) {
$tabs.last().trigger('focus');
} else {
$tabs.first().trigger('focus');
}
}
deactivateActiveTab(tabIndex) {
const settings = this.getSettings(),
activeClass = settings.classes.active,
activeFilter = tabIndex ? '[data-tab="' + tabIndex + '"]' : '.' + activeClass,
$activeTitle = this.elements.$tabTitles.filter(activeFilter),
$activeContent = this.elements.$tabContents.filter(activeFilter);
$activeTitle.add($activeContent).removeClass(activeClass);
$activeTitle.attr({
tabindex: '-1',
'aria-selected': 'false',
'aria-expanded': 'false'
});
$activeContent[settings.hideTabFn]();
$activeContent.attr('hidden', 'hidden');
}
activateTab(tabIndex) {
const settings = this.getSettings(),
activeClass = settings.classes.active,
$requestedTitle = this.elements.$tabTitles.filter('[data-tab="' + tabIndex + '"]'),
$requestedContent = this.elements.$tabContents.filter('[data-tab="' + tabIndex + '"]'),
animationDuration = 'show' === settings.showTabFn ? 0 : 400;
$requestedTitle.add($requestedContent).addClass(activeClass);
$requestedTitle.attr({
tabindex: '0',
'aria-selected': 'true',
'aria-expanded': 'true'
});
$requestedContent[settings.showTabFn](animationDuration, () => elementorFrontend.elements.$window.trigger('elementor-pro/motion-fx/recalc'));
$requestedContent.removeAttr('hidden');
}
isActiveTab(tabIndex) {
return this.elements.$tabTitles.filter('[data-tab="' + tabIndex + '"]').hasClass(this.getSettings('classes.active'));
}
bindEvents() {
this.elements.$tabTitles.on({
keydown: event => {
// Support for old markup that includes an `` tag in the tab
if (jQuery(event.target).is('a') && `Enter` === event.key) {
event.preventDefault();
}
// We listen to keydowon event for these keys in order to prevent undesired page scrolling
if (['End', 'Home', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
this.handleKeyboardNavigation(event);
}
},
keyup: event => {
switch (event.code) {
case 'ArrowLeft':
case 'ArrowRight':
this.handleKeyboardNavigation(event);
break;
case 'Enter':
case 'Space':
event.preventDefault();
this.changeActiveTab(event.currentTarget.getAttribute('data-tab'));
break;
}
},
click: event => {
event.preventDefault();
this.changeActiveTab(event.currentTarget.getAttribute('data-tab'));
}
});
}
onInit() {
super.onInit(...arguments);
this.activateDefaultTab();
}
onEditSettingsChange(propertyName) {
if ('activeItemIndex' === propertyName) {
this.activateDefaultTab();
}
}
changeActiveTab(tabIndex) {
const isActiveTab = this.isActiveTab(tabIndex),
settings = this.getSettings();
if ((settings.toggleSelf || !isActiveTab) && settings.hidePrevious) {
this.deactivateActiveTab();
}
if (!settings.hidePrevious && isActiveTab) {
this.deactivateActiveTab(tabIndex);
}
if (!isActiveTab) {
this.activateTab(tabIndex);
}
}
}
exports["default"] = baseTabs;
/***/ }),
/***/ "../assets/dev/js/frontend/handlers/toggle.js":
/*!****************************************************!*\
!*** ../assets/dev/js/frontend/handlers/toggle.js ***!
\****************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _baseTabs = _interopRequireDefault(__webpack_require__(/*! ./base-tabs */ "../assets/dev/js/frontend/handlers/base-tabs.js"));
class Toggle extends _baseTabs.default {
getDefaultSettings() {
const defaultSettings = super.getDefaultSettings();
return {
...defaultSettings,
showTabFn: 'slideDown',
hideTabFn: 'slideUp',
hidePrevious: false,
autoExpand: 'editor'
};
}
}
exports["default"] = Toggle;
/***/ })
}]);
//# sourceMappingURL=toggle.375da8e2f6fed12731c2.bundle.js.map