kollapsminoriteten/wp-content/plugins/jetpack/_inc/blocks/editor-beta.js

281 lines
1.7 MiB
JavaScript
Raw Normal View History

2022-04-02 10:26:41 +02:00
/*! For license information please see editor-beta.js.LICENSE.txt */
2025-02-28 08:42:11 +01:00
(()=>{var e,t,n,r,a={7675:(e,t,n)=>{"use strict";n.d(t,{y:()=>l});var r=n(76416),a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n};const s="text/event-stream",o=1e3,i="last-event-id";function l(e,t){var{signal:n,headers:l,onopen:u,onmessage:d,onclose:p,onerror:m,openWhenHidden:h,fetch:g}=t,f=a(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise(((t,a)=>{const b=Object.assign({},l);let v;function k(){v.abort(),document.hidden||A()}b.accept||(b.accept=s),h||document.addEventListener("visibilitychange",k);let y=o,w=0;function E(){document.removeEventListener("visibilitychange",k),window.clearTimeout(w),v.abort()}null==n||n.addEventListener("abort",(()=>{E(),t()}));const _=null!=g?g:window.fetch,C=null!=u?u:c;async function A(){var n;v=new AbortController;try{const n=await _(e,Object.assign(Object.assign({},f),{headers:b,signal:v.signal}));await C(n),await(0,r.q5)(n.body,(0,r.iv)((0,r.VL)((e=>{e?b[i]=e:delete b[i]}),(e=>{y=e}),d))),null==p||p(),E(),t()}catch(e){if(!v.signal.aborted)try{const t=null!==(n=null==m?void 0:m(e))&&void 0!==n?n:y;window.clearTimeout(w),w=window.setTimeout(A,t)}catch(e){E(),a(e)}}}A()}))}function c(e){const t=e.headers.get("content-type");if(!(null==t?void 0:t.startsWith(s)))throw new Error(`Expected content-type to be ${s}, Actual: ${t}`)}},76416:(e,t,n)=>{"use strict";async function r(e,t){const n=e.getReader();let r;for(;!(r=await n.read()).done;)t(r.value)}function a(e){let t,n,r,a=!1;return function(s){void 0===t?(t=s,n=0,r=-1):t=function(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(t,s);const o=t.length;let i=0;for(;n<o;){a&&(10===t[n]&&(i=++n),a=!1);let s=-1;for(;n<o&&-1===s;++n)switch(t[n]){case 58:-1===r&&(r=n-i);break;case 13:a=!0;case 10:s=n}if(-1===s)break;e(t.subarray(i,s),r),i=n,r=-1}i===o?t=void 0:0!==i&&(t=t.subarray(i),n-=i)}}function s(e,t,n){let r=o();const a=new TextDecoder;return function(s,i){if(0===s.length)null==n||n(r),r=o();else if(i>0){const n=a.decode(s.subarray(0,i)),o=i+(32===s[i+1]?2:1),l=a.decode(s.subarray(o));switch(n){case"data":r.data=r.data?r.data+"\n"+l:l;break;case"event":r.event=l;break;case"id":e(r.id=l);break;case"retry":const n=parseInt(l,10);isNaN(n)||t(r.retry=n)}}}}function o(){return{data:"",event:"",id:"",retry:void 0}}n.d(t,{VL:()=>s,iv:()=>a,q5:()=>r})},95723:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(84265);let a,s,o,i;const l=/<(\/)?(\w+)\s*(\/)?>/g;function c(e,t,n,r,a){return{element:e,tokenStart:t,tokenLength:n,prevOffset:r,leadingTextStart:a,children:[]}}const u=e=>{const t="object"==typeof e,n=t&&Object.values(e);return t&&n.length&&n.every((e=>(0,r.isValidElement)(e)))};function d(e){const t=function(){const e=l.exec(a);if(null===e)return["no-more-tokens"];const t=e.index,[n,r,s,o]=e,i=n.length;if(o)return["self-closed",s,t,i];if(r)return["closer",s,t,i];return["opener",s,t,i]}(),[n,u,d,h]=t,g=i.length,f=d>s?s:null;if(!e[u])return p(),!1;switch(n){case"no-more-tokens":if(0!==g){const{leadingTextStart:e,tokenStart:t}=i.pop();o.push(a.substr(e,t))}return p(),!1;case"self-closed":return 0===g?(null!==f&&o.push(a.substr(f,d-f)),o.push(e[u]),s=d+h,!0):(m(c(e[u],d,h)),s=d+h,!0);case"opener":return i.push(c(e[u],d,h,d+h,f)),s=d+h,!0;case"closer":if(1===g)return function(e){const{element:t,leadingTextStart:n,prevOffset:s,tokenStart:l,children:c}=i.pop(),u=e?a.substr(s,e-s):a.substr(s);u&&c.push(u);null!==n&&o.push(a.substr(n,l-n));o.push((0,r.cloneElement)(t,null,...c))}(d),s=d+h,!0;const t=i.pop(),n=a.substr(t.prevOffset,d-t.prevOffset);t.children.push(n),t.prevOffset=d+h;const l=c(t.element,t.tokenStart,t.tokenLength,d+h);return l.children=t.children,m(l),s=d+h,!0;default:return p(),!1}}function p(){const e=a.length-s;0!==e
2024-04-17 11:32:24 +02:00
// translators: %1$d: number of requests remaining
2025-02-28 08:42:11 +01:00
__("You have %1$d requests remaining.","jetpack"),e)),React.createElement(r.Button,{variant:"link",onClick:n,href:a,target:a?"_blank":null},__("Upgrade now","jetpack")))}function E({error:e,code:t,onTryAgainClick:n,onUpgradeClick:a,upgradeUrl:o}){const i=e||__("Something went wrong","jetpack");return React.createElement(b,{severity:m},React.createElement("span",null,(0,s.sprintf)(
// translators: %1$d: A dynamic error message
__("Error: %1$s","jetpack"),i)),t===u.Or?React.createElement(r.Button,{variant:"link",onClick:a,href:o,target:o?"_blank":null},__("Upgrade now","jetpack")):React.createElement(r.Button,{variant:"link",onClick:n},__("Try again","jetpack")))}},43984:(e,t,n)=>{"use strict";n.d(t,{A4:()=>l,DD:()=>E,DT:()=>P,Gm:()=>g,HM:()=>_,JR:()=>C,K2:()=>x,Rq:()=>R,UA:()=>h,UD:()=>A,br:()=>d,d5:()=>v,eJ:()=>m,fD:()=>p,fv:()=>k,im:()=>o,mI:()=>j,mT:()=>N,oZ:()=>s,pE:()=>f,sn:()=>i,so:()=>a,u0:()=>y,uQ:()=>w,vE:()=>u,yQ:()=>S,yy:()=>c,z5:()=>b});var r=n(27723);const __=r.__,a={en:{label:__("English","jetpack")},es:{label:__("Spanish","jetpack")},fr:{label:__("French","jetpack")},de:{label:__("German","jetpack")},it:{label:__("Italian","jetpack")},pt:{label:__("Portuguese","jetpack")},ru:{label:__("Russian","jetpack")},zh:{label:__("Chinese","jetpack")},ja:{label:__("Japanese","jetpack")},ar:{label:__("Arabic","jetpack")},hi:{label:__("Hindi","jetpack")},ko:{label:__("Korean","jetpack")}},s={formal:{label:__("Formal","jetpack"),emoji:"🎩"},informal:{label:__("Informal","jetpack"),emoji:"😊"},optimistic:{label:__("Optimistic","jetpack"),emoji:"😃"},humorous:{label:__("Humorous","jetpack"),emoji:"😂"},serious:{label:__("Serious","jetpack"),emoji:"😐"},skeptical:{label:__("Skeptical","jetpack"),emoji:"🤨"},empathetic:{label:__("Empathetic","jetpack"),emoji:"💗"},confident:{label:__("Confident","jetpack"),emoji:"😎"},passionate:{label:__("Passionate","jetpack"),emoji:"❤️"},provocative:{label:__("Provocative","jetpack"),emoji:"🔥"}},o="titleSummary",i="continue",l="simplify",c="correctSpelling",u="generateTitle",d="makeLonger",p="makeShorter",m="changeTone",h="summarize",g="changeLanguage",f="userPrompt",b="jetpackFormCustomPrompt",v="transformListToTable",k="writePostFromList",y=__("Translate","jetpack"),w=__("Change tone","jetpack"),E=__("Correct spelling and grammar","jetpack"),_=__("Simplify","jetpack"),C=__("Summarize","jetpack"),A=__("Make shorter","jetpack"),x=__("Expand","jetpack"),j=__("Turn list into a table","jetpack"),S=__("Write a post from this list","jetpack"),N=__("Generate a post title","jetpack"),R=__("Summary based on title","jetpack"),P=__("Continue writing","jetpack")},2166:(e,t,n)=>{"use strict";n.d(t,{R:()=>o});var r=n(51609),a=n.n(r);const s=(0,r.createContext)({}),o=({value:e,children:t})=>a().createElement(s.Provider,{value:e,children:t})},13965:(e,t,n)=>{"use strict";n.d(t,{Rb:()=>r.R});var r=n(2166);n(59886),n(53471)},53471:(e,t,n)=>{"use strict";n(51609),n(78836),n(13965)},59886:(e,t,n)=>{"use strict";var r=n(29491),a=n(86087),s=n(51609),o=n.n(s),i=n(46219),l=n(13965);(0,r.createHigherOrderComponent)((e=>t=>{const{suggestion:n,error:r,requestingState:s,request:c,stopSuggestion:u,eventSource:d}=(0,i.Ay)(),p=(0,a.useMemo)((()=>({suggestion:n,requestingError:r,requestingState:s,eventSource:d,requestSuggestion:c,stopSuggestion:u})),[n,r,s,d,c,u]);return o().createElement(l.Rb,{value:p},o().createElement(e,t))}),"withAiDataProvider")},46219:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>c,fC:()=>i});var r=n(86087),a=n(27723),s=n(87286),o=n(78836);const __=a.__;function i(e){switch(e){case o.Or:return{code:o.Or,message:__("You have reached the limit of requests for this site.","jetpack"),severity:"info"};case o.L9:return{code:o.L9,message:__("Your request was unclear. Mind trying again?","jetpack"),severity:"info"};case o.AZ:return{code:o.AZ,message:__("Jetpack AI services are currently unavailable. Sorry for the inconvenience.","jetpack"),severity:"info"};case o.ud:return{code:o.ud,message:__("This request has been flagged by our moderation system. Please try to rephrase it and try again.","jetpack"),severity:"info"};case o.cT:return{code:o.cT,message:__("The content is too large to be processed all at once. Please try to shorten it or divide it into smaller parts.","jetpack"),severity:"info"};case o.mA:default:return{code:o.mA,message:__("It was not possible to process your request. Mind trying again?","jetpack"),severity:"info"}}}function l(e){return e.replace(/^<\|start_header_id\|>assistant<\|end_header_id
// translators: %u is the number of requests
__("%u requests remaining.","jetpack"),w)),x&&React.createElement(React.Fragment,null," ",React.createElement(a.Button,{variant:"link",href:A,target:"_blank",onClick:()=>{n(m.AN,{context:U,placement:m.Cn})}},__("Upgrade","jetpack")))," ",React.createElement(a.Tooltip,{text:__("Logo generation costs 10 requests; prompt enhancement costs 1 request each","jetpack"),placement:"bottom"},React.createElement(o.A,{className:"prompt-footer__icon",icon:i.A}))),H&&V&&React.createElement(v.G,null),H&&!V&&React.createElement(b.Q,null),_&&React.createElement("div",{className:"jetpack-ai-logo-generator__prompt-error"},__("Error enhancing prompt. Please try again.","jetpack")),C&&React.createElement("div",{className:"jetpack-ai-logo-generator__prompt-error"},__("Error generating logo. Please try again.","jetpack"))))}},64024:(e,t,n)=>{"use strict";n.d(t,{G:()=>p});var r=n(85985),a=n(56427),s=n(86087),o=n(27723),i=n(51113),l=n(23751),c=n(61356),u=n(60674),d=n(88725);const __=o.__,p=()=>{const{tracks:e}=(0,r.st)(),{recordEvent:t}=e,n=__("Upgrade","jetpack"),o=(0,s.createInterpolateElement)(__("Not enough requests left to generate a logo. <strong>Upgrade now to increase it.</strong>","jetpack"),{strong:React.createElement("strong",null)}),{nextTierCheckoutURL:p}=(0,u.Q)(),{context:m}=(0,d.A)();return React.createElement("div",{className:"jetpack-upgrade-plan-banner"},React.createElement("div",{className:"jetpack-upgrade-plan-banner__wrapper"},React.createElement("div",null,React.createElement(i.A,{className:"jetpack-upgrade-plan-banner__icon",icon:l.A}),React.createElement("span",{className:"jetpack-upgrade-plan-banner__banner-description"},o)),React.createElement(a.Button,{href:p,target:"_blank",className:"is-primary",onClick:()=>{t(c.AN,{context:m,placement:c.tF})}},n)))}},35421:(e,t,n)=>{"use strict";n.d(t,{R:()=>c});var r=n(85985),a=n(56427),s=n(27723),o=n(3924),i=n(61356),l=n(88725);const __=s.__,c=({onCancel:e,upgradeURL:t,reason:n})=>{const{tracks:s}=(0,r.st)(),{recordEvent:c}=s,u=__("Upgrade your Jetpack AI for access to logo generation. This upgrade will also increase the amount of monthly requests you can use in for all AI-powered features.","jetpack"),d=__("Not enough requests left to generate a logo. Upgrade your Jetpack AI to increase the amount of requests you can use in all AI-powered features.","jetpack"),p=(0,o.A)("ai-logo-generator-fair-usage-policy",{anchor:"usage-limitations-and-upgrades"}),{context:m}=(0,l.A)();return React.createElement("div",{className:"jetpack-ai-logo-generator-modal__notice-message-wrapper"},React.createElement("div",{className:"jetpack-ai-logo-generator-modal__notice-message"},React.createElement("span",{className:"jetpack-ai-logo-generator-modal__loading-message"},"feature"===n?u:d)," ",React.createElement(a.Button,{variant:"link",href:p,target:"_blank"},__("Learn more about Jetpack AI.","jetpack"))),React.createElement("div",{className:"jetpack-ai-logo-generator-modal__notice-actions"},React.createElement(a.Button,{variant:"tertiary",onClick:e},__("Cancel","jetpack")),React.createElement(a.Button,{variant:"primary",href:t,target:"_blank",onClick:()=>{c(i.AN,{context:m,placement:i.Tz}),e()}},__("Upgrade","jetpack"))))}},48204:(e,t,n)=>{"use strict";n.d(t,{H:()=>l});var r=n(56427),a=n(27723),s=n(53512),o=n(13022),i=n(36791);const __=a.__,l=({className:e=null,onVisitBlankTarget:t})=>React.createElement("div",{className:(0,o.A)("jetpack-ai-logo-generator-modal-visit-site-banner",e)},React.createElement("div",{className:"jetpack-ai-logo-generator-modal-visit-site-banner__jetpack-logo"},React.createElement("img",{src:i,alt:"Jetpack"})),React.createElement("div",{className:"jetpack-ai-logo-generator-modal-visit-site-banner__content"},React.createElement("strong",null,__("Do you want to know all the amazing things you can do with Jetpack AI?","jetpack")),React.createElement("span",null,__("Generate and tweak content, create forms, get feedback and much more.","jetpack")),React.createElement("div",null,React.createElement(r.Button,{variant:"link",href:"https://jetpack.com/redirect/?source=logo_genera
// Translators: %s is the date when the requests will reset.
const n=__("Requests will reset on %s.","jetpack");return`${t} ${(0,s.sprintf)(n,e)}`})((e=>{if(!e?.nextStart)return null;const t=new Date(e.nextStart);return t.toLocaleString("default",{month:"long"})+" "+t.getDate()})(e)),n=(0,o.A)("ai-logo-generator-fair-usage-policy",{anchor:"jetpack-ai-usage-limit"});return(0,a.createInterpolateElement)(t,{link:React.createElement("a",{href:n,target:"_blank",rel:"noreferrer"})})}},88725:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(47143),a=n(10067),s=n.n(a),o=n(51609),i=n(31439),l=n(62614),c=n(93869),u=n(51391),d=n(19362),p=n(28229),m=n(74423),h=n(44461);const g=s()("jetpack-ai-calypso:use-logo-generator"),f=()=>{const{setSelectedLogoIndex:e,setIsSavingLogoToLibrary:t,setIsApplyingLogo:n,setIsRequestingImage:a,setIsEnhancingPrompt:s,increaseAiAssistantRequestsCount:f,addLogoToHistory:b,setContext:v,setIsLoadingHistory:k}=(0,r.useDispatch)(m.E),{logos:y,selectedLogoIndex:w,selectedLogo:E,siteDetails:_,isSavingLogoToLibrary:C,isApplyingLogo:A,isEnhancingPrompt:x,isBusy:j,isRequestingImage:S,getAiAssistantFeature:N,requireUpgrade:R,context:P,tierPlansEnabled:L,isLoadingHistory:T}=(0,r.useSelect)((e=>{const t=e(m.E);return{logos:t.getLogos(),selectedLogoIndex:t.getSelectedLogoIndex(),selectedLogo:t.getSelectedLogo(),siteDetails:t.getSiteDetails(),isSavingLogoToLibrary:t.getIsSavingLogoToLibrary(),isApplyingLogo:t.getIsApplyingLogo(),isRequestingImage:t.getIsRequestingImage(),isEnhancingPrompt:t.getIsEnhancingPrompt(),isBusy:t.getIsBusy(),getAiAssistantFeature:t.getAiAssistantFeature,requireUpgrade:t.getRequireUpgrade(),context:t.getContext(),tierPlansEnabled:t.getTierPlansEnabled(),isLoadingHistory:t.getIsLoadingHistory()}}),[]),{setFirstLogoPromptFetchError:M,setEnhancePromptFetchError:B,setLogoFetchError:I,setSaveToLibraryError:D,setLogoUpdateError:F}=(0,h.A)(),{generateImageWithParameters:z}=(0,l.Ay)(),{saveToMediaLibrary:O}=(0,c.A)(),{ID:H=null,name:U=null,description:V=null}=_||{},q=H?String(H):null,G=N(q),$=G?.costs?.["jetpack-ai-logo-generator"]?.logo,W=G?.featuresControl?.["logo-generator"],Z=W?.styles||[],J=(0,o.useCallback)((async function(){M(null),f();try{const e=await(0,u.A)();if(!e||!e.token)throw new Error("No token provided");g("Generating first prompt for site");const t={question:`Generate a simple and short prompt asking for a logo based on the site's name and description, keeping the same language.\nExample for a site named "The minimalist fashion blog", described as "Daily inspiration for all things fashion": A logo for a minimalist fashion site focused on daily sartorial inspiration with a clean and modern aesthetic that is sleek and sophisticated.\nAnother example, now for a site called "El observatorio de aves", described as "Un sitio dedicado a nuestros compañeros y compañeras entusiastas de la observación de aves.": Un logo para un sitio web dedicado a la observación de aves, capturando la esencia de la naturaleza y la pasión por la avifauna en un diseño elegante y representativo, reflejando una estética natural y apasionada por la vida silvestre.\n\nSite name: ${U}\nSite description: ${V}`,feature:"jetpack-ai-logo-generator",stream:!1},n="https://public-api.wordpress.com/wpcom/v2/jetpack-ai-query",r={Authorization:`Bearer ${e.token}`,"Content-Type":"application/json"},a=await fetch(n,{method:"POST",headers:r,body:JSON.stringify(t)}).then((e=>e.json()));return a?.choices?.[0]?.message?.content}catch(e){throw f(-1),M(e),e}}),[M,f,U,V]),K=(0,o.useCallback)((async function(e){if(I(null),!Z||!Z.length)return null;const t=[{role:"jetpack-ai",context:{type:"ai-assistant-guess-logo-style",request:e,name:U,description:V}}];try{const e=await(0,i.A)(t,{feature:"jetpack-ai-logo-generator"});if(!e)return null;const n=Z.find((({value:t})=>t===e));return n?n.value:null}catch(e){g("Error guessing style",e),Promise.reject(e)}}),[Z,U,V]),Y=(0,o.useCallback)((async function({prompt:e,style:t=null}){I(null);try{const n=await(0,u.A)();if(!n||!n.token)throw new Error("No token provided");if("auto"===t)throw new Error("Auto style is not supported");g("Generating image wit
__("(opens in a new tab)","jetpack"))),x=v?"_blank":void 0,j=n?.[0]&&null!==n[0]&&"components-tooltip"!==n?.[0]?.props?.className;return d().createElement(s.Button,a()({target:x,variant:r,className:(0,c.A)(_,{"has-text":!!m&&j}),icon:v?void 0:m,iconSize:h,disabled:g,"aria-disabled":g,isDestructive:f,text:y},E),b&&d().createElement(s.Spinner,null),d().createElement("span",null,n),A)}));m.displayName="Button";const h=m},69222:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(96072),a=n.n(r),s=n(29491),o=n(86087),i=n(27723),l=n(51112),c=n(78478);const __=i.__,u=({buttonStyle:e="icon",textToCopy:t,onCopy:n,...r})=>{const[i,u]=(0,o.useState)(!1),d=(0,o.useRef)(),p=(0,s.useCopyToClipboard)(t,(()=>{d.current&&clearTimeout(d.current),u(!0),n?.(),d.current=setTimeout((()=>{u(!1),d.current=void 0}),3e3)}));(0,o.useEffect)((()=>()=>{d.current&&clearTimeout(d.current)}),[]);let m=null,h=null;"text"!==e&&(m=i?React.createElement(c.Nr,null):React.createElement(c.ui,null));const g=__("Copy to clipboard","jetpack");return"icon"!==e&&(h=i?__("Copied!","jetpack"):g),React.createElement(l.A,a()({"aria-label":g,icon:m,children:h,ref:p},r))}},63406:(e,t,n)=>{"use strict";n.d(t,{I:()=>s});var r=n(47143),a=n(692);function s(){const e=(0,r.useDispatch)(a.store),t=(0,r.useSelect)((e=>e(a.store).getNotices()),[]);return{...e,createNotice:(t,n,r)=>e.createNotice(t,n,{type:"snackbar",...r}),createErrorNotice:(t,n)=>e.createErrorNotice(t,{type:"snackbar",...n}),createInfoNotice:(t,n)=>e.createInfoNotice(t,{type:"snackbar",...n}),createSuccessNotice:(t,n)=>e.createSuccessNotice(t,{type:"snackbar",...n}),createWarningNotice:(t,n)=>e.createWarningNotice(t,{type:"snackbar",...n}),getNotices:()=>t}}},11883:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(27723),a=n(13022),s=n(51609);n(4459);const __=r.__;class o extends s.Component{static defaultProps={"aria-hidden":"false",focusable:"true"};needsOffset(e,t){return["gridicons-arrow-left","gridicons-arrow-right","gridicons-calendar","gridicons-cart","gridicons-folder","gridicons-help-outline","gridicons-info","gridicons-info-outline","gridicons-posts","gridicons-star-outline","gridicons-star"].indexOf(e)>=0&&t%18==0}getSVGDescription(e){if("description"in this.props)return this.props.description;switch(e){default:return"";case"gridicons-audio":return __("Has audio.","jetpack");case"gridicons-arrow-left":return __("Arrow left","jetpack");case"gridicons-arrow-right":return __("Arrow right","jetpack");case"gridicons-calendar":return __("Is an event.","jetpack");case"gridicons-cart":return __("Is a product.","jetpack");case"chevron-down":return __("Show filters","jetpack");case"gridicons-comment":return __("Matching comment.","jetpack");case"gridicons-cross":return __("Close.","jetpack");case"gridicons-filter":return __("Toggle search filters.","jetpack");case"gridicons-folder":return __("Category","jetpack");case"gridicons-help-outline":return __("Help","jetpack");case"gridicons-info":case"gridicons-info-outline":return __("Information.","jetpack");case"gridicons-image-multiple":return __("Has multiple images.","jetpack");case"gridicons-image":return __("Has an image.","jetpack");case"gridicons-page":return __("Page","jetpack");case"gridicons-post":return __("Post","jetpack");case"gridicons-jetpack-search":case"gridicons-search":return __("Magnifying Glass","jetpack");case"gridicons-tag":return __("Tag","jetpack");case"gridicons-video":return __("Has a video.","jetpack")}}renderIcon(e){switch(e){default:return null;case"gridicons-audio":return React.createElement("g",null,React.createElement("path",{d:"M8 4v10.184C7.686 14.072 7.353 14 7 14c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V7h7v4.184c-.314-.112-.647-.184-1-.184-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V4H8z"}));case"gridicons-arrow-left":return React.createElement("g",null,React.createElement("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}));case"gridicons-arrow-right":return React.createElement("g",null,React.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z"}));case"gridicons-block":
// translators: %s: The name of the connection the user is disconnecting.
__("Are you sure you want to disconnect <strong>%s</strong>?","jetpack"),e.display_name),{strong:React.createElement("strong",null)})),React.createElement(r.A,{size:"small",onClick:p,disabled:h,variant:t,isDestructive:n,className:u},h?__("Disconnecting…","jetpack"):_x("Disconnect","Disconnect a social media account","jetpack"))):null}},26637:(e,t,n)=>{"use strict";n(56427),n(47143),n(86087),n(27723),n(50001),n(31963),n(48222),n(48712),n(55488),n(85605)},52683:(e,t,n)=>{"use strict";n.d(t,{j:()=>l});var r=n(56427),a=n(47143),s=n(86087),o=n(27723),i=n(31963);const __=o.__;function l({connection:e}){const{updateConnectionById:t}=(0,a.useDispatch)(i.M_),{isUpdating:n}=(0,a.useSelect)((t=>{const{getUpdatingConnections:n}=t(i.M_);return{isUpdating:n().includes(e.connection_id)}}),[e.connection_id]),o=(0,s.useCallback)((n=>{t(e.connection_id,{shared:n})}),[e.connection_id,t]);return React.createElement(r.CheckboxControl,{checked:e.shared??!1,onChange:o,disabled:n||"broken"===e.status,label:__("Mark the connection as shared","jetpack"),__nextHasNoMarginBottom:!0})}},76046:(e,t,n)=>{"use strict";n.d(t,{C:()=>c});var r=n(51112),a=n(47143),s=n(86087),o=n(27723),i=n(31963),l=n(70745);const __=o.__,_x=o._x;function c({connection:e,service:t,variant:n="link"}){const{deleteConnectionById:o,setKeyringResult:c,openConnectionsModal:u,setReconnectingAccount:d}=(0,a.useDispatch)(i.M_),{isDisconnecting:p,canManageConnection:m}=(0,a.useSelect)((t=>{const{getDeletingConnections:n,canUserManageConnection:r}=t(i.M_);return{isDisconnecting:n().includes(e.connection_id),canManageConnection:r(e)}}),[e]),h=(0,s.useCallback)((e=>{c(e),e?.ID&&u()}),[u,c]),g=(0,l.P)({service:t,onConfirm:h}),f=(0,s.useCallback)((async()=>{if(!await o({connectionId:e.connection_id,showSuccessNotice:!1}))return;await d(e);const n=new FormData;"mastodon"===t.ID&&n.set("instance",e.external_handle),"bluesky"===t.ID?u():g(n)}),[e,o,u,g,t.ID,d]);return m?React.createElement(r.A,{size:"small",onClick:f,disabled:p,variant:n},p?__("Disconnecting…","jetpack"):_x("Reconnect","Reconnect a social media account","jetpack")):null}},91910:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(13022),a=n(28120),s=n.n(a),o=n(12141);const i=e=>{const{checked:t,disabled:n,onChange:a,serviceName:s,label:i,profilePicture:l}=e,c=(0,r.A)("components-connection-toggle",{"is-not-checked":!t,"is-disabled":n});return React.createElement("div",{className:c,title:i},React.createElement(o.A,{checked:t,label:i,onClick:a,serviceName:s,profilePicture:l}))};i.propTypes={className:s().string,checked:s().bool,id:s().string.isRequired,disabled:s().bool,onChange:s().func,serviceName:s().string,label:s().string,profilePicture:s().string};const l=i},10267:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(47143),a=n(86087),s=n(31963),o=n(91910),i=n(49514);class l extends a.Component{onConnectionChange=()=>{const{id:e}=this.props;this.isDisabled()||this.props.toggleConnection(e)};connectionIsFailing(){const{failedConnections:e,name:t}=this.props;return e.some((e=>e.service_name===t))}isDisabled(){return this.props.disabled||this.connectionIsFailing()}render(){const{enabled:e,id:t,label:n,name:r,profilePicture:a}=this.props,s="connection-"+r+"-"+t,l=r.replace("_","-"),c=React.createElement(o.A,{id:s,className:i.A["connection-toggle"],checked:e,onChange:this.onConnectionChange,disabled:this.isDisabled(),serviceName:l,label:n,profilePicture:a});return React.createElement("li",null,React.createElement("div",{className:i.A["connection-container"]},c))}}const c=(0,r.withSelect)((e=>({failedConnections:e(s.Af).getFailedConnections()})))(l)},77125:(e,t,n)=>{"use strict";n.d(t,{l:()=>m});var r=n(51112),a=n(56427),s=n(47143),o=n(86087),i=n(27723),l=n(77627),c=n(31963),u=n(51371),d=n(51475),p=n(71016);const _n=i._n,m=()=>{const{brokenConnections:e,reauthConnections:t}=(0,s.useSelect)((e=>{const t=e(c.M_);return{brokenConnections:t.getBrokenConnections(),reauthConnections:t.getMustReauthConnections()}}),[]),{connectionsPageUrl:n}=(0,l.A)(),{useAdminUiV1:i}=(0,u.n)().feature_flags,{openConnectionsModal:m}=(0,s.useDispatch)(c.M_)
_n("This post will be shared to %d connection.","This post will be shared to %d connections.",u.length,"jetpack"),u.length))):null}},9573:(e,t,n)=>{"use strict";n.d(t,{X:()=>u});var r=n(3924),a=n(85985),s=n(56427),o=n(27723),i=n(70407),l=n(71016),c=n(647);const _x=o._x,u=()=>{const e=(0,c.X)();return(0,a.Sy)()||(0,a.d9)()||(0,i.hasSocialPaidFeatures)()?null:React.createElement(s.PanelRow,{className:l.A["enhanced-features-nudge"]},React.createElement(s.Button,{key:"upgrade",variant:"link",onClick:e,href:(0,r.A)("jetpack-social-basic-plan-block-editor",{site:(0,a.GE)()||"",query:"redirect_to="+encodeURIComponent(window.location.href)})},_x("Unlock enhanced media sharing features.","Call to action to buy a new plan","jetpack")))}},70925:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var r=n(56427),a=n(86087),s=n(7162),o=n(98420),i=n(54915),l=n(80624),c=n(52367),u=n(50001),d=n(48222),p=n(96390),m=n(64636),h=n(14993),g=n(9573),f=n(41190);function b(){const{hasConnections:e,hasEnabledConnections:t,connections:n}=(0,u.A)(),{isPublicizeEnabled:b,isPublicizeDisabledBySitePlan:v}=(0,s.usePublicizeConfig)(),{attachedMedia:k}=(0,o.A)(),y=(0,i.A)(),w=k[0]?.id||y,{validationErrors:E,isConvertible:_}=(0,c.A)(n,(0,l.A)(w)[0]),C=b&&(t||k.length>0||0!==Object.keys(E).length&&!_),A=v?r.Disabled:a.Fragment,{feature_flags:x}=(0,s.getSocialScriptData)();return React.createElement(A,null,x.useAdminUiV1?React.createElement(d._,null):null,e?React.createElement(React.Fragment,null,React.createElement(r.PanelRow,null,React.createElement(h.E,null)),x.useEditorPreview&&b?React.createElement(p.n,null):null,React.createElement(g.X,null)):null,React.createElement(m.D,null),!v&&React.createElement(a.Fragment,null,C&&React.createElement(f.o,{analyticsData:{location:"editor"}})))}},62697:(e,t,n)=>{"use strict";n.d(t,{q:()=>c});var r=n(3924),a=n(97999),s=n(56427),o=n(27723),i=n(27844),l=n(51475);const __=o.__,c=()=>(0,a.siteHasFeature)(i.q.ENHANCED_PUBLISHING)?React.createElement(l.A,{type:"warning"},__("To share to Instagram, add an image/video, or enable Social Image Generator.","jetpack"),React.createElement("br",null),React.createElement(s.ExternalLink,{href:(0,r.A)("jetpack-social-share-to-instagram")},__("Learn more","jetpack"))):React.createElement(l.A,{type:"warning"},__("You need a featured image to share to Instagram.","jetpack"),React.createElement("br",null),React.createElement(s.ExternalLink,{href:(0,r.A)("jetpack-social-share-to-instagram")},__("Learn more","jetpack")))},31099:(e,t,n)=>{"use strict";n.d(t,{j:()=>p});var r=n(3924),a=n(56427),s=n(47143),o=n(86087),i=n(27723),l=n(80682),c=n(31963),u=n(51475),d=n(9515);const __=i.__,_x=i._x,p=({validationErrors:e})=>{const{getConnectionById:t}=(0,s.useSelect)((e=>e(c.M_)),[]),n=(0,d.h)(),i=(0,o.useMemo)((()=>Object.entries(e).reduce(((e,[r,a])=>{if(!a)return e;e[a]||(e[a]=[]);const s=n(t(r)?.service_name);return s&&!e[a].includes(s)&&e[a].push(s),e}),{})),[t,n,e]);return React.createElement(u.A,{type:"warning"},React.createElement("p",null,__("The selected media cannot be share to some social media platforms.","jetpack")),React.createElement("ul",null,Object.entries(i).map((([e,t])=>t.length?React.createElement("li",{key:e},React.createElement("i",null,(0,l.$m)(e)),_x(":","Colon to display before the list of social media platforms","jetpack")+" ",t.map(((e,t,{length:n})=>React.createElement(o.Fragment,{key:e},React.createElement("b",null,e),t<n-1&&_x(",","Comma to separate list of social media platforms","jetpack")+" ")))):null))),React.createElement(a.ExternalLink,{href:(0,r.A)("jetpack-social-media-support-information")},__("Troubleshooting tips","jetpack")))}},75013:(e,t,n)=>{"use strict";n.d(t,{L:()=>d});var r=n(98420),a=n(54915),s=n(80624),o=n(52367),i=n(80682),l=n(50001),c=n(62697),u=n(31099);const d=()=>{const{connections:e}=(0,l.A)(),{attachedMedia:t}=(0,r.A)(),n=(0,a.A)(),d=t[0]?.id||n,{validationErrors:p,isConvertible:m}=(0,o.A)(e,(0,s.A)(d)[0]);return Object.keys(p).length?Object.values(p).includes(i.k3)?React.createElement(c.q,null):m?null:React.createElement(u.j,{validationErrors:p}):null}
_n("%d character remaining","%d characters remaining",d,"jetpack"),d),__nextHasNoMarginBottom:!0})}},51475:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(56427),a=n(27723),s=n(51113),o=n(31249),i=n(13022),l=n(28120),c=n.n(l),u=n(93794);const __=a.__,d=({children:e,type:t="default",actions:n=[],onDismiss:a})=>{const l=(0,i.A)(u.A.notice,u.A[`notice--${t}`]);return React.createElement("div",{className:l},React.createElement("div",null," ",e," "),a&&React.createElement("button",{className:u.A.dismiss,onClick:a},React.createElement(r.VisuallyHidden,null,__("Dismiss notice","jetpack")),React.createElement(s.A,{icon:o.A})),n&&n.length>0&&React.createElement("div",{className:u.A.actions},n.map((e=>e))))};d.propTypes={children:c().node.isRequired,type:c().oneOf(["default","highlight","warning","error"]),actions:c().arrayOf(c().element),onDismiss:c().func};const p=d},66561:(e,t,n)=>{"use strict";n.d(t,{A:()=>v});var r=n(56427),a=n(47143),s=n(43656),o=n(86087),i=n(27723),l=n(77627),c=n(88584),u=n(49036),d=n(50001),p=n(51371),m=n(70925),h=n(30642),g=n(51353),f=n(1101),b=n(87170);const __=i.__,v=({prePublish:e,children:t})=>{const{refresh:n,hasConnections:i,hasEnabledConnections:v}=(0,d.A)(),k=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]),{feature_flags:y}=(0,p.n)(),w=(0,c.A)(),{isPublicizeEnabled:E,hidePublicizeFeature:_,togglePublicizeFeature:C}=(0,l.A)();(0,u._D)((function(){v&&n()}),[v,n]);const A=e?o.Fragment:r.PanelBody,x=e?{}:{title:__("Share this post","jetpack"),className:b.A.panel};return w(),React.createElement(A,x,t,!_&&React.createElement(o.Fragment,null,!k&&React.createElement(r.ToggleControl,{label:E?__("Share when publishing","jetpack"):__("Sharing is disabled","jetpack",0),onChange:C,checked:E&&i,disabled:!i,__nextHasNoMarginBottom:!0}),React.createElement(m.A,null),React.createElement(f.O,null)),k&&React.createElement(React.Fragment,null,y.useShareStatus?React.createElement(g.E,null):null,React.createElement(h.F,null)))}},65843:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(85985),a=n(47143),s=n(14309),o=n(43656),i=n(27723),l=n(34600),c=n(68541),u=n(5780);const __=i.__;function d(){const{isCurrentPostPublished:e}=(0,a.useSelect)((e=>e(o.store)),[]);return e()?React.createElement(s.PluginPostPublishPanel,{initialOpen:!0,title:__("Manual sharing","jetpack"),id:"publicize-manual-sharing",icon:React.createElement(r.jt,null)},React.createElement(l.P,{className:u.A.description,variant:"body-small"}),React.createElement(c.R,null)):null}},26029:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(50723),a=n(65843),s=n(39691),o=n(89640);const i=()=>React.createElement(r.Ay,{targetDom:document.body},React.createElement(o.p,null),React.createElement(a.A,null),React.createElement(s.A,null))},39691:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(3924),a=n(85985),s=n(1455),o=n.n(s),i=n(14309),l=n(86087),c=n(77627),u=n(49036),d=n(50001),p=n(25300);const m=()=>{const[e,t]=(0,l.useState)((0,a.$i)()?.social?.reviewRequestDismissed??!0),[n,s]=(0,l.useState)(!1),{hasEnabledConnections:m}=(0,d.A)(),{isPublicizeEnabled:h,isPostAlreadyShared:g}=(0,c.A)();(0,u.Wv)((()=>{s(!g&&h&&m)}),[g,m,h]);const f=(0,l.useCallback)((()=>{const e=(0,a.$i)()?.social?.dismissReviewRequestPath??null;o()({path:e,method:"POST",data:{dismissed:!0}}).catch((e=>{throw e})),t(!0)}),[]);return e||!n?null:React.createElement(i.PluginPostPublishPanel,{id:"publicize-title"},React.createElement(p.A,{href:(0,r.A)("jetpack-social-plugin-reviews"),onClose:f}))}},89640:(e,t,n)=>{"use strict";n.d(t,{p:()=>m});var r=n(47143),a=n(14309),s=n(43656),o=n(92214),i=n(383),l=n(57275),c=n(49036),u=n(31963),d=n(51371),p=n(79594);function m(){const{isPublicizeEnabled:e}=(0,i.h)(),{pollForPostShareStatus:t}=(0,r.useDispatch)(u.M_),{feature_flags:n}=(0,d.n)(),{isPostPublished:m}=(0,r.useSelect)((e=>({isPostPublished:e(s.store).isCurrentPostPublished()})),[]),h=(0,l.z)((0,o.P)()),g=(0,l.z)((0,r.useSelect)((e=>e(u.M_).getEnabledConnections()),[])),f=e&&g.length>0&&h,b=n.useShareStatus&&f&&m;return(0,c._D)((()=>{b&&t({isRequestComplete:({postShareStatus:e})=>e.done})}),[b]),
_n("Your post was unable to be shared to %d connection.","Your post was unable to be shared to %d connections.",u,"jetpack"),u)),React.createElement(l.JU,{variant:"link",analyticsData:{location:"post-publish-panel"}},__("Review status and try again","jetpack"))):t.done?n.length?React.createElement(React.Fragment,null,React.createElement("b",null,__("Your post was shared.","jetpack"))," ","🎉",React.createElement("p",null,(0,s.sprintf)(/* translators: %d: number of connections to which a post was shared */
_n("You post was successfuly shared to %d connection.","You post was successfuly shared to %d connections.",n.length,"jetpack"),n.length)),React.createElement(l.JU,{analyticsData:{location:e?"resharing-section":"post-publish-panel"}})):React.createElement("span",null,__("Your post was not shared.","jetpack")):React.createElement("span",null,__("The request to share your post is still in progress.","jetpack")," ",__("Please refresh and check again in a few minutes.","jetpack"))}},51353:(e,t,n)=>{"use strict";n.d(t,{E:()=>c});var r=n(47143),a=n(51609),s=n(31963),o=n(79594),i=n(7757),l=n(61420);const c=()=>{const e=(0,r.useSelect)((e=>e(s.M_).getPostShareStatus()),[]),[t,n]=(0,a.useState)(null);return(0,a.useEffect)((()=>{e.polling&&n(Date.now()/1e3)}),[e.polling]),t?React.createElement("div",{className:l.A.wrapper},React.createElement(o.q,{reShareTimestamp:t})):React.createElement(i.JU,{withWrapper:!0,analyticsData:{location:"editor"}})}},25300:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(50723),a=n(51112),s=n(85985),o=n(27723),i=n(51609),l=n(76445);const __=o.__,c=({href:e,onClose:t})=>{const{recordEvent:n}=(0,s.st)({pageViewEventName:"social_plugin_review_prompt",pageViewNamespace:"jetpack",pageViewSuffix:"view"}),c=(0,i.useCallback)((()=>{n("jetpack_social_plugin_review_prompt_new_review_click")}),[n]),u=(0,i.useCallback)((()=>{n("jetpack_social_plugin_review_prompt_dismiss_click"),t()}),[n,t]);return React.createElement(r.Ay,null,React.createElement("div",{className:l.A.prompt},React.createElement("h2",{className:l.A.header},(0,o.sprintf)(/* translators: %s is the celebration emoji */
__("Presto! %s","jetpack"),String.fromCodePoint(127881))),React.createElement("p",null,__("Just like that, Jetpack Social has shared your post to your connected social accounts.","jetpack")),React.createElement("p",null,__("Please leave a review to let others know how easy getting your posts on social media can be!","jetpack")),React.createElement("div",{className:l.A.buttons},React.createElement(a.A,{onClick:c,isExternalLink:!0,href:e,className:l.A.button},__("Leave a Review","jetpack")),React.createElement(a.A,{onClick:u,variant:"link",className:l.A.button},__("Dismiss","jetpack")))))}},53774:(e,t,n)=>{"use strict";n.d(t,{$:()=>p});var r=n(51112),a=n(47143),s=n(86087),o=n(27723),i=n(13022),l=n(31963),c=n(75018),u=n(42475),d=n(70745);const __=o.__,_x=o._x;function p({service:e,isSmall:t,onSubmit:n,displayInputs:o,hasConnections:p,buttonLabel:m}){const{setKeyringResult:h}=(0,a.useDispatch)(l.M_),{isConnectionsModalOpen:g}=(0,a.useSelect)((e=>e(l.M_)),[]),f=(0,s.useCallback)((e=>{g()&&h(e)}),[h,g]),b=(0,d.P)({service:e,onConfirm:f}),v=(0,s.useCallback)((e=>{if(e.preventDefault(),e.stopPropagation(),n)return n();const t=new FormData(e.target);b(t)}),[n,b]);return React.createElement("form",{className:(0,i.A)(u.A["connect-form"],{[u.A.small]:t}),onSubmit:v},o?React.createElement("div",{className:u.A["fields-wrapper"]},React.createElement(c.t,{service:e})):null,React.createElement("div",{className:u.A["fields-wrapper"]},React.createElement("div",{className:u.A["fields-item"]},React.createElement(r.A,{variant:p?"secondary":"primary",type:"submit",className:u.A["connect-button"]},m||(p?_x("Connect more","","jetpack"):__("Connect","jetpack"))))))}},75018:(e,t,n)=>{"use strict";n.d(t,{t:()=>u});var r=n(42266),a=n(56427),s=n(47143),o=n(86087),i=n(27723),l=n(31963),c=n(42475);const __=i.__,_x=i._x;function u({service:e}){const t=(0,o.useId)(),n=(0,s.useSelect)((e=>e(l.M_).getReconnectingAccount()),[]);return"mastodon"===e.ID?React.createElement("div",{className:c.A["fields-item"]},React.createElement("label",{htmlFor:`${t}-handle`},_x("Handle","The handle of a social media account.","jetpack")),React.createElement("input",{id:`${t}-handle`,required:!0,type:"text",name:"instance",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false","aria-label":__("Mastodon handle","jetpack"),"aria-describedby":`${t}-handle-description`,placeholder:"@mastodon@mastodon.social"}),React.createElement("p",{className:"description",id:`${t}-handle-description`},__("You can find the handle in your Mastodon profile.","jetpack"))):"bluesky"===e.ID?React.createElement(React.Fragment,null,React.createElement("div",{className:c.A["fields-item"]},React.createElement("label",{htmlFor:`${t}-handle`},_x("Handle","The handle of a social media account.","jetpack")),React.createElement("input",{id:`${t}-handle`,required:!0,type:"text",name:"handle",defaultValue:"bluesky"===n?.service_name?n?.external_handle:void 0,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false","aria-label":__("Bluesky handle","jetpack"),"aria-describedby":`${t}-handle-description`,placeholder:"username.bsky.social"}),React.createElement("p",{className:"description",id:`${t}-handle-description`},__("You can find the handle in your Bluesky profile.","jetpack"))),React.createElement("div",{className:c.A["fields-item"]},React.createElement("label",{htmlFor:`${t}-password`},__("App password","jetpack")),React.createElement("input",{id:`${t}-password`,required:!0,type:"password",name:"app_password",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false","aria-label":__("App password","jetpack"),"aria-describedby":`${t}-password-description`,placeholder:"xxxx-xxxx-xxxx-xxxx"}),React.createElement("p",{className:"description",id:`${t}-password-description`},(0,o.createInterpolateElement)(__("App password is needed to safely connect your account. App password is different from your account password. You can <link>generate it in Bluesky</link>.","jetpack"),{link:React.createElement(a.ExternalLink,{href:"https://bsky.app/settings/app-pa
// translators: %d: Number of connections
__("%d connections","jetpack"),e.length):__("Connected","jetpack"))}},78362:(e,t,n)=>{"use strict";n.d(t,{b:()=>l});var r=n(47143),a=n(31963),s=n(59008),o=n(42475),i=n(39630);function l(){const e=(0,i.o)(),t=(0,r.useSelect)((e=>e(a.M_).getConnections().reduce(((e,t)=>(e[t.service_name]||(e[t.service_name]=[]),e[t.service_name].push(t),e)),{})),[]),n=(0,r.useSelect)((e=>e(a.M_).getReconnectingAccount()),[]);return React.createElement("ul",{className:o.A.services},e.map((e=>React.createElement("li",{key:e.ID,className:o.A["service-list-item"]},React.createElement(s.j,{service:e,serviceConnections:t[e.ID]||[],isPanelDefaultOpen:n?.service_name===e.ID})))))}},70745:(e,t,n)=>{"use strict";n.d(t,{P:()=>u});var r=n(63406),a=n(47143),s=n(86087),o=n(27723),i=n(31963),l=n(70407);const __=o.__,c=e=>/^@?\b([A-Z0-9_]+)@([A-Z0-9.-]+\.[A-Z]{2,})$/gi.test(e);function u({service:e,onConfirm:t}){const{createErrorNotice:n}=(0,r.I)(),o=(0,a.useSelect)((e=>e(i.M_).isMastodonAccountAlreadyConnected),[]),u=(0,a.useSelect)((e=>e(i.M_).isBlueskyAccountAlreadyConnected),[]);return(0,s.useCallback)((r=>{const a=new URL(e.connect_URL);switch(e.ID){case"mastodon":{const e=r.get("instance").toString().trim();if(!c(e))return void n(__("Invalid Mastodon username","jetpack"));if(o?.(e))return void n(__("This Mastodon account is already connected","jetpack"));a.searchParams.set("instance",e);break}case"bluesky":{const e=(r.get("handle")?.toString()||"").trim().replace(/^@/,"");if(!function(e){const t=e.split(".").filter(Boolean);return!(t.length<2)&&t.every((e=>/^[a-z0-9_-]+$/i.test(e)))}(e))return void n(__("Invalid Bluesky handle","jetpack"));if(u?.(e))return void n(__("This Bluesky account is already connected","jetpack"));a.searchParams.set("handle",e),a.searchParams.set("app_password",(r.get("app_password")?.toString()||"").trim());break}}(0,l.requestExternalAccess)(a.toString(),t)}),[n,u,o,t,e.ID,e.connect_URL])}},9515:(e,t,n)=>{"use strict";n.d(t,{h:()=>s});var r=n(51609),a=n(48712);function s(){const e=(0,a.h)();return(0,r.useCallback)((t=>e(t)?.label||t[0].toUpperCase()+t.substring(1)),[e])}},48712:(e,t,n)=>{"use strict";n.d(t,{h:()=>s});var r=n(51609),a=n(39630);function s(){const e=(0,a.o)(),t=(0,r.useMemo)((()=>e.reduce(((e,t)=>(e[t.ID]=t,e)),{})),[e]);return(0,r.useCallback)((e=>t[e]),[t])}},39630:(e,t,n)=>{"use strict";n.d(t,{o:()=>f});var r=n(96072),a=n.n(r),s=n(78478),o=n(56427),i=n(86087),l=n(27723),c=n(30081),u=n(26818),d=n(43443),p=n(11326),m=n(65398),h=n(9791),g=n(51371);const __=l.__;function f(){const e=(0,i.useMemo)((()=>{const{supported_services:e}=(0,g.n)();return e.reduce(((e,t)=>({...e,[t.ID]:t})),{})}),[]),t={text:__("New","jetpack"),style:{background:"#e9eff5",color:"#0675C4"}};return[{...e.facebook,icon:e=>React.createElement(s.M5,a()({serviceName:"facebook"},e)),description:__("Share to your pages","jetpack"),examples:[()=>React.createElement(React.Fragment,null,(0,i.createInterpolateElement)(__("<strong>Connect</strong> to automatically share posts on your Facebook page.","jetpack"),{strong:React.createElement("strong",null)})),()=>React.createElement("img",{src:c,alt:__("Add Facebook connection","jetpack")})]},{...e["instagram-business"],icon:e=>React.createElement(s.M5,a()({serviceName:"instagram"},e)),description:__("Share to your Instagram Business account.","jetpack"),examples:[()=>React.createElement(React.Fragment,null,__("Drive engagement and save time by automatically sharing images to Instagram when you publish blog posts.","jetpack"),React.createElement("div",{className:"instagram-business__requirements"},React.createElement("h4",null,__("Requirements for connecting Instagram:","jetpack")),React.createElement("ol",null,React.createElement("li",null,__("You must have an Instagram Business account.","jetpack")),React.createElement("li",null,__("Your Instagram Business account must be linked to a Facebook page.","jetpack")))),(0,i.createInterpolateElement)(__("<i>When you click connect you'll be asked to <strong>log into Facebook</strong>. If your Instagram Business account isn't listed, ensure it's linked t
__("Share on %s","jetpack"),o);return React.createElement("div",{className:p.A.container,key:i},React.createElement(a.A,{icon:d,variant:t,"aria-label":m,href:u,target:"_blank",rel:"noopener noreferrer",onClick:b(u,{network:i}),className:"icon"===e?p.A[i]:"has-text"},"icon"===e?null:React.createElement(React.Fragment,null,"icon-text"===e&&React.createElement(r.M5,{className:p.A[i],serviceName:i}),React.createElement(s.Ay,{className:p.A.label,component:"span"},m))))})),React.createElement("div",{className:p.A.container},React.createElement(o.A,{buttonStyle:e,onCopy:g,textToCopy:f,className:"icon"===e?p.A.clipboard:" has-text",variant:t},"icon"===e?null:React.createElement(s.Ay,{className:p.A.label,component:"span"},__("Copy to clipboard","jetpack")))))}},53975:(e,t,n)=>{"use strict";n.d(t,{i:()=>i});var r=n(47143),a=n(43656),s=n(86087),o=n(383);function i(){const{shareMessage:e}=(0,o.h)(),{message:t,link:n}=(0,r.useSelect)((t=>{const{getEditedPostAttribute:n}=t(a.store);return{link:n("link"),message:e||n("meta")?.jetpack_seo_html_title||n("title")}}),[e]);return(0,s.useCallback)(((e,r=!0)=>{let a=t,s=n;return e.includes("{{url}}")||(a=a+"\n\n"+s,s=""),r&&(a=encodeURIComponent(a),s=encodeURIComponent(s)),e.replace("{{text}}",a).replace("{{url}}",s)}),[n,t])}},1101:(e,t,n)=>{"use strict";n.d(t,{O:()=>b});var r=n(85985),a=n(56427),s=n(47143),o=n(43656),i=n(86087),l=n(27723),c=n(692),u=n(92214),d=n(77627),p=n(31873),m=n(31963),h=n(51371);const __=l.__;function g(e=__("Unable to share the Post","jetpack")){const{createErrorNotice:t}=(0,s.dispatch)(c.store);t(e,{id:"publicize-post-share-message"})}function f(){const{isPublicizeEnabled:e}=(0,d.A)(),{isFetching:t,isError:n,isSuccess:l,doPublicize:f}=(0,p.A)(),b=(0,s.useSelect)((e=>e(o.store).isCurrentPostPublished()),[]),{feature_flags:v}=(0,h.n)(),{pollForPostShareStatus:k}=(0,s.useDispatch)(m.M_),{recordEvent:y}=(0,r.st)();(0,i.useEffect)((()=>{if(!t)return n?g():void(l&&function(){const{createSuccessNotice:e}=(0,s.dispatch)(c.store);e(__("Request submitted successfully.","jetpack"),{id:"publicize-post-share-message",type:"snackbar"})}())}),[t,n,l]);const w=(0,u.P)(),E=!e||!w||!b||t,_=(0,i.useCallback)((async()=>{if(!b)return g(__("You must publish your post before you can share it.","jetpack"));(0,s.dispatch)(c.store).removeNotice("publicize-post-share-message"),y("jetpack_social_reshare_clicked",{location:"editor",environment:(0,r.d9)()?"atomic":(0,r.Sy)()?"simple":"jetpack"}),await f(),v.useShareStatus&&k()}),[b,y,f,v.useShareStatus,k]);return React.createElement(a.Button,{variant:"secondary",onClick:_,disabled:E,isBusy:t},__("Share post","jetpack"))}function b(){const{isRePublicizeUpgradableViaUpsell:e}=(0,d.A)(),t=(0,s.useSelect)((e=>e(o.store).isCurrentPostPublished()),[]),{hasConnections:n}=(0,s.useSelect)((e=>e(m.M_)),[]);return t?e?null:n()?React.createElement(a.PanelRow,null,React.createElement(f,null)):null:null}},7757:(e,t,n)=>{"use strict";n.d(t,{JU:()=>a.g,Q3:()=>r.Q});var r=n(59032),a=n(95499)},95499:(e,t,n)=>{"use strict";n.d(t,{g:()=>m});var r=n(96072),a=n.n(r),s=n(85985),o=n(56427),i=n(47143),l=n(27723),c=n(51609),u=n(31963),d=n(51371),p=n(14150);const __=l.__,m=(0,c.forwardRef)((({withWrapper:e=!1,analyticsData:t=null,...n},r)=>{const{recordEvent:l}=(0,s.st)(),{openShareStatusModal:m}=(0,i.useDispatch)(u.M_),h=(0,i.useSelect)((e=>e(u.M_).getPostShareStatus()),[]),g=(0,c.useCallback)((()=>{l("jetpack_social_share_status_modal_opened",t),m()}),[t,m,l]);if(!h||!h.shares||0===h.shares.length)return null;const{feature_flags:f}=(0,d.n)();if(!f.useShareStatus)return null;const b=React.createElement(o.Button,a()({variant:"secondary",onClick:g},n,{ref:r}),n.children||__("View sharing history","jetpack"));return e?React.createElement("div",{className:p.A["trigger-wrapper"]},b):b}))},59032:(e,t,n)=>{"use strict";n.d(t,{Q:()=>d});var r=n(50723),a=n(56427),s=n(47143),o=n(27723),i=n(31963),l=n(30557),c=n(14150);const __=o.__;function u(){const{closeShareStatusModal:e}=(0,s.useDispatch)(i.M_);return React.createElement("div",{className:c.A.wrapper},React.createElement(a.Mod
__("Pick the %s template","jetpack"),t.label))))))}},10936:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(26365),a=n(45329),s=n(9509);const o=[{name:"highway",label:"Highway",image:n(22417)},{name:"dois",label:"Dois",image:r},{name:"edge",label:"Edge",image:a},{name:"fullscreen",label:"Fullscreen",image:s}]},98725:(e,t,n)=>{"use strict";n(47143),n(86087),n(51609),n(31963)},96390:(e,t,n)=>{"use strict";n.d(t,{n:()=>d});var r=n(85985),a=n(56427),s=n(86087),o=n(27723),i=n(10991),l=n(18603),c=n(94360),u=n(47944);const __=o.__;function d(){const[e,t]=(0,s.useReducer)((e=>!e),!1),{recordEvent:n}=(0,r.st)(),o=(0,s.useCallback)((()=>{e||n("jetpack_social_preview_modal_opened"),t()}),[e,n]);return React.createElement(a.PanelRow,{className:u.A.panel},e&&React.createElement(a.Modal,{onRequestClose:t,title:__("Social Previews","jetpack"),className:u.A.modal,__experimentalHideHeader:!0},React.createElement("div",{className:u.A["modal-content"]},React.createElement(c.X,null),React.createElement(l.w,null)),React.createElement(a.Button,{className:u.A["close-button"],onClick:t,icon:i.A,label:__("Close","jetpack")})),React.createElement(a.Button,{variant:"secondary",onClick:o},__("Preview social posts","jetpack")))}},98588:(e,t,n)=>{"use strict";n.d(t,{z:()=>E});var r=n(96072),a=n.n(r),s=n(29103),o=n(73188),i=n(73066),l=n(57984),c=n(48914),u=n(83945),d=n(73915),p=n(89075),m=n(95550),h=n(3582),g=n(47143),f=n(86087),b=n(18537),v=n(27723),k=n(39553),y=n(62697),w=n(31137);const __=v.__;function E({connection:e}){const t=(0,f.useMemo)((()=>({displayName:e.display_name,profileImage:e.profile_picture,externalName:e.external_handle})),[e]),{image:n,media:r,title:v,description:E,url:_,excerpt:C}=(0,w.s)(),A=((0,k.A)().message||"").trim(),x=(0,f.useMemo)((()=>({description:E,image:n,media:r,title:v,url:_})),[E,n,r,v,_]),j=(0,g.useSelect)((e=>{const{getUnstableBase:t}=e(h.store);return(0,b.decodeEntities)(t(void 0)?.name)}),[]),S=r?.some((({type:e})=>e.startsWith("image/")||e.startsWith("video/")));switch(e.service_name){case"bluesky":{const e=r?.[0],n=e?.type.startsWith("image/")?e.url:null;return React.createElement(s.O,a()({},x,{description:(0,b.decodeEntities)(C),user:{avatarUrl:t.profileImage,address:t.externalName,displayName:t.displayName},customText:(0,b.decodeEntities)(A||`${v}\n\n${C.replaceAll(/[\s\n]/g," ")}`),customImage:n}))}case"facebook":return S?React.createElement(o.h,a()({},x,{type:"article",customText:A||C||v,user:{...t,avatarUrl:t.profileImage}})):React.createElement(i.l,a()({},x,{type:"article",customText:A||C||v,user:{...t,avatarUrl:t.profileImage}}));case"instagram-business":{const e=Boolean(n);return S||e?React.createElement(l.l,a()({},x,{image:r?.[0]?.url||n,name:t.displayName,profileImage:t.profileImage,caption:A||v||E})):React.createElement(y.q,null)}case"linkedin":return React.createElement(c.$,a()({},x,{jobTitle:__("Job Title (Company Name)","jetpack"),name:t.displayName,profileImage:t.profileImage,description:A||v||E}));case"mastodon":{const e=r?.[0],n=e?.type.startsWith("image/")?e.url:null;return React.createElement(u._,a()({},x,{description:C,siteName:j,user:{avatarUrl:t.profileImage,address:t.displayName,displayName:t.displayName},customText:A,customImage:n}))}case"nextdoor":{const e=`${A||v||E} ${r.length?_:""}`.trim();return React.createElement(d.K,a()({},x,{description:e,name:t.displayName,profileImage:t.profileImage}))}case"threads":{let e=v;A?e=A:v&&C&&(e=`${v}\n\n${C}`);const n=500-_.length-2;return e=(0,b.decodeEntities)(e).slice(0,n),e+=`\n\n${_}`,React.createElement(p.s,a()({},x,{caption:e,name:t.displayName,profileImage:t.profileImage}))}case"tumblr":return React.createElement(m.B,a()({},x,{user:{displayName:t.displayName,avatarUrl:t.profileImage},customText:A}));default:return null}}},18603:(e,t,n)=>{"use strict";n.d(t,{w:()=>h});var r=n(85985),a=n(56427),s=n(47143),o=n(27723),i=n(51609),l=n(31963),c=n(12141),u=n(39329),d=n(48712),p=n(98588),m=n(47944);const __=o.__,_x=o._x;function h(){const{recordEvent:e}=(0,r.st)(),t=(0,d.h)(),{canBeTurnedOn:n,shouldBeDisabled:o}=(0,u.j)(),h=(0,s.useSelect)((e=>e(l.
__("%s account connected successfully.","jetpack"),o.service_label),{type:"snackbar",isDismissible:!0}),n.select(i.store).getCurrentPostId()&&a(w()))}catch(e){let t=__("Error connecting account.","jetpack");"object"==typeof e&&"message"in e&&e.message&&(t=`${t} ${e.message}`),c(t,{type:"snackbar",isDismissible:!0})}finally{a(N(d,!1)),a(_(d))}}}function S(e,t){return{type:u.dw,connectionId:e,data:t}}function N(e,t=!0){return{type:u._6,connectionId:e,updating:t}}function R(e){return{type:u.Nv,reconnectingAccount:e}}function P(e,t){return async function({dispatch:n,select:a}){const{createErrorNotice:i,createSuccessNotice:l}=(0,o.dispatch)(r.store),c=a.getConnectionById(e);try{const r=`/wpcom/v2/publicize/connections/${e}`;n(k()),n(S(e,t)),n(N(e));await s()({method:"POST",path:r,data:t})&&l(__("Account updated successfully.","jetpack"),{type:"snackbar",isDismissible:!0})}catch(t){let r=__("Error updating account.","jetpack");"object"==typeof t&&"message"in t&&t.message&&(r=`${r} ${t.message}`),n(S(e,c)),i(r,{type:"snackbar",isDismissible:!0})}finally{n(N(e,!1))}}}function L(e){return{type:u.xW,isOpen:e}}function T(){return L(!0)}function M(){return L(!1)}},54118:(e,t,n)=>{"use strict";n.d(t,{BN:()=>d,Bc:()=>a,M6:()=>k,Nv:()=>u,WB:()=>m,WH:()=>i,Wp:()=>h,_6:()=>c,_y:()=>v,aF:()=>y,af:()=>s,b5:()=>g,dA:()=>r,dw:()=>l,fz:()=>b,nC:()=>o,rz:()=>f,xW:()=>p});const r="SET_CONNECTIONS",a="ADD_CONNECTION",s="TOGGLE_CONNECTION",o="DELETE_CONNECTION",i="DELETING_CONNECTION",l="UPDATE_CONNECTION",c="UPDATING_CONNECTION",u="SET_RECONNECTING_ACCOUNT",d="SET_KEYRING_RESULT",p="TOGGLE_CONNECTIONS_MODAL",m="ADD_ABORT_CONTROLLER",h="REMOVE_ABORT_CONTROLLERS",g="DEFAULT",f="REFRESH_CONNECTIONS",b="FETCH_POST_SHARE_STATUS",v="RECEIVE_POST_SHARE_STATUS",k="TOGGLE_SHARE_STATUS_MODAL",y="POLLING_FOR_POST_SHARE_STATUS"},62491:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(38716),a=n(8773),s=n(72451),o=n(64236),i=n(63491),l=n(95660);const c={...s,...r,...o,...n(83117),...l,...a,...i}},8773:(e,t,n)=>{"use strict";n.r(t),n.d(t,{setShowPricingPage:()=>s});var r=n(3582),a=n(75238);function s(e){return async function({registry:t}){const{saveSite:n}=t.dispatch(r.store);await n({[a.HN]:e})}}},72451:(e,t,n)=>{"use strict";n.r(t),n.d(t,{closeShareStatusModal:()=>c,defaultIsRequestComplete:()=>u,fetchPostShareStatus:()=>s,openShareStatusModal:()=>l,pollForPostShareStatus:()=>h,pollingForPostShareStatus:()=>m,receivePostShareStaus:()=>o,toggleShareStatusModal:()=>i});var r=n(43656),a=n(54118);function s(e,t=!0){return{type:a.fz,postId:e,loading:t}}function o(e,t){return{type:a._y,shareStatus:e,postId:t}}function i(e){return{type:a.M6,isOpen:e}}function l(){return i(!0)}function c(){return i(!1)}const u=({lastTimestamp:e,postShareStatus:t})=>e?t.shares.some((t=>t.timestamp>e)):t.shares.length>0,d=6e4,p=3e3;function m(e,t=!0){return{type:a.aF,postId:e,polling:t}}function h({pollingInterval:e=p,postId:t,isRequestComplete:n=u,timeout:a=d}={}){return async function({dispatch:s,select:o,registry:i}){const l=Date.now(),c=t||i.select(r.store).getCurrentPostId(),u=o.getPostShareStatus(c).shares[0]?.timestamp||0;let d=!1,p=!1;s(m(c));do{o.getPostShareStatus(c).loading||s.invalidateResolution("getPostShareStatus",[c]),await new Promise((t=>setTimeout(t,e))),d=n({lastTimestamp:u,postShareStatus:o.getPostShareStatus(c)}),p=Date.now()-l>a}while(!d&&!p);s(m(c,!1))}}},64236:(e,t,n)=>{"use strict";n.r(t),n.d(t,{updateSocialImageGeneratorConfig:()=>s});var r=n(3582),a=n(75238);function s(e){return async function({registry:t}){const{saveSite:n}=t.dispatch(r.store);await n({[a.Am]:e})}}},63491:(e,t,n)=>{"use strict";n.r(t),n.d(t,{updateSocialModuleSettings:()=>s});var r=n(3582),a=n(70407);function s(e){return async function({registry:t}){const{socialToggleBase:n}=(0,a.getSocialScriptData)().api_paths,{saveEntityRecord:s}=t.dispatch(r.store);await s("jetpack/v4",n,e)}}},95660:(e,t,n)=>{"use strict";n.r(t),n.d(t,{toggleSocialNotes:()=>s,updateSocialNotesConfig:()=>o});var r=n(3582),a=n(75238);function s(e){return async function({registry:t}){const{saveSite:n}=t.dispatch(r.store);
// Translators: %s is the date when the requests will reset.
const n=__("Requests will reset on %s.","jetpack");return`${t} ${(0,l.sprintf)(n,e)}`})((e=>{if(!e?.nextStart)return null;const t=new Date(e.nextStart);return t.toLocaleString("default",{month:"long"})+" "+t.getDate()})(e));return(0,i.createInterpolateElement)(t,{link:(0,r.createElement)("a",{href:"https://jetpack.com/redirect/?source=ai-assistant-fair-usage-policy",target:"_blank",rel:"noreferrer"})})})();return"muted"===e?(0,r.createElement)("span",{className:"jetpack-ai-fair-usage-notice-muted-variant"},t):"error"===e?(0,r.createElement)(o.Notice,{status:"error",isDismissible:!1,className:"jetpack-ai-fair-usage-notice"},t):null},v=e=>{const{upgradeType:t,currentTier:n}=(0,m.A)();return 1===n?.value?(0,r.createElement)(b,null):"vip"===t?(({description:e=null,useLightNudge:t=!1})=>{const n=t?g.U:d.c,a=(0,i.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. <strong>Please reach out to your VIP account team.</strong>","jetpack"),{strong:(0,r.createElement)("strong",null)});return(0,r.createElement)(n,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:e||a,goToCheckoutPage:null,isRedirecting:null,visible:!0,align:null,title:null,context:null})})({description:e.description,useLightNudge:e?.useLightNudge}):(({placement:e=null,description:t=null,useLightNudge:n=!1})=>{const o=n?g.U:d.c,{checkoutUrl:c}=(0,p.A)(),u=(0,h.C)(),{nextTier:b,tierPlansEnabled:v,currentTier:k,requestsCount:y}=(0,m.A)(),{tracks:w}=(0,s.st)(),E=(0,i.useCallback)((()=>{f("upgrade",e),w.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:k?.slug,requests_count:y,placement:e})}),[k,y,w,e]),_=(0,i.useCallback)((()=>{f("contact us",e),w.recordEvent("jetpack_ai_upgrade_contact_us",{placement:e})}),[w,e]);if(!u){const e=(0,i.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! <strong>Reach out to the site administrator to upgrade and keep using Jetpack AI.</strong>","jetpack"),{strong:(0,r.createElement)("strong",null)});return(0,r.createElement)(o,{showButton:!1,className:"jetpack-ai-upgrade-banner",description:t||e,visible:!0,align:null,title:null,context:null})}if(v){if(!b){const e=(0,a.A)("jetpack-ai-tiers-more-requests-contact"),n=__("You have reached the request limit for your current plan.","jetpack");return(0,r.createElement)(o,{buttonText:__("Contact Us","jetpack"),description:t||n,className:"jetpack-ai-upgrade-banner",checkoutUrl:e,visible:!0,align:null,title:null,context:null,goToCheckoutPage:_,target:"_blank"})}const e=(0,i.createInterpolateElement)((0,l.sprintf)(/* Translators: number of requests */
__("You have reached the requests limit for your current plan. <strong>Upgrade now to increase your requests limit to %d.</strong>","jetpack"),b.limit),{strong:(0,r.createElement)("strong",null)});return(0,r.createElement)(o,{buttonText:(0,l.sprintf)(/* Translators: number of requests */
__("Upgrade to %d requests","jetpack"),b.limit),checkoutUrl:c,className:"jetpack-ai-upgrade-banner",description:t||e,goToCheckoutPage:E,visible:!0,align:"center",title:null,context:null,target:"_blank"})}return(0,r.createElement)(o,{buttonText:"Upgrade",checkoutUrl:c,className:"jetpack-ai-upgrade-banner",description:(0,i.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! <strong>Upgrade now to keep using it.</strong>","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:E,visible:!0,align:null,title:null,context:null,target:"_blank"})})(e)}},93094:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(82170),a=n(56427),s=n(27723);const __=s.__,o=({title:e,description:t,buttonText:n=null,checkoutUrl:s=null,goToCheckoutPage:o=null,isRedirecting:i=!1,showButton:l=!0,target:c="_top"})=>{const u=__("Redirecting…","jetpack");return(0,r.createElement)("div",{className:"jetpack-upgrade-plan-banner-light"},(0,r.createElement)(a.Notice,{status:"error",isDismissible:!1},(0,r.createElement)("p",null,e&&(0,r.createElement)("strong",null,e),t," ",l&&(0,r.createElement)(a.Button,{href:i?null:s,onClick:o,variant:"link",target:c},i?u:n))))}},62402:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>m,US:()=>u,hN:()=>p});var r=n(82170),a=n(96865),s=n(85985),o=n(56427),i=n(27723),l=n(29115);n(51609);const __=i.__,c=["formal","informal","optimistic","humorous","serious","skeptical","empathetic","confident","passionate","provocative"],u="formal",d=({value:e,onChange:t})=>(0,r.createElement)(o.MenuGroup,{label:__("Select tone","jetpack")},c.map((n=>(0,r.createElement)(o.MenuItem,{key:`key-${n}`,onClick:()=>t(n),isSelected:e===n},`${a.oZ[n].emoji} ${a.oZ[n].label}`))));function p({label:e=a.uQ,value:t=u,onChange:n,disabled:s=!1}){return(0,r.createElement)(o.DropdownMenu,{icon:a.Qr,label:e,className:"ai-assistant__tone-dropdown",popoverProps:{variant:"toolbar"},toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__tone-dropdown__toggle-label"},e),(0,r.createElement)(o.Icon,{icon:l.A})),disabled:s}},(({onClose:e})=>(0,r.createElement)(d,{value:t,onChange:t=>{n(t),e()}})))}function m({value:e=u,onChange:t,disabled:n=!1}){const{tracks:i}=(0,s.st)();return n?(0,r.createElement)(o.Tooltip,{text:a.uQ},(0,r.createElement)(o.Button,{disabled:!0},(0,r.createElement)(o.Icon,{icon:a.Qr}))):(0,r.createElement)(o.ToolbarDropdownMenu,{icon:a.Qr,label:a.uQ,popoverProps:{variant:"toolbar"},disabled:n,onToggle:e=>{e&&i.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"tone"})}},(()=>(0,r.createElement)(d,{value:e,onChange:t})))}},51698:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(82170),a=n(96865),s=n(94715),o=n(56427),i=n(27723),l=n(83883),c=n(83822),u=n(2162),d=n(99050),p=n(33468),m=n(62402);const __=i.__,h=({contentIsLoaded:e,getSuggestionFromOpenAI:t,retryRequest:n,handleAcceptContent:i,handleTryAgain:h,showRetry:g,contentBefore:f,hasPostTitle:b,wholeContent:v,setUserPrompt:k,recordEvent:y,isGeneratingTitle:w})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.BlockControls,null,!g&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.ToolbarGroup,null,(0,r.createElement)(p.Ay,{hasContentBefore:!!f?.length,hasContent:!!v?.length,hasPostTitle:b,contentIsLoaded:e,onPromptSelect:e=>{y("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"prompt-template",prompt:e.original}),k(e.translated)},onSuggestionSelect:e=>{y("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:e}),t(e)}})),(0,r.createElement)(s.BlockControls,{group:"block"},(0,r.createElement)(m.Ay,{value:"neutral",onChange:n=>{y("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:a.eJ}),t(a.eJ,{tone:n,contentType:e?"generated":null})},disabled:!e&&!v?.length}),(0,r.createElement)(u.Ay,{value:"en",onChange:n=>{y("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:a.Gm}),t(a.Gm,{language:n,contentType:e?"generated":null})},disabled:!e&&!v?.length})
_n("visitor","visitors",parseInt(x),"jetpack",0),N=/* Translators: Number of views */
_n("hit","hits",parseInt(x),"jetpack",0);return(0,r.createElement)("div",A,(0,r.createElement)(l.InspectorControls,null,(0,r.createElement)(p.z,{attributes:e,setAttributes:n})),(0,r.createElement)("div",{className:t},o||null===k?(0,r.createElement)("p",{className:"jetpack-blog-stats__loading"},__("Loading stats…","jetpack")):(0,r.createElement)("p",null,(0,r.createElement)("span",null,(0,a.A)(x)," "),(0,r.createElement)(l.RichText,{tagName:"span",placeholder:"visitors"===b?S:N,value:f,allowedFormats:["core/bold","core/italic","core/link"],onChange:e=>n({label:e})}))))}},95184:(e,t,n)=>{"use strict";var r=n(74997),a=n(94375),s=n(35116),o=n(20201);(0,a.M)(s,{edit:o.A,save:()=>null,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"blog-stats"===e,transform:({instance:e})=>{const t=e.raw.title?(0,r.createBlock)("core/heading",{content:e.raw.title,level:3}):null,n=(0,r.createBlock)("jetpack/blog-stats",{label:e.raw.hits});return t?[t,n]:n}}]}})},51744:(e,t,n)=>{"use strict";n.d(t,{k:()=>l});var r=n(82170),a=n(85985),s=n(56427),o=n(27723),i=n(35116);const __=o.__,l=({className:e,isLoading:t,changeStatus:n})=>{const o=(0,a.d9)()?"https://wordpress.com/support/stats/":"https://jetpack.com/support/jetpack-stats/";return(0,r.createElement)("div",{className:e},(0,r.createElement)(s.Placeholder,{icon:(0,a.sh)(i),instructions:__("You'll need to activate the Stats module to use this block. Please note that hits are only counted while this module is active.","jetpack"),label:i.title},(0,r.createElement)(s.Button,{disabled:t,isBusy:t,onClick:()=>n(!0),variant:"secondary"},t?__("Activating Stats","jetpack"):__("Activate Stats","jetpack",0)),(0,r.createElement)("div",null,(0,r.createElement)(s.ExternalLink,{href:o},__("Learn more about the Stats module.","jetpack")))))}},12169:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var r=n(82170),a=n(1455),s=n.n(a),o=n(94715),i=n(56427),l=n(47143),c=n(86087),u=n(27723),d=n(93832),p=n(13022),m=n(54919),h=n(9075);const __=u.__,_x=u._x;const g=(0,i.withNotices)((function({attributes:e,noticeOperations:t,noticeUI:n,setAttributes:a}){const g=(0,c.useRef)(!1),{answersLink:f,answersLinkText:b,gravatars:v,promptFetched:k,promptId:y,promptLabel:w,promptText:E,showLabel:_,showResponses:C,tagsAdded:A,isBloganuary:x}=e,j=(0,o.useBlockProps)({className:"jetpack-blogging-prompt"});(0,h.J)(y,A,(e=>a({tagsAdded:e})));const S=(0,l.useSelect)((e=>{const{getEntityRecord:t,hasFinishedResolution:n}=e("core"),r=t("root","site")?.language||"en_US";return n("getEntityRecord",["root","site"])?r:null}),[]);(0,c.useEffect)((()=>{if(!S||g.current||k)return;const e=()=>{a({promptFetched:!1,promptId:null,tagsAdded:!1}),g.current=!1,t.removeAllNotices()};let n="/wpcom/v3/blogging-prompts";if(y)n+="/"+encodeURIComponent(y);else{const e=new Date;n+=`?after=--${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}&order=desc`}n=(0,d.addQueryArgs)(n,{_locale:S,force_year:(new Date)?.getFullYear()}),g.current=!0,s()({path:n}).then((e=>{const t=y?e:e[0],n=(0,m.i)(S);a({answersLink:t.answered_link+`?locale=${n}`,answersLinkText:t.answered_link_text,gravatars:t.answered_users_sample.map((({avatar:e})=>({url:e}))),promptFetched:!0,promptLabel:t.label,promptText:t.text,promptId:t.id,isBloganuary:!!t.bloganuary_id})})).catch((n=>{a({promptFetched:!0});const s="rest_post_invalid_id"===n.code&&y?(o=y,(0,r.createElement)(r.Fragment,null,(0,u.sprintf)(/* translators: %d is the prompt id. */
2023-12-07 09:44:11 +01:00
__("Prompt with id %d not found.","jetpack"),o)," ",(0,r.createElement)(i.Button,{variant:"link",onClick:e},__("Reset prompt","jetpack")))):(t=>(0,r.createElement)(r.Fragment,null,(0,u.sprintf)(/* translators: %s is the error message. */
2025-02-28 08:42:11 +01:00
__("Error while fetching prompt: %s","jetpack"),t)," ",(0,r.createElement)(i.Button,{variant:"link",onClick:e},__("Retry","jetpack"))))(n.message);var o;t.removeAllNotices(),t.createErrorNotice(s)}))}),[g,t,k,y,a,S]);const N=e=>{a({showLabel:e})},R=e=>{a({showResponses:e})},P=(0,p.A)(["jetpack-blogging-prompt__label"],{"is-bloganuary-icon":x});return(0,r.createElement)("div",j,n,(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.InspectorControls,null,(0,r.createElement)(i.PanelBody,{title:_x("Settings","title of block settings sidebar section","jetpack")},(0,r.createElement)(i.ToggleControl,{label:__("Show prompt label","jetpack"),checked:_,onChange:N,__nextHasNoMarginBottom:!0}),(0,r.createElement)(i.ToggleControl,{label:__("Show other responses","jetpack"),checked:C,onChange:R,__nextHasNoMarginBottom:!0})))),k?(0,r.createElement)(r.Fragment,null,_&&(0,r.createElement)("div",{className:P},w),(0,r.createElement)("div",{className:"jetpack-blogging-prompt__text"},E),C&&y&&(0,r.createElement)("div",{className:"jetpack-blogging-prompt__answers"},v&&v.slice(0,3).map((({url:e})=>e&&(0,r.createElement)("img",{className:"jetpack-blogging-prompt__answers-gravatar",src:e,key:e}))),(0,r.createElement)("a",{className:"jetpack-blogging-prompt__answers-link",href:f,target:"_blank",rel:"external noreferrer noopener"},b))):(0,r.createElement)("div",{className:"jetpack-blogging-prompt__spinner"},(0,r.createElement)(i.Spinner,null)))}))},87888:(e,t,n)=>{"use strict";var r=n(74997),a=n(47143),s=n(27723),o=n(94375),i=n(27734),l=n(32442),c=n(12169),u=n(63757),d=n(94530),p=n(86239),m=n(57028);const __=s.__;(0,o.M)(l,{edit:c.A,save:m.A,example:{attributes:{answersLink:"https://wordpress.com/tag/dailyprompt",answersLinkText:__("View all responses","jetpack"),gravatars:[{url:u},{url:d},{url:p}],promptLabel:__("Daily writing prompt","jetpack"),promptText:__("What's your favorite place to visit?","jetpack"),promptFetched:!0,promptId:1234,showResponses:!0,showLabel:!0,tagsAdded:!0,isBloganuary:!1}}}),function(){const e=new URL(document.location.href);if(!e.pathname.endsWith("/wp-admin/post-new.php"))return;const t=e.searchParams.get("answer_prompt")??"0",n=parseInt(t);n&&async function(e){await(0,i.O)();const{insertBlocks:t}=(0,a.dispatch)("core/block-editor");t([(0,r.createBlock)(`jetpack/${name}`,{promptFetched:!1,promptId:e,tagsAdded:!0}),(0,r.createBlock)("core/paragraph")],0,void 0,!1)}(n)}()},57028:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(94715),s=n(13022);const o=function({attributes:e}){const{answersLink:t,answersLinkText:n,gravatars:o,promptId:i,promptLabel:l,promptText:c,showLabel:u,showResponses:d,isBloganuary:p}=e,m=a.useBlockProps.save({className:"jetpack-blogging-prompt"}),h=(0,s.A)(["jetpack-blogging-prompt__label"],{"is-bloganuary-icon":p});return(0,r.createElement)("div",m,u&&(0,r.createElement)("div",{className:h},l),(0,r.createElement)("div",{className:"jetpack-blogging-prompt__text"},c),d&&i&&(0,r.createElement)("div",{className:"jetpack-blogging-prompt__answers"},o.map((({url:e})=>e&&(0,r.createElement)("img",{className:"jetpack-blogging-prompt__answers-gravatar","aria-hidden":"true",src:e,key:e}))),(0,r.createElement)("a",{className:"jetpack-blogging-prompt__answers-link",href:t,target:"_blank",rel:"external noreferrer noopener"},n)))}},9075:(e,t,n)=>{"use strict";n.d(t,{J:()=>c});var r=n(1455),a=n.n(r),s=n(47143),o=n(86087),i=n(89877);function l(e){const t=(0,i.escapeHTML)(e);return a()({path:"/wp/v2/tags",method:"POST",data:{name:t}}).catch((t=>"term_exists"!==t.code?Promise.reject(t):Promise.resolve({id:t.data.term_id,name:e})))}function c(e,t,n){const{editPost:r}=(0,s.useDispatch)("core/editor"),a=(0,o.useRef)("not-started"),{postType:i,postsSupportTags:c,tags:u,tagIds:d,tagsHaveResolved:p}=(0,s.useSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getEntityRecords:n,getPostType:r,hasFinishedResolution:a}=e("core"),s=t("tags"),o={_fields:"id,name",context:"view",include:s?.join(","),per_page:-1};return{postType:t("type"),postsSupportTags:r("post")?.taxonomies.includes("post_tag"),tagI
__("No sites found for %s.","jetpack"),n))),e.length>0&&(0,r.createElement)("ul",{"aria-live":"polite"},e.map((e=>{const n=i.some((t=>t?.id===e?.blog_id));return(0,r.createElement)("li",{key:e.blog_id,className:"jetpack-blogroll__appender-result-container"},(0,r.createElement)("button",{className:"jetpack-blogroll__appender-result-title",disabled:n,onClick:()=>t(e)},(0,r.createElement)("div",{className:"jetpack-blogroll__appender-result-image"},e.site_icon&&(0,r.createElement)("img",{src:e.site_icon,alt:e.name,onError:e=>{e.target.parentNode.classList.add("empty-site-icon")}})),(0,r.createElement)("div",{className:"jetpack-blogroll__appender-result-text"},(0,r.createElement)("span",{className:"jetpack-blogroll__appender-result-title"},e.name),(0,r.createElement)("span",{className:"jetpack-blogroll__appender-result-description"},e.description))))}))))}},17454:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(56427),s=n(27723);const __=s.__;function o({value:e,onChange:t}){return(0,r.createElement)("div",{className:"jetpack-blogroll__appender-search"},(0,r.createElement)(a.TextControl,{__nextHasNoMarginBottom:!0,label:__("Search for sites to add","jetpack"),hideLabelFromVision:!0,placeholder:__("Search…","jetpack"),value:e,onChange:e=>t(e)}))}},37127:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(82170),a=n(56427),s=n(47143),o=n(86087),i=n(27723),l=n(45459),c=n(92507),u=n(85101),d=n(40536),p=n(17454);const __=i.__;function m({isLoading:e,subscriptions:t,clientId:n}){const[i,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(),[f,b]=(0,o.useState)(""),{insertBlock:v}=(0,s.dispatch)("core/block-editor"),{siteDetails:k,isLoading:y}=(0,c.A)({siteURL:f,subscriptions:t,enabled:f});return e?(0,r.createElement)(a.Spinner,{className:"jetpack-blogroll__appender-spinner"}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.Button,{className:"block-editor-button-blogroll-block-appender",ref:g,icon:l.A,label:__("Add Blogroll Item","jetpack"),onClick:()=>{m((e=>!e))}}),i&&(0,r.createElement)(a.Popover,{anchor:h,className:"jetpack-blogroll__appender"},(0,r.createElement)(p.A,{value:f,onChange:b}),(0,r.createElement)(d.A,{results:k,onSelect:e=>{v((0,u.FN)(e),void 0,n),m(!1)},searchInput:f,isLoading:y})))}},63166:(e,t,n)=>{"use strict";n.d(t,{A:()=>v});var r=n(82170),a=n(94715),s=n(74997),o=n(56427),i=n(47143),l=n(86087),c=n(27723),u=n(13022),d=n(2274),p=n(26247),m=n(37127),h=n(32130),g=n(46542),f=n(25688),b=n(85101);const __=c.__;const v=function({className:e,attributes:t,setAttributes:n,clientId:c}){const{show_avatar:v,show_description:k,open_links_new_window:y,ignore_user_blogs:w,load_placeholders:E}=t,_=(0,p.A)(),{isLoading:C,recommendations:A,errorMessage:x}=(0,h.A)(E),{isLoading:j,subscriptions:S,errorMessage:N}=(0,f.A)({ignore_user_blogs:w});(0,g.b)({clientId:c});const{replaceInnerBlocks:R}=(0,i.dispatch)("core/block-editor");(0,l.useEffect)((()=>{if(E&&A.length){n({load_placeholders:!1});const e=[(0,s.createBlock)("core/heading",{content:__("Blogroll","jetpack"),level:3}),...A.map(b.dy)];R(c,e)}}),[A,E,n,c,R]);const P=(0,a.useBlockProps)({className:(0,u.A)(e,{"hide-avatar":!v,"hide-description":!k})});if(!_)return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(d.A,{block:"Blogroll",explanation:__("Connect your WordPress.com account to use the Blogroll block.","jetpack")}));const L=x||N;return(0,r.createElement)("div",P,(0,r.createElement)(a.InnerBlocks,{template:[["core/heading",{content:__("Blogroll","jetpack"),level:3}]],allowedBlocks:["jetpack/blogroll-item"],renderAppender:()=>!C&&(0,r.createElement)(m.A,{isLoading:j,subscriptions:S,clientId:c})}),L&&(0,r.createElement)(o.Notice,{status:"error",isDismissible:!1},(0,r.createElement)("p",null,L)),E&&C&&(0,r.createElement)(o.FlexBlock,{style:{padding:"30px",textAlign:"center"}},(0,r.createElement)(o.Spinner,null)),(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(o.PanelBody,{title:__("Settings","jetpack")},(0,r.createElement)(o.ToggleControl,{label:__("Show avatar","jetpack"),checked:!!v,onChange:()=>n({show_avatar:!v}),__nextHasNoMarginBottom:!
// translators: %s is a link to the cookie policy.
__("Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use. To find out more, including how to control cookies, see here: %s.","jetpack"),`<a href="https://automattic.com/cookies/">${__("Cookie Policy","jetpack")}</a>`)},15216:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(96072),a=n.n(r),s=n(82170),o=n(94715),i=n(56427),l=n(27723),c=n(68071),u=n(34839);const __=l.__;const d=function({clientId:e,attributes:t,setAttributes:n}){const{consentExpiryDays:r,align:d,text:p=c.a}=t;(0,u.w)(e);const m=(0,o.useBlockProps)({className:`wp-block-jetpack-cookie-consent align${d}`});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(o.InspectorControls,null,(0,s.createElement)(i.PanelBody,{title:__("Block Settings","jetpack")},(0,s.createElement)(i.SelectControl,{label:__("Alignment","jetpack"),value:d,options:[{label:(0,l.isRTL)()?__("Right","jetpack"):__("Left","jetpack"),value:"left"},{label:__("Full","jetpack"),value:"full"},{label:__("Wide","jetpack"),value:"wide"},{label:(0,l.isRTL)()?__("Left","jetpack"):__("Right","jetpack"),value:"right"}],onChange:e=>function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};n({...t,align:e})}(e),__nextHasNoMarginBottom:!0}),(0,s.createElement)(i.TextControl,{label:__("Consent Expiry Time (in days)","jetpack"),value:r,type:"number",min:"1",max:"365",onChange:e=>n({consentExpiryDays:parseInt(e)}),__nextHasNoMarginBottom:!0}),(0,s.createElement)("p",null,__("Note: The block position in the editor is not indicative of the position on the front end. The block will always be positioned at the bottom of the page.","jetpack")))),(0,s.createElement)("div",a()({},m,{style:m.style}),(0,s.createElement)(o.RichText,{tagName:"p",value:p,onChange:e=>n({text:e})}),(0,s.createElement)(o.InnerBlocks,{allowedBlocks:["core/button"],template:[["core/button",{text:__("Accept","jetpack")}]],templateLock:"all"})))}},78165:(e,t,n)=>{"use strict";var r=n(94375),a=n(74095),s=n(15216),o=n(75757);(0,r.M)(a,{edit:s.A,save:o.A})},75757:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(96072),a=n.n(r),s=n(82170),o=n(94715),i=n(68071);function l({attributes:e}){const t=o.useBlockProps.save(),{text:n=i.a,consentExpiryDays:r}=e;return(0,s.createElement)("div",a()({},t,{style:t.style,role:"dialog","aria-modal":"true"}),(0,s.createElement)(o.RichText.Content,{tagName:"p",value:n}),(0,s.createElement)(o.InnerBlocks.Content,null),(0,s.createElement)("span",null,r))}},34839:(e,t,n)=>{"use strict";n.d(t,{w:()=>l});var r=n(74997),a=n(29491),s=n(3582),o=n(47143),i=n(86087);function l(e){const t=(0,o.useSelect)((e=>{const{isSavingPost:t,isSavingNonPostEntityChanges:n}=e("core/editor");return t()||n()}),[]),n=!(!(0,a.usePrevious)(t)||t),[,l]=(0,s.useEntityProp)("root","site","cookie_consent_template"),{saveEditedEntityRecord:c}=(0,o.useDispatch)(s.store),[u,d]=(0,i.useState)(!1),p=(0,o.useSelect)((e=>{const{getBlock:t}=e("core/block-editor");return t})),m=(0,i.useCallback)((e=>{d(!0),l(e),c("root","site",void 0,{cookie_consent_template:e}).finally((()=>{d(!1)}))}),[d,l,c]);(0,i.useEffect)((()=>()=>{p(e)||m(null)}),[]),(0,i.useEffect)((()=>{n&&!u&&m((0,r.serialize)([p(e)]))}),[n,u,m,p,e])}},75800:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(82170),a=n(4567),s=n(3975),o=n(94715),i=n(86087),l=n(13022),c=n(72730);const u=({className:e=null,currency:t=null,defaultValue:n=null,disabled:u=!1,label:d="",onChange:p=null,value:m=""})=>{const[h,g]=(0,i.useState)((0,a.Ay)(m,t,{symbol:""})),[f,b]=(0,i.useState)(!1),[v,k]=(0,i.useState)(!1),y=(0,i.useRef)(null),w=(0,i.useCallback)(((e,n)=>{g((r=>{if(e!==r){const r=(0,c.C_)(e,t);r&&r>=(0,c.dv)(t)?(k(!1),n&&p?.(r)):k(!0)}return e}))}),[t,p]),E=()=>{y.current&&(y.current.focus(),b(!0))};return(0,i.useEffect)((()=>{if(!y.current)return;const e=y.current,r=()=>{b(!1),h||w((0,a.Ay)(n,t,{symbol:""}))};return e.addEventListener("blur",r),()=>{e.removeEventListener("blur",r)}}),[t,n,h,y,w]),(0,i.useEffect)((()=>{f||v||g((0,a.Ay)(m,t,{symbol:""}))}),[t,f,v,m]),(0,i.useEffect)((()=>{w((0,a.Ay)(m,t,{symbol:""}))}),[t,m]),(0,r.create
2022-12-15 17:41:53 +01:00
// translators: %d: Tier level e.g: "1", "2", "3"
2025-02-28 08:42:11 +01:00
__("Tier %d","jetpack"),t+1),key:`jetpack-donations-amount-${t}`,onChange:e=>((e,t)=>{const n=[...w];n[t]=e,k("amounts",n)})(e,t),value:e})))),h&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:f,onChange:e=>n({customAmountText:e})}),(0,r.createElement)(l.A,{currency:c,label:__("Custom amount","jetpack"),defaultValue:100*(0,i.dv)(c),className:"donations__custom-amount",disabled:!0})),(0,r.createElement)("hr",{className:"donations__separator"}),(0,r.createElement)(a.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:v("extraText")??u.extraText,onChange:e=>k("extraText",e)}),(0,r.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper"},(0,r.createElement)(a.RichText,{className:"wp-block-button__link donations__donate-button",placeholder:__("Write a message…","jetpack"),value:v("buttonText")||u[b]?.buttonText,onChange:e=>{return t=e,void n({oneTimeDonation:{...d,buttonText:t},monthlyDonation:{...p,buttonText:t},annualDonation:{...m,buttonText:t}});var t},allowedFormats:E})))}},36580:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(86087),s=n(27723),o=n(13022),i=n(57018),l=n(62225);const __=s.__,c=e=>{const{attributes:t,products:n,setAttributes:s}=e,{oneTimeDonation:c,monthlyDonation:u,annualDonation:d}=t,[p,m]=(0,a.useState)("one-time"),h=(0,a.useCallback)((e=>p===e),[p]),g={"one-time":{title:__("One-Time","jetpack")},...u.show&&{"1 month":{title:__("Monthly","jetpack")}},...d.show&&{"1 year":{title:__("Yearly","jetpack")}}};return(0,a.useEffect)((()=>{c.planId===n["one-time"]&&u.planId===n["1 month"]&&d.planId===n["1 year"]||s({...n["one-time"]&&{oneTimeDonation:{...c,planId:n["one-time"]}},...n["1 month"]&&{monthlyDonation:{...u,planId:n["1 month"]}},...n["1 year"]&&{annualDonation:{...d,planId:n["1 year"]}}})}),[c,u,d,s,n]),(0,a.useEffect)((()=>{!u.show&&h("1 month")&&m("one-time"),!d.show&&h("1 year")&&m("one-time")}),[u,d,m,h]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"donations__container"},Object.keys(g).length>1&&(0,r.createElement)("div",{className:"donations__nav"},Object.entries(g).map((([e,{title:t}])=>(0,r.createElement)("div",{role:"button",tabIndex:0,className:(0,o.A)("donations__nav-item",{"is-active":h(e)}),onClick:()=>m(e),onKeyDown:()=>m(e),key:`jetpack-donations-nav-item-${e} `},t)))),(0,r.createElement)("div",{className:"donations__content"},(0,r.createElement)(l.A,{activeTab:p,attributes:t,setAttributes:s}))),(0,r.createElement)(i.A,e))}},75703:(e,t,n)=>{"use strict";function r(){if("undefined"==typeof window)return{};const e=window.Jetpack_DonationsBlock?.defaultTexts;return"object"!=typeof e?{}:e}n.d(t,{O:()=>r})},36850:(e,t,n)=>{"use strict";n.d(t,{GY:()=>a,_t:()=>r,gQ:()=>s});const r=/^\s*https?:\/\/(?:www\.)?(?:eventbrite\.[a-z.]+)\/e\/[^/]*?(\d+)\/?(?:\?[^/]*)?\s*$/i,a=/^\s*https?:\/\/(?:.+\.)?(?:eventbrite\.[a-z.]+)\/?(?:\?[^/]*)?\s*$/i,s="https://www.eventbrite.com/e/test-event-tickets-123456789"},38449:(e,t,n)=>{"use strict";n.d(t,{o:()=>c,s:()=>u});var r=n(82170),a=n(56427),s=n(27723),o=n(5873),i=n(72660);const __=s.__,_x=s._x,l=[{value:"inline",label:__("In-page Embed","jetpack"),preview:(0,r.createElement)("div",{className:"block-editor-block-preview__container"},(0,r.createElement)("img",{src:i,alt:__("In page Eventbrite checkout example","jetpack")}))},{value:"modal",label:__("Button & Modal","jetpack")}],c=({setEditingUrl:e})=>(0,r.createElement)(a.ToolbarGroup,null,(0,r.createElement)(a.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>e(!0)})),u=({attributes:e,clientId:t,setAttributes:n})=>(0,r.createElement)(o.A,{title:_x("Embed Type","option for how the embed displays on a page, e.g. inline or as a modal","jetpack"),clientId:t,styleOptions:l,onSelectStyle:n,activeStyle:e.style,attributes:e,viewportWidth:130})},77629:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=[n(87879).A]},87879:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(82170),a=n(94715)
2024-04-17 11:32:24 +02:00
// translators: default aspect ratio for the embedded Google document.
{label:__("Default","jetpack"),value:""},
// translators: aspect ratio for the embedded Google document.
{label:__("100% - Show the whole document","jetpack"),value:"ar-100"},
// translators: aspect ratio for the embedded Google document.
2025-02-28 08:42:11 +01:00
{label:__("50% - Show half of the document","jetpack"),value:"ar-50"}];return(0,s.createElement)(l.Fragment,null,(0,s.createElement)(l.Fragment,null,(0,s.createElement)(u.A,a()({icon:d.src,instructions:[__("Copy and paste your document link below.","jetpack"),__("If your document is private, only readers logged into a Google account with shared access to the document may view it.","jetpack")].join(" "),label:p,patterns:m,placeholder:_x("Enter the link here…","Embed block placeholder","jetpack"),mapUrl:()=>{if(0===m.length||""===h)return r;const e=r.match(m[0]);return null===e||void 0===e[1]||void 0===e[2]||void 0===e[3]?r:`${e[1]}://${e[2]}/${h}/d/${e[3]}/preview`},mismatchErrorMessage:__("The document couldnt be embedded. To embed a document, use the link in your browser address bar when editing the document.","jetpack"),checkGoogleDocVisibility:!0},e))),(0,s.createElement)(l.Fragment,null,(0,s.createElement)(o.InspectorControls,null,(0,s.createElement)(i.PanelBody,null,(0,s.createElement)("p",null,__("Select a different aspect-ratio to show more (or less) of your embedded document.","jetpack")),(0,s.createElement)(i.SelectControl,{label:__("Aspect Ratio","jetpack"),value:t,options:v,onChange:e=>c({aspectRatio:e}),__nextHasNoMarginBottom:!0})))))}},85779:(e,t,n)=>{"use strict";var r=n(94375),a=n(94575),s=n(94806),o=n(10467),i=n(72371),l=n(60288);(0,r.M)(a,{edit:s.A,save:o.A,transforms:(0,i.A)(a.name),variations:l.A})},93261:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(82170),a=n(56427),s=n(27723),o=n(13022);const _x=s._x,i=({className:e,icon:t,instructions:n,label:s,notices:i,url:l,onSubmit:c,placeholder:u,updateUrl:d})=>(0,r.createElement)("div",{className:(0,o.A)("wp-block-jetpack-google-docs-embed-editmode",e)},(0,r.createElement)(a.Placeholder,{icon:t,label:s,instructions:n,notices:i},(0,r.createElement)("form",{onSubmit:c},(0,r.createElement)("input",{type:"url",value:l||"",className:"components-placeholder__input",placeholder:u,onChange:e=>d(e.target.value)}),(0,r.createElement)(a.Button,{variant:"primary",type:"submit"},_x("Embed","button label","jetpack")))))},58725:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(82170),a=n(1455),s=n.n(a),o=n(94715),i=n(74997),l=n(56427),c=n(29491),u=n(86087),d=n(27723),p=n(92687),m=n(93261),h=n(22336);const __=d.__,_x=d._x,g=({children:e,mapUrl:t,url:n,className:a,interactive:o,toggleInteractive:i,noticeUI:l=null,noticeOperations:c={},checkGoogleDocVisibility:d=!1})=>{if((0,u.useEffect)((()=>{d&&s()({path:`/wpcom/v2/checkGoogleDocVisibility?url=${n}`}).catch((()=>{c.removeAllNotices(),c.createNotice({status:"warning",content:__("This document is private. Only readers logged into a Google account that the document is shared with can view it.","jetpack")})}))}),[n,d,c]),e)return e;let p=!1;return l&&(p=!0),(0,r.createElement)(r.Fragment,null,l,(0,r.createElement)(h.A,{url:t(n),className:a,interactive:o,toggleInteractive:i,isPrivateURL:p}))},f=(0,c.compose)(l.withNotices)((e=>{const{attributes:t,className:n,isSelected:a,setAttributes:s,icon:c="superhero-alt",instructions:h=__("Paste a link to the content you want to display.","jetpack"),forceEditing:f=!1,mismatchErrorMessage:b=__("It does not look like an embeddable URL.","jetpack"),label:v,mapUrl:k=e=>e,noticeOperations:y,noticeUI:w,patterns:E,placeholder:_=__("Enter URL to embed here…","jetpack"),children:C,onSubmitUrl:A=()=>{},checkGoogleDocVisibility:x=!1}=e,{url:j}=t,[S,N]=(0,u.useState)(!1),[R,P]=(0,u.useState)(!1),[L,T]=(0,u.useState)(j);f&&!S&&N(!0);(0,u.useEffect)((()=>{!a&&R&&P(!1)}),[a]);const M=(0,u.useRef)(null),B=(0,o.useBlockProps)({className:"wp-block-jetpack-google-docs-embed",ref:M}),{title:I}=(0,i.getBlockType)(e.name),D=(0,d.sprintf)(/* translators: %s is replaced with the name of the embed provider */
_x("%s URL","placeholder label","jetpack"),I);return(0,r.createElement)("div",B,(0,r.createElement)(o.BlockControls,null,(0,r.createElement)(l.ToolbarGroup,null,!S&&(0,r.createElement)(l.ToolbarButton,{icon:p.A,label:__("Edit URL","jetpack"),isActive:S,onClick:()=>{y.removeAllNotices(),N(!S)}}))),S||!j?(0,r.createElement)(m.A,{className:n,icon:c,instructions:h,label:v||D,url:L,notices:w,placeholder:_,onSubmit:e=>{if(e&&e.preventDefault(),!E[0].test(L))return y.removeAllNotices(),void y.createErrorNotice(b);y.removeAllNotices(),N(!1),s({url:L}),A(L)},updateUrl:T}):(0,r.createElement)(g,{children:C,mapUrl:k,url:L,className:n,interactive:R,toggleInteractive:P,noticeUI:w,noticeOperations:y,checkGoogleDocVisibility:x}))}))},22336:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(56427),s=n(27723);const __=s.__,o=e=>{const{allowFullScreen:t=!0,isPrivateURL:n=!1,interactive:s,toggleInteractive:o,title:i=__("Embed URL","jetpack"),url:l}=e;return(0,r.createElement)("figure",null,n?(0,r.createElement)("div",{className:"wp-block-jetpack-google-docs-embed__wrapper wp-block-jetpack-google-docs-embed__wrapper--error"},(0,r.createElement)("p",{className:"wp-block-jetpack-google-docs-embed__error-msg"},__("This Google Document is private.","jetpack"),(0,r.createElement)("br",null),(0,r.createElement)("br",null),(0,r.createElement)(a.ExternalLink,{href:l},__("Click here to open this document.","jetpack")))):(0,r.createElement)("div",{className:"wp-block-jetpack-google-docs-embed__wrapper"},(0,r.createElement)("iframe",{src:l,allowFullScreen:t,title:i,height:"450"})),!s&&(0,r.createElement)("div",{className:"wp-block-jetpack-google-docs-embed__interactive-overlay",onMouseUp:()=>o(!0)}))}},10467:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);const a=e=>{const{attributes:t}=e;return(0,r.createElement)("figure",null,(0,r.createElement)("div",{className:"embed__wrapper"},`\n${t.url}\n`))}},72371:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(74997),s=n(86087);const o=e=>{const t=[/^(http|https):\/\/(docs\.google.com)\/(spreadsheets|document|presentation)\/d\/([A-Za-z0-9_-]+).*?$/i];return{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&t[0].test(e.textContent)&&1===e.textContent?.match(/https/gi)?.length,transform:t=>(0,a.createBlock)(e,{url:t.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],transform:({url:e})=>{const t=(0,r.createElement)("a",{href:e},e);return(0,a.createBlock)("core/paragraph",{content:(0,s.renderToString)(t)})}}]}}},60288:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(85985),a=n(27723);const __=a.__,s=[{name:"jetpack/google-docs",isDefault:!0,title:__("Google Docs","jetpack"),description:__("Embed a Google Document.","jetpack"),icon:"<svg viewBox='0 0 64 88' width='24' height='24' xmlns='http://www.w3.org/2000/svg'><path d='M58,88H6c-3.3,0-6-2.7-6-6V6c0-3.3,2.7-6,6-6h36l22,22v60C64,85.3,61.3,88,58,88z' /><path fill='#FDFFFF' d='M42,0l22,22H42V0z' /><path fill='#FDFFFF' d='M50,39H14v-5h36V39z M50,46H14v5h36V46z M40,58H14v5h26V58z' /></svg>",keywords:[__("document","jetpack"),__("gsuite","jetpack"),__("doc","jetpack")],attributes:{variation:"jetpack/google-docs"},isActive:["variation"]},{name:"jetpack/google-sheets",isDefault:!0,title:__("Google Sheets","jetpack"),description:__("Embed a Google Sheet.","jetpack"),icon:"<svg viewBox='0 0 64 88' width='24' height='24' xmlns='http://www.w3.org/2000/svg'><path d='M58,88H6c-3.3,0-6-2.7-6-6V6c0-3.3,2.7-6,6-6h36l22,22v60C64,85.3,61.3,88,58,88z' /><path fill='#FDFFFF' d='M42,0l22,22H42V0z' /><path fill='#FDFFFF' d='M12,34.5v28h40v-28H12z M17,39.5h12.5V46H17V39.5z M17,51h12.5v6.5H17V51z M47,57.5H34.5V51H47V57.5z M47,46 H34.5v-6.5H47V46z' /></svg>",keywords:[__("sheet","jetpack"),__("spreadsheet","jetpack")],attributes:{variation:"jetpack/google-sheets"},isActive:["variation"]},{name:"jetpack/google-slides",isDefault:!0,title:__("Google Slides","jetpack"),description:__("Embed a Google Slides presentation.","jetpack"),icon:"<svg viewBox='0 0 64 88' width='24' height='24' xmlns='http://www.w3.org/2000/svg'><path d='M58,88H6c-3.3,0-6-2.7-
_n("There is currently only %s post in your Instagram account.","There are currently only %s posts in your Instagram account.",e,"jetpack"),e):__("There are currently no posts in your Instagram account.","jetpack");return(0,r.createElement)("div",{className:"wp-block-jetpack-instagram-gallery__count-notice"},(0,r.createElement)(a.Notice,{isDismissible:!1,status:"info"},t))})():null,(0,r.createElement)(a.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of Posts","jetpack"),value:p,onChange:e=>c({count:e}),min:1,max:o.V}),(0,r.createElement)(a.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of Columns","jetpack"),value:d,onChange:e=>c({columns:e}),min:1,max:6}),(0,r.createElement)(a.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Image Spacing (px)","jetpack"),value:g,onChange:e=>c({spacing:e}),min:0,max:50}),(0,r.createElement)(a.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Stack on mobile","jetpack"),checked:h,onChange:()=>c({isStackedOnMobile:!h})})))}},11148:(e,t,n)=>{"use strict";n.d(t,{A:()=>w});var r=n(96072),a=n.n(r),s=n(82170),o=n(85985),i=n(94715),l=n(56427),c=n(86087),u=n(27723),d=n(13022),p=n(66087),m=n(78218),h=n(89525),g=n(80427),f=n(57926),b=n(86975),v=n(49783),k=n(53495),y=n(80619);const __=u.__,w=(0,l.withNotices)((e=>{const t=(0,i.useBlockProps)(),{attributes:n,isSelected:r,noticeOperations:u,noticeUI:w,setAttributes:E}=e,{accessToken:_,align:C,columns:A,count:x,isStackedOnMobile:j,spacing:S}=n;(0,c.useEffect)((()=>{const e=(0,m.y)(h.attributes,n);(0,p.isEqual)(e,n)||E(e)}),[n,E]);const[N,R]=(0,c.useState)(_),{isRequestingWpcomConnectUrl:P,wpcomConnectUrl:L}=(0,k.A)(),{images:T,isLoadingGallery:M,setImages:B}=(0,y.A)({accessToken:_,noticeOperations:u,setAttributes:E,setSelectedAccount:R}),{connectToService:I,disconnectFromService:D,isConnecting:F,isRequestingUserConnections:z,userConnections:O}=(0,v.A)({accessToken:_,noticeOperations:u,selectedAccount:N,setAttributes:E,setImages:B,setSelectedAccount:R}),H=(0,o.gB)(),U=x>T.length?T.length:x,V=!M&&(!_||(0,p.isEmpty)(T)),q=!V,G=_&&M&&(0,p.isEmpty)(T),$=!V&&!G,W=(0,d.A)(t.className,{[`align${C}`]:C}),Z=(0,d.A)("wp-block-jetpack-instagram-gallery__grid",`wp-block-jetpack-instagram-gallery__grid-columns-${A}`,{"is-stacked-on-mobile":j}),J={gridGap:S,"--latest-instagram-posts-spacing":S?`${S}px`:void 0},K={padding:S},Y=()=>{N&&g.B!==N?E({accessToken:N,instagramUser:(0,p.find)(O,{token:N}).username}):I()};return(0,s.createElement)("div",a()({},t,{className:W}),V&&(0,s.createElement)(l.Placeholder,{icon:"instagram",instructions:H?z||O.length?void 0:__("Connect to Instagram to start sharing your images.","jetpack"):__("First, you'll need to connect your WordPress.com account.","jetpack"),label:__("Latest Instagram Posts","jetpack"),notices:w},H?(()=>{const e=O.length>0,t=[...(0,p.map)(O,(e=>({label:`@${e.username}`,value:e.token}))),{label:__("Add a new account","jetpack"),value:g.B}],n=F||z||e&&!N;return(0,s.createElement)("div",null,e&&(0,s.createElement)(l.RadioControl,{label:__("Select your Instagram account:","jetpack"),onChange:e=>R(e),options:t,selected:N}),g.B===N&&(0,s.createElement)("p",{className:"wp-block-jetpack-instagram-gallery__new-account-instructions"},__("If you are currently logged in to Instagram on this device, you might need to log out of it first.","jetpack")),(0,s.createElement)(l.Button,{disabled:n,variant:"primary",onClick:Y},F&&__("Connecting…","jetpack"),z&&__("Loading your connections…","jetpack"),!F&&!z&&__("Connect to Instagram","jetpack")))})():(0,s.createElement)(l.Button,{disabled:P||!L,href:L,variant:"secondary"},__("Connect to WordPress.com","jetpack"))),G&&(0,s.createElement)("div",{className:"wp-block-embed is-loading"},(0,s.createElement)(l.Spinner,null),(0,s.createElement)("p",null,__("Embedding…","jetpack"))),$&&(0,s.createElement)("div",{className:Z,style:J},(0,p.times)(r?x:U,(e=>(0,s.createElement)("span",{className:(0,d.A)("wp-block-jetpack-instagram-gallery__grid-post"),key:e,style:K},(e=>{if(T[e]){const t=T[e]
2024-02-16 11:03:01 +01:00
// translators: %$1s: Number of likes
2025-02-28 08:42:11 +01:00
__("<span>%1$d</span> likes","jetpack"),v.length),{span:(0,r.createElement)("span",{className:"wpl-count-number"})}))))))}},67511:(e,t,n)=>{"use strict";var r=n(94375),a=n(71969),s=n(434);(0,r.M)(a,{edit:s.A,save:()=>null})},40483:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(82170),a=n(94715),s=n(56427),o=n(27723),i=n(13022),l=n(54790);const __=o.__,c={name:"jetpack/button",attributes:{element:"button",text:__("Join my Mailchimp audience","jetpack"),uniqueId:"mailchimp-widget-id"}},u=({attributes:e,setAttributes:t,audition:n})=>{const{emailPlaceholder:o=l.Bd,consentText:u=l.Do,processingLabel:d=l.HD,successLabel:p=l.XO,errorLabel:m=l.Ys}=e,h={[l.k1]:d,[l.EM]:p,[l.Dc]:m}[n];return(0,r.createElement)("div",{className:(0,i.A)({[`${l.j7}_notication-audition`]:n})},(0,r.createElement)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-label":o,className:`${l.j7}_text-input`,disabled:!0,onChange:()=>!1,placeholder:o,title:__("You can edit the email placeholder in the sidebar.","jetpack"),type:"email"}),(0,r.createElement)(a.InnerBlocks,{template:[[c.name,c.attributes]],templateLock:"all"}),(0,r.createElement)(a.RichText,{tagName:"p",placeholder:__("Write consent text","jetpack"),value:u,onChange:e=>t({consentText:e}),inlineToolbar:!0}),n&&(0,r.createElement)("div",{className:`${l.j7}_notification ${l.j7}_${n}`,role:n===l.Dc?"alert":"status"},h))}},54790:(e,t,n)=>{"use strict";n.d(t,{Bd:()=>d,Dc:()=>o,Do:()=>p,EM:()=>s,HD:()=>m,JA:()=>c,XO:()=>h,Ys:()=>g,an:()=>l,gI:()=>u,j7:()=>i,k1:()=>a});var r=n(27723);const __=r.__,a="processing",s="success",o="error",i="wp-block-jetpack-mailchimp",l=0,c=1,u=2,d=__("Enter your email","jetpack"),p=__("By clicking submit, you agree to share your email address with the site owner and Mailchimp to receive marketing, updates, and other emails from the site owner. Use the unsubscribe link in those emails to opt out at any time.","jetpack"),m=__("Processing…","jetpack"),h=__("Success! You're on the list.","jetpack"),g=__("Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.","jetpack")},20093:(e,t,n)=>{"use strict";n.d(t,{o:()=>d});var r=n(82170),a=n(94715),s=n(56427),o=n(86087),i=n(27723),l=n(54790),c=n(60462);const __=i.__,u=({auditionNotification:e,clearAudition:t,setAttributes:n,emailPlaceholder:a=l.Bd,processingLabel:o=l.HD,successLabel:i=l.XO,errorLabel:u=l.Ys,interests:d,signupFieldTag:p,signupFieldValue:m,connectURL:h})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.PanelBody,{title:__("Text Elements","jetpack")},(0,r.createElement)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Email Placeholder","jetpack"),value:a,onChange:e=>{n({emailPlaceholder:e}),t()}})),(0,r.createElement)(s.PanelBody,{title:__("Notifications","jetpack")},(0,r.createElement)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Processing text","jetpack"),value:o,onChange:t=>{n({processingLabel:t}),e(l.k1)}}),(0,r.createElement)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Success text","jetpack"),value:i,onChange:t=>{n({successLabel:t}),e(l.EM)}}),(0,r.createElement)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Error text","jetpack"),value:u,onChange:t=>{n({errorLabel:t}),e(l.Dc)}})),(0,r.createElement)(s.PanelBody,{title:__("Mailchimp Groups","jetpack")},(0,r.createElement)(c.A,{interests:d,onChange:(e,t)=>{const r=[...new Set([...d,e])].filter((n=>!(n===e&&!t)&&n));n({interests:r})}}),(0,r.createElement)(s.ExternalLink,{href:"https://mailchimp.com/help/send-groups-audience/"},__("Learn about groups","jetpack"))),(0,r.createElement)(s.PanelBody,{title:__("Signup Location Tracking","jetpack")},(0,r.createElement)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Tag","jetpack"),placeholder:__("SIGNUP","jetpack"),value:p,onChange:e=>n({signupFieldTag:e})}),(0,r.createElement)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Val
_n("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length,"jetpack","jetpack"),e.length),"assertive"):t(__("No results.","jetpack"),"assertive"))}render(){const{onChange:e,onKeyDown:t}=this,{children:n,instanceId:s,completer:o}=this.props,{selectedIndex:i,filteredOptions:l}=this.state,{key:d=""}=l[i]||{},{className:p}=o,m=l.length>0,h=m?`components-autocomplete-listbox-${s}`:null,g=m?`components-autocomplete-item-${s}-${d}`:null;return(0,r.createElement)("div",{className:"components-autocomplete"},n({isExpanded:m,listBoxId:h,activeId:g,onChange:e,onKeyDown:t}),m&&(0,r.createElement)(a.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0},(0,r.createElement)("div",{id:h,role:"listbox",className:"components-autocomplete__results"},(0,u.map)(l,((e,t)=>(0,r.createElement)(a.Button,{key:e.key,id:`components-autocomplete-item-${s}-${e.key}`,role:"option","aria-selected":t===i,disabled:e.isDisabled,className:(0,c.A)("components-autocomplete__result",p,{"is-selected":t===i}),onClick:()=>this.select(e)},e.label))))))}}const m=(0,s.compose)([a.withSpokenMessages,s.withInstanceId,a.withFocusOutside])(p)},82063:(e,t,n)=>{"use strict";function r(e,t){return{default:{details:"mapbox://styles/automattic/cjolkhmez0qdd2ro82dwog1in",no_details:"mapbox://styles/automattic/cjolkci3905d82soef4zlmkdo"},black_and_white:{details:"mapbox://styles/automattic/cjolkixvv0ty42spgt2k4j434",no_details:"mapbox://styles/automattic/cjolkgc540tvj2spgzzoq37k4"},satellite:{details:"mapbox://styles/mapbox/satellite-streets-v10",no_details:"mapbox://styles/mapbox/satellite-v9"},terrain:{details:"mapbox://styles/automattic/cjolkf8p405fh2soet2rdt96b",no_details:"mapbox://styles/automattic/cjolke6fz12ys2rpbpvgl12ha"}}[e][t?"details":"no_details"]}n.d(t,{o:()=>r})},16815:(e,t,n)=>{"use strict";n.d(t,{BY:()=>i,ES:()=>a,_t:()=>s,iU:()=>o,jF:()=>r});const r=e=>Object.hasOwn(e,"lat")&&Object.hasOwn(e,"lng")?e:{lat:e.latitude||0,lng:e.longitude||0};function a(e,t){const n=new e.LngLatBounds;return t.forEach((e=>{n.extend([e.coordinates.longitude,e.coordinates.latitude])})),n}function s(e,t){e.fitBounds(t,{padding:{top:80,bottom:80,left:40,right:40}})}function o(e,t){e.innerHTML=`\n\t\t<?xml version="1.0" encoding="UTF-8"?>\n\t\t<svg version="1.1" viewBox="0 0 32 38" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n\t\t\t<g fill-rule="evenodd">\n\t\t\t\t<path id="d" d="m16 38s16-11.308 16-22-7.1634-16-16-16-16 5.3076-16 16 16 22 16 22z" fill="${t}"/>\n\t\t\t</g>\n\t\t</svg>\n\t`}function i(e){return new e.Popup({closeButton:!0,closeOnClick:!1,offset:{left:[0,0],top:[0,5],right:[0,0],bottom:[0,-40]}})}},42470:(e,t,n)=>{"use strict";n.d(t,{IR:()=>d,K5:()=>c,Sm:()=>i,Yc:()=>u,c6:()=>o,nQ:()=>l});var r=n(34377);const a=6371e3;function s(e){return Math.abs(a*Math.cos(e*Math.PI/180)*2*Math.PI/256)}function o(e,t){return 512/Math.pow(2,e)*.5*s(t)}function i(e,t){const n=e/s(t);return Math.log2(512/(n/.5))}function l(e,t){if(0===t.length)return null;const n=new e.Coordinate(-90,180),r=new e.Coordinate(90,-180);t.forEach((e=>{n.latitude=Math.max(n.latitude,e.coordinates.latitude),n.longitude=Math.min(n.longitude,e.coordinates.longitude),r.latitude=Math.min(r.latitude,e.coordinates.latitude),r.longitude=Math.max(r.longitude,e.coordinates.longitude)}));const a=new e.Coordinate(n.latitude-.5*(n.latitude-r.latitude),n.longitude+.5*(r.longitude-n.longitude)),s=new e.CoordinateSpan(1.3*Math.abs(n.latitude-r.latitude),1.3*Math.abs(r.longitude-n.longitude));return new e.CoordinateRegion(a,s)}function c(e,t){return()=>{const n=e.createElement("div");return n.classList.add("mapkit-popup-content"),t(n),n}}function u(e,t){return new Promise((n=>{if(t.mapkitScriptIsLoading)(0,r.Cu)(t,"mapkit").then((e=>{n(e)}));else{t.mapkitScriptIsLoading=!0;const a=e.createElement("script");a.addEventListener("load",(async()=>{const e=await(0,r.Cu)(t,"mapkit");t.mapkitScriptIsLoading=!1,n(e)}),{once:!0}),a.src="https://cdn.apple-mapkit
__("Open Table Preview %s","jetpack"),t),scrolling:"no",src:`https://www.opentable.com/widget/reservation/canvas?rid=${(0,d.join)(N,"%2C")}&type=${n}&theme=${a}&overlay=false&domain=${P}&lang=${L&&g.L.includes(L)?L:"en-US"}&newtab=${T}&disablega=true`}))})()))}))},82144:(e,t,n)=>{"use strict";var r=n(82170),a=n(94715),s=n(74997),o=n(94375),i=n(79018),l=n(34157),c=n(8100),u=n(71833),d=n(50387),p=n(84260);(0,o.M)(i,{edit:u.A,save:({attributes:{rid:e}})=>{const t=a.useBlockProps.save();return(0,r.createElement)("div",t,e?.map(((e,t)=>(0,r.createElement)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`,key:`${e}-${t}`},`https://www.opentable.com/restref/client/?rid=${e}`))))},attributes:i.attributes,styles:(0,d.Iy)(),transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&0===e.textContent.indexOf("http")&&(p.XA.test(e.textContent)||p.JJ.test(e.textContent)),transform:e=>{const t=(0,p.a9)(e.textContent);return(0,s.createBlock)("jetpack/opentable",t)}}]},deprecated:[l.A,c.A]})},82101:(e,t,n)=>{"use strict";n.d(t,{L:()=>a,P:()=>r});const r=[{value:"en-US",label:"English"},{value:"fr-CA",label:"Français"},{value:"de-DE",label:"Deutsch"},{value:"es-MX",label:"Español"},{value:"ja-JP",label:"日本語"},{value:"nl-NL",label:"Nederlands"},{value:"it-IT",label:"Italiano"}],a=r.map((e=>e.value))},98233:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(96072),a=n.n(r),s=n(82170),o=n(56427),i=n(86087),l=n(27723),c=n(66087),u=n(4673);const __=l.__,_n=l._n,d=20;function p(e){const[t,n]=(0,i.useState)(""),{restaurants:r,hasRequestFailed:l}=(0,u.A)(t,d),[p,m]=(0,i.useState)(e.rids||[]),h=/^(\d+)$|\(#(\d+)\)$/,g=r.filter((e=>p.indexOf(e.rid.toString())<0)).map((e=>e.name+` (#${e.rid})`)),f=(0,s.createElement)(o.FormTokenField,a()({value:p,suggestions:g,saveTransform:e=>u.h.test(e)?"":e.trim(),onInputChange:n,maxSuggestions:d,label:_n("Restaurant","Restaurants",p.length,"jetpack")},e,{onChange:t=>{const n=t.map((e=>{const t=h.exec(e);return t[1]||t[2]}));m(n),e.onChange&&e.onChange(n)},__nextHasNoMarginBottom:!0}));return(0,s.createElement)("div",{className:"wp-block-jetpack-opentable-restaurant-picker"},e.onSubmit?(0,s.createElement)("form",{onSubmit:n=>{n.preventDefault(),e.onSubmit((0,c.isEmpty)(p)?t:p)}},f,(0,s.createElement)(o.Button,{variant:"secondary",type:"submit"},__("Embed","jetpack"))):f,l&&(0,s.createElement)(o.Notice,{status:"error",isDismissible:!1},__("OpenTable can't find this restaurant right now. Please try again later.","jetpack")))}},50387:(e,t,n)=>{"use strict";n.d(t,{Iy:()=>o,K5:()=>i,i9:()=>s});var r=n(27723),a=n(66087);const __=r.__,s={name:"button",label:__("Button (210 x 113 pixels)","jetpack")},o=e=>(0,a.compact)([{name:"standard",label:__("Standard (224 x 301 pixels)","jetpack"),isDefault:!0},{name:"tall",label:__("Tall (288 x 490 pixels)","jetpack")},{name:"wide",label:__("Wide (840 x 150 pixels)","jetpack")},(!e||1===e.length)&&s]),i=e=>o(e).map((e=>e.name))},59038:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(86087);function a(e){const t=(0,r.useRef)(void 0);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}},4673:(e,t,n)=>{"use strict";n.d(t,{A:()=>o,h:()=>s});var r=n(86087),a=n(66087);const s=/^\s*(http[s]?:\/\/|<script)/;function o(e,t){const[n,o]=(0,r.useState)([]),[i,l]=(0,r.useState)(!1),c=(0,r.useCallback)(((e="")=>{l(!1),fetch("https://www.opentable.com/widget/reservation/restaurant-search?pageSize="+t+"&query="+encodeURIComponent(e)).then((e=>e.json())).then((e=>{l(!1),o((0,a.unionBy)(n,e.items,"rid"))})).catch((()=>l(!0)))}),[n,t]),u=(0,r.useMemo)((()=>(0,a.throttle)(c,500)),[c]);return(0,r.useEffect)((()=>{(0,a.isEmpty)(e)||s.test(e)||u(e)}),[e,u]),{restaurants:n,hasRequestFailed:i}}},84260:(e,t,n)=>{"use strict";n.d(t,{JJ:()=>a,XA:()=>s,a9:()=>o});const r=/<\s*script[^>]*src\s*=\s*["']?([^"']*)/i,a=/restref=([0-9]+)&/,s=/rid=([0-9]+)&/,o=e=>{if(e)return(e=>{if(!e)return;let t="";if(t=0===e.indexOf("http")?new URL(e):new URL("http:"+e),!t.host||-1===t.host.indexOf("opentable")||!t.search)return;const n=new URLSearchParams(t.search);let r=n.get("theme");"button"===n.get("t
`${(0,l.sprintf)(__("Loading: %s","jetpack"),n)} ${s}`,"assertive"),!0};loadAndPlay=e=>{this.recordUserInteraction(),this.loadTrack(e)&&this.props.playMediaSource(this.props.playerId)};getTrack=e=>this.props.tracks[e];handleError=e=>{if(!this.state.hasUserInteraction){const t=window.navigator.userAgent.match(/Trident\/7\./)?"IE11: Playing sounds in webpages setting is not checked":e;this.setState((()=>{throw new Error(t)}))}this.props.errorMediaSource(this.props.playerId),(0,a.speak)(`${__("Error: Episode unavailable - Open in a new tab","jetpack")}`,"assertive")};handlePlay=()=>{this.props.playMediaSource(this.props.playerId),this.setState({hasUserInteraction:!0})};handlePause=()=>{this.props.pauseMediaSource(this.props.playerId),this.props.playerState!==d.pF&&this.props.pauseMediaSource(this.props.playerId)};handleTimeChange=e=>{this.props.setMediaSourceCurrentTime(this.props.playerId,e)};handleJump=()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime-5)};handleSkip=()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime+30)};updateMediaData=e=>{this.props.updateMediaSourceData(this.props.playerId,{duration:e.target?.duration,domId:e.target?.id})};registerPlayer(){const e=this.getTrack(this.state.currentTrack)||{},{playerId:t}=this.props;this.props.registerMediaSource(t,{title:e.title,link:e.link,state:d.vh}),this.props.setDefaultMediaSource(t)}componentDidMount(){this.props.playerId&&this.registerPlayer()}componentWillUnmount(){this.props.playerId&&this.props.unregisterMediaSource(this.props.playerId)}componentDidUpdate(e){const t=e=>e?.length?e.map((e=>e.guid)):[],n=t(this.props.tracks),r=new Set(t(e.tracks));n.length===r.size&&n.every((e=>r.has(e)))||this.loadTrack(0)}static getDerivedStateFromProps(e,t){return e.tracks.length<=t.currentTrack?{...t,currentTrack:0}:null}render(){const{playerId:e,title:t,link:n,cover:a,tracks:s,attributes:o,currentTime:i,playerState:d}=this.props,{itemsToShow:g,primaryColor:f,customPrimaryColor:b,hexPrimaryColor:v,secondaryColor:k,customSecondaryColor:y,hexSecondaryColor:w,backgroundColor:E,customBackgroundColor:_,hexBackgroundColor:C,showCoverArt:A,showEpisodeTitle:x,showEpisodeDescription:j}=o,{currentTrack:S}=this.state,N=s.slice(0,g),R=this.getTrack(S),P=(0,p.GU)({primaryColor:f,customPrimaryColor:b,secondaryColor:k,customSecondaryColor:y,backgroundColor:E,customBackgroundColor:_}),L={color:y,backgroundColor:_,"--jetpack-podcast-player-primary":v,"--jetpack-podcast-player-secondary":w,"--jetpack-podcast-player-background":C},T=(0,c.A)("jetpack-podcast-player",d,P.secondary.classes,P.background.classes);return(0,r.createElement)("section",{className:T,style:L,"aria-labelledby":t||R&&R.title?`${e}__title`:void 0,"aria-describedby":R&&R.description?`${e}__track-description`:void 0,"data-jetpack-iframe-ignore":!0},(0,r.createElement)(m.A,{playerId:e,title:t,link:n,cover:a,track:this.getTrack(S),showCoverArt:A,showEpisodeTitle:x,showEpisodeDescription:j,colors:P},(0,r.createElement)(u.A,{onJumpBack:this.handleJump,onSkipForward:this.handleSkip,trackSource:this.getTrack(S).src,onPlay:this.handlePlay,onPause:this.handlePause,onError:this.handleError,playStatus:d,currentTime:i,onTimeChange:this.handleTimeChange,onMetadataLoaded:this.updateMediaData})),N.length>1&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("h4",{id:`jetpack-podcast-player__tracklist-title--${e}`,className:"jetpack-podcast-player--visually-hidden"},(0,l.sprintf)(
2022-12-15 17:41:53 +01:00
// translators: %s is the track title.
2025-02-28 08:42:11 +01:00
__("Playlist: %s","jetpack"),t)),(0,r.createElement)("p",{id:`jetpack-podcast-player__tracklist-description--${e}`,className:"jetpack-podcast-player--visually-hidden"},__("Select an episode to play it in the audio player.","jetpack")),(0,r.createElement)(h.A,{playerId:e,playerState:d,currentTrack:S,tracks:N,selectTrack:this.selectTrack,colors:P})))}}f.defaultProps={title:"",cover:"",link:"",attributes:{url:null,itemsToShow:5,showCoverArt:!0,showEpisodeTitle:!0,showEpisodeDescription:!0},tracks:[]};const b=(0,s.compose)([g.A,(0,o.withSelect)(((e,t)=>{const{playerId:n}=t,{getMediaSourceCurrentTime:r,getMediaPlayerState:a}=e(d.ax);return{currentTime:r(n),playerState:a(n)}})),(0,o.withDispatch)((e=>{const{registerMediaSource:t,updateMediaSourceData:n,unregisterMediaSource:r,setDefaultMediaSource:a,playMediaSource:s,pauseMediaSource:o,toggleMediaSource:i,errorMediaSource:l,setMediaSourceCurrentTime:c}=e(d.ax);return{registerMediaSource:t,updateMediaSourceData:n,unregisterMediaSource:r,setDefaultMediaSource:a,playMediaSource:s,pauseMediaSource:o,toggleMediaSource:i,errorMediaSource:l,setMediaSourceCurrentTime:c}}))])(f)},74050:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(86087),s=n(27723);const __=s.__,o=(0,a.memo)((({link:e,title:t,colors:n})=>(0,r.createElement)("div",{className:"jetpack-podcast-player__track-error"},__("Episode unavailable.","jetpack")," ",e&&(0,r.createElement)("span",{className:n.secondary.classes,style:{color:n.secondary.custom}},(0,r.createElement)("a",{className:"jetpack-podcast-player__link",href:e,rel:"noopener noreferrer nofollow",target:"_blank"},(0,r.createElement)("span",{className:"jetpack-podcast-player--visually-hidden"},`${(0,s.sprintf)(/* translators: %s is the title of the track. This text is visually hidden from the screen, but available to screen readers. */
__("%s:","jetpack"),t)} `),__("Open in a new tab","jetpack"))))))},35311:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(82170),a=n(86087),s=n(27723),o=n(62796);const __=s.__,i=(0,a.memo)((({isPlaying:e,isError:t,className:n})=>{let a,s;t?(s="error",
2022-04-02 10:26:41 +02:00
/* translators: This is text to describe the current state. This will go
before the track title, such as "Error: [The title of the track]". */
2023-12-07 09:44:11 +01:00
a=__("Error:","jetpack")):e&&(s="playing",
2022-04-02 10:26:41 +02:00
/* translators: Text to describe the current state. This will go before the
track title, such as "Playing: [The title of the track]". */
2025-02-28 08:42:11 +01:00
a=__("Playing:","jetpack"));const i=o[s];return i?(0,r.createElement)("span",{className:`${n} ${n}--${s}`},(0,r.createElement)("span",{className:"jetpack-podcast-player--visually-hidden"},`${a} `),i):(0,r.createElement)("span",{className:n})}))},91677:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(82170),a=n(86087),s=n(27723),o=n(13022),i=n(19812),l=n(74050),c=n(35311);const __=s.__,u=(0,a.memo)((({track:e,isActive:t,isPlaying:n,isError:a,selectTrack:s,index:u,colors:d={primary:{},secondary:{}}})=>{const p=(0,i.tQ)("color",d.primary.name),m=(0,i.tQ)("color",d.secondary.name),h=(0,o.A)("jetpack-podcast-player__track",{"is-active":t,"has-primary":t&&(d.primary.name||d.primary.custom),[p]:t&&!!p,"has-secondary":!t&&(d.secondary.name||d.secondary.custom),[m]:!t&&!!m}),g={};t&&d.primary.custom&&!p?g.color=d.primary.custom:t||!d.secondary.custom||m||(g.color=d.secondary.custom);const
2022-04-02 10:26:41 +02:00
/* translators: This needs to be a single word with no spaces. It describes
the current item in the group. A screen reader will announce it as "[title],
current track". */
2025-02-28 08:42:11 +01:00
f=t?__("track","jetpack"):void 0;return(0,r.createElement)("li",{className:h,style:Object.keys(g).length?g:null},(0,r.createElement)("a",{className:"jetpack-podcast-player__link jetpack-podcast-player__track-link",href:e.link||e.src,role:"button","aria-current":f,onClick:e=>{e.shiftKey||e.metaKey||e.altKey||(e.preventDefault(),s(u))},onKeyDown:e=>{" "===event.key&&(e.preventDefault(),s(u))}},(0,r.createElement)(c.A,{className:"jetpack-podcast-player__track-status-icon",isPlaying:n,isError:a}),(0,r.createElement)("span",{className:"jetpack-podcast-player__track-title"},e.title),e.duration&&(0,r.createElement)("time",{className:"jetpack-podcast-player__track-duration",dateTime:e.duration},e.duration)),t&&a&&(0,r.createElement)(l.A,{link:e.link,title:e.title,colors:d}))}))},81166:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(86087),s=n(27723);const __=s.__;function o(e){class t extends a.Component{state={didError:!1,isIE11AudioIssue:!1};componentDidCatch=(e,t)=>{this.props.onError(e,t)};static getDerivedStateFromError=e=>({didError:!0,isIE11AudioIssue:!!e.message.match(/IE11/)});render(){const{didError:t,isIE11AudioIssue:n}=this.state;return t?(0,r.createElement)("section",{className:"jetpack-podcast-player"},(0,r.createElement)("p",{className:"jetpack-podcast-player__error"},n?__('The podcast player cannot be displayed as your browser settings do not allow for sounds to be played in webpages. This can be changed in your browsers "Internet options" settings. In the "Advanced" tab you will have to check the box next to "Play sounds in webpages" in the "Multimedia" section. Once you have confirmed that the box is checked, please press "Apply" and then reload this page.',"jetpack"):__("An unexpected error occured within the Podcast Player. Reloading this page might fix the problem.","jetpack",0))):(0,r.createElement)(e,this.props)}}return t.defaultProps={onError:()=>{}},t}},38288:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a,g:()=>r});const r="podcast-feed",a="embed-block"},18029:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(93832),a=n(20710);const s={attributes:{url:{type:"string",validator:r.isUrl},itemsToShow:{type:"integer",default:5},showCoverArt:{type:"boolean",default:!0},showEpisodeDescription:{type:"boolean",default:!0},primaryColor:{type:"string"},customPrimaryColor:{type:"string",validator:a.A},hexPrimaryColor:{type:"string",validator:a.A},secondaryColor:{type:"string"},customSecondaryColor:{type:"string",validator:a.A},hexSecondaryColor:{type:"string",validator:a.A},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:a.A},hexBackgroundColor:{type:"string",validator:a.A},exampleFeedData:{type:"object"}},supports:{align:!1,alignWide:!0,anchor:!1,customClassName:!0,className:!0,html:!1,multiple:!0,reusable:!0},save:()=>null}},60025:(e,t,n)=>{"use strict";n.d(t,{A:()=>S});var r=n(82170),a=n(85985),s=n(94715),o=n(74997),i=n(56427),l=n(29491),c=n(47143),u=n(86087),d=n(27723),p=n(93832),m=n(10067),h=n.n(m),g=n(66087),f=n(49487),b=n(34377),v=n(78218),k=n(50961),y=n(1624),w=n(57162),E=n(38288),_=n(90388),C=n(90764),A=n(19812);const __=d.__,x=h()("jetpack:podcast-player:edit"),j=(0,a.Sy)()||(0,a.d9)()?"http://en.support.wordpress.com/wordpress-editor/blocks/podcast-player-block/":"https://jetpack.com/support/jetpack-blocks/podcast-player-block/",S=(0,l.compose)([(0,c.withDispatch)(((e,{clientId:t,attributes:n})=>({replaceWithEmbedBlock(){e("core/block-editor").replaceBlock(t,(0,o.createBlock)("core/embed",{url:n.url}))}}))),(0,s.withColors)("backgroundColor",{primaryColor:"color"},{secondaryColor:"color"}),i.withNotices,l.withInstanceId,f.T])((({instanceId:e,attributes:t,setAttributes:n,noticeOperations:{createErrorNotice:a,removeAllNotices:o},noticeUI:l,primaryColor:c,setPrimaryColor:d,secondaryColor:m,setSecondaryColor:h,fallbackTextColor:f,backgroundColor:S,setBackgroundColor:N,fallbackBackgroundColor:R,isSelected:P,replaceWithEmbedBlock:L})=>{const T=(0,v.y)(y.attributes,t),{url:M,selectedEpisodes:B,itemsToShow:I,showCoverArt:D,showEpisodeTitle:F,showEpisodeDescription:z,exampleFeedD
2024-04-17 11:32:24 +02:00
// translators: Prep Time label for a recipe block.
default:__("Prep Time","jetpack")},cookTime:{type:"string",default:"30m"},cookTimeUnit:{type:"string",default:"m"},cookTimeLabel:{type:"string",
// translators: Cook Time label for a recipe block.
default:__("Cook Time","jetpack")},servings:{type:"number",default:4},servingsLabel:{type:"string",
// translators: Servings label for a recipe block.
2025-02-28 08:42:11 +01:00
default:__("Servings","jetpack")}}},54886:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(82170),a=n(94715),s=n(56427);const o=[{value:"m",label:"min"},{value:"h",label:"hours"}];const i=function({className:e,attributes:t,setAttributes:n}){const{prepTime:i,prepTimeLabel:l,cookTime:c,cookTimeLabel:u,servings:d,servingsLabel:p}=t;return(0,r.createElement)("div",{className:e},(0,r.createElement)("div",{className:"wp-container wp-recipe-block-details"},(0,r.createElement)("div",{className:"group"},(0,r.createElement)(s.TextControl,{value:l,onChange:e=>n({prepTimeLabel:e}),__nextHasNoMarginBottom:!0}),(0,r.createElement)(s.__experimentalUnitControl,{onChange:e=>n({prepTime:e}),onUnitChange:e=>n({prepTimeUnit:e}),isUnitSelectTabbable:!0,value:i,units:o})),(0,r.createElement)("div",{className:"group"},(0,r.createElement)(s.TextControl,{value:u,onChange:e=>n({cookTimeLabel:e}),__nextHasNoMarginBottom:!0}),(0,r.createElement)(s.__experimentalUnitControl,{onChange:e=>n({cookTime:e}),onUnitChange:e=>{n({cookTimeUnit:e})},isUnitSelectTabbable:!0,value:c,units:o})),(0,r.createElement)("div",{className:"group"},(0,r.createElement)(s.TextControl,{value:p,onChange:e=>n({servingsLabel:e}),__nextHasNoMarginBottom:!0}),(0,r.createElement)(s.TextControl,{type:"number",value:d,onChange:e=>n({servings:parseInt(e)}),__nextHasNoMarginBottom:!0})),(0,r.createElement)("div",{className:"group"},(0,r.createElement)(a.InnerBlocks,{allowedBlocks:["jetpack/button"],template:[["jetpack/button",{text:"Print Recipe"}]]}))))}},67868:(e,t,n)=>{"use strict";n.d(t,{U:()=>d,W:()=>p});var r=n(82170),a=n(85985),s=n(86087),o=n(27723),i=n(85660),l=n(80375),c=n(54886),u=n(80339);const __=o.__,d="recipe-details",p={title:__("Recipe Details","jetpack"),description:(0,r.createElement)(s.Fragment,null,(0,r.createElement)("p",null,__("Recipe Details","jetpack"))),keywords:[],supports:{align:["left","right","center"]},icon:(0,a.Cq)(i),category:"widgets",attributes:l.A,edit:c.A,save:u.A,parent:["jetpack/recipe"]}},80339:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=({attributes:e,className:t})=>{const{prepTime:n,prepTimeLabel:s,cookTime:o,cookTimeLabel:i,servings:l,servingsLabel:c}=e;return(0,r.createElement)("div",{className:t},(0,r.createElement)("div",{className:"wp-block-jetpack-recipe-details__detail"},(0,r.createElement)("p",null,s),(0,r.createElement)("p",{itemProp:"prepTime",content:`PT${n.toUpperCase()}`},n)),(0,r.createElement)("div",{className:"wp-block-jetpack-recipe-details__detail"},(0,r.createElement)("p",null,i),(0,r.createElement)("p",{itemProp:"cookTime",content:`PT${o.toUpperCase()}`},o)),(0,r.createElement)("div",{className:"wp-block-jetpack-recipe-details__detail"},(0,r.createElement)("p",null,c),(0,r.createElement)("p",{itemProp:"recipeYield"},l)),(0,r.createElement)("div",{className:"wp-block-jetpack-recipe-details__detail wp-block-jetpack-recipe-details__detail--print"},(0,r.createElement)(a.InnerBlocks.Content,null)))}},81629:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(94715),s=n(27723);const __=s.__;const o=function({className:e}){const t=[["jetpack/recipe-hero"],["core/heading",{level:2,placeholder:__("Recipe Title","jetpack"),className:"wp-block-jetpack-recipe-title"}],["core/separator",{color:"--wp--custom--color--foreground",className:"is-style-wide",style:"wide"}],["core/paragraph",{placeholder:__("Recipe Description","jetpack"),className:"wp-block-jetpack-recipe-description"}],["jetpack/recipe-details",{}],["core/columns",{},[["core/column",{width:"33.33%"},[["core/heading",{level:3,
2024-04-17 11:32:24 +02:00
// translators: Ingredients heading for a recipe block.
content:__("Ingredients","jetpack")}],["jetpack/recipe-ingredients-list"]]],["core/column",{width:"66.66%"},[["core/heading",{level:3,
// translators: Instructions heading for a recipe block.
2025-02-28 08:42:11 +01:00
content:__("Instructions","jetpack")}],["jetpack/recipe-steps"]]]]]];return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",(0,a.useBlockProps)({className:e}),(0,r.createElement)(a.InnerBlocks,{template:t})))}},16636:(e,t,n)=>{"use strict";var r=n(94375),a=n(85660),s=n(67868),o=n(81629),i=n(35970),l=n(64947),c=n(665),u=n(5440),d=n(54348),p=n(95413);(0,r.M)(a,{edit:o.A,save:u.A},[{name:s.U,settings:s.W},{name:i.UU,settings:i.W0},{name:c.UU,settings:c.W0},{name:l.UU,settings:l.W0},{name:p.UU,settings:p.W0},{name:d.UU,settings:d.W0}])},82628:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=function({className:e,hasInnerBlocks:t}){return(0,r.createElement)("div",{className:e},(0,r.createElement)(a.InnerBlocks,{allowedBlocks:["core/image","jetpack/slideshow","core/cover"],renderAppender:!t&&a.InnerBlocks.ButtonBlockAppender}))}},35970:(e,t,n)=>{"use strict";n.d(t,{UU:()=>u,W0:()=>d});var r=n(82170),a=n(85985),s=n(86087),o=n(27723),i=n(85660),l=n(82628),c=n(66249);const __=o.__,u="recipe-hero",d={title:__("Recipe Hero","jetpack"),description:(0,r.createElement)(s.Fragment,null,(0,r.createElement)("p",null,__("Image area for the recipe.","jetpack"))),keywords:[],icon:(0,a.Cq)(i),category:"widgets",edit:l.A,save:c.A,parent:["jetpack/recipe"]}},66249:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=({className:e})=>(0,r.createElement)("div",{className:e},(0,r.createElement)(a.InnerBlocks.Content,null))},70922:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={ingredient:{type:"string",selector:".ingredientText"}}},68835:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=function({className:e,attributes:t,setAttributes:n}){const{ingredient:s}=t;return(0,r.createElement)("div",{className:e},(0,r.createElement)(a.RichText,{tagName:"p",className:"ingredientText",value:s,onChange:e=>n({ingredient:e})}))}},64947:(e,t,n)=>{"use strict";n.d(t,{UU:()=>d,W0:()=>p});var r=n(82170),a=n(85985),s=n(86087),o=n(27723),i=n(85660),l=n(70922),c=n(68835),u=n(51166);const __=o.__,d="recipe-ingredient-item",p={title:__("Recipe Ingredient Item","jetpack"),description:(0,r.createElement)(s.Fragment,null,(0,r.createElement)("p",null,__("A single ingredient associated with a recipe.","jetpack"))),keywords:[],icon:(0,a.Cq)(i),category:"widgets",attributes:l.A,edit:c.A,save:u.A,parent:["jetpack/recipe"]}},51166:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=({className:e,attributes:t})=>{const{ingredient:n}=t;return(0,r.createElement)("div",{className:e},(0,r.createElement)(a.RichText.Content,{tagName:"p",itemprop:"recipeIngredient",value:n}))}},75636:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={ingredients:{type:"string[]"}}},17257:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=function({className:e}){return(0,r.createElement)("div",{className:e},(0,r.createElement)(a.InnerBlocks,{allowedBlocks:["jetpack/recipe-ingredient-item"],renderAppender:a.InnerBlocks.ButtonBlockAppender}))}},665:(e,t,n)=>{"use strict";n.d(t,{UU:()=>d,W0:()=>p});var r=n(82170),a=n(85985),s=n(86087),o=n(27723),i=n(85660),l=n(75636),c=n(17257),u=n(89732);const __=o.__,d="recipe-ingredients-list",p={title:__("Recipe Ingredients List","jetpack"),description:(0,r.createElement)(s.Fragment,null,(0,r.createElement)("p",null,__("Recipe ingredient list","jetpack"))),icon:(0,a.Cq)(i),category:"widgets",keywords:[],attributes:l.A,edit:c.A,save:u.A,parent:["jetpack/recipe"]}},89732:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=({className:e})=>(0,r.createElement)("div",{className:e},(0,r.createElement)(a.InnerBlocks.Content,null))},5440:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=({className:e})=>(0,r.createElement)("div",{className:e},(0,r.createElement)(a.InnerBlocks.Content,null))},95478:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=function({className:e}){return(0,r.createElement)("li",null,(0,r.createElement)("div",{className:e},(0,r.createElement)(a.InnerBlocks,{al
_n("This block will only appear to people who have visited this page more than %d time.","This block will only appear to people who have visited this page more than %d times.",+o,"jetpack"),o):1===o?__("This block will only appear to people who are visiting this page for the first time.","jetpack"):(0,d.sprintf)(/* translators: placeholder is a number. */
_n("This block will only appear to people who are visiting this page for %d time.","This block will only appear to people who have visited this page at most %d times.",+o,"jetpack"),o)),(0,s.createElement)("div",{className:"wp-block-jetpack-repeat-visitor__inner-container"},(0,s.createElement)(i.InnerBlocks,null)))}))},53183:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=()=>{const e=a.useBlockProps.save();return(0,r.createElement)("div",e,(0,r.createElement)("div",{className:"wp-block-jetpack-repeat-visitor__inner-container"},(0,r.createElement)(a.InnerBlocks.Content,null)))}},84730:(e,t,n)=>{"use strict";n.d(t,{DF:()=>r,aV:()=>s,et:()=>a});const r="after-visits",a="before-visits",s=3},31566:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(94715),s=n(84730);const o={attributes:{criteria:{type:"string",default:s.DF},threshold:{type:"number",default:s.aV}},supports:{html:!1},save:({className:e})=>(0,r.createElement)("div",{className:e},(0,r.createElement)(a.InnerBlocks.Content,null))}},79238:(e,t,n)=>{"use strict";var r=n(94375),a=n(20242),s=n(34570),o=n(53183),i=n(31566);(0,r.M)(a,{edit:s.A,save:o.A,deprecated:[i.A]})},24097:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);function s(){const e=(0,a.useBlockProps)();return(0,r.createElement)("div",e,(0,r.createElement)(a.InnerBlocks,{template:[["jetpack/whatsapp-button",{}]],allowedBlocks:["jetpack/whatsapp-button"]}))}},38136:(e,t,n)=>{"use strict";var r=n(94375),a=n(58180),s=n(24097),o=n(92908),i=n(92335),l=n(7651);(0,r.M)(a,{edit:s.A,save:o.A,variations:i.A},[{name:l.UU,settings:l.W0}])},92908:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=()=>{const e=a.useBlockProps.save();return(0,r.createElement)("div",e,(0,r.createElement)(a.InnerBlocks.Content,null))}},57699:(e,t,n)=>{"use strict";n.d(t,{N:()=>r});const r=[{code:"US",label:"🇺🇸 +1",value:"1US"},{code:"CA",label:"🇨🇦 +1",value:"1CA"},{code:"BS",label:"🇧🇸 +1242",value:"1242BS"},{code:"BB",label:"🇧🇧 +1246",value:"1246BB"},{code:"AI",label:"🇦🇮 +1264",value:"1264AI"},{code:"AG",label:"🇦🇬 +1268",value:"1268AG"},{code:"VG",label:"🇻🇬 +1284",value:"1284VG"},{code:"VI",label:"🇻🇮 +1340",value:"1340VI"},{code:"BM",label:"🇧🇲 +1441",value:"1441BM"},{code:"GD",label:"🇬🇩 +1473",value:"1473GD"},{code:"TC",label:"🇹🇨 +1649",value:"1649TC"},{code:"MS",label:"🇲🇸 +1664",value:"1664MS"},{code:"MP",label:"🇲🇵 +1670",value:"1670MP"},{code:"GU",label:"🇬🇺 +1671",value:"1671GU"},{code:"AS",label:"🇦🇸 +1684",value:"1684AS"},{code:"LC",label:"🇱🇨 +1758",value:"1758LC"},{code:"DM",label:"🇩🇲 +1767",value:"1767DM"},{code:"VC",label:"🇻🇨 +1784",value:"1784VC"},{code:"DO",label:"🇩🇴 +1849",value:"1849DO"},{code:"TT",label:"🇹🇹 +1868",value:"1868TT"},{code:"KN",label:"🇰🇳 +1869",value:"1869KN"},{code:"JM",label:"🇯🇲 +1876",value:"1876JM"},{code:"PR",label:"🇵🇷 +1939",value:"1939PR"},{code:"EG",label:"🇪🇬 +20",value:"20EG"},{code:"MA",label:"🇲🇦 +212",value:"212MA"},{code:"DZ",label:"🇩🇿 +213",value:"213DZ"},{code:"TN",label:"🇹🇳 +216",value:"216TN"},{code:"LY",label:"🇱🇾 +218",value:"218LY"},{code:"GM",label:"🇬🇲 +220",value:"220GM"},{code:"SN",label:"🇸🇳 +221",value:"221SN"},{code:"MR",label:"🇲🇷 +222",value:"222MR"},{code:"ML",label:"🇲🇱 +223",value:"223ML"},{code:"GN",label:"🇬🇳 +224",value:"224GN"},{code:"CI",label:"🇨🇮 +225",value:"225CI"},{code:"BF",label:"🇧🇫 +226",value:"226BF"},{code:"NE",label:"🇳🇪 +227",value:"227NE"},{code:"TG",label:"🇹🇬 +228",value:"228TG"},{code:"BJ",label:"🇧🇯 +229",value:"229BJ"},{code:"MU",label:"🇲🇺 +230",value:"230MU"},{code:"LR",label:"🇱🇷 +231",value:"231LR"},{code:"SL",label:"🇸🇱 +232",value:"232SL"},{code:"GH",label:"🇬🇭 +233",value:"233GH"},{code:"NG",label:"🇳🇬 +234",value:"234NG"},{code:"TD",label:"🇹🇩 +235",value:"235TD"},{code:"CF",label:"🇨🇫 +236",value:"236CF"},{code:"CM",label:"🇨🇲
// translators: option to print the content - a verb.
label:__("Print","jetpack")},
// translators: option to print the content - a verb labelling a button.
title:__("Print","jetpack"),icon:(0,r.createElement)(s.d6,{icon:"print",size:24})},{name:"facebook",attributes:{service:"facebook",label:"Facebook"},title:"Facebook",icon:(0,r.createElement)(s.d6,{icon:"facebook",size:24})},{name:"linkedin",attributes:{service:"linkedin",label:"LinkedIn"},title:"LinkedIn",isDefault:!0,icon:(0,r.createElement)(s.d6,{icon:"linkedin",size:24})},{name:"mail",attributes:{service:"mail",
// translators: option to share the content by email - a verb.
label:__("Mail","jetpack")},
// translators: option to share the content by email - a verb labelling a button.
title:__("Mail","jetpack"),keywords:["email","e-mail"],icon:(0,r.createElement)(s.d6,{icon:"mail",size:24})},{name:"mastodon",attributes:{service:"mastodon",label:"Mastodon"},title:"Mastodon",icon:(0,r.createElement)(s.d6,{icon:"mastodon",size:24})},{name:"pinterest",attributes:{service:"pinterest",label:"Pinterest"},title:"Pinterest",icon:(0,r.createElement)(s.d6,{icon:"pinterest",size:24})},{name:"pocket",attributes:{service:"pocket",label:"Pocket"},title:"Pocket",icon:(0,r.createElement)(s.d6,{icon:"pocket",size:24})},{name:"reddit",attributes:{service:"reddit",label:"Reddit"},title:"Reddit",icon:(0,r.createElement)(s.d6,{icon:"reddit",size:24})},{name:"telegram",attributes:{service:"telegram",label:"Telegram"},title:"Telegram",icon:(0,r.createElement)(s.d6,{icon:"telegram",size:24})},{name:"threads",attributes:{service:"threads",label:"Threads"},title:"Threads",icon:(0,r.createElement)(s.d6,{icon:"threads",size:24})},{name:"tumblr",attributes:{service:"tumblr",label:"Tumblr"},title:"Tumblr",icon:(0,r.createElement)(s.d6,{icon:"tumblr",size:24})},{name:"whatsapp",attributes:{service:"whatsapp",label:"WhatsApp"},title:"WhatsApp",icon:(0,r.createElement)(s.d6,{icon:"whatsapp",size:24})},{name:"x",attributes:{service:"x",label:"X"},keywords:["twitter","x"],title:"X",icon:(0,r.createElement)(s.d6,{icon:"x",size:24})},{name:"twitter",attributes:{service:"twitter",label:"Twitter"},keywords:["twitter"],title:"Twitter",icon:(0,r.createElement)(s.d6,{icon:"twitter",size:24})},{name:"nextdoor",attributes:{service:"nextdoor",label:"Nextdoor"},title:"Nextdoor",icon:(0,r.createElement)(s.d6,{icon:"nextdoor",size:24})},{name:"native-share",attributes:{service:"share",
// translators: option to share the content - a verb.
label:__("Share","jetpack")},
// translators: option to share the content - a verb labelling a button.
title:__("Native Share","jetpack"),icon:(0,r.createElement)(s.d6,{icon:"share",size:24}),description:__("Share with native tools on users device or copy to clipboard otherwise","jetpack")}];o.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.service===t.service)}));const i=o},11906:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(94715),s=n(56427),o=n(27723),i=n(83883);const __=o.__,l=[{name:__("Small","jetpack"),value:"has-small-icon-size"},{name:__("Normal","jetpack"),value:"has-normal-icon-size"},{name:__("Large","jetpack"),value:"has-large-icon-size"},{name:__("Huge","jetpack"),value:"has-huge-icon-size"}],c=e=>{const{attributes:t,setAttributes:n}=e,{size:o}=t,c=e=>o===e||!o&&"has-normal-icon-size"===e;return(0,r.createElement)(a.BlockControls,{group:"other"},(0,r.createElement)(s.ToolbarDropdownMenu,{label:__("Size","jetpack"),text:__("Size","jetpack"),icon:null,popoverProps:{position:"bottom right"}},(()=>(0,r.createElement)(s.MenuGroup,null,l.map((({name:e,value:t})=>(0,r.createElement)(s.MenuItem,{icon:c(t)&&i.A,isSelected:c(t),key:t,role:"menuitemradio",onClick:()=>{n({size:t})}},e)))))))}},67650:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(96072),a=n.n(r),s=n(82170),o=n(94715),i=n(56427),l=n(27723);const __=l.__,c=(0,o.withColors)({iconColor:"icon-color",iconBackgroundColor:"icon-background-color"})((e=>{const{clientId:t,attributes:n,iconBackgroundColor:r,iconColor:l,setAttributes:c,setIconBackgroundColor:u,setIconColor:d}=e,{iconBackgroundColorValue:p,iconColorValue:m}=n,{styleType:h}=n,g=(0,o.__experimentalUseMultipleOriginColorsAndGradients)(),f=[{value:l.color||m,onChange:e=>{d(e),c({iconColorValue:e})},label:__("Icon color","jetpack"),resetAllFilter:()=>{d(void 0),c({iconColorValue:void 0})}},{value:r.color||p,gradients:"",onChange:e=>{u(e),c({iconBackgroundColorValue:e})},onGradientChange:()=>{},label:__("Icon background","jetpack"),resetAllFilter:()=>{u(void 0),c({iconBackgroundColorValue:void 0})}}];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(o.InspectorControls,null,(0,s.createElement)(i.PanelBody,{title:__("Settings","jetpack")},(0,s.createElement)(i.MenuItemsChoice,{choices:[/* translators: Sharing: Sharing button option label. */
2024-02-16 11:03:01 +01:00
{value:"icon-text",label:__("Icon & Text","jetpack")},/* translators: Sharing: Sharing button option label. */
{value:"icon",label:__("Icon Only","jetpack")},/* translators: Sharing: Sharing button option label. */
2025-02-28 08:42:11 +01:00
{value:"text",label:__("Text Only","jetpack")}],value:h,onSelect:e=>c({styleType:e})}))),(0,s.createElement)(o.InspectorControls,{group:"color"},f.map((({onChange:e,label:n,value:r,resetAllFilter:i})=>(0,s.createElement)(o.__experimentalColorGradientSettingsDropdown,a()({key:`social-links-color-${n}`,__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:r,label:n,onColorChange:e,isShownByDefault:!0,resetAllFilter:i,enableAlpha:!0,clearable:!0}],panelId:t,gradients:""},g)))),(0,s.createElement)(o.ContrastChecker,{textColor:m,backgroundColor:p,isLargeText:!1})))}))},83597:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(82170),a=n(94715),s=n(27723),o=n(13022),i=n(11906),l=n(67650);const __=s.__,c=["jetpack/sharing-button"];const u=function(e){const{attributes:t}=e,{size:n}=t,s=(0,r.createElement)("li",null,__("Click plus to add a Sharing Button","jetpack")),u=(0,o.A)(n,"jetpack-sharing-buttons__services-list"),d=(0,a.useBlockProps)({className:u}),p=(0,a.useInnerBlocksProps)(d,{allowedBlocks:c,placeholder:s,templateLock:!1,orientation:t.layout?.orientation??"horizontal",sharingEventsAdded:!0,__experimentalAppenderTagName:"li"});return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.A,e),(0,r.createElement)(l.A,e),(0,r.createElement)("ul",p))}},74956:(e,t,n)=>{"use strict";var r=n(94375),a=n(32870),s=n(83597),o=n(53840);(0,r.M)(a,{edit:s.A,save:o.A})},53840:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(96072),a=n.n(r),s=n(82170),o=n(94715),i=n(13022);function l({attributes:e}){const{size:t}=e,n=(0,i.A)(t,"jetpack-sharing-buttons__services-list"),r=o.useBlockProps.save({className:n}),l=o.useInnerBlocksProps.save(r);return(0,s.createElement)("ul",a()({},l,{id:"jetpack-sharing-serivces-list"}))}},48715:(e,t,n)=>{"use strict";var r=n(85985),a=n(18692);(0,r.vp)(a.U,a.W)},18692:(e,t,n)=>{"use strict";n.d(t,{U:()=>d,W:()=>p});var r=n(82170),a=n(56427),s=n(47143),o=n(86087),i=n(27723),l=n(66087),c=n(71046),u=n(90062);const __=i.__,d="shortlinks",p={render:()=>(0,r.createElement)(h,null)};class m extends o.Component{render(){const{shortlink:e}=this.props;return e?(0,r.createElement)(u.A,null,(0,r.createElement)(a.PanelBody,{title:__("Shortlink","jetpack"),className:"jetpack-shortlinks__panel",initialOpen:!1},(0,r.createElement)(c.A,{link:e}))):null}}const h=(0,s.withSelect)((e=>{const t=e("core/editor").getCurrentPost();return{shortlink:(0,l.get)(t,"jetpack_shortlink","")}}))(m)},52362:(e,t,n)=>{"use strict";n.d(t,{OS:()=>a,Z3:()=>r,oU:()=>s});const r="jp_pay_product",a="USD",s=[a,"EUR","AUD","BRL","CAD","CZK","DKK","HKD","HUF","ILS","JPY","MYR","MXN","TWD","NZD","NOK","PHP","PLN","GBP","RUB","SGD","SEK","CHF","THB"]},77513:(e,t,n)=>{"use strict";n.d(t,{H:()=>o});var r=n(82170),a=n(56427),s=n(27723);const __=s.__;function o({setAttributes:e,postLinkText:t}){return(0,r.createElement)(a.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1},(0,r.createElement)(a.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Purchase link text","jetpack"),help:__("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text",placeholder:__("Click here to purchase","jetpack"),onChange:t=>e({postLinkText:t}),value:t}))}},54719:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(86087);const s={attributes:{currency:{type:"string",default:"USD"},content:{type:"string",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",default:null},featuredMediaTitle:{type:"string",default:null},multiple:{type:"boolean",default:!1},price:{type:"number"},productId:{type:"number"},title:{type:"string",default:""}},supports:{className:!1,customClassName:!1,html:!1,reusable:!1},save:({attributes:e})=>{const{productId:t}=e;return t?(0,r.createElement)(a.RawHTML,null,`[simple-payment id="${t}"]`):null}}},14604:(e,t,n)=>{"use strict";n.d(t,{A:()=>w});var r=n(82170),a=n(3975),s=n(94715),o=n(56427),i=n(29491),l=n(47143),c=n(
__("%s is not a valid email address.","jetpack"),n):null,fieldPriceError:"spay_price"===t?__("Invalid price.","jetpack"):null})})).finally((()=>{this.setState({isSavingProduct:!1})}))}))}validateAttributes=()=>{const e=this.validatePrice(),t=this.validateTitle(),n=this.validateEmail(),r=this.validateCurrency();return e&&t&&n&&r};validateCurrency=()=>{const{currency:e}=this.props.attributes;return g.oU.includes(e)};validatePrice=()=>{const{currency:e,price:t}=this.props.attributes;if(!t||0===parseFloat(t))return this.setState({fieldPriceError:__("If youre selling something, you need a price tag. Add yours here.","jetpack")}),!1;if(Number.isNaN(parseFloat(t)))return this.setState({fieldPriceError:__("Invalid price","jetpack")}),!1;if(parseFloat(t)<0)return this.setState({fieldPriceError:__("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")}),!1;const{precision:n}=(0,a.i)(e);return(0,v.w1)(t)>n?0===n?(this.setState({fieldPriceError:__("We know every penny counts, but prices in this currency cant contain decimal values.","jetpack")}),!1):(this.setState({fieldPriceError:(0,u.sprintf)(/* translators: Placeholder is a number of decimals in a number. */
_n("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",n,"jetpack"),n)}),!1):(this.state.fieldPriceError&&this.setState({fieldPriceError:null}),!0)};validateEmail=()=>{const{email:e}=this.props.attributes;return e?p.validate(e)?(this.state.fieldEmailError&&this.setState({fieldEmailError:null}),!0):(this.setState({fieldEmailError:(0,u.sprintf)(/* translators: placeholder is an email address. */
__("%s is not a valid email address.","jetpack"),e)}),!1):(this.setState({fieldEmailError:__("We want to make sure payments reach you, so please add an email address.","jetpack")}),!1)};validateTitle=()=>{const{title:e}=this.props.attributes;return e?(this.state.fieldTitleError&&this.setState({fieldTitleError:null}),!0):(this.setState({fieldTitleError:__("Please add a brief title so that people know what theyre paying for.","jetpack")}),!1)};handleEmailChange=e=>{this.props.setAttributes({email:e}),this.setState({fieldEmailError:null})};handleContentChange=e=>{this.props.setAttributes({content:e})};handlePriceChange=e=>{e=parseFloat(e),isNaN(e)?this.props.setAttributes({price:void 0}):this.props.setAttributes({price:e}),this.setState({fieldPriceError:null})};handleCurrencyChange=e=>{this.props.setAttributes({currency:e})};handleMultipleChange=e=>{this.props.setAttributes({multiple:!!e})};handleTitleChange=e=>{this.props.setAttributes({title:e}),this.setState({fieldTitleError:null})};getCurrencyList=g.oU.map((e=>{const{symbol:t}=(0,a.i)(e);return{value:e,label:t===e?e:`${e} ${(0,m.trimEnd)(t,".")}`}}));renderSettings=()=>(0,r.createElement)(s.InspectorControls,null,(0,r.createElement)(o.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1},(0,r.createElement)(o.TextControl,{label:__("Purchase link text","jetpack"),help:__("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text",placeholder:__("Click here to purchase","jetpack"),onChange:e=>this.props.setAttributes({postLinkText:e}),value:this.props.attributes.postLinkText})));render(){const{fieldEmailError:e,fieldPriceError:t,fieldTitleError:n}=this.state,{attributes:a,instanceId:s,isSelected:i,setAttributes:l,simplePayment:c}=this.props,{content:u,currency:p,email:g,featuredMediaId:k,featuredMediaUrl:y,featuredMediaTitle:w,multiple:E,price:_,productId:C,title:A}=a,x=C&&(0,m.isEmpty)(c);if(!i&&x)return(0,r.createElement)("div",{className:"simple-payments__loading"},(0,r.createElement)(b.A,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!i&&g&&_&&A&&!e&&!t&&!n)return(0,r.createElement)(b.A,{"aria-busy":"false",content:u,featuredMediaUrl:y,featuredMediaTitle:w,formattedPrice:(0,v.N_)(_,p),multiple:E,title:A});const j=x?o.Disabled:"div";return(0,r.createElement)(j,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),(0,r.createElement)(f.A,{featuredMediaId:k,featuredMediaUrl:y,featuredMediaTitle:w,setAttributes:l}),(0,r.createElement)("div",null,(0,r.createElement)(o.TextControl,{"aria-describedby":`${s}-title-error`,className:(0,d.A)("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":n}),label:__("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:__("Item name","jetpack"),required:!0,type:"text",value:A}),(0,r.createElement)(h.A,{id:`${s}-title-error`,isError:!0},n),(0,r.createElement)(o.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:__("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:__("Describe your item in a few words","jetpack"),value:u}),(0,r.createElement)("div",{className:"simple-payments__price-container"},(0,r.createElement)(o.SelectControl,{__next40pxDefaultSize:!0,className:"simple-payments__field simple-payments__field-currency",label:__("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:p}),(0,r.createElement)(o.TextControl,{"aria-describedby":`${s}-price-error`,className:(0,d.A)("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":t}),label:__("Price","jetpack"),onChange:this.handlePriceChange,placeholder:(0,v.N_)(0,p,!1),required:!0,step:"1",type:"number",value:_||""}),(0,r.createElement)(h.A,{id:`${s}-price-error`,isError:!0},t)),(0,r.createElement)("div",{className:"simple-payments__field-multiple"},(0,r.create
__("%s is not a valid email address.","jetpack"),R):null),V("spay_price"===t?__("Invalid price.","jetpack"):null)})).finally((()=>{W(!1)}))},K=()=>{const e=Q(),t=ee(),n=X(),r=Y();return e&&t&&n&&r},Y=()=>f.oU.includes(N),Q=()=>{if(!B||0===parseFloat(B))return V(__("If youre selling something, you need a price tag. Add yours here.","jetpack")),!1;if(Number.isNaN(parseFloat(B)))return V(__("Invalid price","jetpack")),!1;if(parseFloat(B)<0)return V(__("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")),!1;const{precision:e}=(0,a.i)(N);return(0,y.w1)(B)>e?0===e?(V(__("We know every penny counts, but prices in this currency cant contain decimal values.","jetpack")),!1):(V((0,u.sprintf)(/* translators: Placeholder is a number of decimals in a number. */
_n("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",e,"jetpack"),e)),!1):(U&&V(null),!0)},X=()=>R?m.validate(R)?(O&&H(null),!0):(H((0,u.sprintf)(/* translators: Placeholder is an email address. */
__("%s is not a valid email address.","jetpack"),R)),!1):(H(__("We want to make sure payments reach you, so please add an email address.","jetpack")),!1),ee=()=>D?(q&&G(null),!0):(G(__("Please add a brief title so that people know what theyre paying for.","jetpack")),!1),te=e=>{i({email:e}),H(null)},ne=e=>{i({content:e})},re=e=>{const t=parseFloat(e);isNaN(t)?i({price:void 0}):i({price:t}),V(null)},ae=e=>{i({currency:e})},se=e=>{i({multiple:!!e})},oe=e=>{i({title:e}),G(null)},ie=f.oU.map((e=>{const{symbol:t}=(0,a.i)(e);return{value:e,label:t===e?e:`${e} ${(0,h.trimEnd)(t,".")}`}}));let le;if((0,c.useEffect)((()=>{(!I&&_||!A)&&J(),window.wp?.customize?.bind("change",(e=>{let t;const n=e.id.match(/^widget_(.+)(?:\[(\d+)\])$/);if(n){t=`${n[1]}-${parseInt(n[2],10)}`}else t=e.id;t===(0,d.getWidgetIdFromBlock)(x)&&K()&&J()}))}),[]),(0,c.useEffect)((()=>{w&&Z.current&&!(0,h.isEmpty)(w)&&(i({content:(0,h.get)(w,["content","raw"],S),currency:(0,h.get)(w,["meta","spay_currency"],N),email:(0,h.get)(w,["meta","spay_email"],R),featuredMediaId:(0,h.get)(w,["featured_media"],P),featuredMediaUrl:(0,h.get)(E,"url",L),featuredMediaTitle:(0,h.get)(E,"title",T),multiple:Boolean((0,h.get)(w,["meta","spay_multiple"],Boolean(M))),price:(0,h.get)(w,["meta","spay_price"],B||void 0),title:(0,h.get)(w,["title","raw"],D)}),Z.current=!1)}),[w]),(0,c.useEffect)((()=>{j&&(_||!A)&&K()?J():n||K()}),[j,n]),(0,c.useEffect)((()=>{const t=C&&C!==e.postLinkUrl,n=!e.postLinkText;(t||n)&&i({...t&&{postLinkUrl:C},...n&&{postLinkText:__("Click here to purchase.","jetpack")}})}),[C,e]),!n&&F)le=(0,r.createElement)("div",{className:"simple-payments__loading"},(0,r.createElement)(k.A,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));else if(n||!R||!B||!D||O||U||q){const n=F?o.Disabled:"div";le=(0,r.createElement)(n,{className:"simple-payments__wrapper"},(0,r.createElement)(s.InspectorControls,null,(0,r.createElement)(b.H,{postLinkText:e.postLinkText,setAttributes:i})),(0,r.createElement)(v.A,{featuredMediaId:P,featuredMediaUrl:L,featuredMediaTitle:T,setAttributes:i}),(0,r.createElement)("div",null,(0,r.createElement)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-describedby":`${t}-title-error`,className:(0,p.A)("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":q}),label:__("Item name","jetpack"),onChange:oe,placeholder:__("Item name","jetpack"),required:!0,type:"text",value:D}),(0,r.createElement)(g.A,{id:`${t}-title-error`,isError:!0},q),(0,r.createElement)(o.TextareaControl,{__nextHasNoMarginBottom:!0,className:"simple-payments__field simple-payments__field-content",label:__("Describe your item in a few words","jetpack"),onChange:ne,placeholder:__("Describe your item in a few words","jetpack"),"aria-label":__("Describe your item in a few words","jetpack"),value:S}),(0,r.createElement)("div",{className:"simple-payments__price-container"},(0,r.createElement)(o.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"simple-payments__field simple-payments__field-currency",label:__("Currency","jetpack"),onChange:ae,options:ie,value:N}),(0,r.createElement)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-describedby":`${t}-price-error`,className:(0,p.A)("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":U}),label:__("Price","jetpack"),onChange:re,placeholder:(0,y.$g)(0,N,!1),required:!0,step:"1",type:"number",value:B||""}),(0,r.createElement)(g.A,{id:`${t}-price-error`,isError:!0},U)),(0,r.createElement)("div",{className:"simple-payments__field-multiple"},(0,r.createElement)(o.ToggleControl,{__nextHasNoMarginBottom:!0,checked:Boolean(M),label:__("Allow people to buy more than one item at a time","jetpack"),onChange:se})),(0,r.createElement)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-describedby":`${t}-email-${O?"error":"help"}`,className:(0,p.A)("simple-payments__field","simple-payments__field-email",{"simple-payments__field-ha
__("Go to slide %s","jetpack"),e)+'"></button>'}else a+=`<div class="swiper-pagination-simple">${t} / ${n}</div>`;return a}},16445:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(82170),a=n(63162),s=n(94715),o=n(56427),i=n(86087),l=n(27723),c=n(13022),u=n(66087),d=n(94107),p=n(39126),m=n(31837),h=n(57464);const __=l.__;class g extends i.Component{pendingRequestAnimationFrame=null;resizeObserver=null;static defaultProps={effect:"slide"};constructor(e){super(e),this.slideshowRef=(0,i.createRef)(),this.btnNextRef=(0,i.createRef)(),this.btnPrevRef=(0,i.createRef)(),this.paginationRef=(0,i.createRef)()}componentDidMount(){const{onError:e}=this.props;this.buildSwiper().then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{e(__("The Swiper library could not be loaded.","jetpack"))}))}componentWillUnmount(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}componentDidUpdate(e){const{align:t,autoplay:n,delay:r,effect:a,images:s,onError:o}=this.props;if(t===e.align&&(0,u.isEqual)(s,e.images)||this.swiperInstance&&this.swiperInstance.update(),a!==e.effect||n!==e.autoplay||r!==e.delay||s!==e.images){let t;t=this.swiperIndex?s.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{o(__("The Swiper library could not be loaded.","jetpack"))}))}}initializeResizeObserver=e=>{this.clearResizeObserver(),this.resizeObserver=new d.A((()=>{this.clearPendingRequestAnimationFrame(),this.pendingRequestAnimationFrame=requestAnimationFrame((()=>{(0,h.bz)(e),e.update()}))})),this.resizeObserver.observe(e.el)};clearPendingRequestAnimationFrame=()=>{this.pendingRequestAnimationFrame&&(cancelAnimationFrame(this.pendingRequestAnimationFrame),this.pendingRequestAnimationFrame=null)};clearResizeObserver=()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)};render(){if(!this.props?.images?.length)return null;const{autoplay:e,className:t,delay:n,effect:i,images:l}=this.props;return(0,r.createElement)("div",{className:t,"data-autoplay":e||null,"data-delay":e?n:null,"data-effect":i},(0,r.createElement)("div",{className:"wp-block-jetpack-slideshow_container swiper-container",ref:this.slideshowRef},(0,r.createElement)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"},l.map((({alt:e,caption:t,id:n,url:i})=>(0,r.createElement)("li",{className:(0,c.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,a.isBlobURL)(i)&&"is-transient"),key:n||i},(0,r.createElement)("figure",null,(0,r.createElement)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${n}`,"data-id":n,src:i}),(0,a.isBlobURL)(i)&&(0,r.createElement)(o.Spinner,null),t&&(0,r.createElement)(s.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})))))),(0,r.createElement)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),(0,r.createElement)("a",{className:"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white",ref:this.btnNextRef,role:"button"}),(0,r.createElement)("a",{"aria-label":"Pause Slideshow",className:"wp-block-jetpack-slideshow_button-pause",role:"button"}),(0,r.createElement)("div",{className:"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white",ref:this.paginationRef})))}prefersReducedMotion=()=>"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;buildSwiper=(e=0)=>(0,p.A)(this.slideshowRef.current,{autoplay:!(!this.props.autoplay||this.prefersReducedMotion())&&{delay:1e3*this.props.delay,disableOnInteraction:!1},effect:this.props.effect,loop:!0,initialSlide:e,navigation:{nextEl:this.btnNextRef.current,prevEl:this.btnPrevRef.current},pagination:{clickable:!0,el:this.paginationRef.current,type:"custom",renderCustom:m.y}},{init:h.rQ,imagesReady:h.bz,paginationRender:h.n7,transition
__("Go to slide %s","jetpack"),e)+'"></button>'}else a+=`<div class="swiper-pagination-simple">${t} / ${n}</div>`;return a}},71576:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(82170),a=n(63162),s=n(94715),o=n(56427),i=n(86087),l=n(27723),c=n(13022),u=n(66087),d=n(94107),p=n(13895),m=n(74194),h=n(25080);const __=l.__;class g extends i.Component{pendingRequestAnimationFrame=null;resizeObserver=null;static defaultProps={effect:"slide"};constructor(e){super(e),this.slideshowRef=(0,i.createRef)(),this.btnNextRef=(0,i.createRef)(),this.btnPrevRef=(0,i.createRef)(),this.paginationRef=(0,i.createRef)()}componentDidMount(){const{onError:e}=this.props;this.buildSwiper().then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{e(__("The Swiper library could not be loaded.","jetpack"))}))}componentWillUnmount(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}componentDidUpdate(e){const{align:t,autoplay:n,delay:r,effect:a,images:s,onError:o}=this.props;if(t===e.align&&(0,u.isEqual)(s,e.images)||this.swiperInstance&&this.swiperInstance.update(),a!==e.effect||n!==e.autoplay||r!==e.delay||s!==e.images){let t;t=this.swiperIndex?s.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{o(__("The Swiper library could not be loaded.","jetpack"))}))}}initializeResizeObserver=e=>{this.clearResizeObserver(),this.resizeObserver=new d.A((()=>{this.clearPendingRequestAnimationFrame(),this.pendingRequestAnimationFrame=requestAnimationFrame((()=>{(0,h.bz)(e),e.update()}))})),this.resizeObserver.observe(e.el)};clearPendingRequestAnimationFrame=()=>{this.pendingRequestAnimationFrame&&(cancelAnimationFrame(this.pendingRequestAnimationFrame),this.pendingRequestAnimationFrame=null)};clearResizeObserver=()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)};render(){if(!this.props?.images?.length)return null;const{autoplay:e,delay:t,effect:n,images:i}=this.props;return(0,r.createElement)("div",{"data-autoplay":e||null,"data-delay":e?t:null,"data-effect":n},(0,r.createElement)("div",{className:"wp-block-jetpack-slideshow_container swiper-container",ref:this.slideshowRef},(0,r.createElement)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"},i.map((({alt:e,caption:t,id:n,url:i})=>(0,r.createElement)("li",{className:(0,c.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,a.isBlobURL)(i)&&"is-transient"),key:n||i},(0,r.createElement)("figure",null,(0,r.createElement)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${n}`,"data-id":n,src:i}),(0,a.isBlobURL)(i)&&(0,r.createElement)(o.Spinner,null),t&&(0,r.createElement)(s.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})))))),(0,r.createElement)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),(0,r.createElement)("a",{className:"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white",ref:this.btnNextRef,role:"button"}),(0,r.createElement)("a",{"aria-label":"Pause Slideshow",className:"wp-block-jetpack-slideshow_button-pause",role:"button"}),(0,r.createElement)("div",{className:"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white",ref:this.paginationRef})))}prefersReducedMotion=()=>"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;buildSwiper=(e=0)=>(0,p.A)(this.slideshowRef.current,{autoplay:!(!this.props.autoplay||this.prefersReducedMotion())&&{delay:1e3*this.props.delay,disableOnInteraction:!1},effect:this.props.effect,loop:!0,initialSlide:e,navigation:{nextEl:this.btnNextRef.current,prevEl:this.btnPrevRef.current},pagination:{clickable:!0,el:this.paginationRef.current,type:"custom",renderCustom:m.y}},{init:h.rQ,imagesReady:h.bz,paginationRender:h.n7,transitionEnd:h.WF})}const f=g},89
__("Go to slide %s","jetpack"),e)+'"></button>'}else a+=`<div class="swiper-pagination-simple">${t} / ${n}</div>`;return a}},41952:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(94715),s=n(241);const o=({attributes:{align:e,autoplay:t,delay:n,effect:o,images:i},className:l})=>{const c=a.useBlockProps.save({className:l});return(0,r.createElement)(s.A,{align:e,autoplay:t,className:c.className,delay:n,effect:o,images:i})}},241:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(82170),a=n(63162),s=n(94715),o=n(56427),i=n(86087),l=n(27723),c=n(13022),u=n(66087),d=n(94107),p=n(33170),m=n(30889),h=n(34308);const __=l.__;class g extends i.Component{pendingRequestAnimationFrame=null;resizeObserver=null;static defaultProps={effect:"slide"};constructor(e){super(e),this.slideshowRef=(0,i.createRef)(),this.btnNextRef=(0,i.createRef)(),this.btnPrevRef=(0,i.createRef)(),this.paginationRef=(0,i.createRef)()}componentDidMount(){const{onError:e}=this.props;this.buildSwiper().then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{e(__("The Swiper library could not be loaded.","jetpack"))}))}componentWillUnmount(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}componentDidUpdate(e){const{align:t,autoplay:n,delay:r,effect:a,images:s,onError:o}=this.props;if(t===e.align&&(0,u.isEqual)(s,e.images)||this.swiperInstance&&this.swiperInstance.update(),a!==e.effect||n!==e.autoplay||r!==e.delay||s!==e.images){let t;t=this.swiperIndex?s.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{o(__("The Swiper library could not be loaded.","jetpack"))}))}}initializeResizeObserver=e=>{this.clearResizeObserver(),this.resizeObserver=new d.A((()=>{this.clearPendingRequestAnimationFrame(),this.pendingRequestAnimationFrame=requestAnimationFrame((()=>{(0,h.bz)(e),e.update()}))})),this.resizeObserver.observe(e.el)};clearPendingRequestAnimationFrame=()=>{this.pendingRequestAnimationFrame&&(cancelAnimationFrame(this.pendingRequestAnimationFrame),this.pendingRequestAnimationFrame=null)};clearResizeObserver=()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)};render(){if(!this.props?.images?.length)return null;const{autoplay:e,className:t,delay:n,effect:i,images:l}=this.props;return(0,r.createElement)("div",{className:t,"data-autoplay":e||null,"data-delay":e?n:null,"data-effect":i},(0,r.createElement)("div",{className:"wp-block-jetpack-slideshow_container swiper-container",ref:this.slideshowRef},(0,r.createElement)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"},l.map((({alt:e,caption:t,id:n,url:i},l)=>(0,r.createElement)("li",{className:(0,c.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,a.isBlobURL)(i)&&"is-transient"),key:n?`${n}-${l}`:`${i}-${l}`},(0,r.createElement)("figure",null,(0,r.createElement)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${n}`,"data-id":n,src:i}),(0,a.isBlobURL)(i)&&(0,r.createElement)(o.Spinner,null),t&&(0,r.createElement)(s.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})))))),(0,r.createElement)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),(0,r.createElement)("a",{className:"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white",ref:this.btnNextRef,role:"button"}),(0,r.createElement)("a",{"aria-label":"Pause Slideshow",className:"wp-block-jetpack-slideshow_button-pause",role:"button"}),(0,r.createElement)("div",{className:"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white",ref:this.paginationRef})))}prefersReducedMotion=()=>"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;buildSwiper=(e=0)=>(0,p.A)(this.slideshowRef.current,{autoplay:!(!this.props.autoplay||this.prefersReducedMot
2023-12-07 09:44:11 +01:00
__("Slide %d, currently selected","jetpack"),n+1):(0,a.sprintf)(/* translators: %d: Slide number. */
2025-02-28 08:42:11 +01:00
__("Go to slide %d","jetpack"),n+1)),(0,r.createElement)("button",{role:c?"presentation":"tab",key:n,className:(0,s.A)("wp-story-pagination-bullet",{"wp-story-pagination-ellipsis":e}),"aria-label":u,"aria-disabled":c||o,onClick:c||o?void 0:l,disabled:c},(0,r.createElement)("div",{className:"wp-story-pagination-bullet-bar"},(0,r.createElement)("div",{className:"wp-story-pagination-bullet-bar-progress",style:{width:`${i}%`}})))}},35941:(e,t,n)=>{"use strict";n.d(t,{d:()=>l,k:()=>i});var r=n(96072),a=n.n(r),s=n(82170),o=n(13022);const i=({className:e,size:t,label:n,isPressed:r,...i})=>(0,s.createElement)("button",a()({type:"button","aria-label":n,"aria-pressed":r,className:(0,o.A)("jetpack-mdc-icon-button","circle-icon","outlined","bordered",e),style:{width:`${t}px`,height:`${t}px`}},i)),l=({className:e,size:t=24,label:n,isPressed:r,...i})=>(0,s.createElement)("button",a()({type:"button","aria-label":n,"aria-pressed":r,className:(0,o.A)("jetpack-mdc-icon-button",e),style:{width:`${t}px`,height:`${t}px`}},i))},20058:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);const a=()=>(0,r.createElement)("div",{className:"wp-story-loading-spinner"},(0,r.createElement)("div",{className:"wp-story-loading-spinner__outer"},(0,r.createElement)("div",{className:"wp-story-loading-spinner__inner"})))},48907:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(82170),a=n(27723),s=n(35941),o=n(44227);const _x=a._x;function i({playing:e,muted:t,onPlayPressed:n,onMutePressed:a,showMute:i}){return(0,r.createElement)("div",{className:"wp-story-controls"},(0,r.createElement)(s.d,{isPressed:e,label:e?_x("pause","Button tooltip text","jetpack"):_x("play","Button tooltip text","jetpack",0),onClick:n},e?(0,r.createElement)(o.E$,null):(0,r.createElement)(o.ud,null)),i&&(0,r.createElement)(s.d,{isPressed:t,label:t?_x("unmute","Button tooltip text","jetpack"):_x("mute","Button tooltip text","jetpack",0),onClick:a},t?(0,r.createElement)(o.lQ,null):(0,r.createElement)(o.Fz,null)))}},41256:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(82170),a=n(27723),s=n(35941),o=n(44227);const __=a.__;function i({fullscreen:e,onExitFullscreen:t,siteIconUrl:n,storyTitle:a}){return e?(0,r.createElement)("div",{className:"wp-story-meta"},(0,r.createElement)("div",{className:"wp-story-icon"},(0,r.createElement)("img",{alt:__("Site icon","jetpack"),src:n,width:"40",height:"40"})),(0,r.createElement)("div",null,(0,r.createElement)("div",{className:"wp-story-title"},a)),(0,r.createElement)(s.d,{className:"wp-story-exit-fullscreen",label:__("Exit Fullscreen","jetpack"),onClick:t},(0,r.createElement)(o.US,null))):null}},44227:(e,t,n)=>{"use strict";n.d(t,{E$:()=>l,Ej:()=>p,Fz:()=>u,US:()=>c,af:()=>m,lQ:()=>d,ud:()=>i});var r=n(82170),a=n(5573),s=n(62289);const o=({children:e,size:t})=>(0,s.A)(e,t,t),i=({size:e})=>(0,r.createElement)(o,{size:e},(0,r.createElement)(a.Path,{d:"M8 5v14l11-7z"})),l=({size:e})=>(0,r.createElement)(o,{size:e},(0,r.createElement)(a.Path,{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})),c=({size:e})=>(0,r.createElement)(o,{size:e},(0,r.createElement)(a.Path,{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),u=({size:e})=>(0,r.createElement)(o,{size:e},(0,r.createElement)(a.Path,{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})),d=({size:e})=>(0,r.createElement)(o,{size:e},(0,r.createElement)(a.Path,{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"})),p=({size:e})=>(0,r.createElement)(o,{size:e},(0,r.createElement)(a.Path,{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),m=({size:e})=>(0,r.createElement)(o,{size:e},(0,r.createElement)(a.Path,{d:"M10 6L8.59 7
_n("<span>%s reader</span> is subscribed.","<span>%s readers</span> are subscribed.",N,"jetpack"),(0,a.A)(N,{notation:"compact",maximumFractionDigits:1})),{span:(0,r.createElement)("span",{style:{fontWeight:"bold"}})})),w&&(0,r.createElement)(o.__experimentalPanelColorGradientSettings,{title:__("Color","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",settings:[{colorValue:e.color,onColorChange:A,gradientValue:n.gradientValue,onGradientChange:n.setGradient,label:__("Button Background","jetpack")},{colorValue:R.color,onColorChange:x,label:__("Button Text","jetpack")},{colorValue:t.color,onColorChange:C,label:__("Border","jetpack")}],initialOpen:!0},(0,r.createElement)(o.ContrastChecker,{fontSize:k.size,textColor:R.color,backgroundColor:f.color,fallbackButtonBackgroundColor:b,fallbackTextColor:v})),!w&&(0,r.createElement)(o.PanelColorSettings,{title:__("Background Colors","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",colorSettings:[{value:e.color,onChange:A,label:__("Button Background Color","jetpack")},{value:R.color,onChange:x,label:__("Button Text Color","jetpack")},{value:t.color,onColorChange:C,label:__("Border Color","jetpack")}],initialOpen:!1},(0,r.createElement)(o.ContrastChecker,{fontSize:k.size,textColor:R.color,backgroundColor:f.color,fallbackButtonBackgroundColor:b,fallbackTextColor:v})),(0,r.createElement)(i.PanelBody,{title:__("Typography","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__textpanel"},(0,r.createElement)(o.FontSizePicker,{withSlider:!0,value:k.size,onChange:e=>{const t=e||p.Fm;_({fontSize:t,customFontSize:t})},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})),(0,r.createElement)(i.PanelBody,{title:__("Border","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__borderpanel"},(0,r.createElement)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:m,label:__("Border Radius","jetpack"),min:p.rG,max:p.Bs,initialPosition:p.Kn,allowReset:!0,onChange:e=>_({borderRadius:e})}),(0,r.createElement)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:h,label:__("Border Weight","jetpack"),min:p.ZS,max:p.JD,initialPosition:p.aS,allowReset:!0,onChange:e=>_({borderWeight:e})})),(0,r.createElement)(i.PanelBody,{title:__("Spacing","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__spacingpanel"},(0,r.createElement)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:E,label:__("Space Inside","jetpack"),min:p.rE,max:p.Vy,initialPosition:p.oi,allowReset:!0,onChange:e=>_({padding:e})}),(0,r.createElement)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:S,label:__("Space Between","jetpack"),min:p.Hq,max:p.Zi,initialPosition:p.E,allowReset:!0,onChange:e=>_({spacing:e})}),(0,r.createElement)(d.s,{width:P,onChange:e=>_({buttonWidth:e})})),(0,r.createElement)(i.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__displaypanel"},(0,r.createElement)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show subscriber count","jetpack"),checked:j,onChange:()=>{_({showSubscribersTotal:!j,includeSocialFollowers:void 0!==y&&y})},help:()=>{if(!N||N<1)return __("This will remain hidden until there is at least one subscriber.","jetpack")}}),M&&(0,r.createElement)(i.ToggleControl,{__nextHasNoMarginBottom:!0,disabled:!j,label:__("Include social followers in count","jetpack"),checked:void 0===y||y,onChange:()=>{_({includeSocialFollowers:void 0!==y&&!y})}}),(0,r.createElement)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Place button on new line","jetpack"),checked:g,onChange:()=>{_({buttonOnNewLine:!g})}}),(0,r.createElement)(i.TextareaControl,{__nextHasNoMarginBottom:!0,value:L,label:__("Input placeholder text","jetpack"),help:__("Edit the placeholder text of the email address input.","jetpack"),onChange:e=>_({subscribePlaceholder:e})}),!(0,s.Sy)()&&(0,r.createElement)(i.TextareaControl,{__nextHasNoMarginBottom:!0,value:T,label:__("Success message","jetpack"),help:__("Edit the m
_n("Join %s other subscriber","Join %s other subscribers",r,"jetpack"),(0,o.A)(r,{notation:"compact",maximumFractionDigits:1}))}})),Y=A({gradientAttribute:"emailFieldGradient",customGradientAttribute:"customEmailFieldGradient"}),Q=A({gradientAttribute:"buttonGradient",customGradientAttribute:"customButtonGradient"}),X={"no-border-radius":0===I,[L.class]:L.class,"has-text-color":j.color,[j.class]:j.class},ee={...X,"has-background":r.color||Y.gradientValue,[r.class]:!Y.gradientValue&&r.class,[Y.gradientClass]:Y.gradientClass},te={...X,"has-background":i.color||Q.gradientValue,[i.class]:!Q.gradientValue&&i.class,[Q.gradientClass]:Q.gradientClass},ne=e=>e||w.E,re={color:j.color,borderColor:R.color,borderRadius:I?I+"px":w.Kn+"px",borderWidth:D?D+"px":w.aS+"px",fontSize:L.size?L.size:w.Fm,padding:(e=>{const t=e||w.oi;return t+"px "+Math.round(1.5*t)+"px "+t+"px "+Math.round(1.5*t)+"px"})(H)},ae={"--subscribe-block-border-radius":I?I+"px":w.Kn+"px"},se={...re,...!r.color&&Y.gradientValue?{background:Y.gradientValue}:{backgroundColor:r.color}},oe={...re,...!i.color&&Q.gradientValue?{background:Q.gradientValue}:{backgroundColor:i.color},width:F};"button"!==Z&&($?oe.marginTop=ne(U)+"px":oe.marginLeft=ne(U)+"px");const ie=(0,u.usePrevious)(i);return(0,p.useEffect)((()=>{ie?.color===R?.color&&R?.color!==i?.color&&P(i.color)}),[i,ie,R,P]),(0,s.createElement)("div",a()({},M,{className:(0,h.A)(M.className,"wp-block-jetpack-subscriptions__container","wp-block-jetpack-subscriptions__supports-newline",$?"wp-block-jetpack-subscriptions__use-newline":void 0,G?"wp-block-jetpack-subscriptions__show-subs":void 0)}),(0,s.createElement)(l.InspectorControls,null,(0,s.createElement)(E.A,{buttonBackgroundColor:i,borderColor:R,buttonGradient:Q,borderRadius:I,borderWeight:D,buttonOnNewLine:$,emailFieldBackgroundColor:r,fallbackButtonBackgroundColor:x,fallbackTextColor:S,fontSize:L,includeSocialFollowers:O,isGradientAvailable:C,padding:H,setAttributes:n,setBorderColor:P,setButtonBackgroundColor:_,setTextColor:N,showSubscribersTotal:G,spacing:U,subscriberCount:J,textColor:j,buttonWidth:F,subscribePlaceholder:q,submitButtonText:V,successMessage:W})),(0,s.createElement)(l.BlockControls,null,(0,s.createElement)(c.Toolbar,{label:(0,v.$E)(T)},(0,s.createElement)(v.Ay,{context:"toolbar",hasTierPlans:T}))),(0,s.createElement)("div",{style:ae},(0,s.createElement)("div",{className:"wp-block-jetpack-subscriptions__container is-not-subscriber"},(0,s.createElement)("div",{className:"wp-block-jetpack-subscriptions__form",role:"form"},(0,s.createElement)("div",{className:"wp-block-jetpack-subscriptions__form-elements"},"button"!==Z&&(0,s.createElement)(c.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,placeholder:q,disabled:!0,className:(0,h.A)(ee,"wp-block-jetpack-subscriptions__textfield"),style:se}),(0,s.createElement)(l.RichText,{className:(0,h.A)(te,"wp-block-jetpack-subscriptions__button","wp-block-button__link"),onChange:e=>n({submitButtonText:e}),style:oe,value:V,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/strikethrough"]})))),G&&(0,s.createElement)("div",{className:"wp-block-jetpack-subscriptions__subscount"},K)))}))},13554:(e,t,n)=>{"use strict";var r=n(82170),a=n(85985),s=n(74997),o=n(47143),i=n(43656),l=n(86087),c=n(52619),u=n(27723),d=n(67709),p=n(62599),m=n(94375),h=n(99876),g=n(63200),f=n(39025),b=n(38387),v=n(3722),k=n(74500),y=n(48313);const __=u.__,w=h.name.replace("jetpack/","");(0,m.M)(h,{edit:b.h,transforms:{from:[{type:"block",isMultiBlock:!1,blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"blog_subscription"===e,transform:({instance:e})=>(0,s.createBlock)("jetpack/subscriptions",{showSubscribersTotal:e.raw.show_subscribers_total,submitButtonText:e.raw.subscribe_button,subscribePlaceholder:e.raw.subscribe_placeholder,successMessage:e.raw.success_message})},{type:"block",isMultiBlock:!1,blocks:["core/buttons"],transform:(e,t)=>{if(!t?.length)return(0,s.createBlock)("jetpack/subscriptions");const n=[];return t.forEach((e=>{const t=e?.attributes?.text;n.push((0,s.create
__("image %1$d of %2$d in gallery","jetpack"),t+1,n.length);return(0,r.createElement)(c.A,{alt:e.alt,"aria-label":i,height:e.height,id:e.id,origUrl:e.url,isSelected:s===t,key:t,link:e.link,linkTo:a,url:this.photonize(e),width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:o}=this.props,i=m(o)?d.A:u.A,l=this.props.images.map(this.renderImage,this);return(0,r.createElement)("div",{className:n},(0,r.createElement)(i,{align:e,columns:a,images:s,layoutStyle:o,renderedImages:l}),t)}}function m(e){return["circle","square"].includes(e)}function h(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,a]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,a);return r.toString()}},58070:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(82170),a=n(86087),s=n(94107),o=n(29971),i=n(75303),l=n(56237),c=n(34896),u=n(5236);class d extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;ro=null;componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:n}of e){const{width:e}=t;(0,u.S)(n).forEach((t=>(0,u.r)(t,e)))}}))};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new s.A(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}render(){const{align:e,columns:t,images:n,layoutStyle:a,renderedImages:s}=this.props,u=(0,c.mJ)(n),d="columns"===a?(0,c.FL)(u,t):(0,c.VU)(u,{isWide:["full","wide"].includes(e)});let p=0;return(0,r.createElement)(i.A,{galleryRef:this.gallery},d.map(((e,t)=>(0,r.createElement)(l.A,{key:t},e.map(((e,t)=>{const n=s.slice(p,p+e);return p+=e,(0,r.createElement)(o.A,{key:t},n)}))))))}}},34896:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,(t=>{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),b=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),v=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),w=x([1,1,1],3),E=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:b(a)&&v(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){const a=(0,r.sum)((0,r.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&w(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:E(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);const o=e.concat([s]),A=(0,r.sum)(s),x=a.slice(A);return n(o,x)};return n([],e)}function x(e,t){return n=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}function j(e){return t=>t.length>=
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:m,srcSet:h}=(0,c.A)(e,{layoutStyle:u});return(0,r.createElement)(l.A,{alt:e.alt,"aria-label":p,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:d===t,key:t,link:e.link,linkTo:i,origUrl:e.url,showMovers:o.length>1,srcSet:h,url:m,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:p}=this.props,m=(0,c.s)(l)?d.A:u.A,h=this.props.images.map(this.renderImage,this),g=l!==i.aQ?Math.min(p,i.WN):0;return(0,r.createElement)("div",{className:(0,o.A)(n,{[`has-rounded-corners-${g}`]:g>0})},(0,r.createElement)(m,{align:e,columns:a,images:s,layoutStyle:l,renderedImages:h}),t)}}},84255:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(86087),s=n(84394),o=n(38548),i=n(70954),l=n(89195);class c extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:n,layoutStyle:a,renderedImages:c}=this.props,u=(0,l.mJ)(n),d="columns"===a?(0,l.FL)(u,t):(0,l.VU)(u,{isWide:["full","wide"].includes(e)});let p=0;return(0,r.createElement)(o.A,{galleryRef:this.gallery},d.map(((e,t)=>(0,r.createElement)(i.A,{key:t},e.map(((e,t)=>{const n=c.slice(p,p+e);return p+=e,(0,r.createElement)(s.A,{key:t},n)}))))))}}},89195:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,(t=>{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),b=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),v=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),w=x([1,1,1],3),E=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:b(a)&&v(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){const a=(0,r.sum)((0,r.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&w(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:E(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);const o=e.concat([s]),A=(0,r.sum)(s),x=a.slice(A);return n(o,x)};return n([],e)}function x(e,t){return n=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}function j(e){return t=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function S(e){return e>=1&&e<2}function N(e){return e<1}function R(e){return t=>t>=e}function P(e){return t=>t<e}},70954:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(13022);function s({children:e,className:t}){return(0,r.createElement)("div",{className:(0,a.A)("tiled-gallery__row",t)},e)}},73856:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(66087),s=n(43566),o=n(84394),i=n(38548),l=n(70954);function c({columns:e,renderedImages:t}){const n=Math.min(s.ZS,e),c=t.length%n;return(0,r.createElement)(i.A,null,[...c?[(0,a.take)(t,c)]:[],...(0,a.chunk)((0,a.drop)(t,c),n)].map(((e,t)=>(0,r.createElement)(l.A,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(o.A,{key:t},e)))))))}},14294:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(82170),a=n(90907),s=n(43566),o=n(65378);function i(e){return Math.min(3,e.images.length)}function l({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:l,className:c,columns:u=i(e),linkTo:d,round
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,c.A)(e,{layoutStyle:d});return(0,r.createElement)(l.A,{alt:e.alt,"aria-label":v,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,key:t,link:e.link,linkTo:u,onMoveBackward:i?void 0:p(t),onMoveForward:i?void 0:m(t),onRemove:i?void 0:h(t),onSelect:i?void 0:g(t),origUrl:e.url,setAttributes:i?void 0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:p,onResize:m,isSave:h,columnWidths:g}=this.props,f=(0,c.s)(l)?d.A:u.A,b=this.props.images.map(this.renderImage,this),v=l!==i.aQ?Math.min(p,i.WN):0;return(0,r.createElement)("div",{className:(0,o.A)(n,{[`has-rounded-corners-${v}`]:v>0})},(0,r.createElement)(f,{align:e,columns:a,columnWidths:h?g:void 0,images:s,layoutStyle:l,renderedImages:b,onResize:h?void 0:m}),t)}}},56420:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(86087),s=n(54001),o=n(99309),i=n(46479),l=n(70394);class c extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:n,layoutStyle:a,renderedImages:c,columnWidths:u}=this.props,d=(0,l.mJ)(n),p="columns"===a?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)});let m=0;return(0,r.createElement)(o.A,{galleryRef:this.gallery},p.map(((e,t)=>(0,r.createElement)(i.A,{key:t},e.map(((e,n)=>{const a=c.slice(m,m+e);return m+=e,(0,r.createElement)(s.A,{key:n,width:u?.[t]?.[n]},a)}))))))}}},70394:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,(t=>{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),b=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),v=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),w=x([1,1,1],3),E=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:b(a)&&v(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){const a=(0,r.sum)((0,r.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&w(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:E(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);const o=e.concat([s]),A=(0,r.sum)(s),x=a.slice(A);return n(o,x)};return n([],e)}function x(e,t){return n=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}function j(e){return t=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function S(e){return e>=1&&e<2}function N(e){return e<1}function R(e){return t=>t>=e}function P(e){return t=>t<e}},46479:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(13022);function s({children:e,className:t}){return(0,r.createElement)("div",{className:(0,a.A)("tiled-gallery__row",t)},e)}},65216:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(66087),s=n(60041),o=n(54001),i=n(99309),l=n(46479);function c({columns:e,renderedImages:t}){const n=Math.min(s.ZS,e),c=t.length%n;return(0,r.createElement)(i.A,null,[...c?[(0,a.take)(t,c)]:[],...(0,a.chunk)((0,a.drop)(t,c),n)].map(((e,t)=>(0,r.createElement)(l.A,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(o.A,{key:t},e)))))))}},28635:(e,t,n)=>{"use strict";n.d(t,{A:(
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,c.A)(e,{layoutStyle:d});return(0,r.createElement)(l.A,{alt:e.alt,"aria-label":v,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,key:t,link:e.link,linkTo:u,onMoveBackward:i?void 0:p(t),onMoveForward:i?void 0:m(t),onRemove:i?void 0:h(t),onSelect:i?void 0:g(t),origUrl:e.url,setAttributes:i?void 0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:p,onResize:m,style:h,isSave:g,columnWidths:f}=this.props,b=(0,c.s)(l)?d.A:u.A,v=this.props.images.map(this.renderImage,this),k=l!==i.aQ?Math.min(p,i.WN):0;return(0,r.createElement)("div",{style:h,className:(0,o.A)(n,{[`has-rounded-corners-${k}`]:k>0})},(0,r.createElement)(b,{align:e,columns:a,columnWidths:g?f:void 0,images:s,layoutStyle:l,renderedImages:v,onResize:g?void 0:m}),t)}}},91341:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(82170),a=n(86087),s=n(94107),o=n(78608),i=n(52042),l=n(9276),c=n(71245),u=n(86461);class d extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;ro=null;componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:n}of e){const{width:e}=t,r=[];(0,u.S)(n).forEach((t=>{r.push((0,u.r)(t,e))})),void 0!==this.props.onResize&&this.props.onResize(r)}}))};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new s.A(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}getColumnWidths(e,t,n){let r=0;return e.map((e=>e.map((e=>{const n=t.slice(r,r+e);return r+=e,n})))).map((e=>(0,u.r)(e,n)))}render(){const{align:e,columns:t,images:n,layoutStyle:s,renderedImages:u}=this.props,d=(0,c.mJ)(n),p="columns"===s?(0,c.FL)(d,t):(0,c.VU)(d,{isWide:["full","wide"].includes(e)}),m=a.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,u,1e3)})();let h=0;return(0,r.createElement)(i.A,{galleryRef:this.gallery},p.map(((e,t)=>(0,r.createElement)(l.A,{key:t},e.map(((e,n)=>{const a=u.slice(h,h+e);return h+=e,(0,r.createElement)(o.A,{key:n,width:m?.[t]?.[n]},a)}))))))}}},71245:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,(t=>{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),b=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),v=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),w=x([1,1,1],3),E=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:b(a)&&v(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){con
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,c.A)(e,{layoutStyle:d});return(0,r.createElement)(l.A,{alt:e.alt,"aria-label":v,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,key:t,link:e.link,linkTo:u,onMoveBackward:i?void 0:p(t),onMoveForward:i?void 0:m(t),onRemove:i?void 0:h(t),onSelect:i?void 0:g(t),origUrl:e.url,setAttributes:i?void 0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:p,onResize:m,isSave:h,columnWidths:g}=this.props,f=(0,c.s)(l)?d.A:u.A,b=this.props.images.map(this.renderImage,this),v=l!==i.aQ?Math.min(p,i.WN):0;return(0,r.createElement)("div",{className:(0,o.A)(n,{[`has-rounded-corners-${v}`]:v>0})},(0,r.createElement)(f,{align:e,columns:a,columnWidths:h?g:void 0,images:s,layoutStyle:l,renderedImages:b,onResize:h?void 0:m}),t)}}},62579:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(86087),s=n(89798),o=n(38448),i=n(26054),l=n(79167);class c extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:n,layoutStyle:a,renderedImages:c,columnWidths:u}=this.props,d=(0,l.mJ)(n),p="columns"===a?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)});let m=0;return(0,r.createElement)(o.A,{galleryRef:this.gallery},p.map(((e,t)=>(0,r.createElement)(i.A,{key:t},e.map(((e,n)=>{const a=c.slice(m,m+e);return m+=e,(0,r.createElement)(s.A,{key:n,width:u?.[t]?.[n]},a)}))))))}}},79167:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,(t=>{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),b=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),v=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),w=x([1,1,1],3),E=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:b(a)&&v(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){const a=(0,r.sum)((0,r.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&w(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:E(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);const o=e.concat([s]),A=(0,r.sum)(s),x=a.slice(A);return n(o,x)};return n([],e)}function x(e,t){return n=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}function j(e){return t=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function S(e){return e>=1&&e<2}function N(e){return e<1}function R(e){return t=>t>=e}function P(e){return t=>t<e}},26054:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(13022);function s({children:e,className:t}){return(0,r.createElement)("div",{className:(0,a.A)("tiled-gallery__row",t)},e)}},58711:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(66087),s=n(41314),o=n(89798),i=n(38448),l=n(26054);function c({columns:e,renderedImages:t}){const n=Math.min(s.ZS,e),c=t.length%n;return(0,r.createElement)(i.A,null,[...c?[(0,a.take)(t,c)]:[],...(0,a.chunk)((0,a.drop)(t,c),n)].map(((e,t)=>(0,r.createElement)(l.A,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(o.A,{key:t},e)))))))}},91162:(e,t,n)=>{"use strict";n.d(t,{A:(
__("Open image %1$d of %2$d in full-screen","jetpack"),t+1,o.length),y=i?c.A:l.A,{src:w,srcSet:E}=(0,u.A)(e,{layoutStyle:p});return(0,r.createElement)(y,{alt:e.alt,"aria-label":k,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:b===t,key:t,link:e.link,linkTo:d,onMoveBackward:i?void 0:m(t),onMoveForward:i?void 0:h(t),onRemove:i?void 0:g(t),onSelect:i?void 0:f(t),origUrl:e.url,setAttributes:i?void 0:v(t),showMovers:o.length>1,srcSet:E,url:w,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:c,onResize:m,style:h,isSave:g,columnWidths:f}=this.props,b=(0,u.s)(l)?p.A:d.A,v=this.props.images.map(this.renderImage,this),k=l!==i.aQ?Math.min(c,i.WN):0;return(0,r.createElement)("div",{style:h,className:(0,o.A)(n,{[`has-rounded-corners-${k}`]:k>0})},(0,r.createElement)(b,{align:e,columns:a,columnWidths:g?f:void 0,images:s,layoutStyle:l,renderedImages:v,onResize:g?void 0:m}),t)}}},31238:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(82170),a=n(86087),s=n(94107),o=n(98627),i=n(54359),l=n(43645),c=n(74176),u=n(18980);class d extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;ro=null;componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:n}of e){const{width:e}=t,r=[];(0,u.S)(n).forEach((t=>{r.push((0,u.r)(t,e))})),void 0!==this.props.onResize&&this.props.onResize(r)}}))};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new s.A(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}getColumnWidths(e,t,n){let r=0;return e.map((e=>e.map((e=>{const n=t.slice(r,r+e);return r+=e,n})))).map((e=>(0,u.r)(e,n)))}render(){const{align:e,columns:t,images:n,layoutStyle:s,renderedImages:u}=this.props,d=(0,c.mJ)(n),p="columns"===s?(0,c.FL)(d,t):(0,c.VU)(d,{isWide:["full","wide"].includes(e)}),m=a.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,u,1e3)})();let h=0;return(0,r.createElement)(i.A,{galleryRef:this.gallery},p.map(((e,t)=>(0,r.createElement)(l.A,{key:t},e.map(((e,n)=>{const a=u.slice(h,h+e);return h+=e,(0,r.createElement)(o.A,{key:n,width:m?.[t]?.[n]},a)}))))))}}},74176:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,(t=>{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),b=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),v=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),w=x([1,1,1],3),E=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:b(a)&&v(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]
__("Display %s","jetpack"),e.label.toLowerCase()),checked:i[e.id]||!1,onChange:(n=e.id,e=>{const r={...i,[n]:e};if(Object.values(r).every((e=>!1===e)))return f(!0);l(r),t({postTypes:r}),f(!1)})});var n})),g&&(0,r.createElement)(a.Notice,{className:"jetpack-top-posts__error",status:"error",isDismissible:!1},__("At least one item must be selected.","jetpack"))),(0,r.createElement)(a.PanelBody,{title:__("Metadata settings","jetpack")},(0,r.createElement)(a.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display date","jetpack"),checked:d,onChange:e=>t({displayDate:e})}),(0,r.createElement)(a.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display author","jetpack"),checked:c,onChange:e=>t({displayAuthor:e})}),(0,r.createElement)(a.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display context","jetpack"),checked:u,onChange:e=>t({displayContext:e})}),(0,r.createElement)(a.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display thumbnail","jetpack"),checked:p,onChange:e=>t({displayThumbnail:e})})))}function l({attributes:e,setAttributes:t}){const{layout:n}=e,s=[{icon:"grid-view",title:__("Grid view","jetpack"),onClick:()=>t({layout:"grid"}),isActive:"grid"===n},{icon:"list-view",title:__("List view","jetpack"),onClick:()=>t({layout:"list"}),isActive:"list"===n}];return(0,r.createElement)(a.ToolbarGroup,{controls:s})}},96894:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(96072),a=n.n(r),s=n(82170),o=n(85985),i=n(1455),l=n.n(i),c=n(94715),u=n(86087),d=n(13022),p=n(9522),m=n(20600),h=n(8031);function g(e){return(0,s.createElement)("div",{className:"jetpack-top-posts-item"},e.displayThumbnail&&e.thumbnail&&(0,s.createElement)("a",{className:"jetpack-top-posts-thumbnail-link"},(0,s.createElement)("img",{className:"jetpack-top-posts-thumbnail",src:e.thumbnail,alt:e.title,rel:"nofollow noopener noreferrer",target:"_blank"})),e.displayThumbnail&&!e.thumbnail&&(0,s.createElement)("a",{className:"jetpack-top-posts-thumbnail-link"},(0,s.createElement)("div",{className:"jetpack-top-posts-mock-thumbnail"})),(0,s.createElement)("span",{className:"jetpack-top-posts-title"},(0,s.createElement)("a",null,e.title)),e.displayDate&&(0,s.createElement)("span",{className:"jetpack-top-posts-date has-small-font-size"},e.date),e.displayAuthor&&(0,s.createElement)("span",{className:"jetpack-top-posts-author has-small-font-size"},e.author),e.displayContext&&e.context&&(0,s.createElement)("span",{className:"jetpack-top-posts-context has-small-font-size"},(0,s.createElement)("a",null,e.context[0].cat_name)))}const f=function({attributes:e,setAttributes:t}){const{isLoadingModules:n,isChangingStatus:r,isModuleActive:i,changeStatus:f}=(0,o.q7)("stats"),b=(0,c.useBlockProps)(),{className:v}=b,[k,y]=(0,u.useState)(),[w,E]=(0,u.useState)(),[_,C]=(0,u.useState)(),[A,x]=(0,u.useState)({}),{displayAuthor:j,displayContext:S,displayDate:N,displayThumbnail:R,layout:P,period:L,postsToShow:T,postTypes:M}=e;let B;return(0,u.useEffect)((()=>{l()({path:"/wpcom/v2/post-types"}).then((e=>{C(e),e.forEach((e=>{M&&M[e.id]&&x((t=>({...t,[e.id]:!0})))}))}))}),[M]),(0,u.useEffect)((()=>{i&&l()({path:`/wpcom/v2/top-posts?period=${L}`}).then((e=>{y(e)}))}),[L,i]),(0,u.useEffect)((()=>{const e=k;if(!e)return;const t=[];for(let n=0;t.length!==T&&(e[n]&&M[e[n].type]&&t.push((0,s.createElement)(g,{key:"jetpack-top-posts-"+e[n].id,title:e[n].title,date:e[n].date,author:e[n].author,thumbnail:e[n].thumbnail,context:e[n].context,displayDate:N,displayAuthor:j,displayThumbnail:R,displayContext:S})),e[n]);n++);E(t)}),[j,S,N,R,k,M,T,E]),B=i||n?w?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(c.InspectorControls,null,(0,s.createElement)(m.O,{attributes:e,setAttributes:t,toggleAttributes:A,setToggleAttributes:x,postTypesData:_})),(0,s.createElement)(c.BlockControls,null,(0,s.createElement)(m.G,{attributes:e,setAttributes:t})),(0,s.createElement)("div",{"data-item-count":w.length},(0,s.createElement)("div",{className:"jetpack-top-posts-wrapper"},w))):(0,s.createElement)(p.G,null):(0,s.createElement)(h.k,{className:v,changeStatus:f,isLoading:r}),(0,s.createElement)("div
__("Start playing the video as soon as the page loads","jetpack")),onChange:this.toggleAttribute("autoplay"),checked:I,help:this.getAutoplayHelp,__nextHasNoMarginBottom:!0}),(0,s.createElement)(u.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Loop","jetpack"),/* translators: Tooltip describing the "loop" option for the VideoPress player */
__("Restarts the video when it reaches the end","jetpack")),onChange:this.toggleAttribute("loop"),checked:O,__nextHasNoMarginBottom:!0}),(0,s.createElement)(u.ToggleControl,{label:__("Muted","jetpack"),onChange:this.toggleAttribute("muted"),checked:H,__nextHasNoMarginBottom:!0}),(0,s.createElement)(u.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Playback Controls","jetpack"),/* translators: Tooltip describing the "controls" option for the VideoPress player */
__("Display the video playback controls","jetpack")),onChange:this.toggleAttribute("controls"),checked:F,__nextHasNoMarginBottom:!0}),(0,s.createElement)(u.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Play Inline","jetpack"),/* translators: Tooltip describing the "playsinline" option for the VideoPress player */
__("Play the video inline instead of full-screen on mobile devices","jetpack")),onChange:this.toggleAttribute("playsinline"),checked:U,__nextHasNoMarginBottom:!0}),(0,s.createElement)(u.SelectControl,{label:this.renderControlLabelWithTooltip(__("Preload","jetpack"),/* translators: Tooltip describing the "preload" option for the VideoPress player */
__("Content to dowload before the video is played","jetpack")),value:q??"",onChange:e=>p({preload:e}),options:[{value:"auto",label:_x("Auto","VideoPress preload setting","jetpack")},{value:"metadata",label:_x("Metadata","VideoPress preload setting","jetpack")},{value:"none",label:_x("None","VideoPress preload setting","jetpack")}],help:this.getPreloadHelp(),__nextHasNoMarginBottom:!0}),(0,s.createElement)(c.MediaUploadCheck,null,(0,s.createElement)(u.BaseControl,{className:"editor-video-poster-control"},(0,s.createElement)(u.BaseControl.VisualLabel,null,__("Poster Image","jetpack")),(0,s.createElement)(c.MediaUpload,{title:__("Select Poster Image","jetpack"),onSelect:this.onSelectPoster,allowedTypes:N,render:({open:e})=>(0,s.createElement)(u.Button,{variant:"secondary",onClick:e,ref:this.posterImageButton,"aria-describedby":J},K?__("Replace image","jetpack",0):__("Select Poster Image","jetpack"))}),(0,s.createElement)("p",{id:J,hidden:!0},K?(0,g.sprintf)(/* translators: Placeholder is an image URL. */
__("The current poster image url is %s","jetpack"),V??B):__("There is no poster image currently selected","jetpack")),K&&(0,s.createElement)(u.Button,{onClick:this.onRemovePoster,variant:"link",isDestructive:!0},__("Remove Poster Image","jetpack")))),(0,m.createInterpolateElement)(__("Send us your <a>VideoPress feedback</a>","jetpack"),{a:(0,s.createElement)(u.ExternalLink,{href:"https://automattic.survey.fm/videopress-feedback"})})),(0,s.createElement)(C.A,{attributes:t,setAttributes:p,useAverageColor:G,toggleAttribute:this.toggleAttribute}),(0,s.createElement)(u.PanelBody,{title:__("Video File Settings","jetpack")},(0,s.createElement)(u.SelectControl,{label:_x("Rating","The age rating for this video.","jetpack"),value:x??"",disabled:v||k,options:[{label:_x("G",'Video rating for "General Audiences".',"jetpack"),value:"G"},{label:_x("PG-13",'Video rating for "Parental Guidance", unsuitable for children under 13.',"jetpack"),value:"PG-13"},{label:_x("R",'Video rating for "Restricted", not recommended for children under 17.',"jetpack"),value:"R-17"}],onChange:this.onChangeRating,__nextHasNoMarginBottom:!0}),(0,s.createElement)(u.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Allow download","jetpack"),/* translators: Tooltip describing the "allow download" option for the VideoPress player */
__("Display download option and allow viewers to download this video","jetpack")),onChange:this.onChangeAllowDownload,checked:j,disabled:v||T,__nextHasNoMarginBottom:!0}),(0,s.createElement)(u.SelectControl,{label:__("Video Privacy","jetpack"),help:this.getPrivacySettingHelp(L),onChange:this.onChangePrivacySetting,value:L??"",options:[{value:w.NF.SITE_DEFAULT,label:_x("Site Default","VideoPress privacy setting","jetpack")},{value:w.NF.PUBLIC,label:_x("Public","VideoPress privacy setting","jetpack")},{value:w.NF.PRIVATE,label:_x("Private","VideoPress privacy setting","jetpack")}],disabled:v||M,__nextHasNoMarginBottom:!0})))),Q=e=>{this.setState({fileForUpload:e[0]})},X=e=>{e&&e.url?(this.props.setAttributes({src:e.url,id:e.id,poster:e.image?.src!==e.icon?e.image?.src:void 0}),e.videopress_guid&&this.props.setAttributes({guid:e.videopress_guid})):p({src:void 0,id:void 0,poster:void 0})},ee=()=>"videoPressUploadPoster"in window,te=(0,h.escapeHTML)(b?(0,S.T3)(b.name):""),ne=({mediaId:e,guid:t,src:n})=>{this.setState({title:this.state.title??te,fileForUpload:null,isUploadComplete:!!e,isEditingWhileUploading:!!e&&this.state.isEditingWhileUploading}),e&&t&&n&&p({id:e,guid:t,src:n})},re=e=>{this.setState({title:e})},ae=e=>{this.setState({videoFrameSelectedInMillis:e,videoPosterImageData:null})},se=()=>{const e=this.state.title;this.updateMetaApiCall({title:e},(()=>this.setState({isUpdatingTitle:!0,title:e})),(()=>this.setState({title:e})),(()=>this.setState({isUpdatingTitle:!1})))},oe=()=>de({at_time:this.state.videoFrameSelectedInMillis,is_millisec:!0}),ie=()=>de({poster_attachment_id:this.state.videoPosterImageData.id}),le=e=>{e.generating?ce():ue(e.poster)},ce=()=>{setTimeout((()=>{(ee()?window.videoPressGetPoster(z):i()({path:`/videos/${z}/poster`,apiNamespace:"rest/v1.1",global:!0,method:"GET"})).then((e=>le(e)))}),2e3)},ue=e=>{e&&p({poster:e})},de=e=>{if(ee())return window.videoPressUploadPoster(z,e).then((e=>le(e)));i()({path:`/videos/${z}/poster`,apiNamespace:"rest/v1.1",method:"POST",global:!0,data:e}).catch((e=>e))},pe=()=>{const{title:e,videoFrameSelectedInMillis:t}=this.state;e&&se(),B?ie():null!=t&&oe()},me=()=>{this.setState({isEditingWhileUploading:!1}),pe()};if(null!=b&&b.name||this.state.isEditingWhileUploading){const e=this.state.title??te;return(0,s.createElement)(R,{fileForUpload:b,filename:te,uploadFinished:ne,blockSettings:Y,onDismissEditor:me,isUploadComplete:this.state.isUploadComplete,onSelectPoster:this.onSelectPoster,onRemovePoster:this.onRemovePoster,onChangeTitle:re,title:e,videoPosterImageData:this.state.videoPosterImageData,onVideoFrameSelected:ae,onSave:pe})}const he=v||r,ge=f||o||!z,fe=ge&&!o&&!he,be=(0,s.createElement)(m.Fragment,null,(0,s.createElement)("div",{className:o||he?"":"videopress-block-hide"},(0,s.createElement)(E.A,{text:o?__("Uploading…","jetpack"):__("Generating preview…","jetpack",0)})),(0,s.createElement)("div",{className:fe?"":"videopress-block-hide"},(0,s.createElement)(e,this.props)));if(ge)return d?(0,s.createElement)(y.f,{onFilesSelected:Q,onMediaItemSelected:X},be):(0,s.createElement)(m.Fragment,null,be);const{html:ve,scripts:ke}=l||{html:null,scripts:null},ye=he||!l;return(0,s.createElement)(m.Fragment,null,Y,ye&&(0,s.createElement)(E.A,{text:__("Generating preview…","jetpack")}),!ye&&(0,s.createElement)(P,a()({},this.props,{hideOverlay:this.hideOverlay,html:ve,scripts:ke,interactive:_,caption:D})))}}]),"withVideoPressEdit")},27156:(e,t,n)=>{"use strict";var r=n(96072),a=n.n(r),s=n(82170),o=n(90372),i=n(85985),l=n(63162),c=n(94715),u=n(75994),d=n(74997),p=n(56427),m=n(29491),h=n(47143),g=n(43656),f=n(86087),b=n(52619),v=n(27723),k=n(66087),y=n(81837),w=n(59257),E=n(21440),_=n(54727),C=n(65390),A=n(77189),x=n(41560),j=n(47960),S=n(51983),N=n(7345),R=n(40932);const __=v.__,P=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=(0,c.useBlockEditContext)();return"core/video"!==n?(0,s.createElement)(e,t):(0,s.createElement)(e,a()({},t,{disableDropZone:!0,className:"no-videopress-media-placeholder"}),(0,s.createElement)(p.Button,{disabled:!0,className:"components-butto
2023-12-07 09:44:11 +01:00
__("Paused (%s%%)","jetpack"),w):(0,o.sprintf)(/* translators: Placeholder is an upload progress percenatage number, from 0-100. */
2025-02-28 08:42:11 +01:00
__("Uploading (%s%%)","jetpack"),w)),(0,r.createElement)("div",{className:"resumable-upload__file-size"},_)),(0,r.createElement)("div",{className:"resumable-upload__actions"},(0,r.createElement)(a.Button,{variant:"link",onClick:()=>{p&&(u?p.start():p.abort(),d(!u))}},u?"Resume":"Pause"))))}},80534:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a,l:()=>o});var r=n(10781);const a=function(e){return new Promise((function(t,n){const r=e?{data:{key:e}}:{};wp.media.ajax("videopress-get-upload-jwt",{async:!0,...r}).done((function(e){t({token:e.upload_token,blogId:e.upload_blog_id,url:e.upload_action_url})})).fail((function(e){n(e)}))}))},s={},o=({onUploadUuidRetrieved:e,onError:t,onProgress:n,onSuccess:o})=>(i,l)=>{const c=new r._O(i,{onError:t,onProgress:n,endpoint:l.url,removeFingerprintOnSuccess:!0,withCredentials:!1,autoRetry:!0,overridePatchMethod:!1,chunkSize:1e7,allowedFileTypes:["video/*"],metadata:{filename:i.name,filetype:i.type},retryDelays:[0,1e3,3e3,5e3,1e4],onAfterResponse:function(t,n){if(n.getStatus()>=400)return;const r=n.getHeader("x-videopress-upload-guid"),a=n.getHeader("x-videopress-upload-media-id"),i=n.getHeader("x-videopress-upload-src-url");if(r&&a&&i)return void(o&&o({mediaId:Number(a),guid:r,src:i}));const l={"x-videopress-upload-key-token":"token","x-videopress-upload-key":"key"},c={};Object.keys(l).forEach((function(e){const t=n.getHeader(e);t&&(c[l[e]]=t)})),c.key&&c.token&&(s[c.key]=c.token),c.key&&e(c.key)},onBeforeRequest:function(e){const t=e._method;["HEAD","OPTIONS"].indexOf(t)>=0&&(e._method="GET",e.setHeader("X-HTTP-Method-Override",t)),["DELETE","PUT","PATCH"].indexOf(t)>=0&&(e._method="POST",e.setHeader("X-HTTP-Method-Override",t)),e._xhr.open(e._method,e._url,!0);for(const t of Object.keys(e._headers))e.setHeader(t,e._headers[t]);if("POST"===t){if(!!!l.token)throw"should never happen";e.setHeader("x-videopress-upload-token",l.token)}if(["OPTIONS","GET","HEAD","DELETE","PUT","PATCH"].indexOf(t)>=0){const n=new URL(e._url).pathname.split("/"),r=n[n.length-1];if(s[r])e.setHeader("x-videopress-upload-token",s[r]);else if("HEAD"===t)return a(r).then((t=>(s[r]=t.token,e.setHeader("x-videopress-upload-token",t.token),e)))}return Promise.resolve(e)}});return c.findPreviousUploads().then((function(e){e.length&&c.resumeFromPreviousUpload(e[0]),c.start()})),c}},41560:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(82170),a=n(94715),s=n(29491),o=n(13022),i=n(17900);const l=(0,s.createHigherOrderComponent)((e=>t=>{const{attributes:{autoplay:n,caption:s,controls:l,guid:c,loop:u,muted:d,playsinline:p,poster:m,preload:h,videoPressClassNames:g,className:f,align:b,seekbarColor:v,seekbarPlayedColor:k,seekbarLoadingColor:y,useAverageColor:w,maxWidth:E}={}}=t;if(!c)return e(t);const _=a.useBlockProps.save({className:(0,o.A)("wp-block-video",f,g,{[`align${b}`]:b})}),C=(0,i.e)(c,{autoplay:n,controls:l,loop:u,muted:d,playsinline:p,poster:m,preload:h,seekbarColor:v,seekbarPlayedColor:k,seekbarLoadingColor:y,useAverageColor:w});let A={};return E&&E.length>0&&"100%"!==E&&(A={maxWidth:E,margin:"auto"}),(0,r.createElement)("figure",_,(0,r.createElement)("div",{className:"wp-block-embed__wrapper",style:A},`\n${C}\n`),!a.RichText.isEmpty(s)&&(0,r.createElement)(a.RichText.Content,{tagName:"figcaption",value:s}))}),"withVideoPressSave")},57954:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(94715),s=n(56427),o=n(86087),i=n(27723);const __=i.__;class l extends o.Component{constructor(){super(...arguments);const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:n}=this.props.attributes;this.state={seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:n}}handleChangeSeekbarColor=e=>{this.setState({seekbarColor:e})};handleChangeSeekbarLoadingColor=e=>{this.setState({seekbarLoadingColor:e})};handleChangeSeekbarPlayedColor=e=>{this.setState({seekbarPlayedColor:e})};saveColors=()=>{const{seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:n}=this.state,{setAttributes:r}=this.props;r({seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:n})};render(){const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor
2024-02-16 11:03:01 +01:00
__("Delete %s","jetpack"),o.label),disabled:a===l},a===l?__("Deleting","jetpack"):__("Delete","jetpack",0)))))),(0,r.createElement)(i.MenuGroup,{label:__("Text tracks","jetpack"),className:"videopress-block-tracks-editor__track-list"},o)}function y({track:e,guid:t,onChange:n,onClose:a,onCancel:s,trackExists:d}){const[g,f]=(0,c.useState)(),[v=!1,k]=(0,c.useState)(),{label:y="",srcLang:w="",kind:E=p}=e,_=e.tmpFile?e.tmpFile.name:"";if(!(0,l.useSelect)((e=>e(o.store).getSettings().mediaUpload),[]))return null;return(0,r.createElement)(i.NavigableMenu,null,(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor"},(0,r.createElement)("span",{className:"videopress-block-tracks-editor__single-track-editor-label"},__("Edit track","jetpack")),(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file"},(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-label"},(0,r.createElement)("span",null,__("File","jetpack"),":"),""!==_&&(0,r.createElement)("span",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-label-name"},(0,r.createElement)("strong",null,_)),(0,r.createElement)(o.MediaUploadCheck,null,(0,r.createElement)(i.FormFileUpload,{onChange:t=>{const r=t.target.files;!r.length>0||(e.tmpFile=r[0],n(e))},accept:m,render:({openFileDialog:e})=>(0,r.createElement)(i.Button,{variant:"link",onClick:()=>{e()}},""===_?__("Select track","jetpack"):__("Change track","jetpack",0)),disabled:v}))),(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-help"},/* translators: %s: The allowed file types to be uploaded as a video text track." */ /* translators: %s: The allowed file types to be uploaded as a video text track." */
2025-02-28 08:42:11 +01:00
(0,u.sprintf)(__("Allowed formats: %s","jetpack"),m))),(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-label-language"},(0,r.createElement)(i.TextControl,{onChange:t=>n({...e,label:t}),label:__("Label","jetpack"),value:y,help:__("Title of track","jetpack"),disabled:v,__nextHasNoMarginBottom:!0}),(0,r.createElement)(i.TextControl,{onChange:t=>n({...e,srcLang:t}),label:__("Source language","jetpack"),value:w,help:__("Language tag (en, fr, etc.)","jetpack"),disabled:v,__nextHasNoMarginBottom:!0})),(0,r.createElement)(i.SelectControl,{className:"videopress-block-tracks-editor__single-track-editor-kind-select",options:h,value:E,label:/* translators: %s: The kind of video text track e.g: "Subtitles, Captions" */
__("Kind","jetpack"),onChange:t=>{n({...e,kind:t})},disabled:v,__nextHasNoMarginBottom:!0}),(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-buttons-container"},v?(0,r.createElement)(i.Spinner,null):(0,r.createElement)(i.Button,{variant:"secondary",disabled:!e.tmpFile,onClick:()=>{f(null),""===y&&(e.label=__("English","jetpack")),""===w&&(e.srcLang="en"),void 0===e.kind&&(e.kind=p),d(e)?f(__("A track already exists for that language and kind.","jetpack")):(k(!0),b(e,t).then((()=>{n(e),f(null),a()})).catch((e=>{e.message&&f(e.message)})).finally((()=>{k(!1)})))}},__("Save","jetpack")),(0,r.createElement)(i.Button,{variant:"link",onClick:s},__("Close","jetpack"))),g&&(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-error"},/* translators: %s: An error message returned after a failed video track file upload." */ /* translators: %s: An error message returned after a failed video track file upload." */
(0,u.sprintf)(__("Error: %s","jetpack"),g))))}function w({tracks:e=[],onChange:t,guid:n}){const[a,s]=(0,c.useState)(null);return(0,r.createElement)(i.Dropdown,{contentClassName:"videopress-block-tracks-editor",renderToggle:({isOpen:e,onToggle:t})=>(0,r.createElement)(i.ToolbarButton,{label:__("Text tracks","jetpack"),showTooltip:!0,"aria-expanded":e,"aria-haspopup":"true",onClick:t,icon:g}),renderContent:()=>null!==a?(0,r.createElement)(y,{track:e[a],guid:n,onChange:n=>{const r=[...e];r[a]=n,t(r)},onClose:()=>s(null),onCancel:()=>{t(e.filter(((e,t)=>t!==a))),s(null)},trackExists:t=>-1!==e.filter(((e,t)=>t!==a)).findIndex((e=>e.kind===t.kind&&e.srcLang===t.srcLang))}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.NavigableMenu,null,(0,r.createElement)(k,{tracks:e,onChange:t,guid:n}),(0,r.createElement)(i.MenuGroup,{className:"videopress-block-tracks-editor__add-tracks-container",label:__("Add tracks","jetpack")},(0,r.createElement)(i.MenuItem,{icon:d.A,onClick:()=>{(()=>{const n=e.length,r=[...e];r[n]||(r[n]={}),r[n]={...e[n]},t(r),s(n)})()}},__("Upload track","jetpack")))))})}},22857:(e,t,n)=>{"use strict";n.d(t,{d:()=>h});var r=n(82170),a=n(94715),s=n(56427),o=n(86087),i=n(27723),l=n(51113),c=n(13022),u=n(12199);const __=i.__,d=["image"],p=e=>{const{videoPosterImageUrl:t}=e;return(0,r.createElement)("div",{className:"resumable-upload__editor-thumb-placeholder"},t?(0,r.createElement)(r.Fragment,null,(0,r.createElement)("img",{src:t,alt:"Poster"}),(0,r.createElement)(l.A,{className:"uploading-editor__play-icon",icon:u.ud})):(0,r.createElement)("span",null,"No Poster Selected"))},m=e=>{const{onSelectPoster:t,onRemovePoster:n}=e;return(0,r.createElement)(s.BaseControl,{className:(0,c.A)(e.className,"editor-video-poster-control")},(0,r.createElement)(p,e),(0,r.createElement)(a.MediaUpload,{title:__("Select Poster Image","jetpack"),onSelect:t,allowedTypes:d,render:({open:e})=>(0,r.createElement)("div",{className:"poster-selector__buttons"},(0,r.createElement)(s.Button,{onClick:n,variant:"link",isDestructive:!0},__("Remove Poster Image","jetpack")),(0,r.createElement)(s.Button,{variant:"secondary",onClick:e},__("Select Poster Image","jetpack")))}))},h=e=>{const{file:t,onSelectPoster:n,onRemovePoster:i,videoPosterImageData:c,title:p,onChangeTitle:h,onVideoFrameSelected:g}=e,[f,b]=(0,o.useState)(0),[v,k]=(0,o.useState)(!0),y=(0,o.useRef)(null),w=(0,o.useRef)(null),E=()=>{k(!1)};(0,o.useEffect)((()=>{null!==t&&y&&(y.current.src=URL.createObjectURL(t))}),[t,y]);const _={};return c&&(_.display="none"),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"uploading-editor"},(0,r.createElement)("div",{className:"uploading-editor__summary"}),(0,r.createElement)("div",{className:"uploading-editor__fields"},(0,r.createElement)(s.TextControl,{label:__("Video title","jetpack"),className:"uploading-editor__title",onChange:h,value:p,__nextHasNoMarginBottom:!0}),(0,r.createElement)("div",{className:"uploading-editor__content"},(0,r.createElement)(s.BaseControl,{__nextHasNoMarginBottom:!0},(0,r.createElement)(s.BaseControl.VisualLabel,null,__("Video poster (optional)","jetpack")),v?(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"uploading-editor__video-container"},(0,r.createElement)("div",{className:"uploading-editor__video-poster-wrapper"},c&&(0,r.createElement)(m,{onSelectPoster:n,onRemovePoster:i,videoPosterImageUrl:c.url}),(0,r.createElement)("video",{ref:y,muted:!0,className:"uploading-editor__video",onDurationChange:e=>{const t=e.target.duration;b(t),y.current&&(y.current.currentTime=t/2)},onError:E,onLoadedMetadata:e=>{e.target.videoHeight||E()},style:_})),!c&&(0,r.createElement)(l.A,{className:"uploading-editor__play-icon",icon:u.ud})),(0,r.createElement)("span",{style:_},(0,r.createElement)(s.RangeControl,{className:"uploading-editor__range",min:"0",step:"0.1",max:f,showTooltip:!1,withInputField:!1,onChange:e=>{g(1e3*e),y.current&&(y.current.currentTime=e)},__nextHasNoMarginBottom:!0})),(0,r.createElement)("span",{className:"uploading-editor__scrubber-help",style:_},(0,o.cre
c=__("Upgrade to %s to use this premium block","jetpack"),u=(__("Upgrade your plan to use this premium block","jetpack"),_x("Upgrade","Call to action to buy a new plan","jetpack")),d=({onRedirect:e,align:t,className:n,title:d=l,description:p=null,buttonText:m=u,visible:h=!0,requiredPlan:g,context:f})=>{const[b,v,k]=(0,i.A)(g,e),y=(0,a.useSelect)((e=>{if(p)return p;const t=e("wordpress-com/plans"),n=t&&t.getPlan(g);return n?(0,s.sprintf)(c,n.product_name_short):null}),[p,g]);return y&&(0,r.createElement)(o.c,{align:t,buttonText:m,checkoutUrl:b,className:n,context:f,description:y,goToCheckoutPage:v,isRedirecting:k,title:d,visible:h})}},23887:(e,t,n)=>{"use strict";n.d(t,{W:()=>r,r:()=>a});const r=({plan:e,blockName:t,context:n,tracks:r})=>{r.recordEvent("jetpack_editor_block_upgrade_click",{plan:e,block:t,context:n})},a=({plan:e,blockName:t,context:n,tracks:r})=>{r.recordEvent("jetpack_editor_block_upgrade_banner_impression",{plan:e,block:t,context:n})}},3120:(e,t,n)=>{"use strict";n.d(t,{e:()=>m});var r=n(82170),a=n(85985),s=n(94715),o=n(29491),i=n(47143),l=n(86087),c=n(95104),u=n(26845),d=n(23887);const p=(0,o.createHigherOrderComponent)((e=>t=>{const{name:n,clientId:o,isSelected:p,attributes:m,setAttributes:h}=t||{},g=(0,a.tu)(n);if(!g)return(0,r.createElement)(e,t);const f=(0,a.sH)(n),b=(0,a.GT)(n),[v,k]=(0,l.useState)(!f),[y,w]=(0,l.useState)(!1),E="editor-canvas",_=(0,i.useSelect)((e=>e("core/block-editor").hasSelectedInnerBlock(o,!0)),[o]),{hasParentBanner:C}=(0,l.useContext)(c.j)||{},A=(p||_)&&v&&!C,{tracks:x}=(0,a.st)(),j=(0,l.useMemo)((()=>({plan:g,blockName:n,context:E,tracks:x})),[g,n,x]);(0,l.useEffect)((()=>{A&&w(!0)}),[A,w]),(0,l.useEffect)((()=>{!y&&A&&(0,d.r)(j)}),[y,j,A]),(0,l.useEffect)((()=>k(!f)),[m,k,f]),(0,l.useEffect)((()=>{h({shouldDisplayFrontendBanner:!C})}),[h,C]);const S=(0,s.useBlockProps)();return(0,r.createElement)(c.b,{onBannerVisibilityChange:k,hasParentBanner:A},(0,r.createElement)("div",{ref:S.ref,style:{"max-width":"unset"}},(0,r.createElement)(u.Ay,{className:`is-${n.replace(/\//,"-")}-paid-block`,title:null,align:m?.align,visible:A,description:b?.description,requiredPlan:g,context:E,onRedirect:()=>(0,d.W)(j)}),(0,r.createElement)(e,t)))}),"withUpgradeBanner");function m(e,t){return(0,a.tu)(t)?{...e,edit:p(e.edit)}:e}},76047:(e,t,n)=>{"use strict";n.d(t,{k6:()=>s,s6:()=>r,wb:()=>a});const r="jetpack-sidebar",a="document-settings",s="pre-publish"},23162:(e,t,n)=>{"use strict";n.d(t,{A:()=>M});var r=n(82170),a=n(85985),s=n(56427),o=n(3582),i=n(47143),l=n(14309),c=n(43656),u=n(27723),d=n(10067),p=n.n(d),m=n(23e3),h=n(92169),g=n(61297),f=n(44732),b=n(48499),v=n(90062),k=n(58164),y=n(46536),w=n(50976),E=n(81932),_=n(37215),C=n(76318),A=n(27970),x=n(76047),j=n(45606);const __=u.__,S=p()("jetpack-ai-assistant-plugin:sidebar"),N=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-usage-panel"]?.available||!1,R=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-featured-image-generator"]?.available||!1,P=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-title-optimization"]?.available||!1,L=(0,b.C)("ai-title-optimization-keywords-support"),T=({placement:e,requireUpgrade:t,upgradeType:n,showUsagePanel:a,showFairUsageNotice:o})=>{const{checkoutUrl:l}=(0,h.A)(),{productPageUrl:u}=(0,f.A)(),d=(0,E.Ul)(),p=(0,i.useSelect)((e=>e(c.store).isEditedPostEmpty()),[]),g=__("Optimize Publishing","jetpack"),b=__("Optimize Title","jetpack"),v=L?b:g;return(0,r.createElement)(r.Fragment,null,o&&(0,r.createElement)(s.PanelRow,{className:"jetpack-ai-sidebar__feature-section"},(0,r.createElement)(s.BaseControl,{__nextHasNoMarginBottom:!0},(0,r.createElement)(m.Q,{variant:"muted"}))),p&&(0,r.createElement)(s.PanelRow,{className:"jetpack-ai-sidebar__warning-content"},(0,r.createElement)(s.Notice,{isDismissible:!1,status:"warning"},__("The following features require content to work.","jetpack"))),(0,E.GB)()&&d&&(0,r.createElement)(s.PanelRow,null,(0,r.createElement)(s.BaseControl,{__nextHasNoMarginBottom:!0},(0,r.createElement)(s.BaseControl.VisualLabel,null,__("Write Brief (B
__("You have reached the limit of <strong>%d requests</strong>. <button>Upgrade to continue generating feedback.</button>","jetpack"),p),g=(0,o.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. <strong>Please reach out to your VIP account team.</strong>","jetpack"),{strong:(0,r.createElement)("strong",null)}),f=(0,o.createInterpolateElement)(20===p?m:h,{strong:(0,r.createElement)("strong",null),button:(0,r.createElement)(s.Button,{variant:"link",onClick:d,href:c,target:"_blank"})});return(0,r.createElement)("p",null,"vip"===t?g:f)}},78058:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,R:()=>i});var r=n(82170),a=n(56427),s=n(51113),o=n(5573);const i=(0,r.createElement)(a.SVG,{width:"42",height:"42",viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.G,{clipPath:"url(#clip0_4479_1006)"},(0,r.createElement)(a.Path,{d:"M7.87488 0L10.1022 5.64753L15.7498 7.87488L10.1022 10.1022L7.87488 15.7498L5.64753 10.1022L0 7.87488L5.64753 5.64753L7.87488 0Z",fill:"#A7AAAD"}),(0,r.createElement)(a.Path,{d:"M31.4998 0L34.4696 7.53004L41.9997 10.4998L34.4696 13.4696L31.4998 20.9997L28.53 13.4696L21 10.4998L28.53 7.53004L31.4998 0Z",fill:"#A7AAAD"}),(0,r.createElement)(a.Path,{d:"M18.3748 15.7496L22.0871 25.1621L31.4996 28.8744L22.0871 32.5866L18.3748 41.9992L14.6625 32.5866L5.25 28.8744L14.6625 25.1621L18.3748 15.7496Z",fill:"#A7AAAD"})),(0,r.createElement)(o.Defs,null,(0,r.createElement)("clipPath",{id:"clip0_4479_1006"},(0,r.createElement)(a.Rect,{width:"41.9997",height:"41.9992",fill:"white"}))));function l({className:e,size:t=42}){return(0,r.createElement)(s.A,{icon:i,width:t,height:t,className:e})}},2561:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var r=n(82170),a=n(96865),s=n(85985),o=n(56427),i=n(86087),l=n(27723),c=n(10067),u=n.n(c),d=n(23e3),p=n(71933),m=n(15855),h=n(6493);const __=l.__,g="ai-image-generator",f=u()("jetpack-ai:ai-image-modal");function b({title:e,cost:t,open:n,images:l,currentIndex:c=0,onClose:u=null,onTryAgain:b=null,onGenerate:v=null,generating:k=!1,notEnoughRequests:y=!1,requireUpgrade:w=!1,currentLimit:E=null,currentUsage:_=null,isUnlimited:C=!1,upgradeDescription:A=null,hasError:x=!1,handlePreviousImage:j=()=>{},handleNextImage:S=()=>{},acceptButton:N=null,autoStart:R=!1,autoStartAction:P=null,instructionsPlaceholder:L=null,imageStyles:T=[],onGuessStyle:M=null,prompt:B="",setPrompt:I=()=>{},initialStyle:D=null,inputDisabled:F=!1,actionDisabled:z=!1}){const{tracks:O}=(0,s.st)(),{recordEvent:H}=O,U=(0,i.useRef)(!1),[V,q]=(0,i.useState)(!1),[G,$]=(0,i.useState)(null),[W,Z]=(0,i.useState)(T||[]),J=(0,i.useCallback)((()=>{b?.({userPrompt:B,style:G})}),[b,B,G]),K=(0,i.useCallback)((async()=>{if(G===a.Wp&&M){H("jetpack_ai_general_image_guess_style",{context:"block-editor",tool:"image"});const e=await M(B)||a.Hu;$(e),f("guessed style",e),v?.({userPrompt:B,style:e})}else v?.({userPrompt:B,style:G})}),[v,B,G,M,H]),Y=(0,i.useCallback)((e=>{f("change style",e),$(e),H("jetpack_ai_image_generator_switch_style",{context:"block-editor",style:e})}),[$,H]),Q=(w||y)&&!k,X=Boolean(!C&&t&&E),ee=__("Generate","jetpack"),te=__("Try again","jetpack");return(0,i.useEffect)((()=>{R&&n&&(U.current||(U.current=!0,P?.({})))}),[R,P,n]),(0,i.useEffect)((()=>{T&&T.length>0&&(Z([T.find((({value:e})=>e===a.Hu)),T.find((({value:e})=>e===a.Wp)),...T.filter((({value:e})=>![a.Hu,a.Wp].includes(e)))].filter((e=>e))),q(!0),$(D||a.Hu))}),[T,D]),(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)(p.A,{handleClose:u,title:e},(0,r.createElement)("div",{className:"ai-image-modal__content"},V&&(0,r.createElement)("div",{style:{display:"flex",alignItems:"center",gap:16}},(0,r.createElement)("div",{style:{fontWeight:500,flexGrow:1}},__("Generate image","jetpack")),(0,r.createElement)("div",null,(0,r.createElement)(o.SelectControl,{__nextHasNoMarginBottom:!0,value:G,options:W,onChange:Y}))),(0,r.createElement)(a.KJ,{prompt:B,setPrompt:I,disabled:F,actionDisabled:z,generateHandler:x?J:K,placeholder:L,buttonLabel:x?te:ee}),Q&&(0,r.createElement)(d.A,{description:A,placement:g,useLightNudge:!0}),(0,r.create
// Translators: %d is the cost of one image.
// Translators: %d is the cost of one image.
(0,s.sprintf)(__("Requests needed: <counter>%d</counter>","jetpack"),n),{counter:(0,r.createElement)("span",null)}),l=(0,a.createInterpolateElement)(
// Translators: %d is the current requests balance.
// Translators: %d is the current requests balance.
(0,s.sprintf)(__("Requests available: <counter>%d</counter>","jetpack"),o),{counter:o<n?(0,r.createElement)("span",{className:"ai-assistant-featured-image__usage-counter-no-limit"}):(0,r.createElement)("strong",null)});return(0,r.createElement)("div",{className:"ai-assistant-featured-image__usage-counter"},(0,r.createElement)("span",null,i),(0,r.createElement)("span",null,l))}},90096:(e,t,n)=>{"use strict";n.d(t,{A:()=>E});var r=n(82170),a=n(85985),s=n(56427),o=n(47143),i=n(43656),l=n(86087),c=n(27723),u=n(10067),d=n.n(u),p=n(61297),m=n(58164),h=n(9847),g=n(99991),f=n(76047),b=n(2561),v=n(96051),k=n(16615),y=n(22465);const __=c.__,w=d()("jetpack-ai:featured-image");function E({busy:e,disabled:t,placement:n,onClose:u=()=>{}}){const[d,E]=(0,l.useState)(n===y.hB),_=(0,k.A)(),C=(0,h.A)(),{postTitle:A,postFeaturedMediaId:x,isEditorPanelOpened:j}=(0,o.useSelect)((e=>({postTitle:e(i.store).getEditedPostAttribute("title"),postFeaturedMediaId:e(i.store).getEditedPostAttribute("featured_media"),isEditorPanelOpened:e(i.store).isEditorPanelOpened??e("core/edit-post").isEditorPanelOpened})),[]),{saveToMediaLibrary:S}=(0,g.A)(),{tracks:N}=(0,a.st)(),{recordEvent:R}=N,[P,L]=(0,l.useState)(null),[T,M]=(0,l.useState)(""),{enableComplementaryArea:B}=(0,o.useDispatch)("core/interface"),{clearSelectedBlock:I}=(0,o.useDispatch)("core/block-editor"),{toggleEditorPanelOpened:D}=(0,o.useDispatch)("core/edit-post"),{editPost:F,toggleEditorPanelOpened:z}=(0,o.useDispatch)(i.store),{requireUpgrade:O,requestsCount:H,requestsLimit:U,currentTier:V,costs:q}=(0,p.A)(),G=(0,m.Bd)(V),$=q?.[y.oW]?.activeModel??10,W=$===q?.[y.oW]?.stableDiffusion?y.Dk:y.bb,Z=G===m.Ti,J=U-H<$,K=z??D,{pointer:Y,current:Q,setCurrent:X,processImageGeneration:ee,handlePreviousImage:te,handleNextImage:ne,currentImage:re,currentPointer:ae,images:se,imageStyles:oe,guessStyle:ie}=(0,v.A)({autoStart:!1,cost:$,type:"featured-image-generation",feature:y.oW,previousMediaId:x}),le=(0,l.useCallback)((()=>{E(!1),u?.()}),[u]),ce=(0,l.useCallback)((()=>{E(!0)}),[]),ue=(0,l.useCallback)((e=>ie(e,"featured-image-guess-style",A+"\n\n"+C)),[C,A,ie]),de=(0,l.useCallback)((({userPrompt:e,style:t})=>(R("jetpack_ai_featured_image_generation_generate_image",{placement:n,model:W,site_type:_,style:t,userPrompt:e}),E(!0),ee({userPrompt:e,postContent:A+"\n\n"+C,notEnoughRequests:J,style:t}).catch((e=>{R("jetpack_ai_featured_image_generation_error",{placement:n,error:e?.message,model:W,site_type:_,style:t})})))),[R,n,W,_,ee,C,J,A]),pe=(0,l.useCallback)((async()=>{ae.generating=!0;const e=await ue("");L(e);const t=await de({userPrompt:"",style:e});t&&(w("handleFirstGenerate",t.revisedPrompt),M(t.revisedPrompt||""))}),[ae,de,ue]),me=(0,l.useCallback)((({userPrompt:e,style:t})=>{R("jetpack_ai_featured_image_generation_generate_another_image",{placement:n,model:W,site_type:_,style:t}),X((()=>se.length)),ee({userPrompt:e,postContent:A+"\n\n"+C,notEnoughRequests:J,style:t}).catch((r=>{R("jetpack_ai_featured_image_generation_error",{placement:n,error:r?.message,model:W,site_type:_,style:t,userPrompt:e})}))}),[R,n,W,_,X,ee,A,C,J,se]),he=(0,l.useCallback)((({userPrompt:e,style:t})=>{R("jetpack_ai_featured_image_generation_try_again",{placement:n,model:W,site_type:_,style:t}),ee({userPrompt:e,postContent:A+"\n\n"+C,notEnoughRequests:J,style:t}).catch((e=>{R("jetpack_ai_featured_image_generation_error",{placement:n,error:e?.message,model:W,site_type:_,style:t})}))}),[R,n,W,_,ee,C,J,A]),ge=(0,l.useCallback)((()=>(I(),B("core/edit-post","edit-post/document"))),[I,B]),fe=(0,l.useCallback)((()=>{R("jetpack_ai_featured_image_generation_use_image",{placement:n,model:W,site_type:_});const e=e=>{F({featured_media:e}),le(),setTimeout((()=>{const e=j("featured-image"),t=j("post-status");ge().then((()=>{e||K("featured-image"),t||K("post-status")}))}),500)};re?.libraryId?e(re?.libraryId):S(re?.image).then((t=>{e(t?.id)})).catch((e=>{R("jetpack_ai_featured_image_saving_error",{placement:n,error:e?.message,model:W,site_type:_})}))}),[R,n,W,_,re?.libraryId,re?.image,F,le,j,ge,K,S]),be=__("Generate another image","jetpack"),ve=__
// Translators: %d is the cost of generating a featured image.
__("Featured image generation costs %d requests per image. You don't have enough requests to generate another image.","jetpack"),$):null,Ce=(0,r.createElement)(s.Button,{onClick:fe,variant:"primary",disabled:!re?.image||re?.generating||re?.libraryId===x},__("Set as featured image","jetpack"));return(0,r.createElement)(r.Fragment,null,(n===f.s6||n===f.wb)&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"jetpack-ai-assistant__help-text"},__("Based on your post content.","jetpack")),(0,r.createElement)(s.Button,{onClick:ce,isBusy:e,disabled:t||J,variant:"secondary",__next40pxDefaultSize:!0},__("Generate image","jetpack"))),(0,r.createElement)(b.A,{postContent:ke,autoStart:ke&&!x,autoStartAction:pe,images:se,currentIndex:Q,title:__("Generate a featured image with AI","jetpack"),cost:$,open:d,placement:n,onClose:le,onTryAgain:he,onGenerate:Y?.current>0||x?me:de,generating:ae?.generating,notEnoughRequests:J,requireUpgrade:O,upgradeDescription:_e,currentLimit:U,currentUsage:H,isUnlimited:Z,hasError:Boolean(ae?.error),handlePreviousImage:te,handleNextImage:ne,acceptButton:Ce,generateButtonLabel:Y?.current>0?be:ve,instructionsPlaceholder:__("Describe the featured image you'd like to create and select a style.","jetpack"),imageStyles:oe,onGuessStyle:ue,prompt:T,setPrompt:M,initialStyle:P,inputDisabled:we,actionDisabled:Ee}))}},83729:(e,t,n)=>{"use strict";n.d(t,{A:()=>k});var r=n(82170),a=n(85985),s=n(56427),o=n(86087),i=n(27723),l=n(10067),c=n.n(l),u=n(61297),d=n(58164),p=n(9847),m=n(99991),h=n(2561),g=n(96051),f=n(16615),b=n(22465);const __=i.__,v=c()("jetpack-ai:general-purpose-image");function k({placement:e,onClose:t=()=>{},onSetImage:n=()=>{}}){const[l,c]=(0,o.useState)(!0),k=(0,f.A)(),y=(0,p.A)(),{saveToMediaLibrary:w}=(0,m.A)(),{tracks:E}=(0,a.st)(),{recordEvent:_}=E,[C,A]=(0,o.useState)(""),{requireUpgrade:x,requestsCount:j,requestsLimit:S,currentTier:N,costs:R}=(0,u.A)(),P=(0,d.Bd)(N),L=R?.[b.yP]?.activeModel??10,T=L===R?.[b.yP]?.stableDiffusion?b.Dk:b.bb,M=P===d.Ti,B=S-j<L,{current:I,setCurrent:D,processImageGeneration:F,handlePreviousImage:z,handleNextImage:O,currentImage:H,currentPointer:U,images:V,pointer:q,imageStyles:G,guessStyle:$}=(0,g.A)({cost:L,autoStart:!1,type:"general-image-generation",feature:b.yP}),W=C.length>=3,Z=B||U?.generating||x,J=Z||!W,K=(0,o.useCallback)((()=>{c(!1),t?.()}),[t]),Y=(0,o.useCallback)((async({userPrompt:t,style:n})=>{v("handleGenerate",t,n),_("jetpack_ai_general_image_generation_generate_image",{placement:e,model:T,site_type:k,style:n}),F({userPrompt:t,postContent:y,notEnoughRequests:B,style:n}).catch((t=>{_("jetpack_ai_general_image_generation_error",{placement:e,error:t?.message,model:T,site_type:k,style:n})}))}),[_,e,T,k,F,y,B]),Q=(0,o.useCallback)((({userPrompt:t,style:n})=>{v("handleRegenerate",t),_("jetpack_ai_general_image_generation_generate_another_image",{placement:e,model:T,site_type:k,style:n}),D((e=>e+1)),F({userPrompt:t,postContent:y,notEnoughRequests:B,style:n}).catch((t=>{_("jetpack_ai_general_image_generation_error",{placement:e,error:t?.message,model:T,site_type:k})}))}),[_,e,T,k,F,y,B,D]),X=(0,o.useCallback)((({userPrompt:t,style:n})=>{v("handleTryAgain",t),_("jetpack_ai_general_image_generation_try_again",{placement:e,model:T,site_type:k,style:n}),F({userPrompt:t,postContent:y,notEnoughRequests:B,style:n}).catch((t=>{_("jetpack_ai_general_image_generation_error",{placement:e,error:t?.message,model:T,site_type:k})}))}),[_,e,T,k,F,y,B]),ee=(0,o.useCallback)((()=>{_("jetpack_ai_general_image_generation_use_image",{placement:e,model:T,site_type:k});const t=e=>{n?.({id:e.id,url:e.url}),K()};H?.libraryId?t({id:H?.libraryId,url:H?.libraryUrl}):w(H?.image).then((e=>{t(e)}))}),[_,e,T,k,H?.libraryId,H?.libraryUrl,H?.image,n,K,w]),te=__("Generate another image","jetpack"),ne=__("Generate","jetpack"),re=B?(0,i.sprintf)(
// Translators: %d is the cost of generating a featured image.
__("Image generation costs %d requests per image. You don't have enough requests to generate another image.","jetpack"),L):null,ae=(0,r.createElement)(s.Button,{onClick:ee,variant:"primary",disabled:!H?.image||H?.generating},__("Insert image","jetpack"));return(0,r.createElement)(h.A,{postContent:!0,images:V,currentIndex:I,title:__("Generate an image with AI","jetpack"),cost:L,open:l,placement:e,onClose:K,onTryAgain:X,onGenerate:q?.current>0?Q:Y,generating:U?.generating,notEnoughRequests:B,requireUpgrade:x,upgradeDescription:re,currentLimit:S,currentUsage:j,isUnlimited:M,hasError:Boolean(U?.error),handlePreviousImage:z,handleNextImage:O,acceptButton:ae,generateButtonLabel:q?.current>0?te:ne,instructionsPlaceholder:__("Describe the image you'd like to create and select a style.","jetpack"),imageStyles:G,onGuessStyle:$,prompt:C,setPrompt:A,inputDisabled:Z,actionDisabled:J})}},96051:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(96865),a=n(47143),s=n(86087),o=n(27723),i=n(93832),l=n(61297),c=n(99991),u=n(22465);const __=o.__;function d({feature:e,type:t,cost:n,autoStart:o=!0,previousMediaId:d}){const{generateImageWithParameters:p}=(0,r.Kf)(),{increaseRequestsCount:m,featuresControl:h}=(0,l.A)(),{saveToMediaLibrary:g}=(0,c.A)(),{createNotice:f}=(0,a.useDispatch)("core/notices"),b=(0,s.useRef)(0),[v,k]=(0,s.useState)(0),[y,w]=(0,s.useState)([{generating:o}]),E=e===u.oW?"featured-image":"image",_=h?.[E],C=_?.styles,A=(0,s.useCallback)(((e,t)=>{w((n=>{const r=[...n];return r[t]={...r[t],...e},r}))}),[]),x=(0,a.useSelect)((e=>e("core")?.getMedia?.(d)),[d]);(0,s.useEffect)((()=>{x&&A({image:x.source_url,libraryId:x.id,libraryUrl:x.source_url,generating:!1},b.current)}),[x,A]);const j=(0,s.useCallback)((e=>{f("success",e,{type:"snackbar",isDismissible:!0})}),[f]),S=(0,s.useCallback)((()=>{m(n)}),[m,n]),N=(0,s.useCallback)((e=>{if(!e)return"image.png";const t=e.split(" ").slice(0,10).join(" ");return(0,i.cleanForSlug)(t)+".png"}),[]),R=(0,s.useCallback)((({userPrompt:n,postContent:r,notEnoughRequests:a,style:s=null})=>new Promise(((o,i)=>{if(d&&0===b.current&&b.current++,A({generating:!0,error:null},b.current),a)return A({generating:!1,error:new Error(__("You don't have enough requests to generate another image.","jetpack"))},b.current),void o({});const l=p({feature:e,size:"1792x1024",responseFormat:"b64_json",messages:[{role:"jetpack-ai",context:{type:t,request:n||null,content:r,style:s}}],style:s||""}),c=N(n);l.then((e=>{if(e.data.length>0){const t="data:image/png;base64,"+e.data[0].b64_json,r=n||null,a=e.data[0].revised_prompt||null;A({image:t,prompt:r,revisedPrompt:a},b.current),S(),g(t,c).then((e=>{j(__("Image saved to media library.","jetpack")),A({libraryId:e?.id,libraryUrl:e?.url,generating:!1},b.current),b.current+=1,o({image:t,libraryId:e?.id,libraryUrl:e?.url,revisedPrompt:a})})).catch((()=>{A({generating:!1},b.current),b.current+=1,o({image:t})}))}})).catch((e=>{A({generating:!1,error:e},b.current),i(e)}))}))),[A,p,e,t,S,g,j,N,d]),P=(0,s.useCallback)((()=>{k(Math.max(v-1,0))}),[v]),L=(0,s.useCallback)((()=>{k(Math.min(v+1,y.length-1))}),[v,y.length]),T=(0,s.useCallback)((async function(e,t="",n=""){if(!C||!C.length)return null;const a=[{role:"jetpack-ai",context:{type:t||"general-image-guess-style",request:e,content:n}}];try{const e=await(0,r.R0)(a,{feature:"jetpack-ai-image-generator"});if(!e)return null;const t=C.find((({value:t})=>t===e));return t?t.value:null}catch(e){Promise.reject(e)}}),[C]);return{current:v,setCurrent:k,processImageGeneration:R,handlePreviousImage:P,handleNextImage:L,currentImage:y[v],currentPointer:y[b.current],images:y,pointer:b,imageStyles:C,guessStyle:T}}},16615:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(85985),a=n(86087);function s(){const[e]=(0,a.useState)((0,r.d9)()?"atomic":(0,r.Sy)()?"simple":"jetpack");return e}},46536:(e,t,n)=>{"use strict";n.d(t,{OE:()=>a.A,dY:()=>s.dY,hB:()=>s.hB,m2:()=>r.A});var r=n(90096),a=n(83729),s=n(22465)},22465:(e,t,n)=>{"use strict";n.d(t,{Dk:()=>s,bb:()=>o,dY:()=>l,hB:()=>i,oW:()=>r,yP:()=>a});const r="featured-post-image",a="general-image",s="stable
(0,s.sprintf)(__("Got it! You're targeting <b>%s</b>. ✨✅","jetpack"),t),{b:(0,r.createElement)("b",null)});return d({content:n}),l(!0),e}),[d,e,p]);return{id:"keywords",title:__("Optimise for SEO","jetpack"),label:__("Keywords","jetpack"),messages:c,type:"input",placeholder:__("Photography, plants","jetpack"),onSubmit:m,completed:n,setCompleted:l,value:e,setValue:t}}},30125:(e,t,n)=>{"use strict";n.d(t,{l:()=>c});var r=n(82170),a=n(47143),s=n(86087),o=n(27723),i=n(23967),l=n(59096);const __=o.__,c=()=>{const[e,t]=(0,s.useState)(),[n,o]=(0,s.useState)([]),{messages:c,setMessages:u,addMessage:d,removeLastMessage:p,editLastMessage:m,setSelectedMessage:h}=(0,l.ot)(),{editPost:g}=(0,a.useDispatch)("core/editor"),[f,b]=(0,s.useState)(!1),v=(0,s.useCallback)((e=>{t(e.content),h(e)}),[h]),k=(0,s.useCallback)((async()=>(d({content:(0,r.createElement)(i.A,null)}),await g({meta:{advanced_seo_description:e}}),p(),d({content:__("Meta description updated! ✅","jetpack")}),b(!0),e)),[e,d,g,p]),y=(0,s.useCallback)((async({fromSkip:e})=>{const t=e?{content:(0,s.createInterpolateElement)(__("Skipped!<br />Now, let's optimize your meta description.","jetpack"),{br:(0,r.createElement)("br",null)}),showIcon:!0}:{content:__("Now, let's optimize your meta description.","jetpack"),showIcon:!0};let a=[...n];u([t]),0===a.length&&(d({content:(0,r.createElement)(i.A,null)}),a=await new Promise((e=>setTimeout((()=>e([{id:"meta-1",content:"Explore breathtaking flower and plant photography in our Flora Guide, featuring tips and inspiration for gardening and plant enthusiasts to enhance their outdoor spaces."}])),3e3))),p()),o(a);const l=e?(0,s.createInterpolateElement)(__("Skipped!<br />Now, let's optimize your meta description.<br />Here's a suggestion:","jetpack"),{br:(0,r.createElement)("br",null)}):(0,s.createInterpolateElement)(__("Now, let's optimize your meta description.<br />Here's a suggestion:","jetpack"),{br:(0,r.createElement)("br",null)});m(l),a.forEach((e=>d({...e,type:"option",isUser:!0})))}),[n,d,p,u,m]),w=(0,s.useCallback)((async()=>{o([]),u([{content:__("Now, let's optimize your meta description.","jetpack"),showIcon:!0}]),d({content:(0,r.createElement)(i.A,null)});const e=await new Promise((e=>setTimeout((()=>e([{id:"meta-1"+Math.random(),content:"Explore breathtaking flower and plant photography in our Flora Guide, featuring tips and inspiration for gardening and plant enthusiasts to enhance their outdoor spaces."}])),3e3)));p();const t=(0,s.createInterpolateElement)(__("Now, let's optimize your meta description.<br />Here's a suggestion:","jetpack"),{br:(0,r.createElement)("br",null)});m(t),o(e),e.forEach((e=>d({...e,type:"option",isUser:!0})))}),[d,p,m,u]);return{id:"meta",title:__("Add meta description","jetpack"),messages:c,type:"options",options:n,onSelect:v,onSubmit:k,submitCtaLabel:__("Insert","jetpack"),onRetry:w,retryCtaLabel:__("Regenerate","jetpack"),onStart:y,value:e,setValue:t,completed:f,setCompleted:b}}},79399:(e,t,n)=>{"use strict";n.d(t,{c:()=>c});var r=n(82170),a=n(47143),s=n(86087),o=n(27723),i=n(23967),l=n(59096);const __=o.__,c=()=>{const[e,t]=(0,s.useState)(""),[n,o]=(0,s.useState)([]),{editPost:c}=(0,a.useDispatch)("core/editor"),{messages:u,setMessages:d,addMessage:p,removeLastMessage:m,editLastMessage:h,setSelectedMessage:g}=(0,l.ot)(),[f,b]=(0,s.useState)(!1),[v,k]=(0,s.useState)(),y=(0,s.useCallback)((e=>{t(e.content),g(e)}),[g]),w=(0,s.useCallback)((async({fromSkip:e,stepValue:t})=>{const a=t!==v;if(!a)return;k(t);const l=e?{content:(0,s.createInterpolateElement)(__("Skipped!<br />Let's optimise your title first.","jetpack"),{br:(0,r.createElement)("br",null)}),showIcon:!0}:{content:__("Let's optimise your title first.","jetpack"),showIcon:!0};d([l]);let c,u=[...n];(0===u.length||a)&&(p({content:(0,r.createElement)(i.A,null)}),u=await new Promise((e=>setTimeout((()=>e([{id:"1",content:"A Photo Gallery for Gardening Enthusiasths: Flora Guide"},{id:"2",content:"Flora Guide: Beautiful Photos of Flowers and Plants for Gardening Enthusiasts"}])),3e3))),m()),c=e?(0,s.createInterpolateElement)(__("Skippe
2023-12-07 09:44:11 +01:00
// translators: %1$d: number of days until the next usage count reset
2025-02-28 08:42:11 +01:00
__("Requests will reset to <strong>%1$d</strong> on %2$s.","jetpack"),l,d),{strong:(0,r.createElement)("strong",null)}));const b=n/l,v=(0,r.createElement)(r.Fragment,null,t===c.Ti&&(0,r.createElement)("p",null,__("Unlimited requests.","jetpack")),(t===c._X||t===c.ds)&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"jetpack-ai-usage-panel__available-requests"},f),(0,r.createElement)(u,{usage:b}))),k=(0,r.createElement)(a.A,{height:100,className:"jetpack-ai-usage-panel__loading-placeholder"}),y=(0,r.createElement)(r.Fragment,null,!p&&g.length?g.join(" ").concat(" "):null,!p&&h);return(0,r.createElement)(s.BaseControl,{__nextHasNoMarginBottom:!0,help:y},(0,r.createElement)(s.BaseControl.VisualLabel,null,__("Available Requests","jetpack")),!p&&v,p&&k)}},27970:(e,t,n)=>{"use strict";n.d(t,{A:()=>w});var r=n(82170),a=n(3924),s=n(85985),o=n(56427),i=n(38443),l=n(86087),c=n(27723),u=(n(51609),n(92169)),d=n(61297),p=n(75956),m=n(7503),h=n(10617),g=n(58164),f=n(93471);const __=c.__,b=e=>e?(0,i.gmdateI18n)("F j",e):null,v=(e,t)=>e===g._X?__("Upgrade","jetpack"):t?(0,c.sprintf)(
2023-12-07 09:44:11 +01:00
// translators: %1$d: an integer, the number of requests to upgrade to on the next tier
2025-02-28 08:42:11 +01:00
__("Get %1$d requests","jetpack"),t):__("Get more requests","jetpack"),k=()=>{const e=(0,a.A)("jetpack-ai-tiers-more-requests-contact"),{autosaveAndRedirect:t,isRedirecting:n}=(0,h.A)(e);return{contactUsURL:e,autosaveAndRedirectContactUs:t,isRedirectingContactUs:n}};function y({isOverLimit:e,requestsCount:t,requestsLimit:n,nextStart:a,planType:s,loading:i,canUpgrade:l,showContactUsCallToAction:c,nextLimit:u,contactUsURL:d,handleContactUsClick:p,checkoutUrl:m,handleUpgradeClick:h}){const k=v(s,u),y=b(a);return(0,r.createElement)("div",{className:"jetpack-ai-usage-panel"},(0,r.createElement)(r.Fragment,null,(0,r.createElement)(f.A,{isOverLimit:e,requestsCount:t,requestsLimit:n,nextResetDate:y,planType:s,loading:i}),!i&&(s===g._X||s===g.ds)&&l&&(0,r.createElement)("div",{className:"jetpack-ai-usage-panel-upgrade-button"},c&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,__("Need more requests?","jetpack")),(0,r.createElement)(o.Button,{target:"_blank",variant:"primary",label:__("Contact us for more requests","jetpack"),href:d,onClick:p},__("Contact Us","jetpack"))),!c&&(0,r.createElement)(o.Button,{target:"_blank",variant:"primary",label:__("Upgrade your Jetpack AI plan","jetpack"),href:m,onClick:h},k))))}function w({placement:e=null}){const{checkoutUrl:t}=(0,u.A)(),{contactUsURL:n}=k(),{tracks:a}=(0,p.A)(),o=(0,m.C)(),{requestsCount:i,requestsLimit:c,isOverLimit:h,usagePeriod:f,currentTier:b,nextTier:v,loading:w}=(0,d.A)(),E=(0,g.Bd)(b),_=(0,l.useCallback)((()=>{a.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:b?.slug,requests_count:i,...e?{placement:e}:{}})}),[a,b,i,e]),C=(0,l.useCallback)((()=>{a.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:b?.slug,requests_count:i,...e?{placement:e}:{}})}),[a,b,i,e]),A=((0,s.Sy)()||(0,s.d9)())&&E===g.ds&&!v;return(0,r.createElement)(y,{isOverLimit:h,requestsCount:i,requestsLimit:c,nextStart:f?.nextStart,nextLimit:v?.limit,planType:E,loading:w,canUpgrade:o,showContactUsCallToAction:A,contactUsURL:n,handleContactUsClick:C,checkoutUrl:t,handleUpgradeClick:_})}},56199:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});const r="block_settings_sidebar"},88797:(e,t,n)=>{"use strict";var r=n(85985),a=n(23806);(0,r.vp)(a.U,a.W)},9847:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(96865),a=n(74997),s=n(47143);const o=()=>{const e=(0,s.useSelect)((e=>e("core/block-editor").getBlocks()),[]);return e?.length?(0,r.rh)({content:(0,a.serialize)(e)}):""}},99991:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(63162),a=n(47143),s=n(86087),o=n(10067);const i=n.n(o)()("jetpack-ai-assistant-plugin:save-to-media-library");function l(){const[e,t]=(0,s.useState)(!1),{getSettings:n}=(0,a.useSelect)((e=>e("core/block-editor")),[]);return{isLoading:e,saveToMediaLibrary:(e,a=null)=>{const s=n();return new Promise(((n,o)=>{t(!0),i("Fetching image from URL"),fetch(e).then((e=>{i("Transforming response to blob"),e.blob().then((e=>{i("Uploading blob to media library");const l=[];a?l.push(new File([e],a)):l.push(e),s.mediaUpload({allowedTypes:["image"],filesList:l,onFileChange([e]){(0,r.isBlobURL)(e?.url)||(e&&(i("Image uploaded to media library",e),n(e)),t(!1))},onError(e){i("Error uploading image to media library:",e),o(e),t(!1)}})})).catch((e=>{i("Error transforming response to blob:",e?.message),o(e?.message),t(!1)}))})).catch((e=>{i("Error fetching image from URL:",e?.message),o(e?.message),t(!1)}))}))}}}},23806:(e,t,n)=>{"use strict";n.d(t,{U:()=>a,W:()=>s});var r=n(23162);const a="ai-assistant-plugin",s={render:r.A}},1176:(e,t,n)=>{"use strict";n.d(t,{N:()=>d});var r=n(82170),a=n(96865),s=n(56427),o=n(27723),i=n(51609),l=n.n(i),c=n(2162),u=n(62402);const __=o.__;function d({minWords:e=10,maxWords:t=100,disabled:n,words:o,onWordsNumberChange:i,language:d,onLanguageChange:p,tone:m,onToneChange:h}){const[g,f]=l().useState(!1);const b=d?.split(" ")[0],v=a.so[b]?.label||__("Language","jetpack"),k=a.oZ[m]?.label||__("Tone","jetpack");return(0,r.createElement)("div",{className:"jetpack-ai-generate-excerpt-control"},(0,r.createElement)(s.BaseControl,{className:"jetpack-ai-generate-excer
2023-09-26 10:24:36 +02:00
// Translators: %1$s is the number of words in the excerpt.
2025-02-28 08:42:11 +01:00
_n("%1$s word","%1$s words",I,"jetpack"),I),F="requesting"===P||"suggesting"===P||"done"===P&&!y,z="requesting"===P||"suggesting"===P,O=z||"done"===P;const{requireUpgrade:H,isOverLimit:U}=(0,m.A)(),V=(0,s.d9)()||(0,s.Sy)()?__("https://wordpress.com/support/excerpts/","jetpack"):__("https://jetpack.com/support/create-better-post-excerpts-with-ai/","jetpack");return(0,r.createElement)("div",{className:"jetpack-ai-post-excerpt"},(0,r.createElement)(o.TextareaControl,{__nextHasNoMarginBottom:!0,label:__("Write an excerpt (optional)","jetpack"),onChange:e=>h({excerpt:e}),help:I?D:null,value:B,disabled:O}),(0,r.createElement)(o.ExternalLink,{href:V},__("Learn more about manual excerpts","jetpack")),(0,r.createElement)("div",{className:"jetpack-generated-excerpt__ai-container"},L?.code&&"error_quota_exceeded"!==L.code&&(0,r.createElement)(o.Notice,{status:L.severity,isDismissible:!1,className:"jetpack-ai-assistant__error"},L.message),U&&(0,r.createElement)(p.A,{placement:"excerpt-panel"}),(0,r.createElement)(g.N,{words:v,onWordsNumberChange:e=>{k(e),w(!0)},language:E,onLanguageChange:e=>{_(e),w(!0)},tone:C,onToneChange:e=>{A(e),w(!0)},model:x,onModelChange:e=>{j(e),w(!0)},disabled:z||H}),(0,r.createElement)(o.BaseControl,{help:M?.length?null:__("Add content to generate an excerpt.","jetpack"),__nextHasNoMarginBottom:!0},(0,r.createElement)("div",{className:"jetpack-generated-excerpt__generate-buttons-container"},(0,r.createElement)(o.Button,{onClick:function(){h({excerpt:e}),n.recordEvent("jetpack_ai_assistant_block_discard",{feature:"jetpack-ai-content-lens"}),T()},variant:"secondary",isDestructive:!0,disabled:"done"!==P||H},__("Discard","jetpack")),(0,r.createElement)(o.Button,{onClick:function(){h({excerpt:R}),n.recordEvent("jetpack_ai_assistant_block_accept",{feature:"jetpack-ai-content-lens"}),T()},variant:"secondary",disabled:"done"!==P||H},__("Accept","jetpack")),(0,r.createElement)(o.Button,{onClick:function(){w(!1),T();const e=[{role:"jetpack-ai",context:{type:"ai-content-lens",contentType:"post-excerpt",postId:t,words:v,language:E,tone:C,content:`Post content:\n${M}\n`}}];f(),S(e,{feature:"jetpack-ai-content-lens",model:x}),n.recordEvent("jetpack_ai_assistant_block_generate",{feature:"jetpack-ai-content-lens"})},variant:"secondary",isBusy:z,disabled:F||H||!M},__("Generate","jetpack"))))))}const b=()=>{if((0,i.useSelect)((e=>{const{getCurrentPostType:t}=e(l.store),n=t();return"wp_template"===n||"wp_template_part"===n||"wp_block"===n}),[]))return null;return(0,r.createElement)(l.PostTypeSupportCheck,{supportKeys:"excerpt"},(0,r.createElement)((e=>{const t=l.PluginDocumentSettingPanel;return(0,r.createElement)(t,e)}),{className:(0,h.m)("ai-content-lens")?"is-beta-extension inset-shadow":"",name:"ai-content-lens-plugin",title:__("Excerpt","jetpack")},(0,r.createElement)(f,null)))}},33792:(e,t,n)=>{"use strict";n.d(t,{$:()=>s,s:()=>a});var r=n(33251);const a="ai-content-lens",s={render:r.g}},31009:(e,t,n)=>{"use strict";n.d(t,{m:()=>l});var r=n(82170),a=n(3924),s=n(85985),o=n(56427),i=n(27723);const __=i.__,l=({changeStatus:e,isLoading:t,isModuleActive:n})=>{const{tracks:i}=(0,s.st)();return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,__("Activate the Likes feature to allow others to like your posts.","jetpack")),(0,r.createElement)(o.Button,{disabled:n||t,isBusy:t,onClick:()=>(i.recordEvent("jetpack_editor_likes_enable"),e(!0)),variant:"secondary"},t?__("Activating Likes","jetpack"):__("Activate Likes","jetpack",0)),(0,r.createElement)("div",{className:"components-likes-placeholder__learn-more"},(0,r.createElement)(o.ExternalLink,{href:(0,a.A)("jetpack-support-likes")},__("Learn more about Jetpack Likes.","jetpack"))))}},79013:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});var r=n(82170),a=n(50723),s=n(11876),o=n(56427);const i=()=>(0,r.createElement)(a.Ay,null,(0,r.createElement)(o.Placeholder,null,(0,r.createElement)(o.Flex,{gap:2,direction:"column",style:{flexBasis:"100%",padding:"0 1em"}},(0,r.createElement)(o.FlexItem,null,(0,r.createElement)(s.A,{width:"100%",height:30})),(0,r.createElement)(o.FlexItem
__("To re-share a post, you need to upgrade to the %s plan","jetpack"),_)),(0,r.createElement)(o.Button,{href:b?null:g,onClick:f,target:"_top",icon:u.A,className:(0,d.A)("jetpack-publicize__upsell-button is-primary",{"jetpack-upgrade-plan__hidden":!g}),isBusy:b},b?__("Redirecting…","jetpack"):j)):(0,r.createElement)("div",{className:"jetpack-publicize__upsell"},(0,r.createElement)("strong",null,A),(0,r.createElement)("br",null),(0,c.sprintf)(/* translators: placeholder is the product name of the plan. */
__("This feature is for sites with a %s plan.","jetpack"),_),(0,r.createElement)("br",null),(0,r.createElement)(o.ExternalLink,{href:x},__("More information.","jetpack")))}},9357:(e,t,n)=>{"use strict";var r=n(85985),a=n(19822);(0,r.vp)(a.U,a.W)},19822:(e,t,n)=>{"use strict";n.d(t,{U:()=>p,W:()=>m});var r=n(82170),a=n(7162),s=n(85985),o=n(43656),i=n(90062),l=n(96042),c=n(77398),u=n(44529),d=n(59185);const p="publicize",m={render:()=>{const{isLoadingModules:e,isModuleActive:t}=(0,s.q7)(p),n=(0,a.usePostCanUseSig)();let m=null,h=null;return e?m=(0,r.createElement)(c.A,null):t?(m=(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.PublicizePanel,null,(0,r.createElement)(u.A,null)),n&&(0,r.createElement)(a.SocialImageGeneratorPanel,null)),h=(0,r.createElement)(r.Fragment,null,(0,r.createElement)(d.A,null),(0,r.createElement)(a.PostPublishPanels,null),(0,r.createElement)(a.GlobalModals,null))):m=(0,r.createElement)(l.n,null),(0,r.createElement)(o.PostTypeSupportCheck,{supportKeys:"publicize"},(0,r.createElement)(i.A,null,m),h)}}},59185:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(7162),s=n(85985),o=n(14309),i=n(27723),l=n(44529);const __=i.__,c=()=>{(0,a.useSyncPostDataToStore)();const{hasEnabledConnections:e}=(0,a.useSocialMediaConnections)(),t=(0,a.usePostCanUseSig)();return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.PluginPrePublishPanel,{initialOpen:e,id:"publicize-title",title:(0,r.createElement)("span",{id:"publicize-defaults",key:"publicize-title-span"},__("Share this post","jetpack")),icon:(0,r.createElement)(s.jt,null)},(0,r.createElement)(a.PublicizePanel,{prePublish:!0},(0,r.createElement)(l.A,null))),t&&(0,r.createElement)(o.PluginPrePublishPanel,{initialOpen:!0,title:__("Social Image Generator","jetpack"),icon:(0,r.createElement)(s.jt,null)},(0,r.createElement)(a.SocialImageGeneratorPanel,{prePublish:!0})))}},76262:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(82170),a=n(3924),s=n(85985),o=n(56427),i=n(27723);const __=i.__,l=({changeStatus:e,isLoading:t,isModuleActive:n})=>{const{tracks:i}=(0,s.st)();return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,__("Activate the SEO feature and start optimizing your posts for search engines.","jetpack")),(0,r.createElement)(o.Button,{disabled:n||t,isBusy:t,onClick:()=>(i.recordEvent("jetpack_editor_seo_enable"),e(!0)),variant:"secondary"},t?__("Activating Jetpack SEO","jetpack"):__("Activate Jetpack SEO","jetpack",0)),(0,r.createElement)("div",{className:"components-seo-placeholder__learn-more"},(0,r.createElement)(o.ExternalLink,{href:(0,a.A)("jetpack-support-seo-tools")},__("Learn more about Jetpack SEO.","jetpack"))))}},51626:(e,t,n)=>{"use strict";n.d(t,{G:()=>i});var r=n(82170),a=n(50723),s=n(11876),o=n(56427);const i=()=>(0,r.createElement)(a.Ay,null,(0,r.createElement)(o.Placeholder,null,(0,r.createElement)(o.Flex,{gap:2,direction:"column",style:{flexBasis:"100%",padding:"0 1em"}},(0,r.createElement)(o.FlexItem,null,(0,r.createElement)(s.A,{width:"100%",height:30})),(0,r.createElement)(o.FlexItem,null,(0,r.createElement)(s.A,{width:"100%",height:90})),(0,r.createElement)(o.FlexItem,null,(0,r.createElement)(s.A,{width:"100%",height:30})))))},24294:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(82170),a=n(85985),s=n(56427),o=n(47143),i=n(27723),l=n(53512),c=n(13022),u=n(86183);const __=i.__,d=({requiredPlan:e})=>{const[t,n,d,p]=(0,u.A)(e),{tracks:m}=(0,a.st)(),h=p?.product_name||__("paid","jetpack"),g=__("Upgrade now","jetpack"),f="https://wordpress.com/support/seo-tools/",b=__("Learn more about the SEO feature.","jetpack"),v=(0,o.useDispatch)("automattic/help-center"),k=v?.setShowHelpCenter,y=v?.setShowSupportDoc;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",null,(0,i.sprintf)(/* translators: placeholder is the product name of the plan. */
__("To use the SEO feature you need to upgrade to the %s plan","jetpack"),h)),(0,r.createElement)("div",{className:"components-seo-upsell__learn-more"},k?(0,r.createElement)(s.Button,{onClick:()=>{k(!0),y(f)},className:"components-seo-upsell__learn-more-link",variant:"link"},b):(0,r.createElement)(s.ExternalLink,{href:f},b)),(0,r.createElement)(s.Button,{href:d?null:t,onClick:e=>{e.preventDefault(),m.recordEvent("jetpack_seo_tools_upsell_click"),n(e)},target:"_top",icon:l.A,className:(0,c.A)("components-seo-upsell__button is-primary",{"jetpack-upgrade-plan__hidden":!t}),isBusy:d},d?__("Redirecting…","jetpack"):g))}},99463:(e,t,n)=>{"use strict";n.d(t,{P:()=>l});var r=n(96072),a=n.n(r),s=n(82170),o=n(56427),i=n(27723);n(51609);const __=i.__,_n=i._n,l=({suggestedLimit:e,value:t,label:n,...r})=>{const l=!e||t.length<=e?(0,i.sprintf)(/* translators: Placeholder is a number of characters in a sentence. */
2023-12-07 09:44:11 +01:00
_n("%d character","%d characters",t.length,"jetpack"),t.length):(0,i.sprintf)(/* translators: Placeholder is a number of characters in a sentence. */
2025-02-28 08:42:11 +01:00
__("Its recommended to use less than %1$d characters in this field. (%2$d used)","jetpack"),e,t.length);return(0,s.createElement)("div",{className:"jetpack-seo-message-box"},(0,s.createElement)(o.TextareaControl,a()({__nextHasNoMarginBottom:!0,label:n,help:l,value:t},r)))}},92411:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(86087),s=n(27723),o=n(99463),i=n(53189);const __=s.__;class l extends a.Component{onMessageChange=e=>{this.props.updateMetaValue(e)};render(){const{metaValue:e}=this.props;return(0,r.createElement)(o.P,{value:e,onChange:this.onMessageChange,label:__("SEO Description","jetpack"),placeholder:__("Write a description…","jetpack"),suggestedLimit:156,rows:4})}}const c=(0,i.m)("advanced_seo_description")(l)},44921:(e,t,n)=>{"use strict";var r=n(85985),a=n(37802);(0,r.vp)(a.U,a.W)},37802:(e,t,n)=>{"use strict";n.d(t,{U:()=>_,W:()=>x});var r=n(96072),a=n.n(r),s=n(82170),o=n(85985),i=n(56427),l=n(3582),c=n(47143),u=n(14309),d=n(43656),p=n(86087),m=n(27723),h=n(67858),g=n(90062),f=n(43162),b=n(76262),v=n(51626),k=n(24294),y=n(92411),w=n(5664),E=n(80151);const __=m.__,_="seo",C=!0===(0,o.FB)("ai-seo-assistant")?.available,A=()=>{const{isLoadingModules:e,isChangingStatus:t,isModuleActive:n,changeStatus:r}=(0,o.q7)("seo-tools"),m=(0,c.useSelect)((e=>{const t=e(d.store).getCurrentPostType(),n=e(l.store).getPostType(t);return n?.viewable}),[]);if(!m)return null;const _=(0,o.tu)("advanced-seo"),A=(0,o.d9)()||(0,o.Sy)(),x={title:__("SEO","jetpack")};if(A&&!1!==_)return(0,s.createElement)(p.Fragment,null,(0,s.createElement)(g.A,null,(0,s.createElement)(i.PanelBody,a()({className:"jetpack-seo-panel"},x,{initialOpen:!1}),(0,s.createElement)(k.A,{requiredPlan:_}))));if(!n)return(0,s.createElement)(p.Fragment,null,(0,s.createElement)(g.A,null,(0,s.createElement)(i.PanelBody,a()({className:"jetpack-seo-panel"},x,{initialOpen:!1}),e?(0,s.createElement)(v.G,null):(0,s.createElement)(b.l,{changeStatus:r,isModuleActive:n,isLoading:t}))));const j={icon:(0,s.createElement)(o.jt,null),title:__("SEO","jetpack")};return(0,s.createElement)(p.Fragment,null,(0,s.createElement)(g.A,null,(0,s.createElement)(i.PanelBody,a()({className:"jetpack-seo-panel"},x),C&&m&&(0,s.createElement)(i.PanelRow,{className:"jetpack-ai-sidebar__feature-section "+((0,h.m)("ai-seo-assistant")?"is-beta-extension":"")},(0,s.createElement)(f.A,{disabled:!1})),(0,s.createElement)(i.PanelRow,null,(0,s.createElement)(E.A,null)),(0,s.createElement)(i.PanelRow,null,(0,s.createElement)(y.A,null)),(0,s.createElement)(i.PanelRow,null,(0,s.createElement)(w.A,null)))),(0,s.createElement)(u.PluginPrePublishPanel,j,(0,s.createElement)(p.Fragment,null,(0,s.createElement)(i.PanelRow,null,(0,s.createElement)(E.A,null)),(0,s.createElement)(i.PanelRow,null,(0,s.createElement)(y.A,null)),(0,s.createElement)(i.PanelRow,null,(0,s.createElement)(w.A,null)))))},x={render:()=>(0,s.createElement)(A,null)}},5664:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(82170),a=n(56427),s=n(27723),o=(n(51609),n(53189));const __=s.__,i=(0,o.m)("jetpack_seo_noindex")((({metaValue:e,updateMetaValue:t})=>(0,r.createElement)(a.ToggleControl,{label:__("Hide page from search engines","jetpack"),help:__("If selected, a 'noindex' tag will help instruct search engines to not include this page in search results. This page will also be removed from the Jetpack sitemap.","jetpack"),checked:!!e,onChange:e=>{t(e)},__nextHasNoMarginBottom:!0})))},80151:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(86087),s=n(27723),o=(n(51609),n(99463)),i=n(53189);const __=s.__;class l extends a.Component{onTitleChange=e=>{this.props.updateMetaValue(e)};render(){const{metaValue:e}=this.props;return(0,r.createElement)(o.P,{value:e,onChange:this.onTitleChange,label:__("SEO Title","jetpack"),placeholder:__("Write a title…","jetpack"),suggestedLimit:70,rows:2})}}const c=(0,i.m)("jetpack_seo_html_title")(l)},53189:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var r=n(29491),a=n(47143),s=n(66087);const o=e=>(0,r.compose)([(0,a.withSelect)((t=>({metaValue:(0,s.get)(t("core/editor").getEditedPostAttribute("me
2022-12-15 17:41:53 +01:00
// translators: %s: amount
2023-12-07 09:44:11 +01:00
__("%s / month","jetpack"),s);case"1 year":return(0,l.sprintf)(
2022-12-15 17:41:53 +01:00
// translators: %s: amount
2023-12-07 09:44:11 +01:00
__("%s / year","jetpack"),s);case"one-time":return s}return(0,l.sprintf)(
2022-12-15 17:41:53 +01:00
// translators: %s: amount, plan interval
2025-02-28 08:42:11 +01:00
__("%1$s / %2$s","jetpack"),s,n)}function v({onClose:e,product:t}){const{selectedProductIds:n,setSelectedProductIds:a}=(0,h.B)(),{id:s,title:i}=t,l=n&&n.includes(s),u=l?c.A:void 0,d=t?" "+b(t):null;return(0,r.createElement)(o.MenuItem,{icon:u,onClick:t=>{t.preventDefault();const r=l?n.filter((e=>e!==s)):[...n,s];a(r),e()},selected:l,value:s},i," : ",d)}function k({onClose:e}){const{clientId:t,productType:n}=(0,h.B)(),a=(0,i.useSelect)((e=>e(p.M).getSiteSlug())),s=(0,g.A)(t);if(m.Wd===(0,m.AU)())return(0,r.createElement)(o.MenuItem,null,a&&(0,r.createElement)(o.ExternalLink,{href:`https://wordpress.com/earn/payments/${a}#add-new-payment-plan`},(0,f.W)("add a new product",n)));return(0,r.createElement)(o.MenuItem,{onClick:t=>{t.preventDefault(),s(),setTimeout((()=>{const e=document.getElementById("new-product-title");null!==e&&e.focus()}),100),e()}},(0,f.W)("add a new product",n))}function y(){const{products:e,productType:t,selectedProductIds:n}=(0,h.B)(),{selectedProducts:a}=(0,i.useSelect)((e=>{const{getSelectedProducts:t}=e(p.M);return{selectedProducts:t(n)}}));let l=null,c=u.A;return a.length>1?l=__("Multiple products selected","jetpack"):1===a.length&&(l=b(a[0])),a.length!=a.length&&(l=(0,f.W)("product not found",t),c=d.A),(0,r.createElement)(s.BlockControls,{__experimentalShareWithChildBlocks:!0,group:"block"},(0,r.createElement)(o.ToolbarDropdownMenu,{className:"product-management-control-toolbar__dropdown-button",icon:c,label:(0,f.W)("select a product",t),text:l},(({onClose:t})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.MenuGroup,null,e.map((e=>(0,r.createElement)(v,{key:e.id,onClose:t,product:e})))),(0,r.createElement)(o.MenuGroup,null,(0,r.createElement)(k,{onClose:t}))))))}},21212:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(94715),a=n(47143),s=n(14309),o=n(59340);function i(e){const t=(0,o.AU)(),{selectBlock:n}=(0,a.useDispatch)(r.store),{enableComplementaryArea:i}=(0,a.useDispatch)("core/interface"),{closePublishSidebar:l}=(0,a.useDispatch)(s.store);return()=>{switch(e&&n(e),t){case o.O3:return i("core/edit-site","edit-site/block-inspector");case o.RZ:return i("core/edit-widgets","edit-widgets/block-inspector");default:l(),i("core/edit-post","edit-post/block")}}}},1990:(e,t,n)=>{"use strict";n.d(t,{G:()=>l,W:()=>o});var r=n(27723),a=n(29726);const __=r.__,s={"add a new product":{[a._$]:__("Add a new payment plan","jetpack"),[a.h5]:__("Add a new subscription","jetpack")},"product not found":{[a._$]:__("Payment plan not found","jetpack"),[a.h5]:__("Subscription not found","jetpack")},"select a product":{[a._$]:__("Select a payment plan","jetpack"),[a.h5]:__("Select a subscription","jetpack")},"default new product title":{[a._$]:__("Monthly Subscription","jetpack"),[a.h5]:__("Monthly Subscription","jetpack")},"manage your products":{[a._$]:__("Manage your payment plans.","jetpack"),[a.h5]:__("Manage your subscriptions.","jetpack")},"saving product":{[a._$]:__("Saving payment plan…","jetpack"),[a.h5]:__("Saving subscription…","jetpack")},"add product":{[a._$]:__("Add payment plan","jetpack"),[a.h5]:__("Add subscription","jetpack")},"product requires a name":{[a._$]:__("Payment plan requires a name","jetpack"),[a.h5]:__("Subscription requires a name","jetpack")},"product requires a valid price":{[a._$]:__("Payment plan requires a valid price","jetpack"),[a.h5]:__("Subscription requires a valid price","jetpack")},"successfully created product":{[a._$]:__("Successfully created payment plan","jetpack"),[a.h5]:__("Successfully created subscription","jetpack")},"there was an error when adding the product":{[a._$]:__("There was an error when adding the payment plan.","jetpack"),[a.h5]:__("There was an error when adding the subscription.","jetpack")},"invalid product configured for this block":{[a._$]:__("Invalid payment plan configured for this block.","jetpack"),[a.h5]:__("Invalid subscription configured for this block.","jetpack")},"the button will be hidden from your visitors until you select a valid product":{[a._$]:__("The button will be hidden from your visitors until you select a valid paym
2022-04-02 10:26:41 +02:00
/* translators: category of images */
label:__("All categories","jetpack")},{value:"animals",
/* translators: category of images */
label:__("Animals","jetpack")},{value:"arts",
/* translators: category of images */
label:__("Arts","jetpack")},{value:"birthdays",
/* translators: category of images */
label:__("Birthdays","jetpack")},{value:"cityscapes",
/* translators: category of images */
label:__("Cityscapes","jetpack")},{value:"crafts",
/* translators: category of images */
label:__("Crafts","jetpack")},{value:"fashion",
/* translators: category of images */
label:__("Fashion","jetpack")},{value:"food",
/* translators: category of images */
label:__("Food","jetpack")},{value:"flowers",
/* translators: category of images */
label:__("Flowers","jetpack")},{value:"gardens",
/* translators: category of images */
label:__("Gardens","jetpack")},{value:"holidays",
/* translators: category of images */
label:__("Holidays","jetpack")},{value:"houses",
/* translators: category of images */
label:__("Houses","jetpack")},{value:"landmarks",
/* translators: category of images */
label:__("Landmarks","jetpack")},{value:"landscapes",
/* translators: category of images */
label:__("Landscapes","jetpack")},{value:"night",
/* translators: category of images */
label:__("Night","jetpack")},{value:"people",
/* translators: category of images */
label:__("People","jetpack")},{value:"pets",
/* translators: category of images */
label:__("Pets","jetpack")},{value:"selfies",
/* translators: category of images */
label:__("Selfies","jetpack")},{value:"sport",
/* translators: category of images */
label:__("Sport","jetpack")},{value:"travel",
/* translators: category of images */
label:__("Travel","jetpack")},{value:"weddings",
/* translators: category of images */
2025-02-28 08:42:11 +01:00
label:__("Weddings","jetpack")}],v=["mountain","ocean","river","clouds","pattern","abstract","sky"],k="ANY",y="LAST_7_DAYS",w="LAST_30_DAYS",E="LAST_6_MONTHS",_="LAST_12_MONTHS",C="CUSTOM",A=[{value:k,label:__("Any time","jetpack")},{value:y,label:__("Last 7 days","jetpack")},{value:w,label:__("Last 30 days","jetpack")},{value:E,label:__("Last 6 months","jetpack")},{value:_,label:__("Last 12 months","jetpack")},{value:C,label:__("Specific Month/Year","jetpack")}],x=(new Date).getFullYear(),j=[{label:__("Any Month","jetpack"),value:-1},...(0,s.map)((0,s.range)(0,12),(e=>({label:(0,r.dateI18n)("F",new Date(0,e)),value:e})))]},78276:(e,t,n)=>{"use strict";var r=n(96072),a=n.n(r),s=n(82170),o=n(85985),i=n(94715),l=n(52619),c=n(13218),u=n(29071),d=n(86397);if((0,o.gB)()&&"function"==typeof i.useBlockEditContext){(0,u.Oz)(),(0,u.x$)();const e=e=>e.unstableFeaturedImageFlow||e.modalClass&&e.modalClass.indexOf("featured-image")>-1,t=(e,t)=>["core/cover","core/image","core/gallery","core/media-text","jetpack/image-compare","jetpack/slideshow","jetpack/story","jetpack/tiled-gallery","videopress/video"].indexOf(e)>-1&&-1===t.toString().indexOf("coblocks");(0,l.addFilter)("editor.MediaUpload","external-media/replace-media-upload",(n=>r=>{const{name:o}=(0,i.useBlockEditContext)();let{render:l}=r;if("browse"===r?.mode&&t(o,l)||e(r)){const{allowedTypes:e,gallery:t=!1,value:n=[]}=r;e.indexOf("image")>-1&&!(t&&n.length>0)&&(l=e=>(0,s.createElement)(c.A,a()({},e,{mediaProps:r})))}return(0,s.createElement)(n,a()({},r,{render:l}))}),100),(0,l.addFilter)("blocks.registerBlockType","external-media/individual-blocks",(function(e,t){return"core/image"!==t?e:{...e,keywords:[...e.keywords,...d.DG.map((e=>e.keyword))]}}))}},57878:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(82170),a=n(56427),s=n(86087),o=n(27723),i=n(48558),l=n(13022),c=n(66087),u=n(57608),d=n(49667);const __=o.__,p=(0,s.memo)((()=>(0,r.createElement)("div",{className:"jetpack-external-media-browser__empty"},(0,r.createElement)("p",null,__("Sorry, but nothing matched your search criteria.","jetpack")))));const m=function(e){const{media:t,isCopying:n,isLoading:o,imageOnly:m,pageHandle:h,className:g,multiple:f,setPath:b,nextPage:v,onCopy:k,selectButtonText:y,shouldProxyImg:w}=e,[E,_]=(0,s.useState)([]),[C,A]=(0,s.useState)(-1),x=(0,s.useRef)(-1),j=(0,s.useRef)(null),S=(0,s.useCallback)((e=>{let t=[e];"folder"===e.type?b(e.ID):f?(t=E.slice(0,9).concat(e),E.find((t=>e.ID===t.ID))&&(t=E.filter((t=>t.ID!==e.ID)))):1===E.length&&e.ID===E[0].ID&&(t=[]),_(t)}),[E,f,b]),N=(0,s.useCallback)((()=>{k(E)}),[E,k]),R=t.filter((e=>"folder"!==e.type)).length>0,P=(0,l.A)({"jetpack-external-media-browser__media":!0,"jetpack-external-media-browser__media__loading":o}),L=(0,l.A)({"jetpack-external-media-browser":!0,[g]:!0}),T=()=>{let e=1;const t=j.current.children;if(t.length>0){const n=t[0].offsetTop;for(;e<t.length&&t[e].offsetTop===n;)++e}x.current=e},M=(0,c.debounce)(T,400);(0,s.useEffect)((()=>(window.addEventListener("resize",M),()=>{window.removeEventListener("resize",M)})),[]),(0,s.useEffect)((()=>{t.length&&-1===x.current&&T()}),[t]);const B=(e,{item:t})=>{S(t)},I=(e,{item:n,index:r})=>{[i.LEFT,i.RIGHT,i.UP,i.DOWN].includes(e.keyCode)?((e,n)=>{switch(e){case i.LEFT:n>=1&&A(n-1);break;case i.RIGHT:n<t.length&&A(n+1);break;case i.UP:n>=x.current&&A(n-x.current);break;case i.DOWN:n<t.length-x.current&&A(n+x.current)}})(e.keyCode,r):i.SPACE===e.keyCode?(S(n),e.preventDefault()):i.ENTER===e.keyCode&&S(n),[i.LEFT,i.RIGHT,i.UP,i.DOWN,i.SPACE,i.ENTER].includes(e.keyCode)&&e.stopPropagation()};return(0,r.createElement)("div",{className:L},(0,r.createElement)("ul",{ref:j,className:P},t.map(((e,t)=>(0,r.createElement)(u.A,{item:e,imageOnly:m,index:t,key:e.ID,onClick:B,onKeyDown:I,focus:t===C,isSelected:E.find((t=>t.ID===e.ID)),isCopying:n,shouldProxyImg:w}))),0===t.length&&!o&&(0,r.createElement)(p,null),o&&(0,r.createElement)(d.A,null),h&&!o&&(0,r.createElement)(a.Button,{variant:"secondary",className:"jetpack-external-media-browser__loadmore",disabled:o||n,onClick:()=>{t.length&&A(t.length),v()}},
_n("Add %1$d image","Add %1$d images",e,"jetpack"),e):__("Add images","jetpack")}))}))},58472:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(82170),a=n(56427),s=n(86087),o=n(27723),i=n(66087),l=n(14121),c=n(57878),u=n(71034),d=n(56141),p=n(51024);const __=o.__;const m=(0,p.A)(u.g.Openverse)((function(e){const{media:t,isCopying:n,isLoading:o,pageHandle:u,multiple:p,copyMedia:m,getMedia:h}=e,[g,f]=(0,s.useState)((0,i.sample)(l.oc)),[b,v]=(0,s.useState)(""),k=(0,s.useCallback)((e=>{m(e,(0,d.e)("copy",l.Q8),l.Q8)}),[m]),y=(0,s.useCallback)(((e,t=!1)=>{g&&h((0,d.e)("list",l.Q8,{number:20,search:g}),t)}),[h,g]),w=(0,s.useRef)(void 0),E=(0,s.useCallback)((e=>{e.preventDefault(),v(g),y(e,!0),w.current=g}),[y,g]);(0,s.useEffect)(y,[]);const _=(0,s.useRef)(null);return(0,s.useEffect)((()=>{if(!_?.current)return;const e=_.current.querySelector("input[type='search']");e&&(e.focus(),e.select())}),[]),(0,r.createElement)("div",{className:"jetpack-external-media-wrapper__openverse"},(0,r.createElement)("form",{ref:_,className:"jetpack-external-media-header__openverse",onSubmit:E},(0,r.createElement)(a.TextControl,{"aria-label":__("Search","jetpack"),type:"search",value:g,onChange:f,disabled:!!n,__nextHasNoMarginBottom:!0}),(0,r.createElement)(a.Button,{isPrimary:!0,onClick:E,type:"submit",disabled:!g.length||g===w.current||n},__("Search","jetpack"))),(0,r.createElement)(c.A,{key:b,className:"jetpack-external-media-browser__openverse",media:t,isCopying:n,isLoading:o,nextPage:y,onCopy:k,pageHandle:u,multiple:p}))}))},14300:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(82170),a=n(56427),s=n(86087),o=n(27723),i=n(66087),l=n(14121),c=n(57878),u=n(71034),d=n(56141),p=n(51024);const __=o.__;const m=(0,p.A)(u.g.Pexels)((function(e){const{media:t,isCopying:n,isLoading:o,pageHandle:u,multiple:p,copyMedia:m,getMedia:h}=e,[g,f]=(0,s.useState)((0,i.sample)(l.oc)),[b,v]=(0,s.useState)(""),k=(0,s.useCallback)((e=>{m(e,(0,d.e)("copy",l.kL),l.kL)}),[m]),y=(0,s.useCallback)(((e,t=!1)=>{g&&h((0,d.e)("list",l.kL,{number:20,path:"recent",search:g}),t)}),[h,g]),w=(0,s.useRef)(void 0),E=(0,s.useCallback)((e=>{e.preventDefault(),v(g),y(e,!0),w.current=g}),[y,g]);(0,s.useEffect)(y,[]);const _=(0,s.useRef)(null);return(0,s.useEffect)((()=>{if(!_.current)return;const e=Array.from(_.current.elements).find((e=>"search"===e.type));e&&(e.focus(),e.select())}),[]),(0,r.createElement)("div",{className:"jetpack-external-media-wrapper__pexels"},(0,r.createElement)("form",{ref:_,className:"jetpack-external-media-header__pexels",onSubmit:E},(0,r.createElement)(a.TextControl,{"aria-label":__("Search","jetpack"),type:"search",value:g,onChange:f,disabled:!!n,__nextHasNoMarginBottom:!0}),(0,r.createElement)(a.Button,{variant:"primary",onClick:E,type:"submit",disabled:!g.length||g===w.current||n},__("Search","jetpack"))),(0,r.createElement)(c.A,{key:b,className:"jetpack-external-media-browser__pexels",media:t,isCopying:n,isLoading:o,nextPage:y,onCopy:k,pageHandle:u,multiple:p}))}))},51024:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var r=n(82170),a=n(1455),s=n.n(a),o=n(56427),i=n(29491),l=n(47143),c=n(86087),u=n(27723),d=n(48558),p=n(13022),m=n(66087),h=n(14121),g=n(29071),f=n(71034);const __=u.__;function b(e=f.g.Unknown){return(0,i.createHigherOrderComponent)((t=>{class n extends c.Component{constructor(e){super(e),this.defaultAccount={image:"",name:""},this.state={account:this.defaultAccount,media:[],nextHandle:!1,isLoading:!1,isCopying:null,isAuthenticated:!0,path:{ID:h.o$}}}contentRef=e=>{e?(this.contentElement=e,this.modalElement=e.closest(".jetpack-external-media-browser"),this.modalElement&&this.modalElement.addEventListener("keydown",this.stopArrowKeysPropagation)):this.modalElement&&(this.modalElement.removeEventListener("keydown",this.stopArrowKeysPropagation),this.modalElement=null,this.contentElement=null)};stopArrowKeysPropagation=e=>{[d.UP,d.DOWN,d.LEFT,d.RIGHT].includes(e.keyCode)&&!e.target.classList.contains("jetpack-external-media-browser__media__item")&&e.stopPropagation()};setAuthenticated=t=>{this.setState({isAuthenticated:t}),(0,g.jz)(e,t)};mergeMedia(e,
2023-12-07 09:44:11 +01:00
// translators: %1$s: first category name, %2$s: second category name
2025-02-28 08:42:11 +01:00
o=(0,c.sprintf)(__("%1$s and %2$s","jetpack"),...s);else{const e=s.slice(0,-1).join(`${__(",","jetpack")} `),t=s[s.length-1];o=(0,c.sprintf)(
2023-12-07 09:44:11 +01:00
// translators: %1$s: a comma-separated list of category names except for the last one, %2$s: the name of the last category
2025-02-28 08:42:11 +01:00
__("%1$s, and %2$s","jetpack"),e,t)}return o})(n,t),s=r.toLocaleString();return e?(0,c.sprintf)(
2024-02-16 11:03:01 +01:00
// translators: %1s is the list of categories, %2d is subscriptions count
2025-02-28 08:42:11 +01:00
_n("This post will be sent to everyone subscribed to %1$s (%2$s subscriber).","This post will be sent to everyone subscribed to %1$s (%2$s subscribers).",r,"jetpack"),a,s):(0,c.sprintf)(
2024-02-16 11:03:01 +01:00
// translators: %1s is the list of categories, %2d is subscriptions count
2025-02-28 08:42:11 +01:00
_n("This post was sent to everyone subscribed to %1$s (%2$s subscriber).","This post was sent to everyone subscribed to %1$s (%2$s subscribers).",r,"jetpack"),a,s)};const g=function({accessLevel:e,prePublish:t=!1}){const n=(0,o.useSelect)((e=>e("core/block-editor").getBlocks().some((e=>e.name===u.name)))),{isScheduledPost:g,postCategories:f,postMeta:b}=(0,o.useSelect)((e=>{const{isCurrentPostScheduled:t,getEditedPostAttribute:n}=e(i.store);return{isScheduledPost:t(),postCategories:n("categories"),postMeta:n("meta")}})),{emailSubscribersCount:v,hasFinishedLoading:k,newsletterCategories:y,newsletterCategoriesEnabled:w,newsletterCategorySubscriberCount:E,paidSubscribersCount:_}=(0,o.useSelect)((e=>{const{getNewsletterCategories:t,getNewsletterCategoriesEnabled:n,getNewsletterCategoriesSubscriptionsCount:r,getSubscriberCounts:a,hasFinishedResolution:s}=e(m.M),{emailSubscribers:o,paidSubscribers:i}=a();return{hasFinishedLoading:[s("getSubscriberCounts"),s("getNewsletterCategories"),s("getNewsletterCategoriesSubscriptionsCount")].every(Boolean),emailSubscribersCount:o,newsletterCategories:t(),newsletterCategoriesEnabled:n(),newsletterCategorySubscriberCount:r(),paidSubscribersCount:i}}));if(!k)return(0,r.createElement)(s.Animate,{type:"loading"},(({className:e})=>(0,r.createElement)("p",{className:`jetpack-subscribe-affirmation-loading ${e}`},__("Loading…","jetpack"))));const C=e===d.P2.paid_subscribers.key,A=t||g,x=(0,p.Yc)({accessLevel:e,emailSubscribers:v,paidSubscribers:_,postHasPaywallBlock:n});let j;return j=b?.[d.KG]?__("Not sent via email.","jetpack"):(0,a.lk)()?__("Your site is in Coming Soon mode. Emails are sent only when your site is public.","jetpack"):w&&y.length>0&&!C?h({futureTense:A,isPaidPost:C,newsletterCategories:y,postCategories:f,reachCount:E}):(({futureTense:e,isPaidPost:t,postHasPaywallBlock:n,reachCount:r})=>{const a=r.toLocaleString();return e?t&&!n?(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post will be sent to <strong>%s paid subscriber</strong>.","This post will be sent to <strong>%s paid subscribers</strong>.",r,"jetpack"),a):(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post will be sent to <strong>%s subscriber</strong>.","This post will be sent to <strong>%s subscribers</strong>.",r,"jetpack"),a):t&&!n?(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post was sent to <strong>%s paid subscriber</strong>.","This post was sent to <strong>%s paid subscribers</strong>.",r,"jetpack"),a):t&&!n?(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post was sent to <strong>%s paid subscriber</strong> only.","This post was sent to <strong>%s paid subscribers</strong> only.",r,"jetpack"),a):(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post was sent to <strong>%s subscriber</strong>.","This post was sent to <strong>%s subscribers</strong>.",r,"jetpack"),a)})({futureTense:A,isPaidPost:C,postHasPaywallBlock:n,reachCount:x}),(0,r.createElement)("p",null,(0,l.createInterpolateElement)(j,{strong:(0,r.createElement)("strong",null)}))}},64234:(e,t,n)=>{"use strict";n.d(t,{$E:()=>d,Ay:()=>p,Qu:()=>l,fI:()=>c,mf:()=>u});var r=n(82170),a=n(56427),s=n(86087),o=n(27723),i=n(37906);const _x=o._x,__=o.__,l=e=>{const t="https://wordpress.com/earn/payments/"+location.hostname;return e?t:t+"#add-tier-plan"},c=(e,t)=>"public"!==e&&t!==i.P2.everybody.key,u=()=>(0,r.createElement)(a.Notice,{status:"warning",isDismissible:!1,className:"edit-post-post-misconfiguration__warning"},(0,s.createInterpolateElement)(__("Youll need to change the posts access to Everybody or visibility to Public.<br/><br/>Subscribers arent able to view private or password-protected posts.","jetpack"),{br:(0,r.createElement)("br",null)})),d=e=>e?_x("Manage plans","unused context to distinguish translations","jetpack"):__("Set up a paid plan","jetpack");function p({context:e="other",hasTierPlans:t}){const n=d(t);return"toolbar"===e?(0,r.createElement)(a.ToolbarButton,{href:l(t),target:"_blank"},n):(0,r.createElement)(a.Button,{variant:"primary",href:l(t),target:"_blank"},n)}},14435:(e,t,n)=>{"use strict";var r=n(85985),a=n(1455),s=n.n(a),o=n(47143),i=n(27723);n(692);const __=i.__;function l(){const e=(0,r.GE)();return window?.location&&e?(0,r.Sy)()||(0,r.d9)()?`https://wordpress.com/plans/my-plan/${e}`:`${window.location.protocol}//${e.replace("::","/")}/wp-admin/admin.php?page=jetpack#/my-plan`:null}(async()=>{if(window?.location){if(new URLSearchParams(window.location.search).get("plan_upgraded")){let e=null;e:try{if((0,r.Sy)())break e;const t=await s()({path:"/jetpack/v4/site"});e=JSON.parse(t.data).plan.product_name}finally{const t=l();(0,o.dispatch)("core/notices").createNotice("success",e?(0,i.sprintf)(/* translators: %s is the plan name, such as Jetpack Premium. */
__("Congratulations! Your site is now on the %s plan.","jetpack"),e):__("Congratulations! Your site is now on a paid plan.","jetpack"),{isDismissible:!0,...t&&{actions:[{url:l(),label:__("View my plan","jetpack")}]}})}}}})()},79366:(e,t,n)=>{"object"==typeof window&&window.Jetpack_Block_Assets_Base_Url&&(n.p=window.Jetpack_Block_Assets_Base_Url)},94375:(e,t,n)=>{"use strict";n.d(t,{A:()=>i,M:()=>l});var r=n(85985),a=n(74997),s=n(52619);const o="jetpack/";function i(e,t,n=[],i=!0){const l="string"==typeof e?e:e.name,c=l.startsWith(o),u=c?l.slice(o.length):l,{available:d,details:p,unavailableReason:m}=(0,r.FB)(u),h=(0,r.aq)(m,p),g=i||c?o:"";if(!d&&!h)return!1;const f=g+u,b=(0,a.registerBlockType)("object"==typeof e?e:f,t);return h&&(0,s.addFilter)("editor.BlockListBlock",`${f}-with-has-warning-is-interactive-class-names`,(0,r.BT)(f)),n.forEach((e=>(0,a.registerBlockType)(g+e.name,e.settings))),b}function l(e,t,n,a){return i(e,{...t,icon:(0,r.Cq)(e),attributes:e.attributes||{}},n,a)}},62289:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(5573);const s=(e,t=24,n=24,s="0 0 24 24")=>(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:s},(0,r.createElement)(a.Path,{fill:"none",d:"M0 0h24v24H0V0z",className:"icon-filler"}),e)},64882:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(94715);const s=(e,t,n,s,o)=>{const{isSelected:i}=t,l=t.attributes[e];return(0,r.createElement)("div",{className:i?`jetpack-${e}-block is-selected`:`jetpack-${e}-block`},!i&&""!==l&&s(t),(i||""===l)&&(0,r.createElement)(a.PlainText,{value:l,placeholder:n,"aria-label":n,onChange:o}))}},21929:(e,t,n)=>{"use strict";var r=n(47143),a=n(27723);n(692);const __=a.__;if("undefined"!=typeof window&&window.location){const e=new URLSearchParams(window.location.search);e.get("stripe_connect_success")?(0,r.dispatch)("core/notices").createNotice("success",__("Congrats! Your site is now connected to Stripe. You can now start accepting funds!","jetpack")):e.get("stripe_connect_cancelled")&&(0,r.dispatch)("core/notices").createNotice("error",__("You cancelled connecting your site to Stripe.","jetpack"))}},56145:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(1455),a=n.n(r),s=n(66087);function o(e,t=s.noop){return t(!0),new Promise(((n,r)=>{a()({path:`/wpcom/v2/resolve-redirect/?url=${encodeURIComponent(e)}`}).then((a=>{t(!1);const s=a.status?parseInt(a.status,10):null;s&&s>=400?r():n(a.url||e)}),(()=>{t(!1),r()}))}))}},10617:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(47143),a=n(86087),s=n(66087);function o(e,t=s.noop){const[n,o]=(0,a.useState)(!1),{isAutosaveablePost:i,isDirtyPost:l,currentPost:c}=(0,r.useSelect)((e=>{const t=e("core/editor");return{isAutosaveablePost:t.isEditedPostAutosaveable(),isDirtyPost:t.isEditedPostDirty(),currentPost:t.getCurrentPost()}}),[]),u=Object.keys(c).length>0,d=(0,r.useSelect)((e=>!!window.wp?.customize||!!e("core/edit-widgets"))),p=(0,r.dispatch)("core/editor").savePost,m=(0,r.useSelect)((e=>e("core").__experimentalGetDirtyEntityRecords())),h=async e=>{e.preventDefault(),u?l&&i&&await p(e):await(async()=>{for(let e=0;e<m.length;e++)await(0,r.dispatch)("core").saveEditedEntityRecord(m[e].kind,m[e].name,m[e].key)})()};return{autosave:h,autosaveAndRedirect:async r=>{r.preventDefault(),n||(o(!0),h(r).then((()=>{!function(e,t,n=!1){t&&t(e),n?window.open(e,"_blank"):window.top.location.href=e}(e,t,d)})))},isRedirecting:n}}},26247:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(39384),a=n(85985);const s=()=>{const{isUserConnected:e}=(0,r.useConnection)();return(0,a.Sy)()||e}},58164:(e,t,n)=>{"use strict";n.d(t,{Bd:()=>o,Ti:()=>s,_X:()=>r,ds:()=>a});const r="free",a="tiered",s="unlimited",o=e=>e?0===e?.value?r:1===e?.value?s:a:null},71960:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(86087);const a=e=>{e&&cancelAnimationFrame(e.id)},s=(e,t=0)=>{const n=(0,r.useRef)(),s=(0,r.useRef)(e);s.current=e,(0,r.useEffect)((()=>(n.current=((e,t=0)=>{const n=t<0?0:t,r={id:0};let a=Date.now();const s=()=>{const t=Date.now();t-a>=n&&(a=t,e()),r.id=requestAnimationFrame(s)};return r.id=requestAn
2022-12-15 17:41:53 +01:00
// translators: %s: Price
2025-02-28 08:42:11 +01:00
__("Minimum allowed price is %s.","jetpack"),(0,r.Ay)(k,b)),h),void a(!1);if(!(0,c.kF)(b,v))return(0,d.S)((0,l.W)("product requires a valid price",t),h),void a(!1);try{const r=await s()({path:"/wpcom/v2/memberships/product",method:"POST",data:e}),o={id:r.id,title:r.title,interval:r.interval,price:r.price,currency:r.currency},c=h.select(u.EF).getProducts();i(p(c.concat([o]))),n([o.id]),m&&(0,d.L)((0,l.W)("successfully created product",t),h),a(!0)}catch{(0,d.S)((0,l.W)("there was an error when adding the product",t),h),a(!1)}},v=e=>({type:"SET_SUBSCRIBER_COUNTS",subscriberCounts:e}),k=e=>({type:"SET_NEWSLETTER_CATEGORIES",newsletterCategories:e}),y=e=>({type:"SET_NEWSLETTER_CATEGORIES_SUBSCRIPTIONS_COUNT",newsletterCategoriesSubscriptionsCount:e})},3696:(e,t,n)=>{"use strict";n.d(t,{EF:()=>r,JA:()=>s,an:()=>a,gI:()=>o,ky:()=>i});const r="jetpack/membership-products",a=0,s=1,o=2,i="tier"},16521:(e,t,n)=>{"use strict";n.d(t,{M:()=>c});var r=n(47143),a=n(66314),s=n(3696),o=n(91497),i=n(18410),l=n(92955);const c=(0,r.createReduxStore)(s.EF,{actions:a,reducer:o.A,resolvers:i,selectors:l,__experimentalUseThunks:!0});(0,r.register)(c)},91497:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r={products:[],apiState:n(3696).an,connectUrl:null,siteSlug:"",connectedAccountDefaultCurrency:"",subscriberCounts:{socialFollowers:null,emailSubscribers:null,paidSubscribers:null},newsletterCategories:{enabled:!1,categories:[]}};function a(e=r,t){switch(t.type){case"SET_PRODUCTS":return{...e,products:t.products};case"SET_CONNECT_URL":return{...e,connectUrl:t.connectUrl};case"SET_API_STATE":return{...e,apiState:t.apiState};case"SET_SITE_SLUG":return{...e,siteSlug:t.siteSlug};case"SET_CONNECTED_ACCOUNT_DEFAULT_CURRENCY":return{...e,connectedAccountDefaultCurrency:t.connectedAccountDefaultCurrency};case"SET_SUBSCRIBER_COUNTS":return{...e,subscriberCounts:t.subscriberCounts};case"SET_NEWSLETTER_CATEGORIES":return{...e,newsletterCategories:t.newsletterCategories};case"SET_NEWSLETTER_CATEGORIES_SUBSCRIPTIONS_COUNT":return{...e,newsletterCategoriesSubscriptionsCount:t.newsletterCategoriesSubscriptionsCount}}return e}},18410:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fetchNewsletterCategoriesSubscriptionsCount:()=>k,getNewsletterCategories:()=>C,getNewsletterCategoriesSubscriptionsCount:()=>A,getNewsletterTierProducts:()=>w,getProducts:()=>E,getSubscriberCounts:()=>_});var r=n(1455),a=n.n(r),s=n(43656),o=n(93832),i=n(29726),l=n(1990),c=n(56539),u=n(27574),d=n(66314),p=n(3696),m=n(34884);const h="membership-products-resolver-getProducts",g="membership-products-resolver-getSubscriberCounts",f="membership-products-resolver-getNewsletterCategories",b="membership-products-resolver-getNewsletterCategoriesSubscriptionsCount";let v=!1;const k=async e=>{const t=await a()({path:`/wpcom/v2/newsletter-categories/count?term_ids=${e.join(",")}`,method:"GET"});if(!t||"object"!=typeof t)throw new Error("Unexpected API response");const n=t?.errors&&Object.values(t.errors)?.[0]?.[0];if(n)throw new Error(n);return t},y=(e,t,n)=>{if(e.length>0)return;const r=n.getProductsNoResolver()[0]?.id;r&&t([r])},w=(e=i._$,t=[],n=()=>{})=>E(e,t,n,!1),E=(e=i._$,t=[],n=()=>{},r=!0)=>async({dispatch:i,registry:g,select:f})=>{if(await c.A.blockExecution(h),v)return void y(t,n,f);const b=c.A.acquire(h);try{const c=await(async()=>{const e=(0,o.getQueryArg)(window.location.href,"origin"),t=(0,o.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===e?"gutenberg-wpcom":"gutenberg",type:"all",is_editable:!0}),n=await a()({path:t,method:"GET"});if(!n&&"object"!=typeof n)throw new Error("Unexpected API response");const r=n?.errors&&Object.values(n.errors)?.[0]?.[0];if(r)throw new Error(r);return n})();((e,t,n)=>{const r=t.select(s.store).getCurrentPostId();n((0,d.setConnectUrl)((0,u.A)(r,e.connect_url))),n((0,d.setSiteSlug)(e.site_slug)),n((0,d.setProducts)(e.products)),n((0,d.setConnectedAccountDefaultCurrency)(e.connected_account_default_currency)),n((0,d.setApiState)(e.connected_account_id?p.JA:p.gI))})(c,g,i),(e=>!e.products.length&&e.connected_account_id)(c)&&await(async(e
// translators: refers to a social post on Bluesky
__("Your post","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what your social post will look like on Bluesky:","jetpack")}),(0,r.jsx)(i.O,{...a})]}),!n&&(0,r.jsxs)("section",{className:"social-preview__section bluesky-preview__section",children:[(0,r.jsx)(s.w,{level:e,children:
// translators: refers to a link to a Bluesky post
__("Link preview","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what it will look like when someone shares the link to your WordPress post on Bluesky.","jetpack")}),(0,r.jsx)(o.c,{...a})]})]})},46140:(e,t,n)=>{"use strict";n.d(t,{Kq:()=>r,_I:()=>a,q8:()=>s});const r="article",a="landscape",s="portrait"},5954:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(10790),a=n(31280),s=n(57466);const o=({text:e,url:t,forceUrlDisplay:n})=>{let o;return(n||(0,a.ti)(e,"a"))&&(o=(0,r.jsx)("a",{className:"facebook-preview__custom-text-post-url",href:t,rel:"nofollow noopener noreferrer",target:"_blank",children:t})),(0,r.jsxs)("p",{className:"facebook-preview__custom-text",children:[(0,r.jsx)("span",{children:(0,a.x5)(e,{platform:"facebook",maxChars:s.zl})}),o]})}},57466:(e,t,n)=>{"use strict";n.d(t,{B2:()=>i,GA:()=>s,t2:()=>o,zl:()=>a});var r=n(31280);const a=440,s=e=>e.replace(/^[^/]+[/]*/,"").replace(/\/.*$/,""),o=e=>(0,r.RA)((0,r.f5)(110),(0,r.ZT)(110))((0,r.$J)(e))||"",i=e=>(0,r.RA)((0,r.f5)(200),(0,r.ZT)(200))((0,r.$J)(e))||""},72691:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(27723),a=n(51609),s=n(46140);const __=r.__,o=({mode:e})=>{const[t,n]=(0,a.useState)(e),[r,o]=(0,a.useState)(!0),i=(0,a.useCallback)((({target:e})=>{if(!t){const t=e;n(t.naturalWidth>t.naturalHeight?s._I:s.q8)}o(!1)}),[t]),l=(0,a.useCallback)((()=>o(!1)),[]);return[t,r,{alt:__("Facebook Preview Thumbnail","jetpack"),onLoad:i,onError:l}]}},57181:(e,t,n)=>{"use strict";n.d(t,{D:()=>c});var r=n(10790),a=n(46140),s=n(5954),o=n(72691),i=n(72870),l=n(77114);const c=({url:e,customImage:t,user:n,customText:c,imageMode:u})=>{const[d,p,m]=(0,o.A)({mode:u}),h="is-"+(d===a.q8?"portrait":"landscape");return(0,r.jsxs)("div",{className:"facebook-preview__post",children:[(0,r.jsx)(l.A,{user:void 0}),(0,r.jsx)("div",{className:"facebook-preview__content",children:(0,r.jsxs)("div",{className:`facebook-preview__window ${h} ${t&&p?"is-loading":""}`,children:[(0,r.jsx)("div",{className:`facebook-preview__custom-image ${h}`,children:(0,r.jsx)("img",{src:t,...m})}),(0,r.jsx)(l.A,{user:n,timeElapsed:!0,hideOptions:!0}),c&&(0,r.jsx)(s.A,{text:c,url:e,forceUrlDisplay:!0})]})}),(0,r.jsx)(i.A,{})]})}},73066:(e,t,n)=>{"use strict";n.d(t,{l:()=>p});var r=n(10790),a=n(27723),s=n(46140),o=n(5954),i=n(57466),l=n(72691),c=n(72870),u=n(77114),d=n(29659);n(81500);const __=a.__,p=({url:e,title:t,description:n,image:a,user:p,customText:m,type:h,imageMode:g,compactDescription:f})=>{const[b,v,k]=(0,l.A)({mode:g}),y=h===s.Kq,w="is-"+(y&&!a||b===s.q8?"portrait":"landscape");return(0,r.jsxs)("div",{className:"facebook-preview__post",children:[(0,r.jsx)(u.A,{user:p}),(0,r.jsxs)("div",{className:"facebook-preview__content",children:[m&&(0,r.jsx)(o.A,{text:m,url:e}),(0,r.jsxs)("div",{className:`facebook-preview__body ${w} ${a&&v?"is-loading":""}`,children:[(a||y)&&(0,r.jsx)("div",{className:`facebook-preview__image ${a?"":"is-empty"} ${w}`,children:a&&(0,r.jsx)("img",{src:a,...k})}),(0,r.jsx)("div",{className:"facebook-preview__text",children:(0,r.jsxs)("div",{className:"facebook-preview__text-wrapper",children:[(0,r.jsx)("div",{className:"facebook-preview__url",children:(0,i.GA)(e)}),(0,r.jsx)("div",{className:"facebook-preview__title",children:(0,i.t2)(t)||(0,i.GA)(e)}),(0,r.jsxs)("div",{className:"facebook-preview__description "+(f?"is-compact":""),children:[n&&(0,i.B2)(n),y&&!n&&
2023-09-26 10:24:36 +02:00
// translators: Default description for a Facebook post
2025-02-28 08:42:11 +01:00
__("Visit the post for more.","jetpack")]}),(0,r.jsx)("div",{className:"facebook-preview__info",children:(0,r.jsx)(d.A,{name:"info"})})]})})]})]}),(0,r.jsx)(c.A,{})]})}},73188:(e,t,n)=>{"use strict";n.d(t,{h:()=>c});var r=n(10790),a=n(46140),s=n(5954),o=n(72691),i=n(72870),l=n(77114);n(81500);const c=({url:e,user:t,customText:n,media:c,imageMode:u})=>{const[d]=(0,o.A)({mode:u}),p="is-"+(d===a.q8?"portrait":"landscape");return(0,r.jsxs)("div",{className:"facebook-preview__post",children:[(0,r.jsx)(l.A,{user:t}),(0,r.jsxs)("div",{className:"facebook-preview__content",children:[n&&(0,r.jsx)(s.A,{text:n,url:e,forceUrlDisplay:!0}),(0,r.jsx)("div",{className:"facebook-preview__body",children:c?(0,r.jsx)("div",{className:`facebook-preview__media ${p}`,children:c.map(((e,t)=>(0,r.jsx)("div",{className:`facebook-preview__media-item ${p}`,children:e.type.startsWith("video/")?(0,r.jsx)("video",{controls:!0,children:(0,r.jsx)("source",{src:e.url,type:e.type})}):(0,r.jsx)("img",{alt:e.alt||"",src:e.url})},`facebook-preview__media-item-${t}`)))}):null})]}),(0,r.jsx)(i.A,{})]})}},72870:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(10790),a=n(27723),s=n(29659);n(87748);const __=a.__,o=()=>(0,r.jsx)("ul",{className:"facebook-preview__post-actions",children:[{icon:"like",
2023-09-26 10:24:36 +02:00
// translators: Facebook "Like" action
label:__("Like","jetpack")},{icon:"comment",
// translators: Facebook "Comment" action
label:__("Comment","jetpack")},{icon:"share",
// translators: Facebook "Share" action
2025-02-28 08:42:11 +01:00
label:__("Share","jetpack")}].map((({icon:e,label:t})=>(0,r.jsxs)("li",{children:[(0,r.jsx)(s.A,{name:e}),(0,r.jsx)("span",{children:t})]},e)))})},77114:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(10790),a=n(27723),s=n(51609),o=n(29659);n(53290);const __=a.__,_x=a._x,i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAAAXNSR0IB2cksfwAADwtJREFUeJztXet2mzgX3RLg+H5NmsRt0zad6Zp5/6eYtebPvMDX20zaJm4udmwH20jfDyQQQthpgm1gsTuMWgukg7aOzjmSAPLX3/9wlCgs6L4FKLFdlAQXHCXBBUdJcMFRElxwlAQXHCXBBUdJcMFRElxwlAQXHCXBBUdJcMFRElxwlAQXHCXBBUdJcMFRElxwlAQXHCXBBUdJcMFRElxwlAQXHCXBBUdJcMFRElxwlAQXHCXBBUdJcMFh71uAbYMQsjaf82I/e1c4ggkh4JwrB8DBAQ6I/wEg4j8CQvxr5FE0wgtDMCEEjDF4ngdKKSzLQr1eQ71WxUGlAtu2QamvzYxxrFYruIsFZvMHzGZzeJ4XXEspLQzRhSF4tVrBcRwM+j30um2020049uNub7laYTy+x83tGLd3YyyXS1iWtXWZd4FcE0wI4HkchAAnJy9wfNhHvV6Lnccjw3NwNaR5dmwbg34Xg34Xs9kcP0bXuLwcgXPAsgjyrMy5Jdgnl6Fer+Ht6yHa7RYQOE0hefJcYJOzBQAc9XoN785eYtBt49PXC8xmc1gWzS3JuQyTCCFYrRh6vTb+/PDeJ5f7JPnO0lPKlA6ar+ztdgt/fniPXq+N1Ypt9MazitwRTACsPA+DXge/n7+F49hBRhocEBIqu+PY+P38LQa9Dlaet2EMyCZyR7DHOBq1Gt6fn/ne7hbr4gAopXh/foZGrQaP5W+czh3BlBK8ORvCsixwzreqVUTYdMuy8OZsGIRZeUKuCPY8htOTI3TaLZ/cHdhFOfnRabdwenIEz2NbrzNN5IZgzjmq1QMMT46BR0xBpglZ1/DkGNXqQa4mQXJBMCEEHmM4GvT2FrL4MTHF0aAHj+XHq84FwZxzVBwH/X5X/rIPKQAA/X4XFcfJjRZnnmBCCDzPQ6fdRK1W3ZntNcnBOUetVkWn3YTnebnQ4swTLAltNRuZiEMJ4MuSk5WnzBMMEYs2mnVgx86VDll3o1kHpblouuwTzDlgWzYatfgiwr7QqNVgW3Yu5qczTbA/0cDQaFQzpTGUUjQaVXDOMmE21iE7rWaCmPyvVg/2LUkMfjyMdCbAt4hsEwx/u41jO/7fMzAkShkc2/G3AmUcmScYHLDlilEmGtSXwXbsbIizAdknGBxWBodBX6bsM5wDggGSwVWcLMpkQg4IJmBZML4amNgalHXkgGCAsewt0WVRJhMyTzAhwHK5En/fv8ZIGZbLVdYjJCAPBAMErrvYtxAx+DJln+FME8w5B6UE8/k8Yx4rx3w+B6XZX3DINME+COYPLhZimM4CFssV5g9uqcFpgBDfoRlP7oE9Pw0o6x5P7sEYK21wGvAX/Blub8f7FiXA7e0YnpePbTuZJ5hzDmpZGE+mcF13bwvtcuOB67oYT6agYttu1pF5ggGAEoIH18XV6Fr8sg/N8eu8Gl3jwXVBc6C9yAvBnHPYlOJydI3Vaj/xJyH+I6qXo2vYOXp+OBcEAwChFK67xPcfI2DHzpas6/uPEVx3CZKhzQebkBtJ/UdICL79uMLkfrozWyxt7+R+im8/rsTzwvnQXuSJYB/+FtpPn//d2bZVuW1X1pmH2FdFzggGLMvC/XSOz18vdlbn568XuJ/Oc/lah9wRzDmHbVNcXv3Epy//bXUbD+fApy//4fLqJ2w7P46VitwRjOA5IQvfvl/i4+evQcOnQYBa1sfPX/Ht+6V4VPXZRe8FuX1Hh6/JNr5fjuCtPJydDXFQqQR5v2qf5TWEELiLBT5/ucDo+gaObedScyVySzAEKY5tY3Rzi+lsjuHwGC8O+wG5kpgkstV8ec7l6BoXFz8wd93ck4u8EwypyZYFd7HA/z5+wWh0jRcvBmi3mqg4ztprJamL5RLjyT0uL39iPLkHIQR2TqYiNyH3BEMbXseTKe7GE9TrNTTqdbSaddRqNRxUnMAL9jwP7mKJ+XyOyf0M09kMs9kchNDgCYoikIuiEKyCUgJCbMznLmazOX5e30TeRQlBnjz8ZT8KuwDDsQmFIxjKThBC7IhXzJi0uRApCYgtIrkoKsESOmkmX6uoxErkMg4u8XjkQoP1sEfC/JLR1GuPaX6SPFlEZglWX+wtJ/l9uxo6S7t6MZlqx315GAAOSmnmXySeKYJ1UgkhqFUPUK0eoFaronrg/91x7OCl39veWcGELIwxLJcrPDy4eHBdzOcPeHhwMX9whVOXTbIzRbD/wk+Cg4qDfq+DTqeNWu0gmILcBygAW8TPtSrQbjWDPHexwHzu4u5ujOubO7iLJThnsKzsuDbkr7//2Xt3k8/5tFtNHB0N0O92Yo20adpxV0iSw/MYrm/vcDX6ifHY3+KbhddO7E2D5TcWGGNot1oYnh6h22lHGk5dNNg3sRK6HFJG+Ra8w34Xt3djXHy7wngy2fs3IPZCsL+BzUOl4mB4eoyTFwPFM41ORGQd0Q7p/7vX7aDbaeP75U9cfPuBxWIp1pN3L99eCPY8D91uG+/OXgUvWAnnk/chUTqQsst7OT0+RK/Twscv/+LubgxKd78jZKdGgnPf3g5Pj/HHh/PIm1vzoK2PhRonV6sH+OPDOYanx2CM7VyLd6bBIpLE2zcvcfLiKPitSMTqIIRAfCIEZ6+GqFQcfP5yAQ6ys617W9fgwEkC8Nv5WUAucrc/8WlQ7/HkxRF+Oz8LfttF5946wXLi4t2bVxj0e9uuLvMY9Ht49+bVzlawtkqwHwpxvH51iqPDfqYe4d4XOICjwz5evzoFY9t/NfLWCPa/bbTCYb+L05OjrX9AIy+QH/o4PT7C4aArnrXaXstsjWDP89Co1/Dm7KXRpXjMVtdN5zxnu6x+bfSLpfG8x5SnX5+UD6EAb85eolGvbfVDH1vV4LPXQziOHeykWNeApgNy4j72ydjHlAEt1a8lsVQ9HiujKqt6PIZwx7Zx9nq41dg/dYLlE/mHgx66nbb/Makn3sBmDSJaGrk6knLtAHiwniy/Maz+eYqs6wjVO5C8pttp43DQ29obA1KPgxljcBwbL0+Phd3lACebm0y/Nx5JDI1OACI+/Ey44VW0RBg8M/8hueIkrs0xP0ZerqQx8Xn0JKKdxP0zKIDh6TFubsdbeaAuVQ2WCwiHgx6q1YNgaDYhpjE8fsjfw8ZSD6kp3DjExvJjKhzV8CQZTbKa5I2PANEeYDIR0uGqVQ9wOOiJHZ7pEpyqBnPO4TgODgc9/0bCjM3Xbvg90dEKUkM+EVWThOsjHCSVv77eJMHD+jaXyznH4aCH0c+b1F+RmJoGy+do260m6vV64BnK+/xVGyeVLGnbld58uoJy1bYmDKGb8rGG4JgMcSO/dozgSpt4jKFer6O9hc/1pKbBcttKt9sGkYOU6gnr5wf2M8FOcq2BTPnEV1GZRiC1UqR8Q5utkzGQNVa+MN2G7Fi+Tlogmzydo9dp4+bmLtUZrlQJdhwH7VYLHuPS8gg/KM5gxD+CuZuvG0HlBzsICDhnTyxfSmYaVUi8jMgNR9NY/+N6H9OHXqV88dncdrsFx3GwXC5T0+JUhmjpLDQbdf/bgozFYlEdXIYWSdqj5AWp+siJMK4y/dU4OZ4X9Zugcbjxen2UFjKqsupxduRgDBalaDbqIvpIB+nYYDEMN5uN4KPNMT/SQAARN0oMN6znxav0h2ViGp4VmZJMBDQCYz64QR71zyb5AxkVWWM9KNy64stACRrNejhxkgJSGaKl/a0eVERvDAUMmtYUi6
2023-09-26 10:24:36 +02:00
// translators: name of a fictional Facebook User
2023-12-07 09:44:11 +01:00
__("Anonymous User","jetpack")}),(0,r.jsxs)("div",{className:"facebook-preview__post-header-share",children:[(0,r.jsx)("span",{className:"facebook-preview__post-header-time",children:t?__(
2023-09-26 10:24:36 +02:00
// translators: short version of `1 hour`
"1h","jetpack"):_x(
// translators: temporal indication of when a post was published
2025-02-28 08:42:11 +01:00
"Just now","","jetpack")}),(0,r.jsx)("span",{className:"facebook-preview__post-header-dot","aria-hidden":"true",children:"·"}),(0,r.jsx)(o.A,{name:"public"})]})]})]}),!n&&(0,r.jsx)("div",{className:"facebook-preview__post-header-more"})]})}},29659:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(10790);n(15583);const a=({name:e})=>(0,r.jsx)("i",{className:`facebook-preview__post-icon facebook-preview__post-icon-${e}`})},87070:(e,t,n)=>{"use strict";n.d(t,{k:()=>c});var r=n(10790),a=n(27723),s=n(67556),o=n(73066),i=n(57181),l=n(73188);const __=a.__,c=({headingLevel:e,hideLinkPreview:t,hidePostPreview:n,...a})=>{const c=!!a.media?.length,u=!!a.customImage;return(0,r.jsxs)("div",{className:"social-preview facebook-preview",children:[!n&&(0,r.jsxs)("section",{className:"social-preview__section facebook-preview__section",children:[(0,r.jsx)(s.A,{level:e,children:
2023-09-26 10:24:36 +02:00
// translators: refers to a social post on Facebook
2025-02-28 08:42:11 +01:00
__("Your post","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what your social post will look like on Facebook:","jetpack")}),c?(0,r.jsx)(l.h,{...a}):(0,r.jsx)(o.l,{...a})]}),!t&&(0,r.jsxs)("section",{className:"social-preview__section facebook-preview__section",children:[(0,r.jsx)(s.A,{level:e,children:
2023-09-26 10:24:36 +02:00
// translators: refers to a link to a Facebook post
2025-02-28 08:42:11 +01:00
__("Link preview","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what it will look like when someone shares the link to your WordPress post on Facebook.","jetpack")}),u?(0,r.jsx)(i.D,{...a}):(0,r.jsx)(o.l,{...a,compactDescription:!0,customText:"",user:void 0})]})]})}},8797:(e,t,n)=>{"use strict";n.d(t,{m:()=>c});var r=n(10790),a=n(31280);n(88904);const s=160,o=e=>{const t=e.startsWith("https://")?"https://":"http://",n=t+e.replace(t,"").split("/").join(" ");return(0,a.RA)((0,a.f5)(68),(0,a.ZT)(68))(n)},i=(0,a.RA)((0,a.f5)(63),(0,a.y5)(23,73),(0,a.ZT)(63)),l=(0,a.RA)((0,a.f5)(s),(0,a.y5)(80,170),(0,a.ZT)(s)),c=({description:e="",siteTitle:t,title:n="",url:s=""})=>{const c=(0,a.GA)(s);return(0,r.jsx)("div",{className:"search-preview",children:(0,r.jsxs)("div",{className:"search-preview__display",children:[(0,r.jsxs)("div",{className:"search-preview__header",children:[(0,r.jsxs)("div",{className:"search-preview__branding",children:[(0,r.jsx)("img",{className:"search-preview__icon",src:`https://www.google.com/s2/favicons?sz=128&domain_url=${c}`,alt:""}),(0,r.jsxs)("div",{className:"search-preview__site",children:[(0,r.jsx)("div",{className:"search-preview__site--title",children:t||c}),(0,r.jsx)("div",{className:"search-preview__url",children:o(s)})]})]}),(0,r.jsx)("div",{className:"search-preview__menu",children:(0,r.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})})})]}),(0,r.jsx)("div",{className:"search-preview__title",children:i(n)}),(0,r.jsx)("div",{className:"search-preview__description",children:l((0,a.$J)(e))})]})})}},31280:(e,t,n)=>{"use strict";n.d(t,{$J:()=>d,GA:()=>o,RA:()=>u,TR:()=>b,X2:()=>p,ZT:()=>c,f5:()=>i,hV:()=>f,tX:()=>h,ti:()=>m,vI:()=>g,x5:()=>k,y5:()=>l});var r=n(10790),a=n(86087),s=n(27723);const o=e=>e.replace(/^[^/]+[/]*/,"").replace(/\/.*$/,""),i=e=>t=>t.length<=e&&t,l=(e,t)=>n=>{const r=n.slice(0,t),a=r.lastIndexOf(" ");return a>e&&a<t&&r.slice(0,a).concat("…")},c=e=>t=>t.slice(0,e).concat("…"),u=(...e)=>t=>e.find((e=>!1!==e(t)))?.(t),d=(e,t=[])=>{const n=new RegExp(`(<([^${t.join("")}>]+)>)`,"gi");return e?e.replace(n,""):""},p=e=>d(e).substring(0,50),m=(e,t)=>new RegExp(`<${t}[^>]*>`,"gi").test(e),h=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short"}).format,g=new Intl.DateTimeFormat("en-US",{day:"2-digit",month:"2-digit",year:"numeric"}).format,f=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format,b=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format,v={twitter:"https://twitter.com/hashtag/%1$s",facebook:"https://www.facebook.com/hashtag/%1$s",linkedin:"https://www.linkedin.com/feed/hashtag/?keywords=%1$s",instagram:"https://www.instagram.com/explore/tags/%1$s",mastodon:"https://%2$s/tags/%1$s",nextdoor:"https://nextdoor.com/hashtag/%1$s",threads:"https://www.threads.net/search?q=%1$s&serp_type=tags",bluesky:"https://bsky.app/hashtag/%1$s"};function k(e,t){const{platform:n,maxChars:o,maxLines:i,hyperlinkHashtags:l=!0,hyperlinkUrls:u="instagram"!==n}=t;let p=d(e);if(p=p.replaceAll(/(?:\s*[\n\r]){2,}/g,"\n\n"),o&&p.length>o&&(p=c(o)(p)),i){const e=p.split("\n");e.length>i&&(p=e.slice(0,i).join("\n"))}const m={};if(u){(p.match(/(https?:\/\/\S+)/g)||[]).forEach(((e,t)=>{m[`Link${t}`]=(0,r.jsx)("a",{href:e,rel:"noopener noreferrer",target:"_blank",children:e}),p=p.replace(e,`<Link${t} />`)}))}if(l&&v[n]){const e=p.matchAll(/(^|\s)#(\w+)/g),a=v[n];[...e].forEach((([e,n,o],i)=>{const l=(0,s.sprintf)(a,o,t.hashtagDomain);m[`Hashtag${i}`]=(0,r.jsx)("a",{href:l,rel:"noopener noreferrer",target:"_blank",children:`#${o}`}),p=p.replace(e,`${n}<Hashtag${i} />`)}))}return p=p.replace(/\n/g,"<br />"),m.br=(0,r.jsx)("br",{}),(0,a.createInterpolateElement)(p,m)}},41266:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,v:()=>r});const r=120,a=2},51296:(e,t,n)=>{"use strict";n.d(t,{X:()=>a});var r=n(1079
2023-09-26 10:24:36 +02:00
// translators: refers to the actor level of the post being shared, e.g. "1st", "2nd", "3rd", etc.
2023-12-07 09:44:11 +01:00
__("1st","jetpack")})]}),n?(0,r.jsx)("div",{className:"linkedin-preview__header--profile-title",children:n}):null,(0,r.jsxs)("div",{className:"linkedin-preview__header--profile-meta",children:[(0,r.jsx)("span",{children:
2023-09-26 10:24:36 +02:00
// translators: refers to the time since the post was published, e.g. "1h"
2025-02-28 08:42:11 +01:00
__("1h","jetpack")}),(0,r.jsx)("span",{children:"•"}),(0,r.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",width:"16",height:"16",focusable:"false",children:(0,r.jsx)("path",{d:"M8 1a7 7 0 107 7 7 7 0 00-7-7zM3 8a5 5 0 011-3l.55.55A1.5 1.5 0 015 6.62v1.07a.75.75 0 00.22.53l.56.56a.75.75 0 00.53.22H7v.69a.75.75 0 00.22.53l.56.56a.75.75 0 01.22.53V13a5 5 0 01-5-5zm6.24 4.83l2-2.46a.75.75 0 00.09-.8l-.58-1.16A.76.76 0 0010 8H7v-.19a.51.51 0 01.28-.45l.38-.19a.74.74 0 01.68 0L9 7.5l.38-.7a1 1 0 00.12-.48v-.85a.78.78 0 01.21-.53l1.07-1.09a5 5 0 01-1.54 9z"})})]})]})]}),(0,r.jsxs)("div",{className:"linkedin-preview__content",children:[u?(0,r.jsx)("div",{className:"linkedin-preview__caption",children:(0,s.x5)(u,{platform:"linkedin",maxChars:o.v,maxLines:o._})}):null,h?(0,r.jsx)("div",{className:"linkedin-preview__media",children:d.map(((e,t)=>(0,r.jsx)("div",{className:"linkedin-preview__media-item",children:e.type.startsWith("video/")?(0,r.jsx)("video",{controls:!0,children:(0,r.jsx)("source",{src:e.url,type:e.type})}):(0,r.jsx)("img",{alt:e.alt||"",src:e.url})},`linkedin-preview__media-item-${t}`)))}):(0,r.jsxs)("article",{children:[t?(0,r.jsx)("img",{className:"linkedin-preview__image",src:t,alt:""}):null,m?(0,r.jsxs)("div",{className:"linkedin-preview__description",children:[(0,r.jsx)("h2",{className:"linkedin-preview__description--title",children:p||(0,s.X2)(u)}),(0,r.jsxs)("div",{className:"linkedin-preview__description--meta",children:[(0,r.jsx)("span",{className:"linkedin-preview__description--url",children:(0,s.GA)(m)}),(0,r.jsx)("span",{children:"•"}),(0,r.jsx)("span",{children:(0,a.sprintf)(
2023-09-26 10:24:36 +02:00
// translators: %d is the number of minutes it takes to read the article
2025-02-28 08:42:11 +01:00
__("%d min read","jetpack"),e)})]})]}):null]})]})]})})}},7368:(e,t,n)=>{"use strict";n.d(t,{G:()=>l});var r=n(10790),a=n(27723),s=n(67556),o=n(78312),i=n(48914);const __=a.__,l=({headingLevel:e,hideLinkPreview:t,hidePostPreview:n,...a})=>(0,r.jsxs)("div",{className:"social-preview linkedin-preview",children:[!n&&(0,r.jsxs)("section",{className:"social-preview__section linkedin-preview__section",children:[(0,r.jsx)(s.A,{level:e,children:
2023-09-26 10:24:36 +02:00
// translators: refers to a social post on LinkedIn
2025-02-28 08:42:11 +01:00
__("Your post","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what your social post will look like on LinkedIn:","jetpack")}),(0,r.jsx)(i.$,{...a})]}),!t&&(0,r.jsxs)("section",{className:"social-preview__section linkedin-preview__section",children:[(0,r.jsx)(s.A,{level:e,children:
2023-09-26 10:24:36 +02:00
// translators: refers to a link to a LinkedIn post
2025-02-28 08:42:11 +01:00
__("Link preview","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what it will look like when someone shares the link to your WordPress post on LinkedIn.","jetpack")}),(0,r.jsx)(o.X,{...a,name:"",profileImage:""})]})]})},50121:(e,t,n)=>{"use strict";n.d(t,{k:()=>a,w:()=>r});const r="mastodon.social",a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAAWlBMVEXZ4ejW3+fQ2eTN1+LL1eHI0+DG0d7U3ebY4Oi7ydm0w9a2xNe5x9i+y9vS2+XDz93BzduwwNWputKjts+rvNOmudGtvtSgtM2OpMKHn72Bmbl8lbacsMuVq8fmVh92AAAKsklEQVR4AezBMQEAAAQAMKB/ZSWc2wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnmT17O5xVx8ItqJAFIZLUcIhqXV1/zudeZnObYCr+G2gwy91pOz7TrRKU0W0+vXLS9n/+uWb+mMIafCadV6Khi5PCemdxWtGCkXVCinGOy4KTVno0HZy8FFmfH1aRIfPmD7UWcPha3YQ+liJLrpx4pceMLFTR2sMFl9zUlFVtPBYw0a19xQOmPkzE/a3DtJiDdNRNRppsdoQttc2C39rHoeWNms9VrOyqSQHtvGB1mt6N/Fak+nK5EhJ7vQ6kkHROsLyRpNZnVsNSO6SRDjs0usVrePCeyyxoe9piV2coOtSA/b69kMOlneb/bdJgsFeXtFFdThC0hdax4fMpsn+PJKOLikiyfultZaTAq9EGRwzaLoc5XCUbekjjecs5qg/642kyMU9QWuRQU/v9RPnsgj6QI8MbEuXIiyyiPRGGDmn91OiI7Kw4iZz/sabSy9nzmsSb3p4vFP/tPdAkSKN5fy8pqQxwP2KCOSUrkr74BJGlbdHIugSAlCkSORCJrGiR73LriyKFPFcTp+1R2IDnU4bZOc1acslRfrBIDuj6WwRBfgGXJbRekAB8laDnkxcmpNI7jPsjUMJM5c3ogjX0JlidT2SB3C7oxXqu1fliwQ6j6+xR7KgBH+zRX/w84w323WD/EZ+pvFWTyRU34NnlNDeaEFmfq4JBQx0ClX1oBcddkVnkMhu4aTmGenpDA7ZcVL1jJibTPrEZ1j+Z+cMciWFYSAaIj6kFYABk77/UWc18m42X928Cn5XKLnsisGdhMNJ37A+Z1pTD451mKNuWksPM9Zpd/HuYc4a9QvkkyUypm/zRzkSfv7dd5dvIW+7E/0mMqALBFAiQ/ouGV0ggNE3i/f0Zvdyqnf1qY8CcdSj4QooEHQXWaWHrMPuR/x9saJDOiCu1/RVCrxAAHFd+SXrNAKHchDZAHsp+OS76ebCwxgoJ8PcnWN5Ww9BDEILQTylc9p6CNLMAaT1EMQwNF1Btp4cyxHeqi+AGQvtWYvsSt1AnLofXI89pUJHd0E1o3+YAgy+s+rfU8269KyX7Ke9hqLp/pAw99RCHOFfdlZsCgEIssqe9buMxaF7XK5UaCwEPMFX3X8Mm7G4hO+dDBU5ZAHm3jrrngIy63Du3XWvLR5GQ7BAnCkEYV3MGiouhgDm3joIn7S+OhTkJ93IEoKwLsVmWC4EJMMsfba3GY1LcuR1hiUEIVyJdXIIgjAsZw9BCIbllCUE+cdSkiNpWobjlDUsZwpB/M0EwSsE8UhIYK4hiD/yEhhDEL8wjmAPQfbkOGqBvekL4hEdRX56DskJxvRsQaZEo7yeLMirJBxbfa4gdUtAfm4QBLKgGhORsj51Y7iWhGR+6k59S0j+Y1q/EOQvNWeR6DwMA2E/LIXJfP9j/lhWrFdH3sy3D1nVjJQq1nrMQH62HmzMhOdQdi5LG+u8984aPcoJxvp/Z4vc2fArLFF72HMLaP0NG0YZ0fkbTICxW0JCVywg2vhHJFlyC+4ZF8cE4O+wxC/ikyvo/DNue0SiJ9j1s83ywVFsX/9pBZ219hIbt1W2DDlbMiIzuqMTqhIBCReZCmc7FkXkcvTZzKNlMm6AHGvg+CzQqgf3/BsOdrtqReJB8Xz+kTLB9+iEStyqa/d/BVd+5nZkYLMtcle4scAnCOFT3Bna2wqSiMQxl/9rH55ibhNn67ETRD44t6QkxiTipDcJVqRZuC6B+AlC+ZI1IjqlTdrRQPFwB4X1y6AniHxHgfWayOmkG4T8CsulUydIqt7TXkHQSQISGKuw2Smi2bPRFBnwm3TpG605uUyUkO0ikZyND/2E/xZLpFm0zNKsLNncQstxBxgarV66zyW+Zi0rAbFsT2EyA+LShk+uBatYPB+CMsuw/bjNdHXDZlQkZ4OdHeV5E7l6ZExCGxPGHKLhFC5ELfD0NwVDDTp4Msn3ucTvDQfUkZMvhUMDut1JDzxrwlNhbghUruhFHr0G/RThWyHRQJrIVEKx8DVrgrSQSmHxhWgi2DUWz9sJz0Rm8OkfnhavNZzKWDr+yNyEZyGnnYLjG85EyicI6pfSM5piVW8KkE8wzeqLDTfg/08FVmN1CpQDUrO+oHyhI6CpgGz9dQNpFCy7CsTWMyy92ilg3g4oLvJdv6hXbwqa3+zdC3qqMBAF4BMISeSRjAyw/6Xevm6tmipGA1Tn34BfOUxOArVVM37OnbZYu0V2gK1m3D2dwh/nQn1REz6W5MDrsp+lF5q/8ps/d9DNhQW5Ul+T1K88IF+cvjAmjQb+PqBo67hdiW+BVzRaHJRdHdcWeBIq1BHB46eB10M44qmOCA7Po9zVx1pjcczwagaFE9Y0TzkeB0639UGrHc7seS0a51y1O+o6PB1X0GcmnfGIKXglNeK8+cykDSWelLLe4lc1r2L0+J31VuFFORp5DS2ihKeGVzCQQozQRAMvbuyoRIwIRN3IS2uJDESEpTcNL6ymNwrinKZ309IF8q6EOOMCfRgXLpB3BuKMp0+7hQvkg4U4pelLvXCByJoVF+i/iReyp/8MxImCvnU9L2KiA4tjwtBBNy60wTrQOCIU/dRyfj0dcRA/aTrSLLXhJan1uEDH6uXykFqPKOjUfrE8pNYjDJ2ZOJ9xR2cqfBOeIqZl5kNGJMJQzLBoHjIi8QHJn0jfUZxFlAzIwZQ9DxmRiIJouUSGjn5lIQ4vQuL22Z5fRRi8EZouqTM9340qIWDpsoYfp6YrlOThDF2xG/lBWrrGSCCarur6TMfziFJ2WDN0U6btVYSXI+EMgfherad5rBT6VcGiGPg+BWygOYLCy5p5iYwCoFq+i8LsRKysVxdVCh90z+l6vFFGErmgoFm0wxfb3/slKVeRNHvc7GtT4KC7/3vo5ey74MX4lPW84GThxg82Fq9EVWk3as+p9O2fraTNTwSPEw2n8jgoZLd1zIXUW5Q40YiD2bstIwPyg/E4V3GiPY55I4f2m/a7oUBMwYl2OFUGCWT2A5NQOkRZTlThjNMkb0e+VFemw+EXihN5RKgrU6LxKpy+3h1x6Z0eV5hLeci50JQWlyhO0+BXVgc5GcZLNWgLIEsgFS7x55mYAq8kch2q0uI6y0lGhcucLQ19M9riVVlflLoqrcMsZcY/9+N8qXVZeuswl6g4SYE8BHGKGpmIllOUyERMnGBCLoJTGGQiSk4wOGyJdHqFXETNt9sjF6HGTW2xRODbNchGDHyz0SMXYfh2hFyE6uVMuCmdNPqmaL7dDrmIYuSbTQqZiKKX1yBbUo0b2mEJ28prqQ1RNHKCQUE8nqqakVOMBcQjOVuarpk4VQXxQF3P9wkQj9TwfTqIh6qf6f/gSSCtg3is+nnykEB2EA+3f5L9lQQyVtgQCWQosCESSK2QhZg4wRiwIRLI5LEdEshIDtmIgW9Ue2yHBDJpZCV6vkEfHDZDAulJITfRSxzbMv7BxUoCGbYUhwQyGQexFL5s3HcFtkE
2023-09-26 10:24:36 +02:00
// translators: username of a fictional Mastodon User
2025-02-28 08:42:11 +01:00
__("anonymous-user","jetpack")}),(0,r.jsx)("div",{className:"mastodon-preview__post-header-username",children:n?.replace(`@${o.w}`,"")||"@username"})]})]}),(0,r.jsxs)("div",{className:"mastodon-preview__post-header-audience",children:[(0,r.jsx)(i.f,{}),(0,s.TR)(new Date)]})]})}},83734:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});var r=n(10790);function a(){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"15",viewBox:"0 -960 960 960",width:"15",role:"img",children:(0,r.jsx)("path",{d:"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm-40-82v-78q-33 0-56.5-23.5T360-320v-40L168-552q-3 18-5.5 36t-2.5 36q0 121 79.5 212T440-162Zm276-102q20-22 36-47.5t26.5-53q10.5-27.5 16-56.5t5.5-59q0-98-54.5-179T600-776v16q0 33-23.5 56.5T520-680h-80v80q0 17-11.5 28.5T400-560h-80v80h240q17 0 28.5 11.5T600-440v120h40q26 0 47 15.5t29 40.5Z"})})}},71751:(e,t,n)=>{"use strict";n.d(t,{R:()=>l});var r=n(10790),a=n(27723),s=n(67556),o=n(82779),i=n(83945);const __=a.__,l=({headingLevel:e,hidePostPreview:t,hideLinkPreview:n,...a})=>(0,r.jsxs)("div",{className:"social-preview mastodon-preview",children:[!t&&(0,r.jsxs)("section",{className:"social-preview__section mastodon-preview__section",children:[(0,r.jsx)(s.w,{level:e,children:
2023-09-26 10:24:36 +02:00
// translators: refers to a social post on Mastodon
2025-02-28 08:42:11 +01:00
__("Your post","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what your social post will look like on Mastodon:","jetpack")}),(0,r.jsx)(i._,{...a})]}),!n&&(0,r.jsxs)("section",{className:"social-preview__section mastodon-preview__section",children:[(0,r.jsx)(s.w,{level:e,children:
2023-09-26 10:24:36 +02:00
// translators: refers to a link to a Mastodon post
2025-02-28 08:42:11 +01:00
__("Link preview","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what it will look like when someone shares the link to your WordPress post on Mastodon.","jetpack")}),(0,r.jsx)(o.i,{...a,user:void 0})]})]})},37171:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,v:()=>r});const r=160,a=2},33549:(e,t,n)=>{"use strict";n.d(t,{$:()=>l});var r=n(10790),a=n(27723),s=n(67766),o=n(2712),i=n(58528);const __=a.__;function l(){return(0,r.jsxs)("div",{className:"nextdoor-preview__footer--actions",children:[(0,r.jsxs)("div",{className:"nextdoor-preview__footer--actions-item",children:[(0,r.jsx)(o.p,{}),(0,r.jsx)("span",{children:__("Like","jetpack")})]}),(0,r.jsxs)("div",{className:"nextdoor-preview__footer--actions-item",children:[(0,r.jsx)(s.T,{}),(0,r.jsx)("span",{children:__("Comment","jetpack")})]}),(0,r.jsxs)("div",{className:"nextdoor-preview__footer--actions-item",children:[(0,r.jsx)(i.l,{}),(0,r.jsx)("span",{children:__("Share","jetpack")})]})]})}},43288:(e,t,n)=>{"use strict";n.d(t,{z:()=>a});var r=n(10790);function a(){return(0,r.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20","aria-hidden":"true",children:(0,r.jsx)("path",{fill:"#dfe1e4",fillRule:"evenodd",d:"M7.127 13.876a.732.732 0 1 0 1.035 1.035l4.75-4.749a.732.732 0 0 0 0-1.035L8.123 4.34A.732.732 0 0 0 7.09 5.375l4.27 4.27-4.232 4.23Z"})})}},67766:(e,t,n)=>{"use strict";n.d(t,{T:()=>a});var r=n(10790);function a(){return(0,r.jsx)("svg",{width:"20",height:"20",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 10.031C2 5.596 5.574 2 10 2h4c4.427 0 8 3.596 8 8.031 0 4.435-3.573 8.031-8 8.031h-1.52a17.033 17.033 0 0 1-1.377 1.467c-.991.938-2.456 2.079-4.086 2.437a1.403 1.403 0 0 1-1.458-.565 1.55 1.55 0 0 1-.195-1.394c.28-.823.395-1.734.434-2.464.014-.257.018-.485.018-.672A8.017 8.017 0 0 1 2 10.031Zm5.798 6.178a7.02 7.02 0 0 1 .016.418c.005.252.004.606-.019 1.023-.03.573-.103 1.285-.266 2.024.775-.377 1.54-.974 2.202-1.598a15.066 15.066 0 0 0 1.448-1.586l.017-.022.003-.004a1 1 0 0 1 .801-.402h2c3.314 0 6-2.692 6-6.03C20 6.691 17.314 4 14 4h-4c-3.314 0-6 2.692-6 6.031 0 2.336 1.32 4.36 3.258 5.359.308.159.515.474.54.82Z",clipRule:"evenodd"})})}},73462:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});var r=n(10790);const a=()=>(0,r.jsx)("div",{className:"nextdoor-preview__default-avatar",children:"A"})},45906:(e,t,n)=>{"use strict";n.d(t,{z:()=>a});var r=n(10790);function a(){return(0,r.jsx)("div",{className:"nextdoor-preview__default-image",children:(0,r.jsxs)("svg",{width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",color:"#055c00",children:[(0,r.jsx)("path",{fill:"currentColor",d:"M13.207 5.207c1.51-1.51 4.076-1.51 5.586 0 1.51 1.51 1.51 4.076 0 5.586l-2.1 2.1c-1.51 1.51-4.077 1.51-5.586 0a1 1 0 1 0-1.414 1.414c2.29 2.29 6.123 2.29 8.414 0l2.1-2.1c2.29-2.29 2.29-6.124 0-8.414s-6.124-2.29-8.414 0l-.7.7a1 1 0 0 0 1.414 1.414l.7-.7Z"}),(0,r.jsx)("path",{fill:"currentColor",d:"M7.307 11.107c1.51-1.51 4.076-1.51 5.586 0a1 1 0 0 0 1.414-1.414c-2.29-2.29-6.124-2.29-8.414 0l-2.1 2.1c-2.29 2.29-2.29 6.123 0 8.414 2.29 2.29 6.124 2.29 8.414 0l.7-.7a1 1 0 0 0-1.414-1.414l-.7.7c-1.51 1.51-4.076 1.51-5.586 0-1.51-1.51-1.51-4.076 0-5.586l2.1-2.1Z"})]})})}},85086:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});var r=n(10790);function a(){return(0,r.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.495-7.643c.286-.335.46-.357.505-.357.045 0 .219.022.505.357.282.33.581.868.852 1.619.464 1.283.79 3.034.872 5.024H9.771c.082-1.99.408-3.741.871-5.024.272-.751.571-1.289.854-1.62ZM7.77 11c.084-2.181.439-4.171.992-5.704.093-.255.192-.502.298-.738A8.009 8.009 0 0 0 4.062 11h3.707Zm-3.707 2h3.707c.084 2.181.439 4.171.992 5.704.093.255.192.502.298.738A8.009 8.009 0 0 1 4.062 13Zm15.876-2a8.009 8.009 0 0 0-4.997-6.442c.106.236.205.483.298.738.553 1.533.908 3.523.992 5.704h3.707Zm-3.707 2h3.707a8.
2023-12-07 09:44:11 +01:00
// translators: refers to a social post on Nextdoor
2025-02-28 08:42:11 +01:00
__("Your post","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what your social post will look like on Nextdoor:","jetpack")}),(0,r.jsx)(i.K,{...a})]}),!t&&(0,r.jsxs)("section",{className:"social-preview__section nextdoor-preview__section",children:[(0,r.jsx)(s.A,{level:e,children:
2023-12-07 09:44:11 +01:00
// translators: refers to a link to a Nextdoor post
2025-02-28 08:42:11 +01:00
__("Link preview","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what it will look like when someone shares the link to your WordPress post on Nextdoor.","jetpack")}),(0,r.jsx)(o.g,{...a,name:"",profileImage:""})]})]})},67556:(e,t,n)=>{"use strict";n.d(t,{A:()=>o,w:()=>s});var r=n(10790);const a=[2,3,4,5,6],s=({className:e,level:t,children:n})=>{const s=`h${t&&a.includes(t)?t:3}`;return(0,r.jsx)(s,{className:`social-preview__section-heading ${e??""}`,children:n})},o=s},83382:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(10790),a=n(13022),s=n(31280),o=n(26363);const i=({image:e,title:t,url:n})=>{const i=(0,a.A)({"threads-preview__card-has-image":!!e});return(0,r.jsx)("div",{className:"threads-preview__card",children:(0,r.jsxs)("div",{className:i,children:[e&&(0,r.jsx)("img",{className:"threads-preview__card-image",src:e,alt:""}),(0,r.jsxs)("div",{className:"threads-preview__card-body",children:[(0,r.jsx)("div",{className:"threads-preview__card-url",children:(0,s.GA)(n||"")}),(0,r.jsx)("div",{className:"threads-preview__card-title",children:(0,o.c)(t)})]})]})})}},96039:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var r=n(10790);const a=()=>(0,r.jsxs)("div",{className:"threads-preview__footer",children:[(0,r.jsx)("span",{className:"threads-preview__icon--like",children:(0,r.jsx)("svg",{role:"img",viewBox:"0 0 18 18",children:(0,r.jsx)("path",{d:"M1.34375 7.53125L1.34375 7.54043C1.34374 8.04211 1.34372 8.76295 1.6611 9.65585C1.9795 10.5516 2.60026 11.5779 3.77681 12.7544C5.59273 14.5704 7.58105 16.0215 8.33387 16.5497C8.73525 16.8313 9.26573 16.8313 9.66705 16.5496C10.4197 16.0213 12.4074 14.5703 14.2232 12.7544C15.3997 11.5779 16.0205 10.5516 16.3389 9.65585C16.6563 8.76296 16.6563 8.04211 16.6562 7.54043V7.53125C16.6562 5.23466 15.0849 3.25 12.6562 3.25C11.5214 3.25 10.6433 3.78244 9.99228 4.45476C9.59009 4.87012 9.26356 5.3491 9 5.81533C8.73645 5.3491 8.40991 4.87012 8.00772 4.45476C7.35672 3.78244 6.47861 3.25 5.34375 3.25C2.9151 3.25 1.34375 5.23466 1.34375 7.53125Z",strokeWidth:"1.25"})})}),(0,r.jsx)("span",{className:"threads-preview__icon--reply",children:(0,r.jsx)("svg",{role:"img",viewBox:"0 0 18 18",children:(0,r.jsx)("path",{d:"M15.376 13.2177L16.2861 16.7955L12.7106 15.8848C12.6781 15.8848 12.6131 15.8848 12.5806 15.8848C11.3779 16.5678 9.94767 16.8931 8.41995 16.7955C4.94194 16.5353 2.08152 13.7381 1.72397 10.2578C1.2689 5.63919 5.13697 1.76863 9.75264 2.22399C13.2307 2.58177 16.0261 5.41151 16.2861 8.92429C16.4161 10.453 16.0586 11.8841 15.376 13.0876C15.376 13.1526 15.376 13.1852 15.376 13.2177Z",strokeLinejoin:"round",strokeWidth:"1.25"})})}),(0,r.jsx)("span",{className:"threads-preview__icon--repost",children:(0,r.jsxs)("svg",{role:"img",viewBox:"0 0 18 18",children:[(0,r.jsx)("path",{d:"M6.41256 1.23531C6.6349 0.971277 7.02918 0.937481 7.29321 1.15982L9.96509 3.40982C10.1022 3.52528 10.1831 3.69404 10.1873 3.87324C10.1915 4.05243 10.1186 4.2248 9.98706 4.34656L7.31518 6.81971C7.06186 7.05419 6.66643 7.03892 6.43196 6.7856C6.19748 6.53228 6.21275 6.13685 6.46607 5.90237L7.9672 4.51289H5.20312C3.68434 4.51289 2.45312 5.74411 2.45312 7.26289V9.51289V11.7629C2.45312 13.2817 3.68434 14.5129 5.20312 14.5129C5.5483 14.5129 5.82812 14.7927 5.82812 15.1379C5.82812 15.4831 5.5483 15.7629 5.20312 15.7629C2.99399 15.7629 1.20312 13.972 1.20312 11.7629V9.51289V7.26289C1.20312 5.05375 2.99399 3.26289 5.20312 3.26289H7.85002L6.48804 2.11596C6.22401 1.89362 6.19021 1.49934 6.41256 1.23531Z"}),(0,r.jsx)("path",{d:"M11.5874 17.7904C11.3651 18.0545 10.9708 18.0883 10.7068 17.8659L8.03491 15.6159C7.89781 15.5005 7.81687 15.3317 7.81267 15.1525C7.80847 14.9733 7.8814 14.801 8.01294 14.6792L10.6848 12.206C10.9381 11.9716 11.3336 11.9868 11.568 12.2402C11.8025 12.4935 11.7872 12.8889 11.5339 13.1234L10.0328 14.5129H12.7969C14.3157 14.5129 15.5469 13.2816 15.5469 11.7629V9.51286V7.26286C15.5469 5.74408 14.3157 4.51286 12.7969 4.51286C12.4517 4.51286 12.1719 4.23304 12.1719 3.88786C12.1719 3.54269 12.4517 3.26286 12.7969 3.26286C15.006 3.26286 16.7969 5.05373 16.7969 7.26286V9.51286V11.7629
// translators: refers to a social post on Threads
__("Your post","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what your social post will look like on Threads:","jetpack")}),a.map(((e,t)=>{const n=t+1===a.length;return(0,r.jsx)(i.s,{...e,showThreadConnector:!n},`threads-preview__post-${t}`)}))]}),t?null:(0,r.jsxs)("section",{className:"social-preview__section threads-preview__section",children:[(0,r.jsx)(s.A,{level:e,children:
// translators: refers to a link to a Threads post
__("Link preview","jetpack")}),a[0].image?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what it will look like when someone shares the link to your WordPress post on Threads.","jetpack")}),(0,r.jsx)(o.G,{...a[0],name:"",profileImage:""})]}):(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("Threads link preview requires an image to be set for the post. Please add an image to see the preview.","jetpack")})]})]}):null},83390:(e,t,n)=>{"use strict";n.d(t,{B:()=>o});var r=n(10790),a=n(27723),s=n(70718);const __=a.__,o=({profileImage:e,showThreadConnector:t})=>(0,r.jsxs)("div",{className:"threads-preview__sidebar",children:[(0,r.jsx)("div",{className:"threads-preview__profile-image",children:e?(0,r.jsx)("img",{alt:__("Threads profile image","jetpack"),src:e}):(0,r.jsx)(s.f,{})}),t&&(0,r.jsx)("div",{className:"threads-preview__connector"})]})},47956:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a,f:()=>s});var r=n(31280);const a=e=>(0,r.RA)((0,r.f5)(1e3),(0,r.ZT)(1e3))((0,r.$J)(e))||"",s=e=>(0,r.RA)((0,r.f5)(400),(0,r.ZT)(400))((0,r.$J)(e))||""},82484:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(10790),a=n(27723),s=n(31280),o=n(47956),i=n(38336),l=n(52340);n(54447);const __=a.__,c=({title:e,description:t,image:n,user:a,url:c})=>{const u=a?.avatarUrl;return(0,r.jsxs)("div",{className:"tumblr-preview__post",children:[u&&(0,r.jsx)("img",{className:"tumblr-preview__avatar",src:u,alt:""}),(0,r.jsxs)("div",{className:"tumblr-preview__card",children:[(0,r.jsx)(l.A,{user:a}),(0,r.jsxs)("div",{className:"tumblr-preview__window",children:[n&&(0,r.jsxs)("div",{className:"tumblr-preview__window-top",children:[(0,r.jsx)("div",{className:"tumblr-preview__overlay",children:(0,r.jsx)("div",{className:"tumblr-preview__title",children:(0,o.Z)(e)})}),(0,r.jsx)("img",{className:"tumblr-preview__image",src:n,alt:__("Tumblr preview thumbnail","jetpack")})]}),(0,r.jsxs)("div",{className:"tumblr-preview__window-bottom "+(n?"":"is-full"),children:[!n&&(0,r.jsx)("div",{className:"tumblr-preview__title",children:(0,o.Z)(e)}),t&&n&&(0,r.jsx)("div",{className:"tumblr-preview__description",children:(0,o.f)(t)}),c&&(0,r.jsx)("div",{className:"tumblr-preview__site-name",children:(0,s.GA)(c)})]})]}),(0,r.jsx)(i.A,{})]})]})}},95550:(e,t,n)=>{"use strict";n.d(t,{B:()=>l});var r=n(10790),a=n(27723),s=n(47956),o=n(38336),i=n(52340);n(54447);const __=a.__,l=({title:e,description:t,image:n,user:a,url:l,customText:c,media:u})=>{const d=a?.avatarUrl,p=u?.[0];return(0,r.jsxs)("div",{className:"tumblr-preview__post",children:[d&&(0,r.jsx)("img",{className:"tumblr-preview__avatar",src:d,alt:""}),(0,r.jsxs)("div",{className:"tumblr-preview__card",children:[(0,r.jsx)(i.A,{user:a}),(0,r.jsxs)("div",{className:"tumblr-preview__body",children:[(0,r.jsx)("div",{className:"tumblr-preview__title",children:(0,s.Z)(e)}),c&&(0,r.jsx)("div",{className:"tumblr-preview__custom-text",children:c}),t&&(0,r.jsx)("div",{className:"tumblr-preview__description",children:(0,s.f)(t)}),p?(0,r.jsx)("div",{className:"tumblr-preview__media-item",children:p.type.startsWith("video/")?(0,r.jsx)("video",{controls:!0,className:"tumblr-preview__media--video",children:(0,r.jsx)("source",{src:p.url,type:p.type})}):(0,r.jsx)("img",{className:"tumblr-preview__image",src:p.url,alt:""})}):n&&(0,r.jsx)("img",{className:"tumblr-preview__image",src:n,alt:__("Tumblr preview thumbnail","jetpack")}),(0,r.jsx)("a",{className:"tumblr-preview__url",href:l,target:"_blank",rel:"noreferrer",children:__("View On WordPress","jetpack")})]}),(0,r.jsx)(o.A,{})]})]})}},38336:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(10790),a=n(27723),s=n(45949);n(25634);const __=a.__,o=()=>(0,r.jsxs)("div",{className:"tumblr-preview__post-actions",children:[(0,r.jsxs)("div",{className:"tumblr-preview__post-manage-actions",children:[(0,r.jsxs)("div",{className:"tumblr-preview__post-actions-blaze",children:[(0,r.jsx)(s.A,{name:"blaze"})," Blaze"]}),(0,r.jsx)("ul",{children:[{icon:"delete",
2023-09-26 10:24:36 +02:00
// translators: "Delete" action on a Tumblr post
label:__("Delete","jetpack")},{icon:"edit",
// translators: "Edit" action on a Tumblr post
2025-02-28 08:42:11 +01:00
label:__("Edit","jetpack")}].map((({icon:e,label:t})=>(0,r.jsx)("li",{"aria-label":t,children:(0,r.jsx)(s.A,{name:e})},e)))})]}),(0,r.jsxs)("div",{className:"tumblr-preview__post-social-actions",children:[(0,r.jsx)("div",{children:
2023-09-26 10:24:36 +02:00
// translators: count of notes on a Tumblr post
__("0 notes","jetpack")}),(0,r.jsx)("ul",{children:[{icon:"share",
// translators: "Share" action on a Tumblr post
label:__("Share","jetpack")},{icon:"reply",
// translators: "Reply" action on a Tumblr post
label:__("Reply","jetpack")},{icon:"reblog",
// translators: "Reblog" action on a Tumblr post
label:__("Reblog","jetpack")},{icon:"like",
// translators: "Like" action on a Tumblr post
2025-02-28 08:42:11 +01:00
label:__("Like","jetpack")}].map((({icon:e,label:t})=>(0,r.jsx)("li",{"aria-label":t,children:(0,r.jsx)(s.A,{name:e})},e)))})]})]})},52340:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(10790),a=n(27723),s=n(45949);n(49488);const __=a.__,o=({user:e})=>(0,r.jsxs)("div",{className:"tumblr-preview__post-header",children:[(0,r.jsx)("div",{className:"tumblr-preview__post-header-username",children:e?.displayName||
2023-09-26 10:24:36 +02:00
// translators: username of a fictional Tumblr User
2025-02-28 08:42:11 +01:00
__("anonymous-user","jetpack")}),(0,r.jsx)(s.A,{name:"ellipsis"})]})},45949:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(10790);n(34229);const a=({name:e})=>{let t;switch(e){case"blaze":t=(0,r.jsx)("svg",{viewBox:"0 0 25 22",children:(0,r.jsx)("path",{d:"m7.5059-0.24414c-0.79843 0.057223-1.2169 0.88587-1.1635 1.6128-0.2266 2.0449-1.4898 3.8696-3.1975 4.9778-3.0182 2.414-4.2201 6.8066-2.8033 10.411 0.92417 2.4679 2.9589 4.5674 5.4768 5.3928 0.95914 0.16102 1.7233-0.94358 1.3074-1.8059-0.11578-0.51062-0.17482-0.96516-0.17845-1.487 1.0413 1.5607 2.5484 2.8986 4.341 3.4975 1.0396-0.0154 1.98-0.64458 2.8516-1.1608 3.3821-2.1786 4.9604-6.7097 3.6597-10.518-0.49144-1.4599-1.2948-2.8935-2.5028-3.8698-0.7512-0.45498-1.661 0.09677-1.9202 0.86038-0.12274 0.16822-0.70352 1.1955-0.6191 0.61976 0.25488-3.4397-1.6789-7.0066-4.8123-8.4958-0.14322-0.037843-0.292-0.049464-0.43945-0.035156zm1.0586 3.5605c1.8947 2.0016 2.2326 5.1984 0.89062 7.5879-0.38498 0.96148 0.71762 2.0063 1.6567 1.5681 1.4159-0.4624 2.6998-1.3259 3.6577-2.4665 1.6442 2.5888 1.1465 6.2819-1.0629 8.3379-0.62378 0.60782-1.3666 1.0945-2.1754 1.4179-1.9543-0.989-3.3534-3.0966-3.5625-5.3125-0.25636-1.0253-1.81-1.2013-2.2852-0.25781-0.75058 1.3054-1.1846 2.7948-1.2305 4.3008-2.2396-1.9852-2.8468-5.4435-1.4609-8.0527 0.58926-1.239 1.651-2.13 2.724-2.9329 1.2958-1.1271 2.2791-2.62 2.7682-4.2683l0.071578 0.069832z"})});break;case"delete":t=(0,r.jsxs)("svg",{viewBox:"0 0 14 17",children:[(0,r.jsx)("path",{d:"M12 5v9c.1.7-.3 1-1 1H3c-.5 0-.9-.3-1-1V5c0-.6-.4-1-1-1-.5 0-1 .4-1 1v9.5C0 16.1 1.4 17 3 17h8c1.8 0 3-.8 3-2.5V5c0-.6-.5-1-1-1-.6 0-1 .5-1 1z"}),(0,r.jsx)("path",{d:"M4 12s0 1 1 1 1-1 1-1V5c0-.5-.4-1-1-1-.5 0-1 .5-1 1v7zm4 0s0 1 1 1 1-1 1-1V5c0-.5-.4-1-1-1-.5 0-1 .5-1 1v7zm5-10c.5 0 1-.4 1-1 0-.5-.4-.9-1-1H1C.5.1 0 .5 0 1c0 .6.6 1 1.1 1H13z"})]});break;case"edit":t=(0,r.jsx)("svg",{viewBox:"0 0 17.6 17.6",children:(0,r.jsx)("path",{d:"M5.3 13.8l-2.1.7.7-2.1L10.3 6l1.4 1.4-6.4 6.4zm6.4-9.3l-1.4-1.4-1.4 1.4-6.7 6.7-.2.5-2 5.9 3.8-1.3 2.1-.7.4-.1.3-.3 7.8-7.8c.1 0-2.7-2.9-2.7-2.9zm5.6-1.4L14.5.3c-.4-.4-1-.4-1.4 0l-1.4 1.4L15.9 6l1.4-1.4c.4-.5.4-1.1 0-1.5"})});break;case"share":t=(0,r.jsx)("svg",{viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12.6173 1.07612C12.991 0.921338 13.4211 1.00689 13.7071 1.29289L22.7071 10.2929C23.0832 10.669 23.0991 11.2736 22.7433 11.669L13.7433 21.669C13.4663 21.9767 13.0283 22.082 12.6417 21.9336C12.2552 21.7853 12 21.414 12 21V16H11.5C7.31775 16 3.92896 18.2486 2.95256 21.3044C2.80256 21.7738 2.33292 22.064 1.84598 21.9881C1.35904 21.9122 1 21.4928 1 21V18.5C1 12.3162 5.88069 7.27245 12 7.01067V2C12 1.59554 12.2436 1.2309 12.6173 1.07612ZM14 4.41421V8C14 8.55228 13.5523 9 13 9H12.5C7.64534 9 3.64117 12.6414 3.06988 17.3419C5.09636 15.2366 8.18218 14 11.5 14H13C13.5523 14 14 14.4477 14 15V18.394L20.622 11.0362L14 4.41421Z"})});break;case"reply":t=(0,r.jsx)("svg",{viewBox:"0 0 17 17",children:(0,r.jsx)("path",{d:"M8.7 0C4.1 0 .4 3.7.4 8.3c0 1.2.2 2.3.7 3.4-.2.6-.4 1.5-.7 2.5L0 15.8c-.2.7.5 1.4 1.2 1.2l1.6-.4 2.4-.7c1.1.5 2.2.7 3.4.7 4.6 0 8.3-3.7 8.3-8.3C17 3.7 13.3 0 8.7 0zM15 8.3c0 3.5-2.8 6.3-6.4 6.3-1.2 0-2.3-.3-3.2-.9l-3.2.9.9-3.2c-.5-.9-.9-2-.9-3.2.1-3.4 3-6.2 6.5-6.2S15 4.8 15 8.3z"})});break;case"reblog":t=(0,r.jsx)("svg",{viewBox:"0 0 17 18.1",children:(0,r.jsx)("path",{d:"M12.8.2c-.4-.4-.8-.2-.8.4v2H2c-2 0-2 2-2 2v5s0 1 1 1 1-1 1-1v-4c0-1 .5-1 1-1h9v2c0 .6.3.7.8.4L17 3.6 12.8.2zM4.2 17.9c.5.4.8.2.8-.3v-2h10c2 0 2-2 2-2v-5s0-1-1-1-1 1-1 1v4c0 1-.5 1-1 1H5v-2c0-.6-.3-.7-.8-.4L0 14.6l4.2 3.3z"})});break;case"like":t=(0,r.jsx)("svg",{viewBox:"0 0 20 18",children:(0,r.jsx)("path",{d:"M14.658 0c-1.625 0-3.21.767-4.463 2.156-.06.064-.127.138-.197.225-.074-.085-.137-.159-.196-.225C8.547.766 6.966 0 5.35 0 4.215 0 3.114.387 2.162 1.117c-2.773 2.13-2.611 5.89-1.017 8.5 2.158 3.535 6.556 7.18 7.416 7.875A2.3 2.3 0 0 0 9.998 18c.519 0 1.028-.18 1.436-.508.859-.695 5.257-4.34 7.416-7.875 1.595-2.616 1.765-6.376-1-8.5C16.895.387 15.792 0 14.657 0h.001zm0 2.124c.645 0 1.298.208 1.916.683 1.903 1.461 1.457 4.099.484 5.695-1.973 3.23-6.16 6.7-6.94
2023-09-26 10:24:36 +02:00
// translators: refers to a social post on Tumblr
2025-02-28 08:42:11 +01:00
__("Your post","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what your social post will look like on Tumblr:","jetpack")}),l?(0,r.jsx)(i.B,{...a}):(0,r.jsx)(o.Z,{...a})]}),!t&&(0,r.jsxs)("section",{className:"social-preview__section tumblr-preview__section",children:[(0,r.jsx)(s.w,{level:e,children:
2023-09-26 10:24:36 +02:00
// translators: refers to a link on Tumblr
2025-02-28 08:42:11 +01:00
__("Link preview","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what it will look like when someone shares the link to your WordPress post on Tumblr.","jetpack")}),(0,r.jsx)(o.Z,{...a,user:void 0})]})]})}},74404:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(10790),a=n(13022),s=n(31280);const o=(0,s.RA)((0,s.f5)(200),(0,s.ZT)(200)),i=({description:e,image:t,title:n,cardType:i,url:l})=>{const c=(0,a.A)(`twitter-preview__card-${i}`,{"twitter-preview__card-has-image":!!t});return(0,r.jsx)("div",{className:"twitter-preview__card",children:(0,r.jsxs)("div",{className:c,children:[t&&(0,r.jsx)("img",{className:"twitter-preview__card-image",src:t,alt:""}),(0,r.jsxs)("div",{className:"twitter-preview__card-body",children:[(0,r.jsx)("div",{className:"twitter-preview__card-url",children:(0,s.GA)(l||"")}),(0,r.jsx)("div",{className:"twitter-preview__card-title",children:n}),(0,r.jsx)("div",{className:"twitter-preview__card-description",children:o((0,s.$J)(e))})]})]})})}},5501:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var r=n(10790);const a=()=>(0,r.jsxs)("div",{className:"twitter-preview__footer",children:[(0,r.jsx)("span",{className:"twitter-preview__icon-replies",children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01zm8.005-6c-3.317 0-6.005 2.69-6.005 6 0 3.37 2.77 6.08 6.138 6.01l.351-.01h1.761v2.3l5.087-2.81c1.951-1.08 3.163-3.13 3.163-5.36 0-3.39-2.744-6.13-6.129-6.13H9.756z"})})}),(0,r.jsx)("span",{className:"twitter-preview__icon-retweets",children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M4.5 3.88l4.432 4.14-1.364 1.46L5.5 7.55V16c0 1.1.896 2 2 2H13v2H7.5c-2.209 0-4-1.79-4-4V7.55L1.432 9.48.068 8.02 4.5 3.88zM16.5 6H11V4h5.5c2.209 0 4 1.79 4 4v8.45l2.068-1.93 1.364 1.46-4.432 4.14-4.432-4.14 1.364-1.46 2.068 1.93V8c0-1.1-.896-2-2-2z"})})}),(0,r.jsx)("span",{className:"twitter-preview__icon-likes",children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M16.697 5.5c-1.222-.06-2.679.51-3.89 2.16l-.805 1.09-.806-1.09C9.984 6.01 8.526 5.44 7.304 5.5c-1.243.07-2.349.78-2.91 1.91-.552 1.12-.633 2.78.479 4.82 1.074 1.97 3.257 4.27 7.129 6.61 3.87-2.34 6.052-4.64 7.126-6.61 1.111-2.04 1.03-3.7.477-4.82-.561-1.13-1.666-1.84-2.908-1.91zm4.187 7.69c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})}),(0,r.jsx)("span",{className:"twitter-preview__icon-analytics",children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M8.75 21V3h2v18h-2zM18 21V8.5h2V21h-2zM4 21l.004-10h2L6 21H4zm9.248 0v-7h2v7h-2z"})})}),(0,r.jsx)("span",{className:"twitter-preview__icon-share",children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 2.59l5.7 5.7-1.41 1.42L13 6.41V16h-2V6.41l-3.3 3.3-1.41-1.42L12 2.59zM21 15l-.02 3.51c0 1.38-1.12 2.49-2.5 2.49H5.5C4.11 21 3 19.88 3 18.5V15h2v3.5c0 .28.22.5.5.5h12.98c.28 0 .5-.22.5-.5L19 15h2z"})})})]})},69463:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var r=n(10790),a=n(27723),s=n(31280);const __=a.__,o=({name:e,screenName:t,date:n})=>(0,r.jsxs)("div",{className:"twitter-preview__header",children:[(0,r.jsx)("span",{className:"twitter-preview__name",children:e||__("Account Name","jetpack")}),(0,r.jsx)("span",{className:"twitter-preview__screen-name",children:t||"@account"}),(0,r.jsx)("span",{children:"·"}),(0,r.jsx)("span",{className:"twitter-preview__date",children:(0,s.hV)(n||Date.now())})]})},43204:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});var r=n(10790);const a=()=>(0,r.jsxs)("svg",{version:"1.0",xmlns:"http://www.w3.org/2000/svg",width:"271pt",height:"270pt",viewBox:"0 0 271 270",children:[(0,r.jsx)("rect",{width:"100%",height:"100%",fill:"#ccd5de"}),(0,r.jsxs)("g",{transform:"translate(0,270) scale(0.1,-0.1
2023-09-26 10:24:36 +02:00
// translators: refers to a social post on Twitter
2025-02-28 08:42:11 +01:00
__("Your post","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what your social post will look like on X:","jetpack")}),a.map(((e,t)=>{const n=t+1===a.length;return(0,r.jsx)(i.O,{...e,showThreadConnector:!n},`twitter-preview__tweet-${t}`)}))]}),!t&&(0,r.jsxs)("section",{className:"social-preview__section twitter-preview__section",children:[(0,r.jsx)(s.A,{level:e,children:
2023-09-26 10:24:36 +02:00
// translators: refers to a link to a Twitter post
2025-02-28 08:42:11 +01:00
__("Link preview","jetpack")}),(0,r.jsx)("p",{className:"social-preview__section-desc",children:__("This is what it will look like when someone shares the link to your WordPress post on X.","jetpack")}),(0,r.jsx)(o.E,{...a[0],name:"",profileImage:"",screenName:""})]})]}):null},58024:(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var r=n(10790),a=n(56427);const s=({tweet:e})=>e?(0,r.jsxs)("div",{className:"twitter-preview__quote-tweet",children:[(0,r.jsx)(a.SandBox,{html:`<blockquote class="twitter-tweet" data-conversation="none" data-dnt="true"><a href="${e}"></a></blockquote>`,scripts:["https://platform.twitter.com/widgets.js"],title:"Embedded tweet"}),(0,r.jsx)("div",{className:"twitter-preview__quote-tweet-overlay"})]}):null},940:(e,t,n)=>{"use strict";n.d(t,{B:()=>o});var r=n(10790),a=n(27723),s=n(43204);const __=a.__,o=({profileImage:e,showThreadConnector:t})=>(0,r.jsxs)("div",{className:"twitter-preview__sidebar",children:[(0,r.jsx)("div",{className:"twitter-preview__profile-image",children:e?(0,r.jsx)("img",{alt:__("Twitter profile image","jetpack"),src:e}):(0,r.jsx)(s.f,{})}),t&&(0,r.jsx)("div",{className:"twitter-preview__connector"})]})},16801:(e,t,n)=>{"use strict";n.d(t,{E:()=>s});var r=n(10790),a=n(31280);const s=({text:e,url:t,retainUrl:n})=>{if(!e)return null;const s=t&&!n&&e.endsWith(t)?e.substring(0,e.lastIndexOf(t)):e;return(0,r.jsx)("div",{className:"twitter-preview__text",children:(0,a.x5)(s,{platform:"twitter"})})}},10067:(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 r=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(a=r))})),t.splice(a,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;let e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[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(78926)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},78926:(e,t,n)=>{e