2023-10-22 22:21:11 +00:00
/******/ ( ( ) => { // webpackBootstrap
/******/ "use strict" ;
/******/ var _ _webpack _modules _ _ = ( {
/***/ "./assets/js/src/OptimoleNotice/index.js" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / js / src / OptimoleNotice / index . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
/* harmony export */ "default" : ( ) => ( /* binding */ OptimoleNotice )
/* harmony export */ } ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( /*! @wordpress/element */ "@wordpress/element" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( /*! @wordpress/components */ "@wordpress/components" ) ;
/* harmony import */ var _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var _style _scss _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( /*! ./style.scss */ "./assets/js/src/OptimoleNotice/style.scss" ) ;
/* harmony import */ var _common _utils _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( /*! ../common/utils */ "./assets/js/src/common/utils.js" ) ;
/* harmony import */ var _common _useSettings _ _WEBPACK _IMPORTED _MODULE _4 _ _ = _ _webpack _require _ _ ( /*! ../common/useSettings */ "./assets/js/src/common/useSettings.js" ) ;
function OptimoleNotice ( _ref ) {
let {
stacked = false ,
noImage = false ,
type ,
onDismiss ,
onSuccess ,
initialStatus = null
} = _ref ;
const {
assets ,
title ,
email : initialEmail ,
option ,
optionKey ,
optimoleActivationUrl ,
optimoleApi ,
optimoleDash ,
nonce
} = window . themeisleSDKPromotions ;
const [ showForm , setShowForm ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . useState ) ( false ) ;
const [ email , setEmail ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . useState ) ( initialEmail || '' ) ;
const [ dismissed , setDismissed ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . useState ) ( false ) ;
const [ progress , setProgress ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . useState ) ( initialStatus ) ;
const [ getOption , updateOption ] = ( 0 , _common _useSettings _ _WEBPACK _IMPORTED _MODULE _4 _ _ [ "default" ] ) ( ) ;
const dismissNotice = async ( ) => {
setDismissed ( true ) ;
const newValue = { ... option
} ;
newValue [ type ] = new Date ( ) . getTime ( ) / 1000 | 0 ;
window . themeisleSDKPromotions . option = newValue ;
await updateOption ( optionKey , JSON . stringify ( newValue ) ) ;
if ( onDismiss ) {
onDismiss ( ) ;
}
} ;
const toggleForm = ( ) => {
setShowForm ( ! showForm ) ;
} ;
const updateEmail = e => {
setEmail ( e . target . value ) ;
} ;
const submitForm = async e => {
e . preventDefault ( ) ;
setProgress ( 'installing' ) ;
await ( 0 , _common _utils _ _WEBPACK _IMPORTED _MODULE _3 _ _ . installPluginOrTheme ) ( 'optimole-wp' ) ;
setProgress ( 'activating' ) ;
await ( 0 , _common _utils _ _WEBPACK _IMPORTED _MODULE _3 _ _ . activatePlugin ) ( optimoleActivationUrl ) ;
updateOption ( 'themeisle_sdk_promotions_optimole_installed' , ! Boolean ( getOption ( 'themeisle_sdk_promotions_optimole_installed' ) ) ) ;
setProgress ( 'connecting' ) ;
try {
await fetch ( optimoleApi , {
method : 'POST' ,
headers : {
'X-WP-Nonce' : nonce ,
'Content-Type' : 'application/json'
} ,
body : JSON . stringify ( {
'email' : email
} )
} ) ;
if ( onSuccess ) {
onSuccess ( ) ;
}
setProgress ( 'done' ) ;
} catch ( e ) {
setProgress ( 'done' ) ;
}
} ;
if ( dismissed ) {
return null ;
}
const form = ( ) => {
if ( progress === 'done' ) {
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , {
className : "done"
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "p" , null , "Awesome! You are all set!" ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
icon : 'external' ,
isPrimary : true ,
href : optimoleDash ,
target : "_blank"
} , "Go to Optimole dashboard" ) ) ;
}
if ( progress ) {
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "p" , {
className : "om-progress"
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , {
className : "dashicons dashicons-update spin"
} ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , null , progress === 'installing' && 'Installing' , progress === 'activating' && 'Activating' , progress === 'connecting' && 'Connecting to API' , "\u2026" ) ) ;
}
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . Fragment , null , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , null , "Enter your email address to create & connect your account" ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "form" , {
onSubmit : submitForm
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "input" , {
defaultValue : email ,
type : "email" ,
onChange : updateEmail ,
placeholder : "Email address"
} ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
isPrimary : true ,
type : "submit"
} , "Start using Optimole" ) ) ) ;
} ;
const dismissButton = ( ) => ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
disabled : progress && progress !== 'done' ,
onClick : dismissNotice ,
isLink : true ,
className : "om-notice-dismiss"
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , {
className : "dashicons-no-alt dashicons"
} ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , {
className : "screen-reader-text"
} , "Dismiss this notice." ) ) ;
if ( stacked ) {
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , {
className : "ti-om-stack-wrap"
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , {
className : "om-stack-notice"
} , dismissButton ( ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "img" , {
src : assets + '/optimole-logo.svg' ,
alt : "Optimole logo"
} ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "h2" , null , "Get more with Optimole" ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "p" , null , type === 'om-editor' || type === 'om-image-block' ? 'Increase this page speed and SEO ranking by optimizing images with Optimole.' : 'Leverage Optimole\'s full integration with Elementor to automatically lazyload, resize, compress to AVIF/WebP and deliver from 400 locations around the globe!' ) , ! showForm && 'done' !== progress && ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
isPrimary : true ,
onClick : toggleForm ,
className : "cta"
} , "Get Started Free" ) , ( showForm || 'done' === progress ) && form ( ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "i" , null , title ) ) ) ;
}
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . Fragment , null , dismissButton ( ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , {
className : "content"
} , ! noImage && ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "img" , {
src : assets + '/optimole-logo.svg' ,
alt : "Optimole logo"
} ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , null , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "p" , null , title ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "p" , {
className : "description"
} , type === 'om-media' ? 'Save your server space by storing images to Optimole and deliver them optimized from 400 locations around the globe. Unlimited images, Unlimited traffic.' : 'This image looks to be too large and would affect your site speed, we recommend you to install Optimole to optimize your images.' ) , ! showForm && ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , {
className : "actions"
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
isPrimary : true ,
onClick : toggleForm
} , "Get Started Free" ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
isLink : true ,
target : "_blank" ,
href : "https://wordpress.org/plugins/optimole-wp"
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , {
className : "dashicons dashicons-external"
} ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , null , "Learn more" ) ) ) , showForm && ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , {
className : "form-wrap"
} , form ( ) ) ) ) ) ;
}
/***/ } ) ,
/***/ "./assets/js/src/common/useSettings.js" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / js / src / common / useSettings . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
/* harmony export */ "default" : ( ) => ( _ _WEBPACK _DEFAULT _EXPORT _ _ )
/* harmony export */ } ) ;
/* harmony import */ var _wordpress _api _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( /*! @wordpress/api */ "@wordpress/api" ) ;
/* harmony import */ var _wordpress _api _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _api _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _data _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( /*! @wordpress/data */ "@wordpress/data" ) ;
/* harmony import */ var _wordpress _data _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _data _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( /*! @wordpress/element */ "@wordpress/element" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
/ * *
* WordPress dependencies .
* /
/ * *
* useSettings Hook .
*
* useSettings hook to get / update WordPress ' settings database .
*
* Setting field needs to be registered to REST for this function to work .
*
* This hook works similar to get _option and update _option in PHP just without the option for a default value .
* For notificiations to work , you need to add a Snackbar section to your React codebase if it isn ' t being
* used inside the block editor .
*
* @ see https : //github.com/WordPress/gutenberg/blob/trunk/packages/editor/src/components/editor-snackbars/index.js
* @ author Hardeep Asrani < hardeepasrani @ gmail . com >
* @ version 1.1
*
* /
const useSettings = ( ) => {
const {
createNotice
} = ( 0 , _wordpress _data _ _WEBPACK _IMPORTED _MODULE _1 _ _ . dispatch ) ( 'core/notices' ) ;
const [ settings , setSettings ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ . useState ) ( { } ) ;
const [ status , setStatus ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ . useState ) ( 'loading' ) ;
const getSettings = ( ) => {
_wordpress _api _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default ( ) . loadPromise . then ( async ( ) => {
try {
const settings = new ( _wordpress _api _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default ( ) . models . Settings ) ( ) ;
const response = await settings . fetch ( ) ;
setSettings ( response ) ;
} catch ( error ) {
setStatus ( 'error' ) ;
} finally {
setStatus ( 'loaded' ) ;
}
} ) ;
} ;
( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ . useEffect ) ( ( ) => {
getSettings ( ) ;
} , [ ] ) ;
const getOption = option => {
return settings === null || settings === void 0 ? void 0 : settings [ option ] ;
} ;
const updateOption = function ( option , value ) {
let success = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : 'Settings saved.' ;
setStatus ( 'saving' ) ;
const save = new ( _wordpress _api _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default ( ) . models . Settings ) ( {
[ option ] : value
} ) . save ( ) ;
save . success ( ( response , status ) => {
if ( 'success' === status ) {
setStatus ( 'loaded' ) ;
createNotice ( 'success' , success , {
isDismissible : true ,
type : 'snackbar'
} ) ;
}
if ( 'error' === status ) {
setStatus ( 'error' ) ;
createNotice ( 'error' , 'An unknown error occurred.' , {
isDismissible : true ,
type : 'snackbar'
} ) ;
}
getSettings ( ) ;
} ) ;
save . error ( response => {
setStatus ( 'error' ) ;
createNotice ( 'error' , response . responseJSON . message ? response . responseJSON . message : 'An unknown error occurred.' , {
isDismissible : true ,
type : 'snackbar'
} ) ;
} ) ;
} ;
return [ getOption , updateOption , status ] ;
} ;
/* harmony default export */ const _ _WEBPACK _DEFAULT _EXPORT _ _ = ( useSettings ) ;
/***/ } ) ,
/***/ "./assets/js/src/common/utils.js" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / js / src / common / utils . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
/* harmony export */ "activatePlugin" : ( ) => ( /* binding */ activatePlugin ) ,
/* harmony export */ "getBlocksByType" : ( ) => ( /* binding */ getBlocksByType ) ,
/* harmony export */ "installPluginOrTheme" : ( ) => ( /* binding */ installPluginOrTheme )
/* harmony export */ } ) ;
const installPluginOrTheme = function ( slug ) {
let theme = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : false ;
return new Promise ( resolve => {
wp . updates . ajax ( theme === true ? 'install-theme' : 'install-plugin' , {
slug ,
success : ( ) => {
resolve ( {
success : true
} ) ;
} ,
error : err => {
resolve ( {
success : false ,
code : err . errorCode
} ) ;
}
} ) ;
} ) ;
} ;
const activatePlugin = url => {
return new Promise ( resolve => {
jQuery . get ( url ) . done ( ( ) => {
resolve ( {
success : true
} ) ;
} ) . fail ( ( ) => {
resolve ( {
success : false
} ) ;
} ) ;
} ) ;
} ;
const flatRecursively = ( r , a ) => {
const b = { } ;
Object . keys ( a ) . forEach ( function ( k ) {
if ( 'innerBlocks' !== k ) {
b [ k ] = a [ k ] ;
}
} ) ;
r . push ( b ) ;
if ( Array . isArray ( a . innerBlocks ) ) {
b . innerBlocks = a . innerBlocks . map ( i => {
return i . id ;
} ) ;
return a . innerBlocks . reduce ( flatRecursively , r ) ;
}
return r ;
} ;
/ * *
* Get blocks by type .
*
* @ param { Array } blocks blocks array .
* @ param { string } type type of block looking for .
*
* @ return { Array } array of blocks of { type } in page
* /
const getBlocksByType = ( blocks , type ) => blocks . reduce ( flatRecursively , [ ] ) . filter ( a => type === a . name ) ;
/***/ } ) ,
/***/ "./assets/js/src/index.js" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / js / src / index . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony import */ var _otter _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( /*! ./otter.js */ "./assets/js/src/otter.js" ) ;
/* harmony import */ var _optimole _js _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( /*! ./optimole.js */ "./assets/js/src/optimole.js" ) ;
/* harmony import */ var _rop _js _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( /*! ./rop.js */ "./assets/js/src/rop.js" ) ;
/* harmony import */ var _neve _fse _js _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( /*! ./neve-fse.js */ "./assets/js/src/neve-fse.js" ) ;
/***/ } ) ,
/***/ "./assets/js/src/neve-fse.js" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / js / src / neve - fse . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( /*! @wordpress/element */ "@wordpress/element" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( /*! @wordpress/components */ "@wordpress/components" ) ;
/* harmony import */ var _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var _common _useSettings _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( /*! ./common/useSettings */ "./assets/js/src/common/useSettings.js" ) ;
const NeveFSENotice = _ref => {
let {
onDismiss = ( ) => { }
} = _ref ;
const [ getOption , updateOption ] = ( 0 , _common _useSettings _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "default" ] ) ( ) ;
const dismissNotice = async ( ) => {
const newValue = { ... window . themeisleSDKPromotions . option
} ;
newValue [ 'neve-fse-themes-popular' ] = new Date ( ) . getTime ( ) / 1000 | 0 ;
window . themeisleSDKPromotions . option = newValue ;
await updateOption ( window . themeisleSDKPromotions . optionKey , JSON . stringify ( newValue ) ) ;
if ( onDismiss ) {
onDismiss ( ) ;
}
} ;
const {
neveFSEMoreUrl
} = window . themeisleSDKPromotions ;
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . Fragment , null , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
onClick : dismissNotice ,
className : "notice-dismiss"
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , {
className : "screen-reader-text"
} , "Dismiss this notice." ) ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "p" , null , "Meet " , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "b" , null , "Neve FSE" ) , " from the makers of " , window . themeisleSDKPromotions . product , ". A theme that makes full site editing on WordPress straightforward and user-friendly." ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , {
className : "neve-fse-notice-actions"
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
variant : "link" ,
target : "_blank" ,
href : neveFSEMoreUrl
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , {
className : "dashicons dashicons-external"
} ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , null , "Learn more" ) ) ) ) ;
} ;
class NeveFSE {
constructor ( ) {
const {
showPromotion ,
debug
} = window . themeisleSDKPromotions ;
this . promo = showPromotion ;
this . debug = debug === '1' ;
this . domRef = null ;
this . run ( ) ;
}
run ( ) {
if ( window . themeisleSDKPromotions . option [ 'neve-fse-themes-popular' ] ) {
return ;
}
const root = document . querySelector ( '#ti-neve-fse-notice' ) ;
if ( ! root ) {
return ;
}
( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . render ) ( ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( NeveFSENotice , {
onDismiss : ( ) => {
root . style . display = 'none' ;
}
} ) , root ) ;
}
}
new NeveFSE ( ) ;
/***/ } ) ,
/***/ "./assets/js/src/optimole.js" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / js / src / optimole . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( /*! @wordpress/element */ "@wordpress/element" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _plugins _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( /*! @wordpress/plugins */ "@wordpress/plugins" ) ;
/* harmony import */ var _wordpress _plugins _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _plugins _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var _wordpress _edit _post _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( /*! @wordpress/edit-post */ "@wordpress/edit-post" ) ;
/* harmony import */ var _wordpress _edit _post _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _edit _post _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
/* harmony import */ var _wordpress _data _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( /*! @wordpress/data */ "@wordpress/data" ) ;
/* harmony import */ var _wordpress _data _ _WEBPACK _IMPORTED _MODULE _3 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _data _ _WEBPACK _IMPORTED _MODULE _3 _ _ ) ;
/* harmony import */ var _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _4 _ _ = _ _webpack _require _ _ ( /*! @wordpress/compose */ "@wordpress/compose" ) ;
/* harmony import */ var _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _4 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _4 _ _ ) ;
/* harmony import */ var _wordpress _hooks _ _WEBPACK _IMPORTED _MODULE _5 _ _ = _ _webpack _require _ _ ( /*! @wordpress/hooks */ "@wordpress/hooks" ) ;
/* harmony import */ var _wordpress _hooks _ _WEBPACK _IMPORTED _MODULE _5 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _hooks _ _WEBPACK _IMPORTED _MODULE _5 _ _ ) ;
/* harmony import */ var _wordpress _block _editor _ _WEBPACK _IMPORTED _MODULE _6 _ _ = _ _webpack _require _ _ ( /*! @wordpress/block-editor */ "@wordpress/block-editor" ) ;
/* harmony import */ var _wordpress _block _editor _ _WEBPACK _IMPORTED _MODULE _6 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _block _editor _ _WEBPACK _IMPORTED _MODULE _6 _ _ ) ;
/* harmony import */ var _common _utils _ _WEBPACK _IMPORTED _MODULE _7 _ _ = _ _webpack _require _ _ ( /*! ./common/utils */ "./assets/js/src/common/utils.js" ) ;
/* harmony import */ var _OptimoleNotice _ _WEBPACK _IMPORTED _MODULE _8 _ _ = _ _webpack _require _ _ ( /*! ./OptimoleNotice */ "./assets/js/src/OptimoleNotice/index.js" ) ;
const TiSdkMoleEditorPromo = ( ) => {
const [ show , setShow ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . useState ) ( true ) ;
const hide = ( ) => {
setShow ( false ) ;
} ;
const {
getBlocks
} = ( 0 , _wordpress _data _ _WEBPACK _IMPORTED _MODULE _3 _ _ . useSelect ) ( select => {
const {
getBlocks
} = select ( 'core/block-editor' ) ;
return {
getBlocks
} ;
} ) ;
const imageBlocksCount = ( 0 , _common _utils _ _WEBPACK _IMPORTED _MODULE _7 _ _ . getBlocksByType ) ( getBlocks ( ) , 'core/image' ) . length ;
if ( imageBlocksCount < 2 ) {
return null ;
}
const classes = ` ti-sdk-optimole-post-publish ${ show ? '' : 'hidden' } ` ;
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _edit _post _ _WEBPACK _IMPORTED _MODULE _2 _ _ . PluginPostPublishPanel , {
className : classes
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _OptimoleNotice _ _WEBPACK _IMPORTED _MODULE _8 _ _ [ "default" ] , {
stacked : true ,
type : "om-editor" ,
onDismiss : hide
} ) ) ;
} ;
class Optimole {
constructor ( ) {
const {
showPromotion ,
debug
} = window . themeisleSDKPromotions ;
this . promo = showPromotion ;
this . debug = debug === '1' ;
this . domRef = null ;
this . run ( ) ;
}
run ( ) {
if ( this . debug ) {
this . runAll ( ) ;
return ;
}
switch ( this . promo ) {
case 'om-attachment' :
this . runAttachmentPromo ( ) ;
break ;
case 'om-media' :
this . runMediaPromo ( ) ;
break ;
case 'om-editor' :
this . runEditorPromo ( ) ;
break ;
case 'om-image-block' :
this . runImageBlockPromo ( ) ;
break ;
case 'om-elementor' :
this . runElementorPromo ( ) ;
break ;
}
}
runAttachmentPromo ( ) {
wp . media . view . Attachment . Details . prototype . on ( "ready" , ( ) => {
setTimeout ( ( ) => {
this . removeAttachmentPromo ( ) ;
this . addAttachmentPromo ( ) ;
} , 100 ) ;
} ) ;
wp . media . view . Modal . prototype . on ( "close" , ( ) => {
setTimeout ( this . removeAttachmentPromo , 100 ) ;
} ) ;
}
runMediaPromo ( ) {
if ( window . themeisleSDKPromotions . option [ 'om-media' ] ) {
return ;
}
const root = document . querySelector ( '#ti-optml-notice' ) ;
if ( ! root ) {
return ;
}
( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . render ) ( ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _OptimoleNotice _ _WEBPACK _IMPORTED _MODULE _8 _ _ [ "default" ] , {
type : "om-media" ,
onDismiss : ( ) => {
root . style . opacity = 0 ;
}
} ) , root ) ;
}
runImageBlockPromo ( ) {
if ( window . themeisleSDKPromotions . option [ 'om-image-block' ] ) {
return ;
}
let showNotice = true ;
let initialStatus = null ;
const withImagePromo = ( 0 , _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _4 _ _ . createHigherOrderComponent ) ( BlockEdit => {
return props => {
if ( 'core/image' === props . name && showNotice ) {
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . Fragment , null , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( BlockEdit , props ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _block _editor _ _WEBPACK _IMPORTED _MODULE _6 _ _ . InspectorControls , null , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _OptimoleNotice _ _WEBPACK _IMPORTED _MODULE _8 _ _ [ "default" ] , {
stacked : true ,
type : "om-image-block" ,
initialStatus : initialStatus ,
onDismiss : ( ) => {
showNotice = false ;
} ,
onSuccess : ( ) => {
initialStatus = 'done' ;
}
} ) ) ) ;
}
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( BlockEdit , props ) ;
} ;
} , 'withImagePromo' ) ;
( 0 , _wordpress _hooks _ _WEBPACK _IMPORTED _MODULE _5 _ _ . addFilter ) ( 'editor.BlockEdit' , 'optimole-promo/image-promo' , withImagePromo , 99 ) ;
}
runEditorPromo ( ) {
if ( window . themeisleSDKPromotions . option [ 'om-editor' ] ) {
return ;
}
( 0 , _wordpress _plugins _ _WEBPACK _IMPORTED _MODULE _1 _ _ . registerPlugin ) ( 'optimole-promo' , {
render : TiSdkMoleEditorPromo
} ) ;
}
runElementorPromo ( ) {
if ( ! window . elementor ) {
return ;
}
const self = this ;
elementor . on ( "preview:loaded" , ( ) => {
elementor . panel . currentView . on ( "set:page:editor" , details => {
if ( self . domRef ) {
( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . unmountComponentAtNode ) ( self . domRef ) ;
}
if ( ! details . activeSection ) {
return ;
}
if ( details . activeSection !== 'section_image' ) {
return ;
}
self . runElementorActions ( self ) ;
} ) ;
} ) ;
}
addAttachmentPromo ( ) {
if ( this . domRef ) {
( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . unmountComponentAtNode ) ( this . domRef ) ;
}
if ( window . themeisleSDKPromotions . option [ 'om-attachment' ] ) {
return ;
}
const mount = document . querySelector ( '#ti-optml-notice-helper' ) ;
if ( ! mount ) {
return ;
}
this . domRef = mount ;
( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . render ) ( ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , {
className : "notice notice-info ti-sdk-om-notice" ,
style : {
margin : 0
}
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _OptimoleNotice _ _WEBPACK _IMPORTED _MODULE _8 _ _ [ "default" ] , {
noImage : true ,
type : "om-attachment" ,
onDismiss : ( ) => {
mount . style . opacity = 0 ;
}
} ) ) , mount ) ;
}
removeAttachmentPromo ( ) {
const mount = document . querySelector ( '#ti-optml-notice-helper' ) ;
if ( ! mount ) {
return ;
}
( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . unmountComponentAtNode ) ( mount ) ;
}
runElementorActions ( self ) {
if ( window . themeisleSDKPromotions . option [ 'om-elementor' ] ) {
return ;
}
const controlsWrap = document . querySelector ( '#elementor-panel__editor__help' ) ;
const mountPoint = document . createElement ( 'div' ) ;
mountPoint . id = 'ti-optml-notice' ;
self . domRef = mountPoint ;
if ( controlsWrap ) {
controlsWrap . parentNode . insertBefore ( mountPoint , controlsWrap ) ;
( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . render ) ( ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _OptimoleNotice _ _WEBPACK _IMPORTED _MODULE _8 _ _ [ "default" ] , {
stacked : true ,
type : "om-elementor" ,
onDismiss : ( ) => {
mountPoint . style . opacity = 0 ;
}
} ) , mountPoint ) ;
}
}
runAll ( ) {
this . runAttachmentPromo ( ) ;
this . runMediaPromo ( ) ;
this . runEditorPromo ( ) ;
this . runImageBlockPromo ( ) ;
this . runElementorPromo ( ) ;
}
}
new Optimole ( ) ;
/***/ } ) ,
/***/ "./assets/js/src/otter.js" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / js / src / otter . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( /*! @wordpress/element */ "@wordpress/element" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _block _editor _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( /*! @wordpress/block-editor */ "@wordpress/block-editor" ) ;
/* harmony import */ var _wordpress _block _editor _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _block _editor _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var _wordpress _components _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( /*! @wordpress/components */ "@wordpress/components" ) ;
/* harmony import */ var _wordpress _components _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
/* harmony import */ var _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( /*! @wordpress/compose */ "@wordpress/compose" ) ;
/* harmony import */ var _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _3 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _3 _ _ ) ;
/* harmony import */ var _wordpress _data _ _WEBPACK _IMPORTED _MODULE _4 _ _ = _ _webpack _require _ _ ( /*! @wordpress/data */ "@wordpress/data" ) ;
/* harmony import */ var _wordpress _data _ _WEBPACK _IMPORTED _MODULE _4 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _data _ _WEBPACK _IMPORTED _MODULE _4 _ _ ) ;
/* harmony import */ var _wordpress _hooks _ _WEBPACK _IMPORTED _MODULE _5 _ _ = _ _webpack _require _ _ ( /*! @wordpress/hooks */ "@wordpress/hooks" ) ;
/* harmony import */ var _wordpress _hooks _ _WEBPACK _IMPORTED _MODULE _5 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _hooks _ _WEBPACK _IMPORTED _MODULE _5 _ _ ) ;
/* harmony import */ var _common _useSettings _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ = _ _webpack _require _ _ ( /*! ./common/useSettings.js */ "./assets/js/src/common/useSettings.js" ) ;
/* harmony import */ var _common _utils _js _ _WEBPACK _IMPORTED _MODULE _7 _ _ = _ _webpack _require _ _ ( /*! ./common/utils.js */ "./assets/js/src/common/utils.js" ) ;
const style = {
button : {
display : 'flex' ,
justifyContent : 'center' ,
width : '100%'
} ,
image : {
padding : '20px 0'
} ,
skip : {
container : {
display : 'flex' ,
flexDirection : 'column' ,
alignItems : 'center'
} ,
button : {
fontSize : '9px'
} ,
poweredby : {
fontSize : '9px' ,
textTransform : 'uppercase'
}
}
} ;
const upsells = {
'blocks-css' : {
title : 'Custom CSS' ,
description : 'Enable Otter Blocks to add Custom CSS for this block.' ,
image : 'css.jpg'
} ,
'blocks-animation' : {
title : 'Animations' ,
description : 'Enable Otter Blocks to add Animations for this block.' ,
image : 'animation.jpg'
} ,
'blocks-conditions' : {
title : 'Visibility Conditions' ,
description : 'Enable Otter Blocks to add Visibility Conditions for this block.' ,
image : 'conditions.jpg'
}
} ;
const Footer = _ref => {
let {
onClick
} = _ref ;
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , {
style : style . skip . container
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _2 _ _ . Button , {
style : style . skip . button ,
variant : "tertiary" ,
onClick : onClick
} , "Skip for now" ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , {
style : style . skip . poweredby
} , "Recommended by " , window . themeisleSDKPromotions . product ) ) ;
} ;
const withInspectorControls = ( 0 , _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _3 _ _ . createHigherOrderComponent ) ( BlockEdit => {
return props => {
if ( props . isSelected && Boolean ( window . themeisleSDKPromotions . showPromotion ) ) {
const [ isLoading , setLoading ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . useState ) ( false ) ;
const [ installStatus , setInstallStatus ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . useState ) ( 'default' ) ;
const [ hasSkipped , setHasSkipped ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . useState ) ( false ) ;
const [ getOption , updateOption , status ] = ( 0 , _common _useSettings _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ [ "default" ] ) ( ) ;
const install = async ( ) => {
setLoading ( true ) ;
await ( 0 , _common _utils _js _ _WEBPACK _IMPORTED _MODULE _7 _ _ . installPluginOrTheme ) ( 'otter-blocks' ) ;
updateOption ( 'themeisle_sdk_promotions_otter_installed' , ! Boolean ( getOption ( 'themeisle_sdk_promotions_otter_installed' ) ) ) ;
await ( 0 , _common _utils _js _ _WEBPACK _IMPORTED _MODULE _7 _ _ . activatePlugin ) ( window . themeisleSDKPromotions . otterActivationUrl ) ;
setLoading ( false ) ;
setInstallStatus ( 'installed' ) ;
} ;
const Install = ( ) => {
if ( 'installed' === installStatus ) {
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "p" , null , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "strong" , null , "Awesome! Refresh the page to see Otter Blocks in action." ) ) ;
}
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _2 _ _ . Button , {
variant : "secondary" ,
onClick : install ,
isBusy : isLoading ,
style : style . button
} , "Install & Activate Otter Blocks" ) ;
} ;
const onSkip = ( ) => {
const option = { ... window . themeisleSDKPromotions . option
} ;
option [ window . themeisleSDKPromotions . showPromotion ] = new Date ( ) . getTime ( ) / 1000 | 0 ;
updateOption ( 'themeisle_sdk_promotions' , JSON . stringify ( option ) ) ;
window . themeisleSDKPromotions . showPromotion = false ;
} ;
( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . useEffect ) ( ( ) => {
if ( hasSkipped ) {
onSkip ( ) ;
}
} , [ hasSkipped ] ) ;
if ( hasSkipped ) {
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( BlockEdit , props ) ;
}
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . Fragment , null , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( BlockEdit , props ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _block _editor _ _WEBPACK _IMPORTED _MODULE _1 _ _ . InspectorControls , null , Object . keys ( upsells ) . map ( key => {
if ( key === window . themeisleSDKPromotions . showPromotion ) {
const upsell = upsells [ key ] ;
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _2 _ _ . PanelBody , {
key : key ,
title : upsell . title ,
initialOpen : false
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "p" , null , upsell . description ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( Install , null ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "img" , {
style : style . image ,
src : window . themeisleSDKPromotions . assets + upsell . image
} ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( Footer , {
onClick : ( ) => setHasSkipped ( true )
} ) ) ;
}
} ) ) ) ;
}
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( BlockEdit , props ) ;
} ;
} , 'withInspectorControl' ) ;
if ( ! ( 0 , _wordpress _data _ _WEBPACK _IMPORTED _MODULE _4 _ _ . select ) ( 'core/edit-site' ) ) {
( 0 , _wordpress _hooks _ _WEBPACK _IMPORTED _MODULE _5 _ _ . addFilter ) ( 'editor.BlockEdit' , 'themeisle-sdk/with-inspector-controls' , withInspectorControls ) ;
}
/***/ } ) ,
/***/ "./assets/js/src/rop.js" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / js / src / rop . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( /*! @wordpress/element */ "@wordpress/element" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( /*! @wordpress/components */ "@wordpress/components" ) ;
/* harmony import */ var _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var _common _utils _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( /*! ./common/utils */ "./assets/js/src/common/utils.js" ) ;
/* harmony import */ var _common _useSettings _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( /*! ./common/useSettings */ "./assets/js/src/common/useSettings.js" ) ;
const ROPNotice = _ref => {
let {
onDismiss = ( ) => { }
} = _ref ;
const [ status , setStatus ] = ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . useState ) ( '' ) ;
const [ getOption , updateOption ] = ( 0 , _common _useSettings _ _WEBPACK _IMPORTED _MODULE _3 _ _ [ "default" ] ) ( ) ;
const dismissNotice = async ( ) => {
const newValue = { ... window . themeisleSDKPromotions . option
} ;
newValue [ 'rop-posts' ] = new Date ( ) . getTime ( ) / 1000 | 0 ;
window . themeisleSDKPromotions . option = newValue ;
await updateOption ( window . themeisleSDKPromotions . optionKey , JSON . stringify ( newValue ) ) ;
if ( onDismiss ) {
onDismiss ( ) ;
}
} ;
return ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . Fragment , null , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
disabled : 'installing' === status ,
onClick : dismissNotice ,
variant : "link" ,
className : "om-notice-dismiss"
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , {
className : "dashicons-no-alt dashicons"
} ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , {
className : "screen-reader-text"
} , "Dismiss this notice." ) ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "p" , null , "Boost your content's reach effortlessly! Introducing " , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "b" , null , "Revive Old Posts" ) , ", a cutting-edge plugin from the makers of " , window . themeisleSDKPromotions . product , ". Seamlessly auto-share old & new content across social media, driving traffic like never before." ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "div" , {
className : "rop-notice-actions"
} , 'installed' !== status ? ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
variant : "primary" ,
isBusy : 'installing' === status ,
onClick : async ( ) => {
setStatus ( 'installing' ) ;
await ( 0 , _common _utils _ _WEBPACK _IMPORTED _MODULE _2 _ _ . installPluginOrTheme ) ( 'tweet-old-post' ) ;
await ( 0 , _common _utils _ _WEBPACK _IMPORTED _MODULE _2 _ _ . activatePlugin ) ( window . themeisleSDKPromotions . ropActivationUrl ) ;
updateOption ( 'themeisle_sdk_promotions_rop_installed' , ! Boolean ( getOption ( 'themeisle_sdk_promotions_rop_installed' ) ) ) ;
setStatus ( 'installed' ) ;
}
} , "Install & Activate" ) : ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
variant : "primary" ,
href : window . themeisleSDKPromotions . ropDash
} , "Visit Dashboard" ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ . Button , {
variant : "link" ,
target : "_blank" ,
href : "https://wordpress.org/plugins/tweet-old-post/"
} , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , {
className : "dashicons dashicons-external"
} ) , ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( "span" , null , "Learn more" ) ) ) ) ;
} ;
class ROP {
constructor ( ) {
const {
showPromotion ,
debug
} = window . themeisleSDKPromotions ;
this . promo = showPromotion ;
this . debug = debug === '1' ;
this . domRef = null ;
this . run ( ) ;
}
run ( ) {
if ( window . themeisleSDKPromotions . option [ 'rop-posts' ] ) {
return ;
}
const root = document . querySelector ( '#ti-rop-notice' ) ;
if ( ! root ) {
return ;
}
( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . render ) ( ( 0 , _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ . createElement ) ( ROPNotice , {
onDismiss : ( ) => {
root . style . display = 'none' ;
}
} ) , root ) ;
}
}
new ROP ( ) ;
/***/ } ) ,
/***/ "./assets/js/src/OptimoleNotice/style.scss" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / js / src / OptimoleNotice / style . scss * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
// extracted by mini-css-extract-plugin
/***/ } ) ,
/***/ "@wordpress/api" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * external [ "wp" , "api" ] * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( module ) => {
module . exports = window [ "wp" ] [ "api" ] ;
/***/ } ) ,
/***/ "@wordpress/block-editor" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * external [ "wp" , "blockEditor" ] * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( module ) => {
module . exports = window [ "wp" ] [ "blockEditor" ] ;
/***/ } ) ,
/***/ "@wordpress/components" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * external [ "wp" , "components" ] * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( module ) => {
module . exports = window [ "wp" ] [ "components" ] ;
/***/ } ) ,
/***/ "@wordpress/compose" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * external [ "wp" , "compose" ] * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( module ) => {
module . exports = window [ "wp" ] [ "compose" ] ;
/***/ } ) ,
/***/ "@wordpress/data" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * external [ "wp" , "data" ] * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( module ) => {
module . exports = window [ "wp" ] [ "data" ] ;
/***/ } ) ,
/***/ "@wordpress/edit-post" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * external [ "wp" , "editPost" ] * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( module ) => {
module . exports = window [ "wp" ] [ "editPost" ] ;
/***/ } ) ,
/***/ "@wordpress/element" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * external [ "wp" , "element" ] * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( module ) => {
module . exports = window [ "wp" ] [ "element" ] ;
/***/ } ) ,
/***/ "@wordpress/hooks" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * external [ "wp" , "hooks" ] * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( module ) => {
module . exports = window [ "wp" ] [ "hooks" ] ;
/***/ } ) ,
/***/ "@wordpress/plugins" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * external [ "wp" , "plugins" ] * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( module ) => {
module . exports = window [ "wp" ] [ "plugins" ] ;
/***/ } )
/******/ } ) ;
/************************************************************************/
/******/ // The module cache
/******/ var _ _webpack _module _cache _ _ = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/ // Check if module is in cache
/******/ var cachedModule = _ _webpack _module _cache _ _ [ moduleId ] ;
/******/ if ( cachedModule !== undefined ) {
/******/ return cachedModule . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = _ _webpack _module _cache _ _ [ moduleId ] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ _ _webpack _modules _ _ [ moduleId ] ( module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ _ _webpack _require _ _ . m = _ _webpack _modules _ _ ;
/******/
/************************************************************************/
/******/ /* webpack/runtime/chunk loaded */
/******/ ( ( ) => {
/******/ var deferred = [ ] ;
/******/ _ _webpack _require _ _ . O = ( result , chunkIds , fn , priority ) => {
/******/ if ( chunkIds ) {
/******/ priority = priority || 0 ;
/******/ for ( var i = deferred . length ; i > 0 && deferred [ i - 1 ] [ 2 ] > priority ; i -- ) deferred [ i ] = deferred [ i - 1 ] ;
/******/ deferred [ i ] = [ chunkIds , fn , priority ] ;
/******/ return ;
/******/ }
/******/ var notFulfilled = Infinity ;
/******/ for ( var i = 0 ; i < deferred . length ; i ++ ) {
/******/ var chunkIds = deferred [ i ] [ 0 ] ;
/******/ var fn = deferred [ i ] [ 1 ] ;
/******/ var priority = deferred [ i ] [ 2 ] ;
/******/ var fulfilled = true ;
/******/ for ( var j = 0 ; j < chunkIds . length ; j ++ ) {
/******/ if ( ( priority & 1 === 0 || notFulfilled >= priority ) && Object . keys ( _ _webpack _require _ _ . O ) . every ( ( key ) => ( _ _webpack _require _ _ . O [ key ] ( chunkIds [ j ] ) ) ) ) {
/******/ chunkIds . splice ( j -- , 1 ) ;
/******/ } else {
/******/ fulfilled = false ;
/******/ if ( priority < notFulfilled ) notFulfilled = priority ;
/******/ }
/******/ }
/******/ if ( fulfilled ) {
/******/ deferred . splice ( i -- , 1 )
/******/ var r = fn ( ) ;
/******/ if ( r !== undefined ) result = r ;
/******/ }
/******/ }
/******/ return result ;
/******/ } ;
/******/ } ) ( ) ;
/******/
/******/ /* webpack/runtime/compat get default export */
/******/ ( ( ) => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = ( module ) => {
/******/ var getter = module && module . _ _esModule ?
/******/ ( ) => ( module [ 'default' ] ) :
/******/ ( ) => ( module ) ;
/******/ _ _webpack _require _ _ . d ( getter , { a : getter } ) ;
/******/ return getter ;
/******/ } ;
/******/ } ) ( ) ;
/******/
/******/ /* webpack/runtime/define property getters */
/******/ ( ( ) => {
/******/ // define getter functions for harmony exports
/******/ _ _webpack _require _ _ . d = ( exports , definition ) => {
/******/ for ( var key in definition ) {
/******/ if ( _ _webpack _require _ _ . o ( definition , key ) && ! _ _webpack _require _ _ . o ( exports , key ) ) {
/******/ Object . defineProperty ( exports , key , { enumerable : true , get : definition [ key ] } ) ;
/******/ }
/******/ }
/******/ } ;
/******/ } ) ( ) ;
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ ( ( ) => {
/******/ _ _webpack _require _ _ . o = ( obj , prop ) => ( Object . prototype . hasOwnProperty . call ( obj , prop ) )
/******/ } ) ( ) ;
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ ( ( ) => {
/******/ // define __esModule on exports
/******/ _ _webpack _require _ _ . r = ( exports ) => {
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
/******/ } ) ( ) ;
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ ( ( ) => {
/******/ // no baseURI
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "index" : 0 ,
/******/ "./style-index" : 0
/******/ } ;
/******/
/******/ // no chunk on demand loading
/******/
/******/ // no prefetching
/******/
/******/ // no preloaded
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ _ _webpack _require _ _ . O . j = ( chunkId ) => ( installedChunks [ chunkId ] === 0 ) ;
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = ( parentChunkLoadingFunction , data ) => {
/******/ var chunkIds = data [ 0 ] ;
/******/ var moreModules = data [ 1 ] ;
/******/ var runtime = data [ 2 ] ;
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId , chunkId , i = 0 ;
/******/ if ( chunkIds . some ( ( id ) => ( installedChunks [ id ] !== 0 ) ) ) {
/******/ for ( moduleId in moreModules ) {
/******/ if ( _ _webpack _require _ _ . o ( moreModules , moduleId ) ) {
/******/ _ _webpack _require _ _ . m [ moduleId ] = moreModules [ moduleId ] ;
/******/ }
/******/ }
/******/ if ( runtime ) var result = runtime ( _ _webpack _require _ _ ) ;
/******/ }
/******/ if ( parentChunkLoadingFunction ) parentChunkLoadingFunction ( data ) ;
/******/ for ( ; i < chunkIds . length ; i ++ ) {
/******/ chunkId = chunkIds [ i ] ;
/******/ if ( _ _webpack _require _ _ . o ( installedChunks , chunkId ) && installedChunks [ chunkId ] ) {
/******/ installedChunks [ chunkId ] [ 0 ] ( ) ;
/******/ }
/******/ installedChunks [ chunkId ] = 0 ;
/******/ }
/******/ return _ _webpack _require _ _ . O ( result ) ;
/******/ }
/******/
/******/ var chunkLoadingGlobal = self [ "webpackChunkthemeisle_sdk" ] = self [ "webpackChunkthemeisle_sdk" ] || [ ] ;
/******/ chunkLoadingGlobal . forEach ( webpackJsonpCallback . bind ( null , 0 ) ) ;
/******/ chunkLoadingGlobal . push = webpackJsonpCallback . bind ( null , chunkLoadingGlobal . push . bind ( chunkLoadingGlobal ) ) ;
/******/ } ) ( ) ;
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
/******/ var _ _webpack _exports _ _ = _ _webpack _require _ _ . O ( undefined , [ "./style-index" ] , ( ) => ( _ _webpack _require _ _ ( "./assets/js/src/index.js" ) ) )
/******/ _ _webpack _exports _ _ = _ _webpack _require _ _ . O ( _ _webpack _exports _ _ ) ;
/******/
/******/ } ) ( )
;
//# sourceMappingURL=index.js.map