HOME


Mini Shell 1.0
DIR: /home3/otwalrll/.trash/wp-content/plugins/jetpack/_inc/build/widget-visibility/editor/
Upload File :
Current File : //home3/otwalrll/.trash/wp-content/plugins/jetpack/_inc/build/widget-visibility/editor/index.js
(()=>{var e={171:e=>{var t=1e3,n=60*t,i=60*n,s=24*i,o=7*s,r=365.25*s;function a(e,t,n,i){var s=t>=1.5*n;return Math.round(e/n)+" "+i+(s?"s":"")}e.exports=function(e,c){c=c||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*r;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*s;case"hours":case"hour":case"hrs":case"hr":case"h":return c*i;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===l&&isFinite(e))return c.long?function(e){var o=Math.abs(e);if(o>=s)return a(e,o,s,"day");if(o>=i)return a(e,o,i,"hour");if(o>=n)return a(e,o,n,"minute");if(o>=t)return a(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=s)return Math.round(e/s)+"d";if(o>=i)return Math.round(e/i)+"h";if(o>=n)return Math.round(e/n)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},975:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(128);const s=n.n(i)()("dops:analytics");let o,r;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const a={initialize:function(e,t,n){a.setUser(e,t),a.setSuperProps(n),a.identifyUser()},setGoogleAnalyticsEnabled:function(e,t=null){this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){r={ID:e,username:t}},setSuperProps:function(e){o=e},assignSuperProps:function(e){o=Object.assign(o||{},e)},mc:{bumpStat:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);s("Bumping stats %o",e)}else n="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),s('Bumping stat "%s" in group "%s"',t,e);return n}(e,t);a.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+n+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);s("Built stats %o",e)}else n="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),s('Built stat "%s" in group "%s"',t,e);return n}(e,t);a.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+n+"&t="+Math.random())}},pageView:{record:function(e,t){a.tracks.recordPageView(e),a.ga.recordPageView(e,t)}},purchase:{record:function(e,t,n,i,s,o,r){a.ga.recordPurchase(e,t,n,i,s,o,r)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(o&&(s("- Super Props: %o",o),t=Object.assign(t,o)),s('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):s('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};a.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){a.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){s("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};a.ga.initialized||(r&&(e={userId:"u-"+r.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),a.ga.initialized=!0)},recordPageView:function(e,t){a.ga.initialize(),s("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,n,i){a.ga.initialize();let o="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==n&&(o+=" [Option Label: "+n+"]"),void 0!==i&&(o+=" [Option Value: "+i+"]"),s(o),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,n,i)},recordPurchase:function(e,t,n,i,s,o,r){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:i,currency:r}),window.ga("ecommerce:addItem",{id:e,name:t,sku:n,price:s,quantity:o}),window.ga("ecommerce:send")}},identifyUser:function(){r&&window._tkq.push(["identifyUser",r.ID,r.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}},c=a},743:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>u});var i=n(132),s=n(483);function o(e){class t extends Error{constructor(...t){super(...t),this.name=e}}return t}const r=o("JsonParseError"),a=o("JsonParseAfterRedirectError"),c=o("Api404Error"),l=o("Api404AfterRedirectError"),d=o("FetchNetworkError");const u=new function(e,t){let n=e,o=e,r={"X-WP-Nonce":t},a={credentials:"same-origin",headers:r},c={method:"post",credentials:"same-origin",headers:Object.assign({},r,{"Content-type":"application/json"})},l=function(e){const t=e.split("?"),n=t.length>1?t[1]:"",i=n.length?n.split("&"):[];return i.push("_cacheBuster="+(new Date).getTime()),t[0]+"?"+i.join("&")};const d={setApiRoot(e){n=e},setWpcomOriginApiUrl(e){o=e},setApiNonce(e){r={"X-WP-Nonce":e},a={credentials:"same-origin",headers:r},c={method:"post",credentials:"same-origin",headers:Object.assign({},r,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{l=e},registerSite:(e,t)=>{const s={registration_nonce:e,no_iframe:!0};return(0,i.jetpackConfigHas)("consumer_slug")&&(s.plugin_slug=(0,i.jetpackConfigGet)("consumer_slug")),null!==t&&(s.redirect_uri=t),h(`${n}jetpack/v4/connection/register`,c,{body:JSON.stringify(s)}).then(p).then(g)},fetchAuthorizationUrl:e=>u((0,s.addQueryArgs)(`${n}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),a).then(p).then(g),fetchSiteConnectionData:()=>u(`${n}jetpack/v4/connection/data`,a).then(g),fetchSiteConnectionStatus:()=>u(`${n}jetpack/v4/connection`,a).then(g),fetchSiteConnectionTest:()=>u(`${n}jetpack/v4/connection/test`,a).then(p).then(g),fetchUserConnectionData:()=>u(`${n}jetpack/v4/connection/data`,a).then(g),fetchUserTrackingSettings:()=>u(`${n}jetpack/v4/tracking/settings`,a).then(p).then(g),updateUserTrackingSettings:e=>h(`${n}jetpack/v4/tracking/settings`,c,{body:JSON.stringify(e)}).then(p).then(g),disconnectSite:()=>h(`${n}jetpack/v4/connection`,c,{body:JSON.stringify({isActive:!1})}).then(p).then(g),fetchConnectUrl:()=>u(`${n}jetpack/v4/connection/url`,a).then(p).then(g),unlinkUser:()=>h(`${n}jetpack/v4/connection/user`,c,{body:JSON.stringify({linked:!1})}).then(p).then(g),reconnect:()=>h(`${n}jetpack/v4/connection/reconnect`,c).then(p).then(g),fetchConnectedPlugins:()=>u(`${n}jetpack/v4/connection/plugins`,a).then(p).then(g),setHasSeenWCConnectionModal:()=>h(`${n}jetpack/v4/seen-wc-connection-modal`,c).then(p).then(g),fetchModules:()=>u(`${n}jetpack/v4/module/all`,a).then(p).then(g),fetchModule:e=>u(`${n}jetpack/v4/module/${e}`,a).then(p).then(g),activateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,c,{body:JSON.stringify({active:!0})}).then(p).then(g),deactivateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,c,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${n}jetpack/v4/module/${e}`,c,{body:JSON.stringify(t)}).then(p).then(g),updateSettings:e=>h(`${n}jetpack/v4/settings`,c,{body:JSON.stringify(e)}).then(p).then(g),getProtectCount:()=>u(`${n}jetpack/v4/module/protect/data`,a).then(p).then(g),resetOptions:e=>h(`${n}jetpack/v4/options/${e}`,c,{body:JSON.stringify({reset:!0})}).then(p).then(g),activateVaultPress:()=>h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(p).then(g),getVaultPressData:()=>u(`${n}jetpack/v4/module/vaultpress/data`,a).then(p).then(g),installPlugin:(e,t)=>{const i={slug:e,status:"active"};return t&&(i.source=t),h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify(i)}).then(p).then(g)},activateAkismet:()=>h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(p).then(g),getAkismetData:()=>u(`${n}jetpack/v4/module/akismet/data`,a).then(p).then(g),checkAkismetKey:()=>u(`${n}jetpack/v4/module/akismet/key/check`,a).then(p).then(g),checkAkismetKeyTyped:e=>h(`${n}jetpack/v4/module/akismet/key/check`,c,{body:JSON.stringify({api_key:e})}).then(p).then(g),fetchStatsData:e=>u(function(e){let t=`${n}jetpack/v4/module/stats/data`;-1!==t.indexOf("?")?t+=`&range=${encodeURIComponent(e)}`:t+=`?range=${encodeURIComponent(e)}`;return t}(e),a).then(p).then(g).then(m),getPluginUpdates:()=>u(`${n}jetpack/v4/updates/plugins`,a).then(p).then(g),getPlans:()=>u(`${n}jetpack/v4/plans`,a).then(p).then(g),fetchSettings:()=>u(`${n}jetpack/v4/settings`,a).then(p).then(g),updateSetting:e=>h(`${n}jetpack/v4/settings`,c,{body:JSON.stringify(e)}).then(p).then(g),fetchSiteData:()=>u(`${n}jetpack/v4/site`,a).then(p).then(g).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>u(`${n}jetpack/v4/site/features`,a).then(p).then(g).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>u(`${n}jetpack/v4/site/products`,a).then(p).then(g),fetchSitePurchases:()=>u(`${n}jetpack/v4/site/purchases`,a).then(p).then(g).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>u(`${n}jetpack/v4/site/benefits`,a).then(p).then(g).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>u(`${n}jetpack/v4/site/discount`,a).then(p).then(g).then((e=>e.data)),fetchSetupQuestionnaire:()=>u(`${n}jetpack/v4/setup/questionnaire`,a).then(p).then(g),fetchRecommendationsData:()=>u(`${n}jetpack/v4/recommendations/data`,a).then(p).then(g),fetchRecommendationsProductSuggestions:()=>u(`${n}jetpack/v4/recommendations/product-suggestions`,a).then(p).then(g),fetchRecommendationsUpsell:()=>u(`${n}jetpack/v4/recommendations/upsell`,a).then(p).then(g),fetchRecommendationsConditional:()=>u(`${n}jetpack/v4/recommendations/conditional`,a).then(p).then(g),saveRecommendationsData:e=>h(`${n}jetpack/v4/recommendations/data`,c,{body:JSON.stringify({data:e})}).then(p),fetchProducts:()=>u(`${n}jetpack/v4/products`,a).then(p).then(g),fetchRewindStatus:()=>u(`${n}jetpack/v4/rewind`,a).then(p).then(g).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>u(`${n}jetpack/v4/scan`,a).then(p).then(g).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>h(`${n}jetpack/v4/notice/${e}`,c,{body:JSON.stringify({dismissed:!0})}).then(p).then(g),fetchPluginsData:()=>u(`${n}jetpack/v4/plugins`,a).then(p).then(g),fetchIntroOffers:()=>u(`${n}jetpack/v4/intro-offers`,a).then(p).then(g),fetchVerifySiteGoogleStatus:e=>u(null!==e?`${n}jetpack/v4/verify-site/google/${e}`:`${n}jetpack/v4/verify-site/google`,a).then(p).then(g),verifySiteGoogle:e=>h(`${n}jetpack/v4/verify-site/google`,c,{body:JSON.stringify({keyring_id:e})}).then(p).then(g),submitSurvey:e=>h(`${n}jetpack/v4/marketing/survey`,c,{body:JSON.stringify(e)}).then(p).then(g),saveSetupQuestionnaire:e=>h(`${n}jetpack/v4/setup/questionnaire`,c,{body:JSON.stringify(e)}).then(p).then(g),updateLicensingError:e=>h(`${n}jetpack/v4/licensing/error`,c,{body:JSON.stringify(e)}).then(p).then(g),updateLicenseKey:e=>h(`${n}jetpack/v4/licensing/set-license`,c,{body:JSON.stringify({license:e})}).then(p).then(g),getUserLicensesCounts:()=>u(`${n}jetpack/v4/licensing/user/counts`,a).then(p).then(g),getUserLicenses:()=>u(`${n}jetpack/v4/licensing/user/licenses`,a).then(p).then(g),updateLicensingActivationNoticeDismiss:e=>h(`${n}jetpack/v4/licensing/user/activation-notice-dismiss`,c,{body:JSON.stringify({last_detached_count:e})}).then(p).then(g),updateRecommendationsStep:e=>h(`${n}jetpack/v4/recommendations/step`,c,{body:JSON.stringify({step:e})}).then(p),confirmIDCSafeMode:()=>h(`${n}jetpack/v4/identity-crisis/confirm-safe-mode`,c).then(p),startIDCFresh:e=>h(`${n}jetpack/v4/identity-crisis/start-fresh`,c,{body:JSON.stringify({redirect_uri:e})}).then(p).then(g),migrateIDC:()=>h(`${n}jetpack/v4/identity-crisis/migrate`,c).then(p),attachLicenses:e=>h(`${n}jetpack/v4/licensing/attach-licenses`,c,{body:JSON.stringify({licenses:e})}).then(p).then(g),fetchSearchPlanInfo:()=>u(`${o}jetpack/v4/search/plan`,a).then(p).then(g),fetchSearchSettings:()=>u(`${o}jetpack/v4/search/settings`,a).then(p).then(g),updateSearchSettings:e=>h(`${o}jetpack/v4/search/settings`,c,{body:JSON.stringify(e)}).then(p).then(g),fetchSearchStats:()=>u(`${o}jetpack/v4/search/stats`,a).then(p).then(g),fetchWafSettings:()=>u(`${n}jetpack/v4/waf`,a).then(p).then(g),updateWafSettings:e=>h(`${n}jetpack/v4/waf`,c,{body:JSON.stringify(e)}).then(p).then(g),fetchWordAdsSettings:()=>u(`${n}jetpack/v4/wordads/settings`,a).then(p).then(g),updateWordAdsSettings:e=>h(`${n}jetpack/v4/wordads/settings`,c,{body:JSON.stringify(e)}),fetchSearchPricing:()=>u(`${o}jetpack/v4/search/pricing`,a).then(p).then(g),fetchMigrationStatus:()=>u(`${n}jetpack/v4/migration/status`,a).then(p).then(g),fetchBackupUndoEvent:()=>u(`${n}jetpack/v4/site/backup/undo-event`,a).then(p).then(g)};function u(e,t){return fetch(l(e),t)}function h(e,t,n){return fetch(e,Object.assign({},t,n)).catch(f)}function m(e){return e.general&&void 0===e.general.response||e.week&&void 0===e.week.response||e.month&&void 0===e.month.response?e:{}}Object.assign(this,d)};function p(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new l(e.redirected):new c})):e.json().catch((e=>h(e))).then((t=>{const n=new Error(`${t.message} (Status ${e.status})`);throw n.response=t,n.name="ApiError",n}))}function g(e){return e.json().catch((t=>h(t,e.redirected,e.url)))}function h(e,t,n){throw t?new a(n):new r}function f(){throw new d}},132:(e,t,n)=>{let i={};try{i=n(787)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),i={missingConfig:!0}}const s=e=>i.hasOwnProperty(e);e.exports={jetpackConfigHas:s,jetpackConfigGet:e=>{if(!s(e))throw'This app requires the "'+e+'" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';return i[e]}}},294:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(743),s=n(818),o=n(196),r=n(428);const a=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{},c=({registrationNonce:e=a.registrationNonce,apiRoot:t=a.apiRoot,apiNonce:n=a.apiNonce,redirectUri:c,autoTrigger:l,from:d,skipUserConnection:u}={})=>{const{registerSite:p,connectUser:g,refreshConnectedPlugins:h}=(0,s.useDispatch)(r.t),f=(0,s.useSelect)((e=>e(r.t).getRegistrationError())),{siteIsRegistering:m,userIsConnecting:C,userConnectionData:v,connectedPlugins:y,connectionErrors:w,isRegistered:k,isUserConnected:_,hasConnectedOwner:S,isOfflineMode:j}=(0,s.useSelect)((e=>({siteIsRegistering:e(r.t).getSiteIsRegistering(),userIsConnecting:e(r.t).getUserIsConnecting(),userConnectionData:e(r.t).getUserConnectionData(),connectedPlugins:e(r.t).getConnectedPlugins(),connectionErrors:e(r.t).getConnectionErrors(),isOfflineMode:e(r.t).getIsOfflineMode(),...e(r.t).getConnectionStatus()}))),b=()=>u?c?(window.location=c,Promise.resolve(c)):Promise.resolve():g({from:d,redirectUri:c}),E=t=>(t&&t.preventDefault(),k?b():p({registrationNonce:e,redirectUri:c}).then((()=>b())));return(0,o.useEffect)((()=>{i.ZP.setApiRoot(t),i.ZP.setApiNonce(n)}),[t,n]),(0,o.useEffect)((()=>{!l||m||C||E()}),[]),{handleRegisterSite:E,handleConnectUser:b,refreshConnectedPlugins:h,isRegistered:k,isUserConnected:_,siteIsRegistering:m,userIsConnecting:C,registrationError:f,userConnectionData:v,hasConnectedOwner:S,connectedPlugins:y,connectionErrors:w,isOfflineMode:j}}},523:(e,t,n)=>{"use strict";n.d(t,{LI:()=>o,N4:()=>a,Qo:()=>u,T1:()=>l,TS:()=>d,ZP:()=>_,b5:()=>g,i6:()=>s,qJ:()=>h,qV:()=>c,r7:()=>r,wQ:()=>p});var i=n(743);const s="SET_CONNECTION_STATUS",o="SET_CONNECTION_STATUS_IS_FETCHING",r="SET_SITE_IS_REGISTERING",a="SET_USER_IS_CONNECTING",c="SET_REGISTRATION_ERROR",l="CLEAR_REGISTRATION_ERROR",d="SET_AUTHORIZATION_URL",u="DISCONNECT_USER_SUCCESS",p="SET_CONNECTED_PLUGINS",g="SET_CONNECTION_ERRORS",h="SET_IS_OFFLINE_MODE",f=e=>({type:s,connectionStatus:e}),m=e=>({type:r,isRegistering:e}),C=e=>({type:a,isConnecting:e}),v=e=>({type:c,registrationError:e}),y=()=>({type:l}),w=e=>({type:d,authorizationUrl:e}),k=e=>({type:p,connectedPlugins:e});const _={setConnectionStatus:f,setConnectionStatusIsFetching:e=>({type:o,isFetching:e}),fetchConnectionStatus:()=>({type:"FETCH_CONNECTION_STATUS"}),fetchAuthorizationUrl:e=>({type:"FETCH_AUTHORIZATION_URL",redirectUri:e}),setSiteIsRegistering:m,setUserIsConnecting:C,setRegistrationError:v,clearRegistrationError:y,setAuthorizationUrl:w,registerSite:function*({registrationNonce:e,redirectUri:t}){yield y(),yield m(!0);try{const n=yield{type:"REGISTER_SITE",registrationNonce:e,redirectUri:t};return yield f({isRegistered:!0}),yield w(n.authorizeUrl),yield m(!1),Promise.resolve(n)}catch(e){return yield v(e),yield m(!1),Promise.reject(e)}},connectUser:function*({from:e,redirectFunc:t,redirectUri:n}={}){yield C(!0),yield{type:"CONNECT_USER",from:e,redirectFunc:t,redirectUri:n}},disconnectUserSuccess:()=>({type:u}),setConnectedPlugins:k,refreshConnectedPlugins:()=>async({dispatch:e})=>await new Promise((t=>i.ZP.fetchConnectedPlugins().then((n=>{e(k(n)),t(n)})))),setConnectionErrors:e=>({type:g,connectionErrors:e}),setIsOfflineMode:e=>({type:h,isOfflineMode:e})}},432:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(743),s=n(818),o=n(57);const r={FETCH_AUTHORIZATION_URL:({redirectUri:e})=>i.ZP.fetchAuthorizationUrl(e),REGISTER_SITE:({registrationNonce:e,redirectUri:t})=>i.ZP.registerSite(e,t),CONNECT_USER:(0,s.createRegistryControl)((({resolveSelect:e})=>({from:t,redirectFunc:n,redirectUri:i}={})=>new Promise(((s,r)=>{e(o.Z).getAuthorizationUrl(i).then((e=>{const i=n||(e=>window.location.assign(e)),o=new URL(e);t&&o.searchParams.set("from",encodeURIComponent(t));const r=o.toString();i(r),s(r)})).catch((e=>{r(e)}))}))))}},479:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(818),s=n(523);const o=(0,i.combineReducers)({connectionStatus:(e={},t)=>{switch(t.type){case s.i6:return{...e,...t.connectionStatus};case s.Qo:return{...e,isUserConnected:!1}}return e},connectionStatusIsFetching:(e=!1,t)=>t.type===s.LI?t.isFetching:e,siteIsRegistering:(e=!1,t)=>t.type===s.r7?t.isRegistering:e,userIsConnecting:(e=!1,t)=>t.type===s.N4?t.isConnecting:e,registrationError:(e,t)=>{switch(t.type){case s.T1:return!1;case s.qV:return t.registrationError;default:return e}},authorizationUrl:(e,t)=>t.type===s.TS?t.authorizationUrl:e,userConnectionData:(e,t)=>(t.type,e),connectedPlugins:(e={},t)=>t.type===s.wQ?t.connectedPlugins:e,connectionErrors:(e={},t)=>t.type===s.b5?t.connectionErrors:e,isOfflineMode:(e=!1,t)=>t.type===s.qJ?t.isConnecting:e})},728:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(818),s=n(523),o=n(57);const r={...{getAuthorizationUrl:{isFulfilled:(e,...t)=>{const n=Boolean(e.authorizationUrl),s=(0,i.select)(o.Z).hasFinishedResolution("getAuthorizationUrl",t);return n&&!s&&(0,i.dispatch)(o.Z).finishResolution("getAuthorizationUrl",t),n},*fulfill(e){const t=yield s.ZP.fetchAuthorizationUrl(e);yield s.ZP.setAuthorizationUrl(t.authorizeUrl)}}}}},725:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={...{getConnectionStatus:e=>e.connectionStatus||{},getConnectionStatusIsFetching:()=>!1,getSiteIsRegistering:e=>e.siteIsRegistering||!1,getUserIsConnecting:e=>e.userIsConnecting||!1,getRegistrationError:e=>e.registrationError||!1,getAuthorizationUrl:e=>e.authorizationUrl||!1,getUserConnectionData:e=>e.userConnectionData||!1,getConnectedPlugins:e=>e.connectedPlugins||[],getConnectionErrors:e=>e.connectionErrors||[],getIsOfflineMode:e=>e.isOfflineMode||!1,getWpcomUser:e=>e?.userConnectionData?.currentUser?.wpcomUser,getBlogId:e=>e?.userConnectionData?.currentUser?.blogId}}},535:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(818);class s{static store=null;static mayBeInit(e,t){null===s.store&&(s.store=(0,i.createReduxStore)(e,t),(0,i.register)(s.store))}}const o=s},57:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="jetpack-connection"},428:(e,t,n)=>{"use strict";n.d(t,{t:()=>l.Z});var i=n(523),s=n(432),o=n(479),r=n(728),a=n(725),c=n(535),l=n(57);const d=window.JP_CONNECTION_INITIAL_STATE;d||console.error("Jetpack Connection package: Initial state is missing. Check documentation to see how to use the Connection composer package to set up the initial state."),c.Z.mayBeInit(l.Z,{__experimentalUseThunks:!0,reducer:o.Z,actions:i.ZP,selectors:a.Z,resolvers:r.Z,controls:s.Z,initialState:d||{}})},419:(e,t,n)=>{"use strict";n.d(t,{Wp:()=>i.Wp,z$:()=>s.Z});var i=n(505),s=(n(714),n(354),n(404),n(53));n(380),n(342),n(959),n(58)},342:(e,t,n)=>{"use strict";n(196)},959:(e,t,n)=>{"use strict";n(307)},53:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(975),s=n(294),o=n(307);const{tracks:r}=i.Z,{recordEvent:a}=r,c=({pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:c={}}={})=>{const[l,d]=(0,o.useState)(!1),{isUserConnected:u,isRegistered:p,userConnectionData:g={}}=(0,s.Z)(),{wpcomUser:{login:h,ID:f}={},blogId:m}=g.currentUser||{},C=(0,o.useCallback)((async(e,t={})=>{u&&f&&h&&a(e,t)}),[u,f,h]);return(0,o.useEffect)((()=>{u&&f&&h&&m&&i.Z.initialize(f,h,{blog_id:m})}),[m,f,h,u]),(0,o.useEffect)((()=>{const i=e?`${t}_${e}_${n}`:null;p&&i&&(l||(C(i,c),d(!0)))}),[l,t,e,n,p,c,C]),{recordEvent:C,tracks:r}}},380:(e,t,n)=>{"use strict";n(818),n(307),n(58)},166:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p,rW:()=>u});var i=n(818),s=n(505),o=n(162),r=n(58);const a="SET_JETPACK_MODULES",c="SET_MODULE_UPDATING";function l(e){return u({isLoading:e})}function d(e,t){return{type:c,name:e,isUpdating:t}}function u(e){return{type:a,options:e}}const p={updateJetpackModuleStatus:function*(e){try{yield d(e.name,!0),yield(0,o.zL)(e);const t=yield(0,o.Bs)();return yield u({data:t}),!0}catch(e){const t=(0,i.select)(r.p).getJetpackModules();return yield u(t),!1}finally{yield d(e.name,!1)}},setJetpackModules:u,fetchModules:function*(){if((0,s.Wp)())return!0;try{yield l(!0);const e=yield(0,o.Bs)();return yield u({data:e}),!0}catch(e){const t=(0,i.select)(r.p).getJetpackModules();return yield u(t),!1}finally{yield l(!1)}}}},162:(e,t,n)=>{"use strict";n.d(t,{Bs:()=>a,ZP:()=>l,zL:()=>c});var i=n(989),s=n.n(i);const o="FETCH_JETPACK_MODULES",r="UPDATE_JETPACK_MODULE_STATUS",a=()=>({type:o}),c=e=>({type:r,settings:e}),l={[o]:function(){return s()({path:"/jetpack/v4/module/all",method:"GET"})},[r]:function({settings:e}){return s()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},58:(e,t,n)=>{"use strict";n.d(t,{p:()=>l});var i=n(818),s=n(166),o=n(162),r=n(469),a=n(133),c=n(524);const l="jetpack-modules",d=(0,i.createReduxStore)(l,{reducer:r.Z,actions:s.ZP,controls:o.ZP,resolvers:a.Z,selectors:c.Z});(0,i.register)(d);const u=window?.Initial_State?.getModules||window?.Jetpack_Editor_Initial_State?.modules||null;null!==u&&(0,i.dispatch)(l).setJetpackModules({data:{...u}})},469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});const i={isLoading:!1,isUpdating:{},data:{}},s=(e=i,t)=>{switch(t.type){case"SET_JETPACK_MODULES":return{...e,...t.options};case"SET_MODULE_UPDATING":return{...e,isUpdating:{...e.isUpdating,[t.name]:t.isUpdating}}}return e}},133:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(166),s=n(162);const o={getJetpackModules:function*(){try{const e=yield(0,s.Bs)();if(e)return(0,i.rW)({data:e})}catch(e){console.error(e)}}}},524:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(505);const s={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,i.Wp)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,isModuleUpdating:(e,t)=>e?.isUpdating?.[t]??!1}},404:(e,t,n)=>{"use strict";var i=n(736);n(483),n(819);const __=i.__;__("Upgrade your plan to use video covers","jetpack"),__("Upgrade your plan to upload audio","jetpack")},714:(e,t,n)=>{"use strict";n(817)},505:(e,t,n)=>{"use strict";function i(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function s(){return"simple"===i()}n.d(t,{Wp:()=>s})},354:(e,t,n)=>{"use strict";n(674),n(333)},128:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let i=0,s=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(i++,"%c"===e&&(s=i))})),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(942)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},942:(e,t,n)=>{e.exports=function(e){function t(e){let n,s,o,r=null;function a(...e){if(!a.enabled)return;const i=a,s=Number(new Date),o=s-(n||s);i.diff=o,i.prev=n,i.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if("%%"===n)return"%";r++;const o=t.formatters[s];if("function"==typeof o){const t=e[r];n=o.call(i,t),e.splice(r,1),r--}return n})),t.formatArgs.call(i,e);(i.log||t.log).apply(i,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=i,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{r=e}}),"function"==typeof t.init&&t.init(a),a}function i(e,n){const i=t(this.namespace+(void 0===n?":":n)+e);return i.log=this.log,i}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(s),...t.skips.map(s).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),s=i.length;for(n=0;n<s;n++)i[n]&&("-"===(e=i[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(171),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},787:e=>{"use strict";if(void 0==={consumer_slug:"jetpack"}){var t=new Error('Cannot find module \'{"consumer_slug":"jetpack"}\'');throw t.code="MODULE_NOT_FOUND",t}e.exports={consumer_slug:"jetpack"}},196:e=>{"use strict";e.exports=window.React},819:e=>{"use strict";e.exports=window.lodash},989:e=>{"use strict";e.exports=window.wp.apiFetch},175:e=>{"use strict";e.exports=window.wp.blockEditor},609:e=>{"use strict";e.exports=window.wp.components},333:e=>{"use strict";e.exports=window.wp.compose},818:e=>{"use strict";e.exports=window.wp.data},307:e=>{"use strict";e.exports=window.wp.element},736:e=>{"use strict";e.exports=window.wp.i18n},817:e=>{"use strict";e.exports=window.wp.plugins},483:e=>{"use strict";e.exports=window.wp.url},674:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);(()=>{"use strict";var e=n(419),t=n(175),i=n(609),s=n(333),o=n(818),r=n(307),a=n(736);const __=a.__,_x=a._x,c={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&nbsp;":" "},l=/&(?:amp|lt|gt|quot|#39|nbsp);/g,d=e=>{if("string"!=typeof e)return e;return e.replace(l,(e=>c[e]))},u=e=>!new Set(["core/legacy-widget","core/widget-area"]).has(e);wp.hooks.addFilter("blocks.registerBlockType","widget/visibility",(function(e,t){return u(t)&&void 0!==e.attributes&&(e.attributes=Object.assign(e.attributes,{conditions:{type:"object",default:{}}})),e}));const p=(e,t=0)=>e.reduce(((e,n)=>{const[i,s]=n,o=" ".repeat(3*t);if(Array.isArray(s)){const n={label:d(o+i),value:i,disabled:!0},r=p(s,t+1);return e.concat([n]).concat(r)}const r={label:d(o+s),value:i};return e.concat([r])}),[]),g=t=>{const{rule:n,onDelete:s,setMajor:o,setMinor:r}=t,a=[{label:__("User","jetpack"),value:"loggedin"},{label:__("Role","jetpack"),value:"role"}],c=widget_conditions_data.taxonomy&&widget_conditions_data.taxonomy.length>1||"taxonomy"===n.major,l=[{label:__("Taxonomy","jetpack"),value:"taxonomy"}],d=[{label:__("-- Select --","jetpack"),value:""},{label:__("Category","jetpack"),value:"category"},{label:__("Author","jetpack"),value:"author"}].concat((0,e.Wp)()?[]:a).concat([{label:__("Tag","jetpack"),value:"tag"},{label:__("Date","jetpack"),value:"date"},{label:__("Page","jetpack"),value:"page"}]).concat(c?l:[]);let u=[];return n.major in widget_conditions_data&&(u=p(widget_conditions_data[n.major])),React.createElement("div",{className:"widget-vis__rule"},React.createElement("div",{className:"widget-vis__rule-major"},React.createElement("span",{className:"widget-vis__if"},_x("If","Widget Visibility: If {Rule Major [Page]} is {Rule Minor [Search results]}","jetpack")),React.createElement("div",{className:"widget-vis__select"},React.createElement(i.SelectControl,{label:__("Major Rule","jetpack"),hideLabelFromVision:!0,value:n.major,options:d,onChange:o}))),n.major&&React.createElement("div",{className:"widget-vis__rule-minor"},React.createElement("span",{className:"widget-vis__is"},_x("is","Widget Visibility: {Rule Major [Page]} is {Rule Minor [Search results]}","jetpack")),React.createElement("div",{className:"widget-vis__select"},React.createElement(i.SelectControl,{className:"widget-vis__select-multi-level",label:__("Minor Rule","jetpack"),hideLabelFromVision:!0,value:n.minor,options:u,onChange:r}))),React.createElement("div",{className:"widget-vis__delete-rule"},React.createElement(i.Button,{onClick:s,isSmall:!0,variant:"secondary"},_x("Remove","Delete this visibility rule","jetpack"))))},h=e=>({action:"show",rules:[],match_all:0,...e}),f=(0,s.createHigherOrderComponent)((n=>s=>{const{clientId:a,attributes:c,setAttributes:l,isSelected:d}=s,p=(0,r.useMemo)((()=>c.conditions||{}),[c]),f=(0,r.useMemo)((()=>p.rules||[]),[p]),{tracks:m}=(0,e.z$)(),C=(0,o.useSelect)((e=>{const{getBlockParents:t,getBlock:n}=e("core/block-editor"),i=t(a,!0),s=i?n(i[0]):void 0;return!s||s&&"core/widget-area"===s.name}),[a]),v=(0,r.useCallback)((()=>{m.recordEvent("jetpack_widget_visibility_toggle_match_all_click"),l({conditions:{...h(p),match_all:"0"===p.match_all?"1":"0"}})}),[m,l,p]),y=(0,r.useCallback)((e=>l({conditions:{...h(p),action:e}})),[l,p]),w=(0,r.useCallback)((()=>{const e=[...f,{major:"",minor:""}];m.recordEvent("jetpack_widget_visibility_add_new_rule_click"),l({conditions:{...h(p),rules:e}})}),[f,m,l,p]),k=(0,r.useCallback)((e=>{const t=[...f.slice(0,e),...f.slice(e+1)];m.recordEvent("jetpack_widget_visibility_delete_rule_click"),l({conditions:{...h(p),rules:t}})}),[f,m,l,p]),_=(0,r.useCallback)(((e,t)=>{m.recordEvent("jetpack_widget_visibility_set_major_rule_click");let n="";t in widget_conditions_data&&Array.isArray(widget_conditions_data[t])&&widget_conditions_data[t].length>0&&(n=widget_conditions_data[t][0][0]);const i=[...f.slice(0,e),{...f[e],major:t,minor:n},...f.slice(e+1)];l({conditions:{...h(p),rules:i}})}),[m,f,l,p]),S=(0,r.useCallback)(((e,t)=>{if(m.recordEvent("jetpack_widget_visibility_set_minor_rule_click"),t&&t.includes("__HEADER__"))return;const n=[...f.slice(0,e),{...f[e],minor:t},...f.slice(e+1)];l({conditions:{...h(p),rules:n}})}),[m,f,l,p]);let j=null;return j=0===f.length?React.createElement(i.BaseControl,{id:"widget-vis__wrapper",className:"widget-vis__wrapper",label:__("Visibility","jetpack"),help:__("No visibility rules yet. Add at least one rule to use this feature.","jetpack")},React.createElement(i.Button,{variant:"secondary",onClick:w,className:"widget-vis__add-new-rule"},__("Add new rule","jetpack"))):React.createElement(i.BaseControl,{className:"widget-vis__wrapper",id:"widget-vis__wrapper",label:__("Visibility","jetpack")},React.createElement(i.SelectControl,{className:"widget-vis__show-hide",label:__("Action","jetpack"),hideLabelFromVision:!0,value:c.conditions.action,options:[{label:__("Show this block","jetpack"),value:"show"},{label:__("Hide this block","jetpack"),value:"hide"}],onChange:y}),f.map(((e,t)=>React.createElement(g,{key:t,rule:e,i:t,onDelete:()=>k(t),setMajor:e=>_(t,e),setMinor:e=>S(t,e)}))),f.length>1&&React.createElement(i.ToggleControl,{className:"widget-vis__match-all",label:__("Match all rules","jetpack"),checked:"1"===p.match_all,onChange:v}),React.createElement(i.Button,{variant:"secondary",onClick:w},__("Add new rule","jetpack"))),React.createElement(r.Fragment,null,React.createElement(n,s),d&&C&&u(s.name)&&React.createElement(t.InspectorAdvancedControls,null,j),d&&!C&&u(s.name)&&React.createElement(t.InspectorAdvancedControls,null,React.createElement(i.BaseControl,{id:"widget-vis__wrapper",className:"widget-vis__wrapper",label:__("Visibility","jetpack"),help:__("Please select the top level block of this widget to apply visibility rules.","jetpack")})))}),"visibilityAdvancedControls");wp.hooks.addFilter("editor.BlockEdit","widget/visibility",f)})(),window.WidgetVisibility={}.WidgetVisibility})();