/*! For license information please see editor.js.LICENSE.txt */ !function(){var e,t,n,r,a,o,i={60400:function(e,t,n){"use strict";n.d(t,{L:function(){return c}});var r=n(2615),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{const b=Object.assign({},c);let v;function k(){v.abort(),document.hidden||j()}b.accept||(b.accept=o),h||document.addEventListener("visibilitychange",k);let y=i,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:l;async function j(){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.Pw)(n.body,(0,r.UM)((0,r._U)((e=>{e?b[s]=e:delete b[s]}),(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(j,t)}catch(e){E(),a(e)}}}j()}))}function l(e){const t=e.headers.get("content-type");if(!(null==t?void 0:t.startsWith(o)))throw new Error(`Expected content-type to be ${o}, Actual: ${t}`)}},2615:function(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(o){void 0===t?(t=o,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,o);const i=t.length;let s=0;for(;n0){const n=a.decode(o.subarray(0,s)),i=s+(32===o[s+1]?2:1),c=a.decode(o.subarray(i));switch(n){case"data":r.data=r.data?r.data+"\n"+c:c;break;case"event":r.event=c;break;case"id":e(r.id=c);break;case"retry":const n=parseInt(c,10);isNaN(n)||t(r.retry=n)}}}}function i(){return{data:"",event:"",id:"",retry:void 0}}n.d(t,{Pw:function(){return r},UM:function(){return a},_U:function(){return o}})},45416:function(e,t,n){"use strict";var r,a=n(99196);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),r||(r=a.createElement("path",{d:"M14.344 19.344H9.656a.157.157 0 0 0-.156.156v.625c0 .346.28.625.625.625h3.75c.346 0 .625-.28.625-.625V19.5a.157.157 0 0 0-.156-.156ZM12 3.25a6.407 6.407 0 0 0-3.203 11.955v2.264c0 .345.28.625.625.625h5.156c.346 0 .625-.28.625-.625v-2.264A6.407 6.407 0 0 0 12 3.25Zm2.498 10.738-.701.407v2.293h-3.594v-2.293l-.701-.407a5 5 0 1 1 4.996 0Z"})))},84788:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(2378);let a,o,i,s;const c=/<(\/)?(\w+)\s*(\/)?>/g;function l(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=c.exec(a);if(null===e)return["no-more-tokens"];const t=e.index,[n,r,o,i]=e,s=n.length;if(i)return["self-closed",o,t,s];if(r)return["closer",o,t,s];return["opener",o,t,s]}(),[n,u,d,h]=t,g=s.length,f=d>o?o:null;if(!e[u])return p(),!1;switch(n){case"no-more-tokens":if(0!==g){const{leadingTextStart:e,tokenStart:t}=s.pop();i.push(a.substr(e,t))}return p(),!1;case"self-closed":return 0===g?(null!==f&&i.push(a.substr(f,d-f)),i.push(e[u]),o=d+h,!0):(m(l(e[u],d,h)),o=d+h,!0);case"opener":return s.push(l(e[u],d,h,d+h,f)),o=d+h,!0;case"closer":if(1===g)return function(e){const{element:t,leadingTextStart:n,prevOffset:o,tokenStart:c,children:l}=s.pop(),u=e?a.substr(o,e-o):a.substr(o);u&&l.push(u);null!==n&&i.push(a.substr(n,c-n));i.push((0,r.cloneElement)(t,null,...l))}(d),o=d+h,!0;const t=s.pop(),n=a.substr(t.prevOffset,d-t.prevOffset);t.children.push(n),t.prevOffset=d+h;const c=l(t.element,t.tokenStart,t.tokenLength,d+h);return c.children=t.children,m(c),o=d+h,!0;default:return p(),!1}}function p(){const e=a.length-o;0!==e&&i.push(a.substr(o,e))}function m(e){const{element:t,tokenStart:n,tokenLength:o,prevOffset:i,children:c}=e,l=s[s.length-1],u=a.substr(l.prevOffset,n-l.prevOffset);u&&l.children.push(u),l.children.push((0,r.cloneElement)(t,null,...c)),l.prevOffset=i||n+o}var h=(e,t)=>{if(a=e,o=0,i=[],s=[],c.lastIndex=0,!u(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are WPElements");do{}while(d(t));return(0,r.createElement)(r.Fragment,null,...i)};t.default=h},51806:function(e,t,n){"use strict";var r=n(25877);Object.defineProperty(t,"__esModule",{value:!0});var a={createInterpolateElement:!0,Platform:!0,renderToString:!0,RawHTML:!0};Object.defineProperty(t,"Platform",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"RawHTML",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"createInterpolateElement",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"renderToString",{enumerable:!0,get:function(){return u.default}});var o=r(n(84788)),i=n(2378);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(a,e)||e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var s=n(29115);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(a,e)||e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var c=n(82986);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(a,e)||e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))}));var l=r(n(82912)),u=r(n(51962)),d=r(n(74745))},82912:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={OS:"web",select:e=>"web"in e?e.web:e.default,isWeb:!0};t.default=n},74745:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({children:e,...t}){let n="";return r.Children.toArray(e).forEach((e=>{"string"==typeof e&&""!==e.trim()&&(n+=e)})),(0,r.createElement)("div",{dangerouslySetInnerHTML:{__html:n},...t})};var r=n(2378)},29115:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createPortal",{enumerable:!0,get:function(){return r.createPortal}}),Object.defineProperty(t,"createRoot",{enumerable:!0,get:function(){return a.createRoot}}),Object.defineProperty(t,"findDOMNode",{enumerable:!0,get:function(){return r.findDOMNode}}),Object.defineProperty(t,"flushSync",{enumerable:!0,get:function(){return r.flushSync}}),Object.defineProperty(t,"hydrate",{enumerable:!0,get:function(){return r.hydrate}}),Object.defineProperty(t,"hydrateRoot",{enumerable:!0,get:function(){return a.hydrateRoot}}),Object.defineProperty(t,"render",{enumerable:!0,get:function(){return r.render}}),Object.defineProperty(t,"unmountComponentAtNode",{enumerable:!0,get:function(){return r.unmountComponentAtNode}});var r=n(91850),a=n(51516)},2378:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Children",{enumerable:!0,get:function(){return r.Children}}),Object.defineProperty(t,"Component",{enumerable:!0,get:function(){return r.Component}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return r.Fragment}}),Object.defineProperty(t,"StrictMode",{enumerable:!0,get:function(){return r.StrictMode}}),Object.defineProperty(t,"Suspense",{enumerable:!0,get:function(){return r.Suspense}}),Object.defineProperty(t,"cloneElement",{enumerable:!0,get:function(){return r.cloneElement}}),t.concatChildren=function(...e){return e.reduce(((e,t,n)=>(r.Children.forEach(t,((t,a)=>{t&&"string"!=typeof t&&(t=(0,r.cloneElement)(t,{key:[n,a].join()})),e.push(t)})),e)),[])},Object.defineProperty(t,"createContext",{enumerable:!0,get:function(){return r.createContext}}),Object.defineProperty(t,"createElement",{enumerable:!0,get:function(){return r.createElement}}),Object.defineProperty(t,"createRef",{enumerable:!0,get:function(){return r.createRef}}),Object.defineProperty(t,"forwardRef",{enumerable:!0,get:function(){return r.forwardRef}}),Object.defineProperty(t,"isValidElement",{enumerable:!0,get:function(){return r.isValidElement}}),Object.defineProperty(t,"lazy",{enumerable:!0,get:function(){return r.lazy}}),Object.defineProperty(t,"memo",{enumerable:!0,get:function(){return r.memo}}),Object.defineProperty(t,"startTransition",{enumerable:!0,get:function(){return r.startTransition}}),t.switchChildrenNodeName=function(e,t){return e&&r.Children.map(e,((e,n)=>{if("string"==typeof e?.valueOf())return(0,r.createElement)(t,{key:n},e);const{children:a,...o}=e.props;return(0,r.createElement)(t,{key:n,...o},a)}))},Object.defineProperty(t,"useCallback",{enumerable:!0,get:function(){return r.useCallback}}),Object.defineProperty(t,"useContext",{enumerable:!0,get:function(){return r.useContext}}),Object.defineProperty(t,"useDebugValue",{enumerable:!0,get:function(){return r.useDebugValue}}),Object.defineProperty(t,"useDeferredValue",{enumerable:!0,get:function(){return r.useDeferredValue}}),Object.defineProperty(t,"useEffect",{enumerable:!0,get:function(){return r.useEffect}}),Object.defineProperty(t,"useId",{enumerable:!0,get:function(){return r.useId}}),Object.defineProperty(t,"useImperativeHandle",{enumerable:!0,get:function(){return r.useImperativeHandle}}),Object.defineProperty(t,"useInsertionEffect",{enumerable:!0,get:function(){return r.useInsertionEffect}}),Object.defineProperty(t,"useLayoutEffect",{enumerable:!0,get:function(){return r.useLayoutEffect}}),Object.defineProperty(t,"useMemo",{enumerable:!0,get:function(){return r.useMemo}}),Object.defineProperty(t,"useReducer",{enumerable:!0,get:function(){return r.useReducer}}),Object.defineProperty(t,"useRef",{enumerable:!0,get:function(){return r.useRef}}),Object.defineProperty(t,"useState",{enumerable:!0,get:function(){return r.useState}}),Object.defineProperty(t,"useSyncExternalStore",{enumerable:!0,get:function(){return r.useSyncExternalStore}}),Object.defineProperty(t,"useTransition",{enumerable:!0,get:function(){return r.useTransition}});var r=n(99196)},51962:function(e,t,n){"use strict";var r=n(25877);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.hasPrefix=b,t.renderAttributes=L,t.renderComponent=P,t.renderElement=S,t.renderNativeComponent=x,t.renderStyle=T;var a=n(62313),o=n(28132),i=n(81975),s=n(2378),c=r(n(74745));const{Provider:l,Consumer:u}=(0,s.createContext)(void 0),d=(0,s.forwardRef)((()=>null)),p=new Set(["string","boolean","number"]),m=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),h=new Set(["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"]),g=new Set(["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"]),f=new Set(["animation","animationIterationCount","baselineShift","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","cx","cy","fillOpacity","flexGrow","flexShrink","floodOpacity","fontWeight","gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","r","rx","ry","shapeImageThreshold","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","x","y","zIndex","zoom"]);function b(e,t){return t.some((t=>0===e.indexOf(t)))}function v(e){return"key"===e||"children"===e}function k(e,t){return"style"===e?T(t):t}const y=["accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","panose1","pointerEvents","renderingIntent","shapeRendering","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","vectorEffect","vertAdvY","vertOriginX","vertOriginY","wordSpacing","writingMode","xmlnsXlink","xHeight"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{}),w=["allowReorder","attributeName","attributeType","autoReverse","baseFrequency","baseProfile","calcMode","clipPathUnits","contentScriptType","contentStyleType","diffuseConstant","edgeMode","externalResourcesRequired","filterRes","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","suppressContentEditableWarning","suppressHydrationWarning","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{}),E=["xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xml:space","xmlns:xlink"].reduce(((e,t)=>(e[t.replace(":","").toLowerCase()]=t,e)),{});function _(e){switch(e){case"htmlFor":return"for";case"className":return"class"}const t=e.toLowerCase();return w[t]?w[t]:y[t]?(0,o.paramCase)(y[t]):E[t]?E[t]:t}function C(e){return e.startsWith("--")?e:b(e,["ms","O","Moz","Webkit"])?"-"+(0,o.paramCase)(e):(0,o.paramCase)(e)}function j(e,t){return"number"!=typeof t||0===t||f.has(e)?t:t+"px"}function S(e,t,n={}){if(null==e||!1===e)return"";if(Array.isArray(e))return N(e,t,n);switch(typeof e){case"string":return(0,i.escapeHTML)(e);case"number":return e.toString()}const{type:r,props:a}=e;switch(r){case s.StrictMode:case s.Fragment:return N(a.children,t,n);case c.default:const{children:e,...r}=a;return x(Object.keys(r).length?"div":null,{...r,dangerouslySetInnerHTML:{__html:e}},t,n)}switch(typeof r){case"string":return x(r,a,t,n);case"function":return r.prototype&&"function"==typeof r.prototype.render?P(r,a,t,n):S(r(a,n),t,n)}switch(r&&r.$$typeof){case l.$$typeof:return N(a.children,a.value,n);case u.$$typeof:return S(a.children(t||r._currentValue),t,n);case d.$$typeof:return S(r.render(a),t,n)}return""}function x(e,t,n,r={}){let a="";if("textarea"===e&&t.hasOwnProperty("value")){a=N(t.value,n,r);const{value:e,...o}=t;t=o}else t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html?a=t.dangerouslySetInnerHTML.__html:void 0!==t.children&&(a=N(t.children,n,r));if(!e)return a;const o=L(t);return m.has(e)?"<"+e+o+"/>":"<"+e+o+">"+a+""}function P(e,t,n,r={}){const a=new e(t,r);"function"==typeof a.getChildContext&&Object.assign(r,a.getChildContext());return S(a.render(),n,r)}function N(e,t,n={}){let r="";e=Array.isArray(e)?e:[e];for(let a=0;a"number"!=typeof e&&("string"==typeof e?.valueOf()||Array.isArray(e)?!e.length:!e)},61074:function(e,t,n){"use strict";var r=n(69307);t.Z=function({icon:e,size:t=24,...n}){return(0,r.cloneElement)(e,{width:t,height:t,...n})}},79404:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"}));t.Z=o},90986:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"}));t.Z=o},58829:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"}));t.Z=o},23435:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21ZM15.5303 8.46967C15.8232 8.76256 15.8232 9.23744 15.5303 9.53033L13.0607 12L15.5303 14.4697C15.8232 14.7626 15.8232 15.2374 15.5303 15.5303C15.2374 15.8232 14.7626 15.8232 14.4697 15.5303L12 13.0607L9.53033 15.5303C9.23744 15.8232 8.76256 15.8232 8.46967 15.5303C8.17678 15.2374 8.17678 14.7626 8.46967 14.4697L10.9393 12L8.46967 9.53033C8.17678 9.23744 8.17678 8.76256 8.46967 8.46967C8.76256 8.17678 9.23744 8.17678 9.53033 8.46967L12 10.9393L14.4697 8.46967C14.7626 8.17678 15.2374 8.17678 15.5303 8.46967Z"}));t.Z=o},79201:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.Z=o},46936:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));t.Z=o},6163:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.Z=o},39517:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.Z=o},64967:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"}));t.Z=o},15381:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"}));t.Z=o},43618:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));t.Z=o},75022:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"}));t.Z=o},90496:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));t.Z=o},75365:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,r.createElement)(a.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));t.Z=o},1078:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));t.Z=o},20843:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,r.createElement)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"}));t.Z=o},77840:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"}));t.Z=o},24955:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"}));t.Z=o},58532:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z"}));t.Z=o},92710:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"}));t.Z=o},3639:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));t.Z=o},586:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z"}));t.Z=o},32677:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z"}));t.Z=o},48381:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"m11.3 17.2-5-5c-.1-.1-.1-.3 0-.4l2.3-2.3-1.1-1-2.3 2.3c-.7.7-.7 1.8 0 2.5l5 5H7.5v1.5h5.3v-5.2h-1.5v2.6zm7.5-6.4-5-5h2.7V4.2h-5.2v5.2h1.5V6.8l5 5c.1.1.1.3 0 .4l-2.3 2.3 1.1 1.1 2.3-2.3c.6-.7.6-1.9-.1-2.5z"}));t.Z=o},47659:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));t.Z=o},30797:function(e,t,n){"use strict";var r=n(69307),a=n(70444);const o=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,r.createElement)(a.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"}));t.Z=o},59823:function(e,t,n){"use strict";n.d(t,{AG:function(){return i},Ti:function(){return o},eV:function(){return s}});var r=n(38697),a=n(72867);function o(e,t){return 0===t?e.toLowerCase():(0,a.By)(e,t)}function i(e,t){return 0===t?e.toLowerCase():(0,a.Pv)(e)}function s(e,t){return void 0===t&&(t={}),(0,a.Ho)(e,(0,r.pi)({transform:o},t))}},81338:function(e,t,n){"use strict";n.d(t,{I:function(){return s},w:function(){return i}});var r=n(38697),a=n(68308),o=n(83078);function i(e){return(0,o.l)(e.toLowerCase())}function s(e,t){return void 0===t&&(t={}),(0,a.B)(e,(0,r.pi)({delimiter:" ",transform:i},t))}},28132:function(e,t,n){"use strict";n.r(t),n.d(t,{camelCase:function(){return r.eV},camelCaseTransform:function(){return r.Ti},camelCaseTransformMerge:function(){return r.AG},capitalCase:function(){return a.I},capitalCaseTransform:function(){return a.w},constantCase:function(){return o.c},dotCase:function(){return i.$},headerCase:function(){return s.e},noCase:function(){return c.B},paramCase:function(){return l.o},pascalCase:function(){return u.Ho},pascalCaseTransform:function(){return u.By},pascalCaseTransformMerge:function(){return u.Pv},pathCase:function(){return d.Y},sentenceCase:function(){return p.G},sentenceCaseTransform:function(){return p.a},snakeCase:function(){return m.f}});var r=n(59823),a=n(81338),o=n(56233),i=n(77352),s=n(20025),c=n(68308),l=n(76854),u=n(72867),d=n(76559),p=n(44434),m=n(59491)},73320:function(e,t){var n;!function(){"use strict";var r=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r>>1^n:o>>>=1;i=i>>>8^o}return-1^i}function a(e,n){var r,o,i;if(void 0!==a.crc&&n&&e||(a.crc=-1,e)){for(r=a.crc,o=0,i=e.length;o>>8^t[255&(r^e[o])];return a.crc=r,-1^r}}!function(){var e,r,a;for(r=0;r<256;r+=1){for(e=r,a=0;a<8;a+=1)1&e?e=n^e>>>1:e>>>=1;t[r]=e>>>0}}(),e.exports=function(e,t){var n;e="string"==typeof e?(n=e,Array.prototype.map.call(n,(function(e){return e.charCodeAt(0)}))):e;return((t?r(e):a(e))>>>0).toString(16)},e.exports.direct=r,e.exports.table=a}()},77352:function(e,t,n){"use strict";n.d(t,{$:function(){return o}});var r=n(38697),a=n(68308);function o(e,t){return void 0===t&&(t={}),(0,a.B)(e,(0,r.pi)({delimiter:"."},t))}},92384:function(e,t){"use strict";var n=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;t.validate=function(e){if(!e)return!1;if(e.length>254)return!1;if(!n.test(e))return!1;var t=e.split("@");return!(t[0].length>64)&&!t[1].split(".").some((function(e){return e.length>63}))}},53184:function(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function a(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",a),n([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,n)}(e,a,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var i=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var a,o,i,l;if(s(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),i=o[t]),void 0===i)i=o[t]=n,++e._eventsCount;else if("function"==typeof i?i=o[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(a=c(e))>0&&i.length>a&&!i.warned){i.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=i.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=u.bind(r);return a.listener=n,r.wrapFn=a,a}function p(e,t,n){var r=e._events;if(void 0===r)return[];var a=r[t];return void 0===a?[]:"function"==typeof a?n?[a.listener||a]:[a]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var l=c.length,u=h(c,l);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){i=n[o].listener,a=o;break}if(a<0)return this;0===a?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},90861:function(e){e.exports=function(){"use strict";var e=/^(b|B)$/,t={iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},n={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]},r={floor:Math.floor,ceil:Math.ceil};function a(a){var o,i,s,c,l,u,d,p,m,h,g,f,b,v,k,y,w,E,_,C,j,S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},x=[],P=0;if(isNaN(a))throw new TypeError("Invalid number");if(s=!0===S.bits,k=!0===S.unix,f=!0===S.pad,i=S.base||10,b=void 0!==S.round?S.round:k?1:2,d=void 0!==S.locale?S.locale:"",p=S.localeOptions||{},y=void 0!==S.separator?S.separator:"",w=void 0!==S.spacer?S.spacer:k?"":" ",_=S.symbols||{},E=2===i?S.standard||"iec":"jedec",g=S.output||"string",l=!0===S.fullform,u=S.fullforms instanceof Array?S.fullforms:[],o=void 0!==S.exponent?S.exponent:-1,C=r[S.roundingMethod]||Math.round,m=(h=Number(a))<0,c=i>2?1e3:1024,j=!1===isNaN(S.precision)?parseInt(S.precision,10):0,m&&(h=-h),(-1===o||isNaN(o))&&(o=Math.floor(Math.log(h)/Math.log(c)))<0&&(o=0),o>8&&(j>0&&(j+=8-o),o=8),"exponent"===g)return o;if(0===h)x[0]=0,v=x[1]=k?"":t[E][s?"bits":"bytes"][o];else{P=h/(2===i?Math.pow(2,10*o):Math.pow(1e3,o)),s&&(P*=8)>=c&&o<8&&(P/=c,o++);var N=Math.pow(10,o>0?b:0);x[0]=C(P*N)/N,x[0]===c&&o<8&&void 0===S.exponent&&(x[0]=1,o++),v=x[1]=10===i&&1===o?s?"kbit":"kB":t[E][s?"bits":"bytes"][o],k&&(x[1]=x[1].charAt(0),e.test(x[1])&&(x[0]=Math.floor(x[0]),x[1]=""))}if(m&&(x[0]=-x[0]),j>0&&(x[0]=x[0].toPrecision(j)),x[1]=_[x[1]]||x[1],!0===d?x[0]=x[0].toLocaleString():d.length>0?x[0]=x[0].toLocaleString(d,p):y.length>0&&(x[0]=x[0].toString().replace(".",y)),f&&!1===Number.isInteger(x[0])&&b>0){var L=y||".",T=x[0].toString().split(L),A=T[1]||"",R=A.length,I=b-R;x[0]="".concat(T[0]).concat(L).concat(A.padEnd(R+I,"0"))}return l&&(x[1]=u[o]?u[o]:n[E][o]+(s?"bit":"byte")+(1===x[0]?"":"s")),"array"===g?x:"object"===g?{value:x[0],symbol:x[1],exponent:o,unit:v}:x.join(w)}return a.partial=function(e){return function(t){return a(t,e)}},a}()},20025:function(e,t,n){"use strict";n.d(t,{e:function(){return o}});var r=n(38697),a=n(81338);function o(e,t){return void 0===t&&(t={}),(0,a.I)(e,(0,r.pi)({delimiter:"-"},t))}},62313:function(e,t){"use strict";function n(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=function(e){var t,r;return!1!==n(e)&&(void 0===(t=e.constructor)||!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}},84097:function(e,t){var n,r;r="undefined"!=typeof self?self:"undefined"!=typeof window||"undefined"!=typeof window?window:this,e.exports=function(r){"use strict";var a,o=(r=r||{}).Base64,i="2.6.4",s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=function(e){for(var t={},n=0,r=e.length;n>>6)+l(128|63&t):l(224|t>>>12&15)+l(128|t>>>6&63)+l(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return l(240|t>>>18&7)+l(128|t>>>12&63)+l(128|t>>>6&63)+l(128|63&t)},d=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(e){return e.replace(d,u)},m=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[s.charAt(n>>>18),s.charAt(n>>>12&63),t>=2?"=":s.charAt(n>>>6&63),t>=1?"=":s.charAt(63&n)].join("")},h=r.btoa&&"function"==typeof r.btoa?function(e){return r.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,m)},g=function(e){return h(p(String(e)))},f=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},b=function(e,t){return t?f(g(e)):g(e)},v=function(e){return b(e,!0)};r.Uint8Array&&(a=function(e,t){for(var n="",r=0,a=e.length;r>>18)+s.charAt(l>>>12&63)+(void 0!==i?s.charAt(l>>>6&63):"=")+(void 0!==c?s.charAt(63&l):"=")}return t?f(n):n});var k,y=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return l(55296+(t>>>10))+l(56320+(1023&t));case 3:return l((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return l((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},E=function(e){return e.replace(y,w)},_=function(e){var t=e.length,n=t%4,r=(t>0?c[e.charAt(0)]<<18:0)|(t>1?c[e.charAt(1)]<<12:0)|(t>2?c[e.charAt(2)]<<6:0)|(t>3?c[e.charAt(3)]:0),a=[l(r>>>16),l(r>>>8&255),l(255&r)];return a.length-=[0,0,2,1][n],a.join("")},C=r.atob&&"function"==typeof r.atob?function(e){return r.atob(e)}:function(e){return e.replace(/\S{1,4}/g,_)},j=function(e){return C(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},S=function(e){return E(C(e))},x=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},P=function(e){return S(x(e))};r.Uint8Array&&(k=function(e){return Uint8Array.from(j(x(e)),(function(e){return e.charCodeAt(0)}))});var N=function(){var e=r.Base64;return r.Base64=o,e};if(r.Base64={VERSION:i,atob:j,btoa:h,fromBase64:P,toBase64:b,utob:p,encode:b,encodeURI:v,btou:E,decode:P,noConflict:N,fromUint8Array:a,toUint8Array:k},"function"==typeof Object.defineProperty){var L=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};r.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",L((function(){return P(this)}))),Object.defineProperty(String.prototype,"toBase64",L((function(e){return b(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",L((function(){return b(this,!0)})))}}return r.Meteor&&(Base64=r.Base64),e.exports?e.exports.Base64=r.Base64:void 0===(n=function(){return r.Base64}.apply(t,[]))||(e.exports=n),{Base64:r.Base64}}(r)},62232:function(e,t,n){"use strict";function r(e){return Array.prototype.slice.call(arguments,1).forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function a(e){return Object.prototype.toString.call(e)}function o(e){return"[object Function]"===a(e)}function i(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var s={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var c={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},l="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",u="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function d(e){var t=e.re=n(95843)(e.__opts__),r=e.__tlds__.slice();function s(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||r.push(l),r.push(t.src_xn),t.src_tlds=r.join("|"),t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");var c=[];function u(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===a(n))return!function(e){return"[object RegExp]"===a(e)}(n.validate)?o(n.validate)?r.validate=n.validate:u(t,n):r.validate=function(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(o(n.normalize)?r.normalize=n.normalize:n.normalize?u(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===a(e)}(n)?u(t,n):c.push(t)}})),c.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var d=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(i).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+d+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+d+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function p(e,t){var n=e.__index__,r=e.__last_index__,a=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=a,this.text=a,this.url=a}function m(e,t){var n=new p(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function h(e,t){if(!(this instanceof h))return new h(e,t);var n;t||(n=e,Object.keys(n||{}).reduce((function(e,t){return e||s.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=r({},s,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},c,e),this.__compiled__={},this.__tlds__=u,this.__tlds_replaced__=!1,this.re={},d(this)}h.prototype.add=function(e,t){return this.__schemas__[e]=t,d(this),this},h.prototype.set=function(e){return this.__opts__=r(this.__opts__,e),this},h.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,a,o,i,s,c;if(this.re.schema_test.test(e))for((s=this.re.schema_search).lastIndex=0;null!==(t=s.exec(e));)if(a=this.testSchemaAt(e,t[2],s.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+a;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,i=r.index+r[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=i)),this.__index__>=0},h.prototype.pretest=function(e){return this.re.pretest.test(e)},h.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},h.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(m(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(m(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},h.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),d(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,d(this),this)},h.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},h.prototype.onCompile=function(){},e.exports=h},95843:function(e,t,n){"use strict";e.exports=function(e){var t={};t.src_Any=n(44957).source,t.src_Cc=n(19590).source,t.src_Z=n(59939).source,t.src_P=n(95162).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");var r="[><|]";return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+r+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+").|;(?!"+t.src_ZCc+").|\\!+(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}},97740:function(e,t,n){"use strict";n.d(t,{U:function(){return r}});function r(e){return e.toLowerCase()}},82339:function(e){"use strict";function t(e,t,n,r){var a=Number(e[t].meta.id+1).toString(),o="";return"string"==typeof r.docId&&(o="-"+r.docId+"-"),o+a}function n(e,t){var n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=":"+e[t].meta.subId),"["+n+"]"}function r(e,t,n,r,a){var o=a.rules.footnote_anchor_name(e,t,n,r,a),i=a.rules.footnote_caption(e,t,n,r,a),s=o;return e[t].meta.subId>0&&(s+=":"+e[t].meta.subId),''+i+""}function a(e,t,n){return(n.xhtmlOut?'
\n':'
\n')+'
\n
    \n'}function o(){return"
\n
\n"}function i(e,t,n,r,a){var o=a.rules.footnote_anchor_name(e,t,n,r,a);return e[t].meta.subId>0&&(o+=":"+e[t].meta.subId),'
  • '}function s(){return"
  • \n"}function c(e,t,n,r,a){var o=a.rules.footnote_anchor_name(e,t,n,r,a);return e[t].meta.subId>0&&(o+=":"+e[t].meta.subId),' ↩︎'}e.exports=function(e){var l=e.helpers.parseLinkLabel,u=e.utils.isSpace;e.renderer.rules.footnote_ref=r,e.renderer.rules.footnote_block_open=a,e.renderer.rules.footnote_block_close=o,e.renderer.rules.footnote_open=i,e.renderer.rules.footnote_close=s,e.renderer.rules.footnote_anchor=c,e.renderer.rules.footnote_caption=n,e.renderer.rules.footnote_anchor_name=t,e.block.ruler.before("reference","footnote_def",(function(e,t,n,r){var a,o,i,s,c,l,d,p,m,h,g,f=e.bMarks[t]+e.tShift[t],b=e.eMarks[t];if(f+4>b)return!1;if(91!==e.src.charCodeAt(f))return!1;if(94!==e.src.charCodeAt(f+1))return!1;for(c=f+2;c=b||58!==e.src.charCodeAt(++c))return!1;if(r)return!0;for(c++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),l=e.src.slice(f+2,c-2),e.env.footnotes.refs[":"+l]=-1,(d=new e.Token("footnote_reference_open","",1)).meta={label:l},d.level=e.level++,e.tokens.push(d),a=e.bMarks[t],o=e.tShift[t],i=e.sCount[t],s=e.parentType,g=c,p=m=e.sCount[t]+c-(e.bMarks[t]+e.tShift[t]);c=i)&&(94===e.src.charCodeAt(s)&&(91===e.src.charCodeAt(s+1)&&(n=s+2,!((r=l(e,s+1))<0)&&(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),a=e.env.footnotes.list.length,e.md.inline.parse(e.src.slice(n,r),e.md,e.env,o=[]),e.push("footnote_ref","",0).meta={id:a},e.env.footnotes.list[a]={content:e.src.slice(n,r),tokens:o}),e.pos=r+1,e.posMax=i,!0))))})),e.inline.ruler.after("footnote_inline","footnote_ref",(function(e,t){var n,r,a,o,i=e.posMax,s=e.pos;if(s+3>i)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(s))return!1;if(94!==e.src.charCodeAt(s+1))return!1;for(r=s+2;r=i)&&(r++,n=e.src.slice(s+2,r-1),void 0!==e.env.footnotes.refs[":"+n]&&(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(a=e.env.footnotes.list.length,e.env.footnotes.list[a]={label:n,count:0},e.env.footnotes.refs[":"+n]=a):a=e.env.footnotes.refs[":"+n],o=e.env.footnotes.list[a].count,e.env.footnotes.list[a].count++,e.push("footnote_ref","",0).meta={id:a,subId:o,label:n}),e.pos=r,e.posMax=i,!0)))})),e.core.ruler.after("inline","footnote_tail",(function(e){var t,n,r,a,o,i,s,c,l,u,d=!1,p={};if(e.env.footnotes&&(e.tokens=e.tokens.filter((function(e){return"footnote_reference_open"===e.type?(d=!0,l=[],u=e.meta.label,!1):"footnote_reference_close"===e.type?(d=!1,p[":"+u]=l,!1):(d&&l.push(e),!d)})),e.env.footnotes.list)){for(i=e.env.footnotes.list,s=new e.Token("footnote_block_open","",1),e.tokens.push(s),t=0,n=i.length;t0?i[t].count:1,r=0;r`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",n="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",r=new RegExp("^(?:"+t+"|"+n+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?][\\s\\S]*?[?]>|]*>|)"),a=new RegExp("^(?:"+t+"|"+n+")");e.exports.n=r,e.exports.q=a},39615:function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function a(e,t){return r.call(e,t)}function o(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function i(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var s=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(s.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,u=n(38337);var d=/[&<>"]/,p=/[&<>"]/g,m={"&":"&","<":"<",">":">",'"':"""};function h(e){return m[e]}var g=/[.?*+^$[\]\\(){}|-]/g;var f=n(95162);t.lib={},t.lib.mdurl=n(49236),t.lib.ucmicro=n(84353),t.assign=function(e){return Array.prototype.slice.call(arguments,1).forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=a,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(s,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(c,(function(e,t,n){return t||function(e,t){var n=0;return a(u,t)?u[t]:35===t.charCodeAt(0)&&l.test(t)&&o(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?i(n):e}(e,n)}))},t.isValidEntityCode=o,t.fromCodePoint=i,t.escapeHtml=function(e){return d.test(e)?e.replace(p,h):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return f.test(e)},t.escapeRE=function(e){return e.replace(g,"\\$&")},t.normalizeReference=function(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}},57007:function(e,t,n){"use strict";t.parseLinkLabel=n(82174),t.parseLinkDestination=n(36990),t.parseLinkTitle=n(15336)},36990:function(e,t,n){"use strict";var r=n(39615).unescapeAll;e.exports=function(e,t,n){var a,o,i=t,s={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;t32)return s;if(41===a){if(0===o)break;o--}t++}return i===t||0!==o||(s.str=r(e.slice(i,t)),s.lines=0,s.pos=t,s.ok=!0),s}},82174:function(e){"use strict";e.exports=function(e,t,n){var r,a,o,i,s=-1,c=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos=n)return c;if(34!==(o=e.charCodeAt(t))&&39!==o&&40!==o)return c;for(t++,40===o&&(o=41);t=0))try{t.hostname=d.toASCII(t.hostname)}catch(e){}return u.encode(u.format(t))}function v(e){var t=u.parse(e,!0);if(t.hostname&&(!t.protocol||f.indexOf(t.protocol)>=0))try{t.hostname=d.toUnicode(t.hostname)}catch(e){}return u.decode(u.format(t),u.decode.defaultChars+"%")}function k(e,t){if(!(this instanceof k))return new k(e,t);t||r.isString(e)||(t=e||{},e="default"),this.inline=new c,this.block=new s,this.core=new i,this.renderer=new o,this.linkify=new l,this.validateLink=g,this.normalizeLink=b,this.normalizeLinkText=v,this.utils=r,this.helpers=r.assign({},a),this.options={},this.configure(e),t&&this.set(t)}k.prototype.set=function(e){return r.assign(this.options,e),this},k.prototype.configure=function(e){var t,n=this;if(r.isString(e)&&!(e=p[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},k.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},k.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},k.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},k.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},k.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},k.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},k.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=k},99575:function(e,t,n){"use strict";var r=n(81377),a=[["table",n(12592),["paragraph","reference"]],["code",n(99334)],["fence",n(79783),["paragraph","reference","blockquote","list"]],["blockquote",n(36901),["paragraph","reference","blockquote","list"]],["hr",n(68837),["paragraph","reference","blockquote","list"]],["list",n(46388),["paragraph","reference","blockquote"]],["reference",n(33765)],["html_block",n(33869),["paragraph","reference","blockquote"]],["heading",n(21127),["paragraph","reference","blockquote"]],["lheading",n(5393)],["paragraph",n(24934)]];function o(){this.ruler=new r;for(var e=0;e=n))&&!(e.sCount[i]=c){e.line=n;break}for(r=0;r=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},i.prototype.parse=function(e,t,n,r){var a,o,i,s=new this.State(e,t,n,r);for(this.tokenize(s),i=(o=this.ruler2.getRules("")).length,a=0;a"+o(e[t].content)+""},i.code_block=function(e,t,n,r,a){var i=e[t];return""+o(e[t].content)+"\n"},i.fence=function(e,t,n,r,i){var s,c,l,u,d,p=e[t],m=p.info?a(p.info).trim():"",h="",g="";return m&&(h=(l=m.split(/(\s+)/g))[0],g=l.slice(2).join("")),0===(s=n.highlight&&n.highlight(p.content,h,g)||o(p.content)).indexOf(""+s+"\n"):"
    "+s+"
    \n"},i.image=function(e,t,n,r,a){var o=e[t];return o.attrs[o.attrIndex("alt")][1]=a.renderInlineAsText(o.children,n,r),a.renderToken(e,t,n)},i.hardbreak=function(e,t,n){return n.xhtmlOut?"
    \n":"
    \n"},i.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"
    \n":"
    \n":"\n"},i.text=function(e,t){return o(e[t].content)},i.html_block=function(e,t){return e[t].content},i.html_inline=function(e,t){return e[t].content},s.prototype.renderAttrs=function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t\n":">")},s.prototype.renderInline=function(e,t,n){for(var r,a="",o=this.rules,i=0,s=e.length;i=4)return!1;if(62!==e.src.charCodeAt(S++))return!1;if(a)return!0;for(c=m=e.sCount[t]+1,32===e.src.charCodeAt(S)?(S++,c++,m++,o=!1,y=!0):9===e.src.charCodeAt(S)?(y=!0,(e.bsCount[t]+m)%4==3?(S++,c++,m++,o=!1):o=!0):y=!1,h=[e.bMarks[t]],e.bMarks[t]=S;S=x,v=[e.sCount[t]],e.sCount[t]=m-c,k=[e.tShift[t]],e.tShift[t]=S-e.bMarks[t],E=e.md.block.ruler.getRules("blockquote"),b=e.parentType,e.parentType="blockquote",p=t+1;p=(x=e.eMarks[p])));p++)if(62!==e.src.charCodeAt(S++)||C){if(u)break;for(w=!1,s=0,l=E.length;s=x,g.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(y?1:0),v.push(e.sCount[p]),e.sCount[p]=m-c,k.push(e.tShift[p]),e.tShift[p]=S-e.bMarks[p]}for(f=e.blkIndent,e.blkIndent=0,(_=e.push("blockquote_open","blockquote",1)).markup=">",_.map=d=[t,0],e.md.block.tokenize(e,t,p),(_=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=j,e.parentType=b,d[1]=e.line,s=0;s=4))break;a=++r}return e.line=a,(o=e.push("code_block","code",0)).content=e.getLines(t,a,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}},79783:function(e){"use strict";e.exports=function(e,t,n,r){var a,o,i,s,c,l,u,d=!1,p=e.bMarks[t]+e.tShift[t],m=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(p+3>m)return!1;if(126!==(a=e.src.charCodeAt(p))&&96!==a)return!1;if(c=p,(o=(p=e.skipChars(p,a))-c)<3)return!1;if(u=e.src.slice(c,p),i=e.src.slice(p,m),96===a&&i.indexOf(String.fromCharCode(a))>=0)return!1;if(r)return!0;for(s=t;!(++s>=n)&&!((p=c=e.bMarks[s]+e.tShift[s])<(m=e.eMarks[s])&&e.sCount[s]=4||(p=e.skipChars(p,a))-c=4)return!1;if(35!==(o=e.src.charCodeAt(l))||l>=u)return!1;for(i=1,o=e.src.charCodeAt(++l);35===o&&l6||ll&&r(e.src.charCodeAt(s-1))&&(u=s),e.line=t+1,(c=e.push("heading_open","h"+String(i),1)).markup="########".slice(0,i),c.map=[t,e.line],(c=e.push("inline","",0)).content=e.src.slice(l,u).trim(),c.map=[t,e.line],c.children=[],(c=e.push("heading_close","h"+String(i),-1)).markup="########".slice(0,i)),!0)}},68837:function(e,t,n){"use strict";var r=n(39615).isSpace;e.exports=function(e,t,n,a){var o,i,s,c,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(42!==(o=e.src.charCodeAt(l++))&&45!==o&&95!==o)return!1;for(i=1;l|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(a.source+"\\s*$"),/^$/,!1]];e.exports=function(e,t,n,r){var a,i,s,c,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(l))return!1;for(c=e.src.slice(l,u),a=0;a=4)return!1;for(p=e.parentType,e.parentType="paragraph";m3)){if(e.sCount[m]>=e.blkIndent&&(c=e.bMarks[m]+e.tShift[m])<(l=e.eMarks[m])&&(45===(d=e.src.charCodeAt(c))||61===d)&&(c=e.skipChars(c,d),(c=e.skipSpaces(c))>=l)){u=61===d?1:2;break}if(!(e.sCount[m]<0)){for(a=!1,o=0,i=h.length;o=i)return-1;if((n=e.src.charCodeAt(o++))<48||n>57)return-1;for(;;){if(o>=i)return-1;if(!((n=e.src.charCodeAt(o++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(o-a>=10)return-1}return o=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]=e.blkIndent&&(I=!0),(P=o(e,t))>=0){if(p=!0,L=e.bMarks[t]+e.tShift[t],v=Number(e.src.slice(L,P-1)),I&&1!==v)return!1}else{if(!((P=a(e,t))>=0))return!1;p=!1}if(I&&e.skipSpaces(P)>=e.eMarks[t])return!1;if(b=e.src.charCodeAt(P-1),r)return!0;for(f=e.tokens.length,p?(R=e.push("ordered_list_open","ol",1),1!==v&&(R.attrs=[["start",v]])):R=e.push("bullet_list_open","ul",1),R.map=g=[t,0],R.markup=String.fromCharCode(b),y=t,N=!1,A=e.md.block.ruler.getRules("list"),_=e.parentType,e.parentType="list";y=k?1:w-d)>4&&(u=1),l=d+u,(R=e.push("list_item_open","li",1)).markup=String.fromCharCode(b),R.map=m=[t,0],p&&(R.info=e.src.slice(L,P-1)),S=e.tight,j=e.tShift[t],C=e.sCount[t],E=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=l,e.tight=!0,e.tShift[t]=s-e.bMarks[t],e.sCount[t]=w,s>=k&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!N||(M=!1),N=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=E,e.tShift[t]=j,e.sCount[t]=C,e.tight=S,(R=e.push("list_item_close","li",-1)).markup=String.fromCharCode(b),y=t=e.line,m[1]=y,s=e.bMarks[t],y>=n)break;if(e.sCount[y]=4)break;for(T=!1,c=0,h=A.length;c3||e.sCount[c]<0)){for(r=!1,a=0,o=l.length;a=4)return!1;if(91!==e.src.charCodeAt(_))return!1;for(;++_3||e.sCount[j]<0)){for(k=!1,d=0,p=y.length;d0&&this.level++,this.tokens.push(a),a},o.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},o.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;et;)if(!a(this.src.charCodeAt(--e)))return e+1;return e},o.prototype.skipChars=function(e,t){for(var n=this.src.length;en;)if(t!==this.src.charCodeAt(--e))return e+1;return e},o.prototype.getLines=function(e,t,n,r){var o,i,s,c,l,u,d,p=e;if(e>=t)return"";for(u=new Array(t-e),o=0;pn?new Array(i-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return u.join("")},o.prototype.Token=r,e.exports=o},12592:function(e,t,n){"use strict";var r=n(39615).isSpace;function a(e,t){var n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.substr(n,r-n)}function o(e){var t,n=[],r=0,a=e.length,o=!1,i=0,s="";for(t=e.charCodeAt(r);rn)return!1;if(p=t+1,e.sCount[p]=4)return!1;if((l=e.bMarks[p]+e.tShift[p])>=e.eMarks[p])return!1;if(124!==(_=e.src.charCodeAt(l++))&&45!==_&&58!==_)return!1;if(l>=e.eMarks[p])return!1;if(124!==(C=e.src.charCodeAt(l++))&&45!==C&&58!==C&&!r(C))return!1;if(45===_&&r(C))return!1;for(;l=4)return!1;if((m=o(c)).length&&""===m[0]&&m.shift(),m.length&&""===m[m.length-1]&&m.pop(),0===(h=m.length)||h!==f.length)return!1;if(i)return!0;for(y=e.parentType,e.parentType="table",E=e.md.block.ruler.getRules("blockquote"),(g=e.push("table_open","table",1)).map=v=[t,0],(g=e.push("thead_open","thead",1)).map=[t,t+1],(g=e.push("tr_open","tr",1)).map=[t,t+1],u=0;u=4)break;for((m=o(c)).length&&""===m[0]&&m.shift(),m.length&&""===m[m.length-1]&&m.pop(),p===t+2&&((g=e.push("tbody_open","tbody",1)).map=k=[t+2,0]),(g=e.push("tr_open","tr",1)).map=[p,p+1],u=0;u/i.test(e)}e.exports=function(e){var t,n,o,i,s,c,l,u,d,p,m,h,g,f,b,v,k,y,w=e.tokens;if(e.md.options.linkify)for(n=0,o=w.length;n=0;t--)if("link_close"!==(c=i[t]).type){if("html_inline"===c.type&&(y=c.content,/^\s]/i.test(y)&&g>0&&g--,a(c.content)&&g++),!(g>0)&&"text"===c.type&&e.md.linkify.test(c.content)){for(d=c.content,k=e.md.linkify.match(d),l=[],h=c.level,m=0,u=0;um&&((s=new e.Token("text","",0)).content=d.slice(m,p),s.level=h,l.push(s)),(s=new e.Token("link_open","a",1)).attrs=[["href",b]],s.level=h++,s.markup="linkify",s.info="auto",l.push(s),(s=new e.Token("text","",0)).content=v,s.level=h,l.push(s),(s=new e.Token("link_close","a",-1)).level=--h,s.markup="linkify",s.info="auto",l.push(s),m=k[u].lastIndex);m=0;t--)"text"!==(n=e[t]).type||a||(n.content=n.content.replace(r,o)),"link_open"===n.type&&"auto"===n.info&&a--,"link_close"===n.type&&"auto"===n.info&&a++}function s(e){var n,r,a=0;for(n=e.length-1;n>=0;n--)"text"!==(r=e[n]).type||a||t.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===r.type&&"auto"===r.info&&a--,"link_close"===r.type&&"auto"===r.info&&a++}e.exports=function(e){var r;if(e.md.options.typographer)for(r=e.tokens.length-1;r>=0;r--)"inline"===e.tokens[r].type&&(n.test(e.tokens[r].content)&&i(e.tokens[r].children),t.test(e.tokens[r].content)&&s(e.tokens[r].children))}},28867:function(e,t,n){"use strict";var r=n(39615).isWhiteSpace,a=n(39615).isPunctChar,o=n(39615).isMdAsciiPunct,i=/['"]/,s=/['"]/g;function c(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function l(e,t){var n,i,l,u,d,p,m,h,g,f,b,v,k,y,w,E,_,C,j,S,x;for(j=[],n=0;n=0&&!(j[_].level<=m);_--);if(j.length=_+1,"text"===i.type){d=0,p=(l=i.content).length;e:for(;d=0)g=l.charCodeAt(u.index-1);else for(_=n-1;_>=0&&("softbreak"!==e[_].type&&"hardbreak"!==e[_].type);_--)if(e[_].content){g=e[_].content.charCodeAt(e[_].content.length-1);break}if(f=32,d=48&&g<=57&&(E=w=!1),w&&E&&(w=b,E=v),w||E){if(E)for(_=j.length-1;_>=0&&(h=j[_],!(j[_].level=0;t--)"inline"===e.tokens[t].type&&i.test(e.tokens[t].content)&&l(e.tokens[t].children,e)}},30727:function(e,t,n){"use strict";var r=n(71872);function a(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}a.prototype.Token=r,e.exports=a},73273:function(e){"use strict";var t=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,n=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;e.exports=function(e,r){var a,o,i,s,c,l,u=e.pos;if(60!==e.src.charCodeAt(u))return!1;for(c=e.pos,l=e.posMax;;){if(++u>=l)return!1;if(60===(s=e.src.charCodeAt(u)))return!1;if(62===s)break}return a=e.src.slice(c+1,u),n.test(a)?(o=e.md.normalizeLink(a),!!e.md.validateLink(o)&&(r||((i=e.push("link_open","a",1)).attrs=[["href",o]],i.markup="autolink",i.info="auto",(i=e.push("text","",0)).content=e.md.normalizeLinkText(a),(i=e.push("link_close","a",-1)).markup="autolink",i.info="auto"),e.pos+=a.length+2,!0)):!!t.test(a)&&(o=e.md.normalizeLink("mailto:"+a),!!e.md.validateLink(o)&&(r||((i=e.push("link_open","a",1)).attrs=[["href",o]],i.markup="autolink",i.info="auto",(i=e.push("text","",0)).content=e.md.normalizeLinkText(a),(i=e.push("link_close","a",-1)).markup="autolink",i.info="auto"),e.pos+=a.length+2,!0))}},7912:function(e){"use strict";e.exports=function(e,t){var n,r,a,o,i,s,c,l,u=e.pos;if(96!==e.src.charCodeAt(u))return!1;for(n=u,u++,r=e.posMax;ui;r-=h[r]+1)if((o=t[r]).marker===a.marker&&o.open&&o.end<0&&(c=!1,(o.close||a.open)&&(o.length+a.length)%3==0&&(o.length%3==0&&a.length%3==0||(c=!0)),!c)){l=r>0&&!t[r-1].open?h[r-1]+1:0,h[n]=n-r+l,h[r]=l,a.open=!1,o.end=n,o.close=!1,s=-1,m=-2;break}-1!==s&&(u[a.marker][(a.open?3:0)+(a.length||0)%3]=s)}}}e.exports=function(e){var n,r=e.tokens_meta,a=e.tokens_meta.length;for(t(0,e.delimiters),n=0;n=0;n--)95!==(r=t[n]).marker&&42!==r.marker||-1!==r.end&&(a=t[r.end],s=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===a.token+1,i=String.fromCharCode(r.marker),(o=e.tokens[r.token]).type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?i+i:i,o.content="",(o=e.tokens[a.token]).type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?i+i:i,o.content="",s&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}e.exports.w=function(e,t){var n,r,a=e.pos,o=e.src.charCodeAt(a);if(t)return!1;if(95!==o&&42!==o)return!1;for(r=e.scanDelims(e.pos,42===o),n=0;n?@[]^_`{|}~-".split("").forEach((function(e){a[e.charCodeAt(0)]=1})),e.exports=function(e,t){var n,o=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(++o=o)&&(!(33!==(n=e.src.charCodeAt(i+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(a=e.src.slice(i).match(r))&&(t||(e.push("html_inline","",0).content=e.src.slice(i,i+a[0].length)),e.pos+=a[0].length,!0))))}},92560:function(e,t,n){"use strict";var r=n(39615).normalizeReference,a=n(39615).isSpace;e.exports=function(e,t){var n,o,i,s,c,l,u,d,p,m,h,g,f,b="",v=e.pos,k=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(l=e.pos+2,(c=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((u=c+1)=k)return!1;for(f=u,(p=e.md.helpers.parseLinkDestination(e.src,u,e.posMax)).ok&&(b=e.md.normalizeLink(p.str),e.md.validateLink(b)?u=p.pos:b=""),f=u;u=k||41!==e.src.charCodeAt(u))return e.pos=v,!1;u++}else{if(void 0===e.env.references)return!1;if(u=0?s=e.src.slice(f,u++):u=c+1):u=c+1,s||(s=e.src.slice(l,c)),!(d=e.env.references[r(s)]))return e.pos=v,!1;b=d.href,m=d.title}return t||(i=e.src.slice(l,c),e.md.inline.parse(i,e.md,e.env,g=[]),(h=e.push("image","img",0)).attrs=n=[["src",b],["alt",""]],h.children=g,h.content=i,m&&n.push(["title",m])),e.pos=u,e.posMax=k,!0}},95028:function(e,t,n){"use strict";var r=n(39615).normalizeReference,a=n(39615).isSpace;e.exports=function(e,t){var n,o,i,s,c,l,u,d,p="",m="",h=e.pos,g=e.posMax,f=e.pos,b=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(c=e.pos+1,(s=e.md.helpers.parseLinkLabel(e,e.pos,!0))<0)return!1;if((l=s+1)=g)return!1;if(f=l,(u=e.md.helpers.parseLinkDestination(e.src,l,e.posMax)).ok){for(p=e.md.normalizeLink(u.str),e.md.validateLink(p)?l=u.pos:p="",f=l;l=g||41!==e.src.charCodeAt(l))&&(b=!0),l++}if(b){if(void 0===e.env.references)return!1;if(l=0?i=e.src.slice(f,l++):l=s+1):l=s+1,i||(i=e.src.slice(c,s)),!(d=e.env.references[r(i)]))return e.pos=h,!1;p=d.href,m=d.title}return t||(e.pos=c,e.posMax=s,e.push("link_open","a",1).attrs=n=[["href",p]],m&&n.push(["title",m]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=l,e.posMax=g,!0}},62378:function(e,t,n){"use strict";var r=n(39615).isSpace;e.exports=function(e,t){var n,a,o,i=e.pos;if(10!==e.src.charCodeAt(i))return!1;if(n=e.pending.length-1,a=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(o=n-1;o>=1&&32===e.pending.charCodeAt(o-1);)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(i++;i0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(a),this.tokens_meta.push(o),a},s.prototype.scanDelims=function(e,t){var n,r,s,c,l,u,d,p,m,h=e,g=!0,f=!0,b=this.posMax,v=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;h0&&r++,"text"===a[t].type&&t+1=0&&(n=this.attrs[t][1]),n},t.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},e.exports=t},64309:function(e){"use strict";var t={};function n(e,r){var a;return"string"!=typeof r&&(r=n.defaultChars),a=function(e){var n,r,a=t[e];if(a)return a;for(a=t[e]=[],n=0;n<128;n++)r=String.fromCharCode(n),a.push(r);for(n=0;n=55296&&c<=57343?"���":String.fromCharCode(c),t+=6):240==(248&r)&&t+91114111?l+="����":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),t+=9):l+="�";return l}))}n.defaultChars=";/?:@&=+$,#",n.componentChars="",e.exports=n},16087:function(e){"use strict";var t={};function n(e,r,a){var o,i,s,c,l,u="";for("string"!=typeof r&&(a=r,r=n.defaultChars),void 0===a&&(a=!0),l=function(e){var n,r,a=t[e];if(a)return a;for(a=t[e]=[],n=0;n<128;n++)r=String.fromCharCode(n),/^[0-9a-z]$/i.test(r)?a.push(r):a.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2));for(n=0;n=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1=56320&&c<=57343){u+=encodeURIComponent(e[o]+e[o+1]),o++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(e[o]);return u}n.defaultChars=";/?:@&=+$,-_.!~*'()#",n.componentChars="-_.!~*'()",e.exports=n},46175:function(e){"use strict";e.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||""}},49236:function(e,t,n){"use strict";e.exports.encode=n(16087),e.exports.decode=n(64309),e.exports.format=n(46175),e.exports.parse=n(57507)},57507:function(e){"use strict";function t(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),i=["'"].concat(o),s=["%","/","?",";","#"].concat(i),c=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};t.prototype.parse=function(e,t){var r,o,i,m,h,g=e;if(g=g.trim(),!t&&1===e.split("#").length){var f=a.exec(g);if(f)return this.pathname=f[1],f[2]&&(this.search=f[2]),this}var b=n.exec(g);if(b&&(i=(b=b[0]).toLowerCase(),this.protocol=b,g=g.substr(b.length)),(t||b||g.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(h="//"===g.substr(0,2))||b&&d[b]||(g=g.substr(2),this.slashes=!0)),!d[b]&&(h||b&&!p[b])){var v,k,y=-1;for(r=0;r127?j+="x":j+=C[S];if(!j.match(l)){var P=_.slice(0,r),N=_.slice(r+1),L=C.match(u);L&&(P.push(L[1]),N.unshift(L[2])),N.length&&(g=N.join(".")+g),this.hostname=P.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var T=g.indexOf("#");-1!==T&&(this.hash=g.substr(T),g=g.slice(0,T));var A=g.indexOf("?");return-1!==A&&(this.search=g.substr(A),g=g.slice(0,A)),g&&(this.pathname=g),p[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this},t.prototype.parseHost=function(e){var t=r.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=function(e,n){if(e&&e instanceof t)return e;var r=new t;return r.parse(e,n),r}},1488:function(){},56878:function(){},40888:function(){},59961:function(){},73443:function(){},78296:function(){},44046:function(){},7679:function(){},15184:function(){},9170:function(){},32295:function(){},61154:function(){},46154:function(){},91680:function(){},49304:function(){},27212:function(){},5609:function(){},58449:function(){},62103:function(e,t){"use strict";t.Z={button:"zI5tJ_qhWE6Oe6Lk75GY","is-icon-button":"tuBt2DLqimiImoqVzPqo",small:"Na39I683LAaSA99REg14",normal:"ipS7tKy9GntCS4R3vekF",icon:"paGLQwtPEaJmtArCcmyK",regular:"lZAo6_oGfclXOO9CC6Rd","full-width":"xJDOiJxTt0R_wSl8Ipz_",loading:"q_tVWqMjl39RcY6WtQA6","external-icon":"CDuBjJp_8jxzx5j6Nept"}},45460:function(e,t){"use strict";t.Z={"star-icon":"cuoSlhSNrqf1dozY22Xb",jetpack:"lAIiifeLMmZAPlQ9n9ZR","checkmark-icon":"JLquNpQVlysAamuh5lJO",socialIcon:"cbOwD8Y4tFjwimmtchQI",facebook:"aHOlEBGD5EA8NKRw3xTw",instagram:"cL3m0xBYTYhIKI7lCqDB",twitter:"af4Y_zItXvLAOEoSDPSv",linkedin:"f68aqF3XSD1OBvXR1get",tumblr:"xFI0dt3UiXRlRQdqPWkx",google:"q7JEoyymveP6kF747M43",mastodon:"DKOBOTVmTLbh26gUH_73"}},49710:function(e,t){"use strict";t.Z={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)"}},46409:function(e,t){"use strict";t.Z={placeholder:"NisihrgiIKl_knpYJtfg",pulse:"R2i0K45dEF157drbVRPI"}},48026:function(){},93468:function(e,t){"use strict";t.Z={global:"_fUXxnSp5pagKBp9gSN7"}},91853:function(e,t){"use strict";t.Z={"connection-container":"KQcQQLxH5fI08DfOlKwL"}},75631:function(e,t){"use strict";t.Z={"connections-list":"Ua6eKcnk_tQQpFlgXMSn","components-notice":"SHqrIEguRfCILRHPyxE9","upgrade-link":"ABTyknbLXdzwcEZeSGzL","more-link":"ejyuBjiLmHz_UTFmBnjA","change-settings-button":"smqXe_da1eoP4Agql_Cs"}},58487:function(e,t){"use strict";t.Z={container:"OWstrHF6QZdaosKs0b6j",hidden:"HJMFrbZ0khdkKKkocrIK"}},69339:function(e,t){"use strict";t.Z={"preview-wrapper":"cZuW54OEuUN9yvuE_rNU","preview-image":"vCs0BOExDMOystFhG2wa",container:"sKpch49QzrpontC0DvF7",subtitle:"vOO47kVjHn7i63fQ0bx0",preview:"ziE_jq4PmQmGBedGskf_",remove:"qqGj0rmSJvZs9dyr0u_I","remove-loading":"TJGgifcTHqUtknPqVQpH"}},45811:function(e,t){"use strict";t.Z={wrapper:"f92zWdEJJIwBvwH5rRzn",disabled:"rBTOWyeewE4VxAqYgjoI","preview-wrapper":"PykCvaqoL7AIDzVKJAtg",notice:"SSMDWFYkP44va5KqPpTP"}},82283:function(e,t){"use strict";t.Z={notice:"ptn8jt555LOvMXWaoLxs","notice--default":"IVzciZv5S5E8XgR5EsLp","notice--highlight":"OpbDsm3F65Z4K5Bz43cz","notice--warning":"dlrSwB0tyuf1TYcypDec","notice--error":"hkpqil8E11PObwu7TVU2",content:"AeqtA3GRe7sFjKaC9SqL",dismiss:"IArBTmNL2K4du5WPBUhg",actions:"T7E2eJJN4qjwPpv3mcjV"}},2097:function(e,t){"use strict";t.Z={prompt:"CW7R8fRQqVKfyXFYiNWR",buttons:"n34j0qWq2EZzYl1jAiej",button:"aIuCL8MdydCJGcrOqp4x",header:"qegtnlYWDc3UnIGPRlQb"}},78619:function(e,t){"use strict";t.Z={"settings-link":"ZuktxapayvvIV1xDFrTG"}},40088:function(e,t){"use strict";t.Z={templateControl:"tfWupx32Rn5hHqVjTzui",customText:"qu9UsV1EEFeFxhU3Wgt5",mediaPicker:"nZhgKYFn6MQoIDGcKrUG"}},15214:function(){"use strict"},47320:function(e,t){"use strict";t.Z={templates:"m9360_cMWKFHTNk9xpNz",template:"j4EvSJfKIJLGEIAETiEY","template--active":"dQb3Zpl0puk4V6ezZslo"}},89696:function(e,t){"use strict";t.Z={checkbox:"NWFjHxAKqZPzk0O6w4IF",disabled:"gLaHzq2GjbiHJ5It_wy3"}},28161:function(e,t){"use strict";t.Z={"publicize-notice":"__nV49on4_ijaV8Brnsw","components-notice":"zZ3Pu7E87XyYIdPR2WTt","components-button":"fLC8AaLf3xcKaoJ4Opax"}},87728:function(e,t){"use strict";t.Z={wrapper:"sP1aklNMfj7lCDxuhWaq",progress:"a6tcXi51GAewl3qx0AVi",duration:"uFtCCGeycoI94JbCnJh8"}},5743:function(e,t){"use strict";t.Z={wrapper:"h2NGkiVs1r1nf85LtJpF","conversion-notice":"k3Apzwo3v9n0IaHbB8tf"}},73171:function(e){var t=1e3,n=60*t,r=60*n,a=24*r,o=7*a,i=365.25*a;function s(e,t,n,r){var a=t>=1.5*n;return Math.round(e/n)+" "+r+(a?"s":"")}e.exports=function(e,c){c=c||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*a;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===l&&isFinite(e))return c.long?function(e){var o=Math.abs(e);if(o>=a)return s(e,o,a,"day");if(o>=r)return s(e,o,r,"hour");if(o>=n)return s(e,o,n,"minute");if(o>=t)return s(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=a)return Math.round(e/a)+"d";if(o>=r)return Math.round(e/r)+"h";if(o>=n)return Math.round(e/n)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},68308:function(e,t,n){"use strict";n.d(t,{B:function(){return i}});var r=n(97740),a=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],o=/[^A-Z0-9]+/gi;function i(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,i=void 0===n?a:n,c=t.stripRegexp,l=void 0===c?o:c,u=t.transform,d=void 0===u?r.U:u,p=t.delimiter,m=void 0===p?" ":p,h=s(s(e,i,"$1\0$2"),l,"\0"),g=0,f=h.length;"\0"===h.charAt(g);)g++;for(;"\0"===h.charAt(f-1);)f--;return h.slice(g,f).split("\0").map(d).join(m)}function s(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}},76854:function(e,t,n){"use strict";n.d(t,{o:function(){return o}});var r=n(38697),a=n(77352);function o(e,t){return void 0===t&&(t={}),(0,a.$)(e,(0,r.pi)({delimiter:"-"},t))}},72867:function(e,t,n){"use strict";n.d(t,{By:function(){return o},Ho:function(){return s},Pv:function(){return i}});var r=n(38697),a=n(68308);function o(e,t){var n=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function i(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function s(e,t){return void 0===t&&(t={}),(0,a.B)(e,(0,r.pi)({delimiter:"",transform:o},t))}},76559:function(e,t,n){"use strict";n.d(t,{Y:function(){return o}});var r=n(38697),a=n(77352);function o(e,t){return void 0===t&&(t={}),(0,a.$)(e,(0,r.pi)({delimiter:"/"},t))}},69424:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(94273),a=n.n(r),o=n(53191),i=n.n(o),s=n(51128),c=n.n(s)()("photon"),l={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},u="__domain__.invalid",d="http://".concat(u),p="https://i0.wp.com";function m(e,t){var n;try{n=new URL(e,d)}catch(e){return null}var r,o,s,m,h,g="https:"===n.protocol,f=new URL(p);if(h=n.host,/^i[0-2]\.wp\.com$/.test(h))f.pathname=n.pathname,f.hostname=n.hostname;else{if(n.search)return null;var b=n.href.replace("".concat(n.protocol,"/"),"");"blob:"===n.protocol&&(b=n.pathname.replace("://","//")),n.hostname===u&&(b=n.pathname),f.pathname=b,f.hostname=(r=b,o=a()(r),s=i()(o),m="i"+Math.floor(3*s()),c('determined server "%s" to use with "%s"',m,r),m+".wp.com"),g&&f.searchParams.set("ssl",1)}if(t)for(var v in t)"host"!==v&&"hostname"!==v?"secure"!==v||t[v]?f.searchParams.set(l[v]||v,t[v]):f.protocol="http:":f.hostname=t[v];return c("generated Photon URL: %s",f.href),f.href}},469:function(e,t,n){"use strict";var r=n(90758);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},25162:function(e,t,n){e.exports=n(469)()},90758:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},28918:function(e,t,n){"use strict";n.d(t,{ZP:function(){return P}});var r,a=n(99196),o=n.n(a),i=Object.defineProperty,s=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&u(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&u(e,n,t[n]);return e},p=(e,t)=>{var n={};for(var r in e)c.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var r of s(e))t.indexOf(r)<0&&l.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],et.MAX_VERSION)throw new RangeError("Version value out of range");if(a<-1||a>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let i=[];for(let e=0;e7)throw new RangeError("Invalid value");let u,d;for(u=a;;u++){const r=8*t.getNumDataCodewords(u,n),a=s.getTotalBits(e,u);if(a<=r){d=a;break}if(u>=i)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=8*t.getNumDataCodewords(u,e)&&(n=e);let p=[];for(const t of e){r(t.mode.modeBits,4,p),r(t.numChars,t.mode.numCharCountBits(u),p);for(const e of t.getData())p.push(e)}o(p.length==d);const m=8*t.getNumDataCodewords(u,n);o(p.length<=m),r(0,Math.min(4,m-p.length),p),r(0,(8-p.length%8)%8,p),o(p.length%8==0);for(let e=236;p.lengthh[t>>>3]|=e<<7-(7&t))),new t(u,n,h,c)}getModule(e,t){return 0<=e&&e>>9);const r=21522^(t<<10|n);o(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,a(r,e));this.setFunctionModule(8,7,a(r,6)),this.setFunctionModule(8,8,a(r,7)),this.setFunctionModule(7,8,a(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,a(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,a(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,a(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const n=a(t,e),r=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(r,o,n),this.setFunctionModule(o,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const a=Math.max(Math.abs(r),Math.abs(n)),o=e+r,i=t+n;0<=o&&o{(e!=l-i||n>=c)&&p.push(t[e])}));return o(p.length==s),p}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r>>3],7-(7&n)),n++)}}o(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t5&&e++):(this.finderPenaltyAddHistory(a,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[n][i],a=1);e+=this.finderPenaltyTerminateAndCount(r,a,o)*t.PENALTY_N3}for(let n=0;n5&&e++):(this.finderPenaltyAddHistory(a,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[i][n],a=1);e+=this.finderPenaltyTerminateAndCount(r,a,o)*t.PENALTY_N3}for(let n=0;ne+(t?1:0)),n);const r=this.size*this.size,a=Math.ceil(Math.abs(20*n-10*r)/r)-1;return o(0<=a&&a<=9),e+=a*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.lengtht.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return o(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t0));for(const a of e){const e=a^r.shift();r.push(0),n.forEach(((n,a)=>r[a]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return o(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function a(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const i=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new i(i.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!i.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n=1<{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(r||(r={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(r||(r={}));var m=r,h={L:m.QrCode.Ecc.LOW,M:m.QrCode.Ecc.MEDIUM,Q:m.QrCode.Ecc.QUARTILE,H:m.QrCode.Ecc.HIGH},g=128,f="L",b="#FFFFFF",v="#000000",k=!1,y=4,w=.1;function E(e,t=0){const n=[];return e.forEach((function(e,r){let a=null;e.forEach((function(o,i){if(!o&&null!==a)return n.push(`M${a+t} ${r+t}h${i-a}v1H${a+t}z`),void(a=null);if(i!==e.length-1)o&&null===a&&(a=i);else{if(!o)return;null===a?n.push(`M${i+t},${r+t} h1v1H${i+t}z`):n.push(`M${a+t},${r+t} h${i+1-a}v1H${a+t}z`)}}))})),n.join("")}function _(e,t){return e.slice().map(((e,n)=>n=t.y+t.h?e:e.map(((e,n)=>(n=t.x+t.w)&&e))))}function C(e,t,n,r){if(null==r)return null;const a=n?y:0,o=e.length+2*a,i=Math.floor(t*w),s=o/t,c=(r.width||i)*s,l=(r.height||i)*s,u=null==r.x?e.length/2-c/2:r.x*s,d=null==r.y?e.length/2-l/2:r.y*s;let p=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);p={x:e,y:t,w:Math.ceil(c+u-e),h:Math.ceil(l+d-t)}}return{x:u,y:d,h:l,w:c,excavation:p}}var j=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function S(e){const t=e,{value:n,size:r=g,level:i=f,bgColor:s=b,fgColor:c=v,includeMargin:l=k,style:u,imageSettings:w}=t,S=p(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),x=null==w?void 0:w.src,P=(0,a.useRef)(null),N=(0,a.useRef)(null),[L,T]=(0,a.useState)(!1);(0,a.useEffect)((()=>{if(null!=P.current){const e=P.current,t=e.getContext("2d");if(!t)return;let a=m.QrCode.encodeText(n,h[i]).getModules();const o=l?y:0,u=a.length+2*o,d=C(a,r,l,w),p=N.current,g=null!=d&&null!==p&&p.complete&&0!==p.naturalHeight&&0!==p.naturalWidth;g&&null!=d.excavation&&(a=_(a,d.excavation));const f=window.devicePixelRatio||1;e.height=e.width=r*f;const b=r/u*f;t.scale(b,b),t.fillStyle=s,t.fillRect(0,0,u,u),t.fillStyle=c,j?t.fill(new Path2D(E(a,o))):a.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+o,n+o,1,1)}))})),g&&t.drawImage(p,d.x+o,d.y+o,d.w,d.h)}})),(0,a.useEffect)((()=>{T(!1)}),[x]);const A=d({height:r,width:r},u);let R=null;return null!=x&&(R=o().createElement("img",{src:x,key:x,style:{display:"none"},onLoad:()=>{T(!0)},ref:N})),o().createElement(o().Fragment,null,o().createElement("canvas",d({style:A,height:r,width:r,ref:P},S)),R)}function x(e){const t=e,{value:n,size:r=g,level:a=f,bgColor:i=b,fgColor:s=v,includeMargin:c=k,imageSettings:l}=t,u=p(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let w=m.QrCode.encodeText(n,h[a]).getModules();const j=c?y:0,S=w.length+2*j,x=C(w,r,c,l);let P=null;null!=l&&null!=x&&(null!=x.excavation&&(w=_(w,x.excavation)),P=o().createElement("image",{xlinkHref:l.src,height:x.h,width:x.w,x:x.x+j,y:x.y+j,preserveAspectRatio:"none"}));const N=E(w,j);return o().createElement("svg",d({height:r,width:r,viewBox:`0 0 ${S} ${S}`},u),o().createElement("path",{fill:i,d:`M0,0 h${S}v${S}H0z`,shapeRendering:"crispEdges"}),o().createElement("path",{fill:s,d:N,shapeRendering:"crispEdges"}),P)}var P=e=>{const t=e,{renderAs:n}=t,r=p(t,["renderAs"]);return"svg"===n?o().createElement(x,d({},r)):o().createElement(S,d({},r))}},40142:function(e,t){"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function a(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,o,i=[];for(o in"string"!=typeof t&&(t="?"),e)if(n.call(e,o)){if((r=e[o])||null!=r&&!isNaN(r)||(r=""),o=a(o),r=a(r),null===o||null===r)continue;i.push(o+"="+r)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,a={};t=n.exec(e);){var o=r(t[1]),i=r(t[2]);null===o||null===i||o in a||(a[o]=i)}return a}},51516:function(e,t,n){"use strict";var r=n(91850);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},671:function(e,t,n){"use strict";var r=n(25162),a=n.n(r),o=n(99196),i=n.n(o),s=n(19905),c=function(){function e(e,t){for(var n=0;n0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;i.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),l=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),w="undefined"!=typeof WeakMap?new WeakMap:new n,E=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=c.getInstance(),r=new y(t,n,this);w.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){E.prototype[e]=function(){var t;return(t=w.get(this))[e].apply(t,arguments)}}));var _=void 0!==a.ResizeObserver?a.ResizeObserver:E;t.Z=_},53191:function(e){"use strict";var t=256,n=[],r=window,a=Math.pow(t,6),o=Math.pow(2,52),i=2*o,s=255,c=Math.random;function l(e){var n,r=e.length,a=this,o=0,i=a.i=a.j=0,c=a.S=[];for(r||(e=[r++]);o=i;)e/=2,n/=2,r>>>=1;return(e+r)/n}},e.exports.resetGlobal=function(){Math.random=c},d(Math.random(),n)},44434:function(e,t,n){"use strict";n.d(t,{G:function(){return s},a:function(){return i}});var r=n(38697),a=n(68308),o=n(83078);function i(e,t){var n=e.toLowerCase();return 0===t?(0,o.l)(n):n}function s(e,t){return void 0===t&&(t={}),(0,a.B)(e,(0,r.pi)({delimiter:" ",transform:i},t))}},59491:function(e,t,n){"use strict";n.d(t,{f:function(){return o}});var r=n(38697),a=n(77352);function o(e,t){return void 0===t&&(t={}),(0,a.$)(e,(0,r.pi)({delimiter:"_"},t))}},36222:function(e,t,n){"use strict";n.d(t,{$L:function(){return c.$L},X_:function(){return s.X_},jt:function(){return r.Z},pw:function(){return a.Z},rp:function(){return i.rp},tK:function(){return i.tK},u_:function(){return o.u_},v_:function(){return o.v_},w$:function(){return s.w$}});n(2890),n(56694);var r=n(67742),a=n(42194),o=(n(13109),n(59822)),i=n(58890),s=n(20281),c=n(16700)},67742:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(51128),a=n.n(r),o=n(56694);const i=a()("jetpack-ai-client:ask-question");async function s(e){let{postId:t=null,fromCache:n=!1,feature:r,functions:a,model:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i("Asking question: %o. options: %o",e,{postId:t,fromCache:n,feature:r,functions:a,model:s}),new o.Z({question:e,options:{postId:t,feature:r,fromCache:n,functions:a,model:s}})}},4437:function(e,t,n){"use strict";var r=n(52175),a=n(55609),o=n(94333),i=n(69307),s=n(65736),c=n(6163),l=n(61074),u=n(90986),d=n(79201),p=n(65235),m=n.n(p),h=n(99196),g=n.n(h),f=n(11928),b=n(22291);const __=s.__,v=()=>{};t.Z=(0,i.forwardRef)((function(e,t){let{disabled:n=!1,value:s="",placeholder:p="",showAccept:h=!1,acceptLabel:k=__("Accept","jetpack"),showButtonLabels:y=!0,isTransparent:w=!1,state:E="init",showClearButton:_=!0,showGuideLine:C=!1,onChange:j=v,onSend:S=v,onStop:x=v,onAccept:P=v}=e;const N=(0,i.useRef)(null),L="requesting"===E||"suggesting"===E;(0,i.useImperativeHandle)(t,(()=>N.current)),(0,o.useKeyboardShortcut)("mod+enter",(()=>{h&&P?.()}),{target:N}),(0,o.useKeyboardShortcut)("enter",(e=>{e.preventDefault(),S?.(s)}),{target:N});const T=m()("jetpack-components-ai-control__controls-prompt_button",{"has-label":y});return g().createElement("div",{className:"jetpack-components-ai-control__container"},g().createElement("div",{className:m()("jetpack-components-ai-control__wrapper",{"is-transparent":w})},g().createElement(f.Z,{state:E}),g().createElement("div",{className:"jetpack-components-ai-control__input-wrapper"},g().createElement(r.PlainText,{value:s,onChange:j,placeholder:p,className:"jetpack-components-ai-control__input",disabled:L||n,ref:N})),s?.length>0&&_&&g().createElement(a.Button,{icon:c.Z,className:"jetpack-components-ai-control__clear",onClick:()=>j("")}),g().createElement("div",{className:"jetpack-components-ai-control__controls-prompt_button_wrapper"},L?g().createElement(a.Button,{className:T,onClick:x,isSmall:!0,label:__("Stop request","jetpack")},g().createElement(l.Z,{icon:c.Z}),y&&__("Stop","jetpack")):g().createElement(a.Button,{className:T,onClick:()=>S(s),isSmall:!0,disabled:!s?.length||n,label:__("Send request","jetpack")},g().createElement(l.Z,{icon:u.Z}),y&&__("Send","jetpack"))),h&&g().createElement("div",{className:"jetpack-components-ai-control__controls-prompt_button_wrapper"},g().createElement(a.Button,{className:T,onClick:P,isSmall:!0,label:k},g().createElement(l.Z,{icon:d.Z}),y&&k))),C&&g().createElement(b.Eo,null))}))},22291:function(e,t,n){"use strict";n.d(t,{Eo:function(){return b}});var r=n(55609),a=n(69307),o=n(65736),i=n(30797),s=n(23435),c=n(79201),l=n(90496),u=n(61074);const __=o.__,d="warning",p="error",m="success",h="info",g={[d]:i.Z,[p]:s.Z,[m]:c.Z,[h]:l.Z};function f(e){let{severity:t=null,icon:n=null,children:r}=e;return React.createElement("div",{className:"jetpack-ai-assistant__message"},(t||n)&&React.createElement(u.Z,{icon:g[t]||n}),React.createElement("div",{className:"jetpack-ai-assistant__message-content"},r))}function b(){return React.createElement(f,{severity:h},(0,a.createInterpolateElement)(__("AI-generated content could be inaccurate or biased. Learn more","jetpack"),{link:React.createElement(r.ExternalLink,{href:"https://automattic.com/ai-guidelines"})}))}},11928:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(55609),a=n(65235),o=n.n(a),i=n(59822);function s(e){let{state:t,size:n=24}=e;return React.createElement("div",{className:o()("jetpack-ai-status-indicator__icon-wrapper",{[`is-${t}`]:!0})},React.createElement(r.Icon,{icon:i.u_,size:n}))}},590:function(e,t,n){"use strict";n(69307)},58890:function(e,t,n){"use strict";n.d(t,{rp:function(){return a.Z},tK:function(){return r.Z}});var r=n(4437),a=n(11928);n(590)},62282:function(e,t,n){"use strict";n.d(t,{h:function(){return s},u:function(){return i}});var r=n(69307),a=n(99196),o=n.n(a);const i=(0,r.createContext)({}),s=e=>{let{value:t,children:n}=e;return o().createElement(i.Provider,{value:t,children:n})}},20281:function(e,t,n){"use strict";n.d(t,{X_:function(){return o.Z},hE:function(){return r.h},uE:function(){return r.u},w$:function(){return a.w}});var r=n(62282),a=n(3669),o=n(79466)},79466:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(69307),a=n(16700),o=n(20281);function i(){let{onDone:e,onSuggestion:t,onError:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=(0,r.useContext)(o.uE),{eventSource:s}=i,c=(0,r.useCallback)((t=>e?.(t?.detail)),[e]),l=(0,r.useCallback)((e=>t?.(e?.detail)),[t]),u=(0,r.useCallback)((e=>{n?.(e?.detail)}),[]);return(0,r.useEffect)((()=>{if(s)return e&&s.addEventListener("done",c),t&&s.addEventListener("suggestion",l),n&&s.addEventListener(a.vF,u),()=>{s.removeEventListener("done",c),s.removeEventListener("suggestion",l),s.removeEventListener(a.vF,u)}}),[s]),i}},3669:function(e,t,n){"use strict";n.d(t,{w:function(){return l}});var r=n(94333),a=n(69307),o=n(99196),i=n.n(o),s=n(36222),c=n(20281);(0,r.createHigherOrderComponent)((e=>t=>{const{suggestion:n,error:r,requestingState:o,request:l,stopSuggestion:u,eventSource:d}=(0,s.pw)(),p=(0,a.useMemo)((()=>({suggestion:n,requestingError:r,requestingState:o,eventSource:d,requestSuggestion:l,stopSuggestion:u})),[n,r,o,d,l,u]);return i().createElement(c.hE,{value:p},i().createElement(e,t))}),"withAiDataProvider");const l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{blocks:[""]};return(0,r.createHigherOrderComponent)((t=>n=>{const r=n?.block?.name;if(!r)return i().createElement(t,n);if(!(Array.isArray(e.blocks)?e.blocks:[e.blocks]).includes(r))return i().createElement(t,n);const{suggestion:o,error:l,requestingState:u,request:d,stopSuggestion:p,eventSource:m}=(0,s.pw)(),h=(0,a.useMemo)((()=>({suggestion:o,requestingError:l,requestingState:u,eventSource:m,requestSuggestion:d,stopSuggestion:p})),[o,l,u,m,d,p]);return i().createElement(c.hE,{value:h},i().createElement(t,n))}),"blockListBlockWithAiDataProvider")}},42194:function(e,t,n){"use strict";n.d(t,{A:function(){return u},Z:function(){return d}});var r=n(69307),a=n(65736),o=n(51128),i=n.n(o),s=n(67742),c=n(16700);const __=a.__,l=i()("jetpack-ai-client:use-suggestion");function u(e){switch(e){case c.$L:return{code:c.$L,message:__("You have reached the limit of requests for this site.","jetpack"),severity:"info"};case c.bC:return{code:c.bC,message:__("Your request was unclear. Mind trying again?","jetpack"),severity:"info"};case c.$u:return{code:c.$u,message:__("Jetpack AI services are currently unavailable. Sorry for the inconvenience.","jetpack"),severity:"info"};case c.q4:return{code:c.q4,message:__("This request has been flagged by our moderation system. Please try to rephrase it and try again.","jetpack"),severity:"info"};case c.co:default:return{code:c.co,message:__("It was not possible to process your request. Mind trying again?","jetpack"),severity:"info"}}}function d(){let{prompt:e,autoRequest:t=!1,askQuestionOptions:n={},onSuggestion:a,onDone:o,onError:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[d,p]=(0,r.useState)("init"),[m,h]=(0,r.useState)(""),[g,f]=(0,r.useState)(),b=(0,r.useRef)(void 0),v=(0,r.useCallback)((e=>{h(e?.detail),a?.(e?.detail)}),[a]),k=(0,r.useCallback)((e=>{o?.(e?.detail),p("done")}),[o]),y=(0,r.useCallback)((e=>{b?.current?.close(),p("error"),f(u(e)),i?.(u(e))}),[i]),w=(0,r.useCallback)((()=>y(c.$L)),[]),E=(0,r.useCallback)((()=>y(c.bC)),[]),_=(0,r.useCallback)((()=>y(c.$u)),[]),C=(0,r.useCallback)((()=>y(c.q4)),[]),j=(0,r.useCallback)((()=>y(c.co)),[]),S=(0,r.useCallback)((async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{...n};Array.isArray(e)&&e?.length?e.forEach(((t,n)=>{let{role:r,content:a}=t;return l("(%s/%s) %o\n%s",n+1,e.length,`[${r}]`,a)})):l("%o",e),p("requesting");try{if(b.current=await(0,s.Z)(e,t),!b?.current)return;const n=b.current;p("suggesting"),n.addEventListener("suggestion",v),n.addEventListener(c.$L,w),n.addEventListener(c.bC,E),n.addEventListener(c.$u,_),n.addEventListener(c.q4,C),n.addEventListener(c.co,j),n.addEventListener("done",k)}catch(e){console.error(e)}}),[k,w,E,_,C,j,v]),x=(0,r.useCallback)((()=>{p("init"),h(""),f(void 0)}),[]),P=(0,r.useCallback)((()=>{if(!b?.current)return;const e=b?.current;e.close(),e.removeEventListener("suggestion",v),e.removeEventListener(c.$L,w),e.removeEventListener(c.bC,E),e.removeEventListener(c.$u,_),e.removeEventListener(c.q4,C),e.removeEventListener(c.co,j),e.removeEventListener("done",k),p("done")}),[b,v,w,E,_,C,j,k]);return(0,r.useEffect)((()=>{if(e?.length)return t&&S(e,n),()=>{P()}}),[t,e,S,P]),{suggestion:m,error:g,requestingState:d,request:S,stopSuggestion:P,reset:x,eventSource:b.current}}},13109:function(e,t,n){"use strict";n(69307)},61317:function(e,t,n){"use strict";var r=n(55609),a=n(99196),o=n.n(a);const i=o().createElement(r.SVG,{viewBox:"0 0 32 32",width:"32",height:"32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"ai-assistant-icon"},o().createElement(r.Path,{className:"spark-first",d:"M9.33301 5.33325L10.4644 8.20188L13.333 9.33325L10.4644 10.4646L9.33301 13.3333L8.20164 10.4646L5.33301 9.33325L8.20164 8.20188L9.33301 5.33325Z"}),o().createElement(r.Path,{className:"spark-second",d:"M21.3333 5.33333L22.8418 9.15817L26.6667 10.6667L22.8418 12.1752L21.3333 16L19.8248 12.1752L16 10.6667L19.8248 9.15817L21.3333 5.33333Z"}),o().createElement(r.Path,{className:"spark-third",d:"M14.6667 13.3333L16.5523 18.1144L21.3333 20L16.5523 21.8856L14.6667 26.6667L12.781 21.8856L8 20L12.781 18.1144L14.6667 13.3333Z"}));t.Z=i},59822:function(e,t,n){"use strict";n.d(t,{u_:function(){return r.Z},v_:function(){return a.Z}});var r=n(61317),a=(n(81204),n(4454),n(71893),n(52887),n(96083),n(50500))},81204:function(e,t,n){"use strict";var r=n(55609),a=n(99196),o=n.n(a);r.SVG,r.Rect,r.Line,r.Path},4454:function(e,t,n){"use strict";var r=n(55609),a=n(99196),o=n.n(a);r.SVG,r.Path,r.Path},96083:function(e,t,n){"use strict";var r=n(55609),a=n(99196),o=n.n(a);r.SVG,r.Path,r.Rect,r.Rect},71893:function(e,t,n){"use strict";var r=n(55609),a=n(99196),o=n.n(a);r.SVG,r.Path,r.Path},52887:function(e,t,n){"use strict";var r=n(55609),a=n(99196),o=n.n(a);r.SVG,r.Path,r.Rect},50500:function(e,t,n){"use strict";var r=n(55609),a=n(99196),o=n.n(a);const i=o().createElement(r.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o().createElement(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5 10C12.5 11.3807 11.3807 12.5 10 12.5C8.61929 12.5 7.5 11.3807 7.5 10C7.5 8.61929 8.61929 7.5 10 7.5C11.3807 7.5 12.5 8.61929 12.5 10ZM14 10C14 12.2091 12.2091 14 10 14C7.79086 14 6 12.2091 6 10C6 7.79086 7.79086 6 10 6C12.2091 6 14 7.79086 14 10ZM16.75 21V19C16.75 17.4812 15.5188 16.25 14 16.25L6 16.25C4.48122 16.25 3.25 17.4812 3.25 19V21H4.75L4.75 19C4.75 18.3096 5.30964 17.75 6 17.75L14 17.75C14.6904 17.75 15.25 18.3096 15.25 19V21H16.75Z",fill:"currentColor"}),o().createElement(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M19.976 16.3599C21.2507 14.5642 22.0001 12.3695 22.0001 9.99969C22.0001 7.63128 21.2515 5.43769 19.9782 3.64258L18.754 4.50967C19.8537 6.05996 20.5001 7.95434 20.5001 9.99969C20.5001 12.0464 19.8528 13.9419 18.7519 15.4928L19.976 16.3599ZM17.3357 14.4897C18.2357 13.222 18.7648 11.6727 18.7648 9.99969C18.7648 8.32808 18.2365 6.77984 17.3379 5.51279L16.1137 6.37988C16.8387 7.4021 17.2648 8.65114 17.2648 9.99969C17.2648 11.3496 16.8378 12.5998 16.1116 13.6226L17.3357 14.4897Z",fill:"currentColor"}));t.Z=i},2890:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(13419),a=n(86989),o=n.n(a),i=n(51128);const s=n.n(i)()("jetpack-ai-client:jwt"),c="jetpack-ai-jwt",l=12e4;async function u(){let{apiNonce:e,siteId:t,expirationTime:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=e||window.JP_CONNECTION_INITIAL_STATE.apiNonce,t=t||window.JP_CONNECTION_INITIAL_STATE.siteSuffix,n=n||l;const a=(0,r.Wp)(),i=localStorage.getItem(c);let u,d=null;if(i)try{d=JSON.parse(i)}catch(e){s("Error parsing token",e)}if(d&&d?.expire>Date.now())return s("Using cached token"),d;u=a?await o()({path:"/wpcom/v2/sites/"+t+"/jetpack-openai-query/jwt",method:"POST"}):await o()({path:"/jetpack/v4/jetpack-ai-jwt?_cacheBuster="+Date.now(),credentials:"same-origin",headers:{"X-WP-Nonce":e},method:"POST"});const p={token:u.token,blogId:a?t:u.blog_id,expire:Date.now()+n};return s("Storing new token"),localStorage.setItem(c,JSON.stringify(p)),p}},56694:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(60400),a=n(51128),o=n.n(a),i=n(42194),s=n(2890),c=n(16700);const l=o()("jetpack-ai-client:suggestions-event-source");class u extends EventTarget{constructor(e){super(),this.fullMessage="",this.fullFunctionCall={name:"",arguments:""},this.isPromptClear=!1,this.controller=new AbortController,this.initEventSource(e)}async initEventSource(e){let{url:t,question:n,token:a,options:o={}}=e;if(!a)try{l("Token was not provided, requesting one..."),a=(await(0,s.Z)()).token}catch(e){return void this.processErrorEvent(e)}const u={};if(o?.postId&&(u.post_id=o.postId),!t){const e=new URL("https://public-api.wordpress.com/wpcom/v2/jetpack-ai-query");o?.fromCache&&e.searchParams.append("stream_cache","true"),t=e.toString(),l("URL not provided, using default: %o",t)}Array.isArray(n)?u.messages=n:u.question=n,o?.feature?.length&&(l("Feature: %o",o.feature),u.feature=o.feature),o?.functions?.length&&(l("Functions: %o",o.functions),u.functions=o.functions),o?.model?.length&&(l("Model: %o",o.model),u.model=o.model),await(0,r.L)(t,{openWhenHidden:!0,method:"POST",headers:{"Content-type":"application/json",Authorization:"Bearer "+a},body:JSON.stringify(u),onclose:()=>{l("Stream closed")},onerror:e=>{throw this.processErrorEvent(e),e},onmessage:e=>{this.processEvent(e)},onopen:async e=>{if(e.ok)return;let t;throw e.status>=400&&e.status<=500&&![413,422,429].includes(e.status)&&this.processConnectionError(e),503===e.status&&(t=c.$u,this.dispatchEvent(new CustomEvent(c.$u))),413===e.status&&(t=c.cv,this.dispatchEvent(new CustomEvent(c.cv))),422===e.status&&(t=c.q4,this.dispatchEvent(new CustomEvent(c.q4))),429===e.status&&(t=c.$L,this.dispatchEvent(new CustomEvent(c.$L))),this.dispatchEvent(new CustomEvent(c.vF,{detail:(0,i.A)(t)})),new Error},signal:this.controller.signal})}checkForUnclearPrompt(){if(this.isPromptClear)return;const e=this.fullMessage.replace(/__|(\*\*)/g,"");e.startsWith("JETPACK_AI_ERROR")?(this.dispatchEvent(new CustomEvent(c.bC)),this.dispatchEvent(new CustomEvent(c.vF,{detail:(0,i.A)(c.bC)}))):"JETPACK_AI_ERROR".startsWith(e)?l(this.fullMessage):this.isPromptClear=!0}close(){this.controller.abort()}processEvent(e){if("[DONE]"===e.data){if(this.fullMessage.length)return this.dispatchEvent(new CustomEvent("done",{detail:this.fullMessage})),void l("Done: %o",this.fullMessage);if(this.fullFunctionCall.name.length)return this.dispatchEvent(new CustomEvent("function_done",{detail:this.fullFunctionCall})),void l("Done: %o",this.fullFunctionCall)}let t;try{t=JSON.parse(e.data)}catch(t){return void l("Error parsing JSON",e,t)}const{delta:n}=t?.choices?.[0]??{delta:{content:null,function_call:null}},r=n.content,a=n.function_call;r&&(this.fullMessage+=r,this.checkForUnclearPrompt(),this.isPromptClear&&(this.dispatchEvent(new CustomEvent("chunk",{detail:r})),l("suggestion: %o",this.fullMessage),this.dispatchEvent(new CustomEvent("suggestion",{detail:this.fullMessage})))),a&&(null!=a.name&&(this.fullFunctionCall.name+=a.name),null!=a.arguments&&(this.fullFunctionCall.arguments+=a.arguments),this.dispatchEvent(new CustomEvent("functionCallChunk",{detail:this.fullFunctionCall})))}processConnectionError(e){l("Connection error: %o",e),this.dispatchEvent(new CustomEvent(c.co,{detail:e})),this.dispatchEvent(new CustomEvent(c.vF,{detail:(0,i.A)(c.co)}))}processErrorEvent(e){l("onerror: %o",e),this.dispatchEvent(new CustomEvent(c.co,{detail:e})),this.dispatchEvent(new CustomEvent(c.vF,{detail:(0,i.A)(c.co)}))}}},16700:function(e,t,n){"use strict";n.d(t,{$L:function(){return a},$u:function(){return r},bC:function(){return c},co:function(){return s},cv:function(){return i},q4:function(){return o},vF:function(){return l}});const r="error_service_unavailable",a="error_quota_exceeded",o="error_moderation",i="error_context_too_large",s="error_network",c="error_unclear_prompt",l="error_response"},6975:function(e,t,n){"use strict";var r=n(51128);const a=n.n(r)()("dops:analytics");let o,i;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const s={initialize:function(e,t,n){s.setUser(e,t),s.setSuperProps(n),s.identifyUser()},setGoogleAnalyticsEnabled:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){i={ID:e,username:t}},setSuperProps:function(e){o=e},assignSuperProps:function(e){o=Object.assign(o||{},e)},mc:{bumpStat:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);a("Bumping stats %o",e)}else n="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),a('Bumping stat "%s" in group "%s"',t,e);return n}(e,t);s.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+n+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);a("Built stats %o",e)}else n="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),a('Built stat "%s" in group "%s"',t,e);return n}(e,t);s.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+n+"&t="+Math.random())}},pageView:{record:function(e,t){s.tracks.recordPageView(e),s.ga.recordPageView(e,t)}},purchase:{record:function(e,t,n,r,a,o,i){s.ga.recordPurchase(e,t,n,r,a,o,i)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(o&&(a("- Super Props: %o",o),t=Object.assign(t,o)),a('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):a('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};s.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){s.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){a("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};s.ga.initialized||(i&&(e={userId:"u-"+i.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),s.ga.initialized=!0)},recordPageView:function(e,t){s.ga.initialize(),a("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,n,r){s.ga.initialize();let o="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==n&&(o+=" [Option Label: "+n+"]"),void 0!==r&&(o+=" [Option Value: "+r+"]"),a(o),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,n,r)},recordPurchase:function(e,t,n,r,a,o,i){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:r,currency:i}),window.ga("ecommerce:addItem",{id:e,name:t,sku:n,price:a,quantity:o}),window.ga("ecommerce:send")}},identifyUser:function(){i&&window._tkq.push(["identifyUser",i.ID,i.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}};t.Z=s},64743:function(e,t,n){"use strict";var r=n(61132),a=n(96483);function o(e){class t extends Error{constructor(){super(...arguments),this.name=e}}return t}const i=o("JsonParseError"),s=o("JsonParseAfterRedirectError"),c=o("Api404Error"),l=o("Api404AfterRedirectError"),u=o("FetchNetworkError");const d=new function(e,t){let n=e,o=e,i={"X-WP-Nonce":t},s={credentials:"same-origin",headers:i},c={method:"post",credentials:"same-origin",headers:Object.assign({},i,{"Content-type":"application/json"})},l=function(e){const t=e.split("?"),n=t.length>1?t[1]:"",r=n.length?n.split("&"):[];return r.push("_cacheBuster="+(new Date).getTime()),t[0]+"?"+r.join("&")};const u={setApiRoot(e){n=e},setWpcomOriginApiUrl(e){o=e},setApiNonce(e){i={"X-WP-Nonce":e},s={credentials:"same-origin",headers:i},c={method:"post",credentials:"same-origin",headers:Object.assign({},i,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{l=e},registerSite:(e,t)=>{const a={registration_nonce:e,no_iframe:!0};return(0,r.jetpackConfigHas)("consumer_slug")&&(a.plugin_slug=(0,r.jetpackConfigGet)("consumer_slug")),null!==t&&(a.redirect_uri=t),h(`${n}jetpack/v4/connection/register`,c,{body:JSON.stringify(a)}).then(p).then(m)},fetchAuthorizationUrl:e=>d((0,a.addQueryArgs)(`${n}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),s).then(p).then(m),fetchSiteConnectionData:()=>d(`${n}jetpack/v4/connection/data`,s).then(m),fetchSiteConnectionStatus:()=>d(`${n}jetpack/v4/connection`,s).then(m),fetchSiteConnectionTest:()=>d(`${n}jetpack/v4/connection/test`,s).then(p).then(m),fetchUserConnectionData:()=>d(`${n}jetpack/v4/connection/data`,s).then(m),fetchUserTrackingSettings:()=>d(`${n}jetpack/v4/tracking/settings`,s).then(p).then(m),updateUserTrackingSettings:e=>h(`${n}jetpack/v4/tracking/settings`,c,{body:JSON.stringify(e)}).then(p).then(m),disconnectSite:()=>h(`${n}jetpack/v4/connection`,c,{body:JSON.stringify({isActive:!1})}).then(p).then(m),fetchConnectUrl:()=>d(`${n}jetpack/v4/connection/url`,s).then(p).then(m),unlinkUser:()=>h(`${n}jetpack/v4/connection/user`,c,{body:JSON.stringify({linked:!1})}).then(p).then(m),reconnect:()=>h(`${n}jetpack/v4/connection/reconnect`,c).then(p).then(m),fetchConnectedPlugins:()=>d(`${n}jetpack/v4/connection/plugins`,s).then(p).then(m),setHasSeenWCConnectionModal:()=>h(`${n}jetpack/v4/seen-wc-connection-modal`,c).then(p).then(m),fetchModules:()=>d(`${n}jetpack/v4/module/all`,s).then(p).then(m),fetchModule:e=>d(`${n}jetpack/v4/module/${e}`,s).then(p).then(m),activateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,c,{body:JSON.stringify({active:!0})}).then(p).then(m),deactivateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,c,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${n}jetpack/v4/module/${e}`,c,{body:JSON.stringify(t)}).then(p).then(m),updateSettings:e=>h(`${n}jetpack/v4/settings`,c,{body:JSON.stringify(e)}).then(p).then(m),getProtectCount:()=>d(`${n}jetpack/v4/module/protect/data`,s).then(p).then(m),resetOptions:e=>h(`${n}jetpack/v4/options/${e}`,c,{body:JSON.stringify({reset:!0})}).then(p).then(m),activateVaultPress:()=>h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(p).then(m),getVaultPressData:()=>d(`${n}jetpack/v4/module/vaultpress/data`,s).then(p).then(m),installPlugin:(e,t)=>{const r={slug:e,status:"active"};return t&&(r.source=t),h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify(r)}).then(p).then(m)},activateAkismet:()=>h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(p).then(m),getAkismetData:()=>d(`${n}jetpack/v4/module/akismet/data`,s).then(p).then(m),checkAkismetKey:()=>d(`${n}jetpack/v4/module/akismet/key/check`,s).then(p).then(m),checkAkismetKeyTyped:e=>h(`${n}jetpack/v4/module/akismet/key/check`,c,{body:JSON.stringify({api_key:e})}).then(p).then(m),fetchStatsData:e=>d(function(e){let t=`${n}jetpack/v4/module/stats/data`;-1!==t.indexOf("?")?t+=`&range=${encodeURIComponent(e)}`:t+=`?range=${encodeURIComponent(e)}`;return t}(e),s).then(p).then(m).then(f),getPluginUpdates:()=>d(`${n}jetpack/v4/updates/plugins`,s).then(p).then(m),getPlans:()=>d(`${n}jetpack/v4/plans`,s).then(p).then(m),fetchSettings:()=>d(`${n}jetpack/v4/settings`,s).then(p).then(m),updateSetting:e=>h(`${n}jetpack/v4/settings`,c,{body:JSON.stringify(e)}).then(p).then(m),fetchSiteData:()=>d(`${n}jetpack/v4/site`,s).then(p).then(m).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>d(`${n}jetpack/v4/site/features`,s).then(p).then(m).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>d(`${n}jetpack/v4/site/products`,s).then(p).then(m),fetchSitePurchases:()=>d(`${n}jetpack/v4/site/purchases`,s).then(p).then(m).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>d(`${n}jetpack/v4/site/benefits`,s).then(p).then(m).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>d(`${n}jetpack/v4/site/discount`,s).then(p).then(m).then((e=>e.data)),fetchSetupQuestionnaire:()=>d(`${n}jetpack/v4/setup/questionnaire`,s).then(p).then(m),fetchRecommendationsData:()=>d(`${n}jetpack/v4/recommendations/data`,s).then(p).then(m),fetchRecommendationsProductSuggestions:()=>d(`${n}jetpack/v4/recommendations/product-suggestions`,s).then(p).then(m),fetchRecommendationsUpsell:()=>d(`${n}jetpack/v4/recommendations/upsell`,s).then(p).then(m),fetchRecommendationsConditional:()=>d(`${n}jetpack/v4/recommendations/conditional`,s).then(p).then(m),saveRecommendationsData:e=>h(`${n}jetpack/v4/recommendations/data`,c,{body:JSON.stringify({data:e})}).then(p),fetchProducts:()=>d(`${n}jetpack/v4/products`,s).then(p).then(m),fetchRewindStatus:()=>d(`${n}jetpack/v4/rewind`,s).then(p).then(m).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>d(`${n}jetpack/v4/scan`,s).then(p).then(m).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>h(`${n}jetpack/v4/notice/${e}`,c,{body:JSON.stringify({dismissed:!0})}).then(p).then(m),fetchPluginsData:()=>d(`${n}jetpack/v4/plugins`,s).then(p).then(m),fetchIntroOffers:()=>d(`${n}jetpack/v4/intro-offers`,s).then(p).then(m),fetchVerifySiteGoogleStatus:e=>d(null!==e?`${n}jetpack/v4/verify-site/google/${e}`:`${n}jetpack/v4/verify-site/google`,s).then(p).then(m),verifySiteGoogle:e=>h(`${n}jetpack/v4/verify-site/google`,c,{body:JSON.stringify({keyring_id:e})}).then(p).then(m),submitSurvey:e=>h(`${n}jetpack/v4/marketing/survey`,c,{body:JSON.stringify(e)}).then(p).then(m),saveSetupQuestionnaire:e=>h(`${n}jetpack/v4/setup/questionnaire`,c,{body:JSON.stringify(e)}).then(p).then(m),updateLicensingError:e=>h(`${n}jetpack/v4/licensing/error`,c,{body:JSON.stringify(e)}).then(p).then(m),updateLicenseKey:e=>h(`${n}jetpack/v4/licensing/set-license`,c,{body:JSON.stringify({license:e})}).then(p).then(m),getUserLicensesCounts:()=>d(`${n}jetpack/v4/licensing/user/counts`,s).then(p).then(m),getUserLicenses:()=>d(`${n}jetpack/v4/licensing/user/licenses`,s).then(p).then(m),updateLicensingActivationNoticeDismiss:e=>h(`${n}jetpack/v4/licensing/user/activation-notice-dismiss`,c,{body:JSON.stringify({last_detached_count:e})}).then(p).then(m),updateRecommendationsStep:e=>h(`${n}jetpack/v4/recommendations/step`,c,{body:JSON.stringify({step:e})}).then(p),confirmIDCSafeMode:()=>h(`${n}jetpack/v4/identity-crisis/confirm-safe-mode`,c).then(p),startIDCFresh:e=>h(`${n}jetpack/v4/identity-crisis/start-fresh`,c,{body:JSON.stringify({redirect_uri:e})}).then(p).then(m),migrateIDC:()=>h(`${n}jetpack/v4/identity-crisis/migrate`,c).then(p),attachLicenses:e=>h(`${n}jetpack/v4/licensing/attach-licenses`,c,{body:JSON.stringify({licenses:e})}).then(p).then(m),fetchSearchPlanInfo:()=>d(`${o}jetpack/v4/search/plan`,s).then(p).then(m),fetchSearchSettings:()=>d(`${o}jetpack/v4/search/settings`,s).then(p).then(m),updateSearchSettings:e=>h(`${o}jetpack/v4/search/settings`,c,{body:JSON.stringify(e)}).then(p).then(m),fetchSearchStats:()=>d(`${o}jetpack/v4/search/stats`,s).then(p).then(m),fetchWafSettings:()=>d(`${n}jetpack/v4/waf`,s).then(p).then(m),updateWafSettings:e=>h(`${n}jetpack/v4/waf`,c,{body:JSON.stringify(e)}).then(p).then(m),fetchWordAdsSettings:()=>d(`${n}jetpack/v4/wordads/settings`,s).then(p).then(m),updateWordAdsSettings:e=>h(`${n}jetpack/v4/wordads/settings`,c,{body:JSON.stringify(e)}),fetchSearchPricing:()=>d(`${o}jetpack/v4/search/pricing`,s).then(p).then(m),fetchMigrationStatus:()=>d(`${n}jetpack/v4/migration/status`,s).then(p).then(m),fetchBackupUndoEvent:()=>d(`${n}jetpack/v4/site/backup/undo-event`,s).then(p).then(m)};function d(e,t){return fetch(l(e),t)}function h(e,t,n){return fetch(e,Object.assign({},t,n)).catch(g)}function f(e){return e.general&&void 0===e.general.response||e.week&&void 0===e.week.response||e.month&&void 0===e.month.response?e:{}}Object.assign(this,u)};function p(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new l(e.redirected):new c})):e.json().catch((e=>h(e))).then((t=>{const n=new Error(`${t.message} (Status ${e.status})`);throw n.response=t,n.name="ApiError",n}))}function m(e){return e.json().catch((t=>h(t,e.redirected,e.url)))}function h(e,t,n){throw t?new s(n):new i}function g(){throw new u}t.ZP=d},90526:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(55609),i=n(61074),s=n(15381),c=n(65235),l=n.n(c),u=n(99196),d=n.n(u),p=n(62103);const m=(0,u.forwardRef)(((e,t)=>{const{children:n,variant:r="primary",size:c="normal",weight:u="bold",icon:m,iconSize:h,disabled:g,isDestructive:f,isLoading:b,isExternalLink:v,className:k,text:y,fullWidth:w,...E}=e,_=l()(p.Z.button,k,{[p.Z.normal]:"normal"===c,[p.Z.small]:"small"===c,[p.Z.icon]:Boolean(m),[p.Z.loading]:b,[p.Z.regular]:"regular"===u,[p.Z["full-width"]]:w,[p.Z["is-icon-button"]]:Boolean(m)&&!n});E.ref=t;const C="normal"===c?20:16,j=v&&d().createElement(i.Z,{size:C,icon:s.Z,className:p.Z["external-icon"]}),S=v?"_blank":void 0,x=n?.[0]&&null!==n[0]&&"components-tooltip"!==n?.[0]?.props?.className;return d().createElement(o.Button,a()({target:S,variant:r,className:l()(_,{"has-text":!!m&&x}),icon:v?void 0:m,iconSize:h,disabled:g,"aria-disabled":g,isDestructive:f,text:y},E),b&&d().createElement(o.Spinner,null),d().createElement("span",null,n),j)}));m.displayName="Button",t.Z=m},3396:function(e,t,n){"use strict";n.d(t,{av:function(){return p}});var r=n(82674),a=n.n(r),o=n(55609),i=n(65235),s=n.n(i),c=n(45460);const l=e=>{let{className:t,size:n=24,viewBox:r="0 0 24 24",opacity:i=1,color:l="#2C3338",children:u}=e;const d={className:s()(c.Z.iconWrapper,t),width:n,height:n,viewBox:r,opacity:i,fill:void 0};return l&&(d.fill=l),React.createElement(o.SVG,a()({},d,{fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg"}),React.createElement(o.G,{opacity:i},u))},u=e=>{let{className:t,fill:n="none",size:r,children:a}=e;return React.createElement(l,{className:s()(c.Z.socialIcon,t),size:r,color:n},a)},d={...{"anti-spam":e=>{let{opacity:t=1,size:n,color:r}=e;return React.createElement(l,{size:n,opacity:t,color:r},React.createElement(o.Path,{d:"M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1 s0,0.1-0.1,0.1c-0.1,0-0.1,0.1-0.1,0.1s-0.1,0-0.2,0h-5.1c-0.1,0-0.1,0-0.2,0c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1 c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1l0.1-0.1c0,0,0.1,0,0.2,0c0.5,0,1.1-0.2,1.1-0.8c0-0.3-0.1-0.5-0.2-0.8l-1.1-3.1 c-0.1-0.2-0.1-0.2-0.2-0.2h-4.3c-0.7,0-1.5,0-1.9,0.9l-1.1,2.4C7.1,17.6,7,17.8,7,18.1c0,0.8,1,0.9,1.6,0.9c0.1,0,0.1,0,0.2,0 L8.8,19l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1s-0.1,0.1-0.1,0.1l-0.1,0.1c-0.1,0-0.1,0-0.2,0H4.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1L4,19c0,0,0.1,0,0.1,0C5.2,19,5.5,18.5,6,17.5 l5.4-12.4c0.2-0.5,0.8-1,1.3-1C13,4.2,13.1,4.4,13.2,4.7z M9.1,13.1c0,0.1-0.1,0.1-0.1,0.2c0,0.1,0.1,0.1,0.1,0.1h4.4 c0.3,0,0.4-0.1,0.4-0.3c0-0.1,0-0.2-0.1-0.3l-1.2-3.5c-0.3-0.8-0.8-1.9-0.8-2.7c0-0.1,0-0.1-0.1-0.1c0,0-0.1,0-0.1,0.1 c-0.1,0.6-0.4,1.2-0.7,1.7L9.1,13.1z"}),React.createElement(o.Path,{d:"M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1 s0,0.1-0.1,0.1c-0.1,0-0.1,0.1-0.1,0.1s-0.1,0-0.2,0h-5.1c-0.1,0-0.1,0-0.2,0c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1 c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1l0.1-0.1c0,0,0.1,0,0.2,0c0.5,0,1.1-0.2,1.1-0.8c0-0.3-0.1-0.5-0.2-0.8l-1.1-3.1 c-0.1-0.2-0.1-0.2-0.2-0.2h-4.3c-0.7,0-1.5,0-1.9,0.9l-1.1,2.4C7.1,17.6,7,17.8,7,18.1c0,0.8,1,0.9,1.6,0.9c0.1,0,0.1,0,0.2,0 L8.8,19l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1s-0.1,0.1-0.1,0.1l-0.1,0.1c-0.1,0-0.1,0-0.2,0H4.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1L4,19c0,0,0.1,0,0.1,0C5.2,19,5.5,18.5,6,17.5 l5.4-12.4c0.2-0.5,0.8-1,1.3-1C13,4.2,13.1,4.4,13.2,4.7z M9.1,13.1c0,0.1-0.1,0.1-0.1,0.2c0,0.1,0.1,0.1,0.1,0.1h4.4 c0.3,0,0.4-0.1,0.4-0.3c0-0.1,0-0.2-0.1-0.3l-1.2-3.5c-0.3-0.8-0.8-1.9-0.8-2.7c0-0.1,0-0.1-0.1-0.1c0,0-0.1,0-0.1,0.1 c-0.1,0.6-0.4,1.2-0.7,1.7L9.1,13.1z"}),React.createElement(o.Path,{d:"M21.6,12.5c0,0.6-0.3,1-0.9,1c-0.6,0-0.8-0.3-0.8-0.8c0-0.6,0.4-1,0.9-1C21.3,11.7,21.6,12.1,21.6,12.5z"}),React.createElement(o.Path,{d:"M4.1,12.5c0,0.6-0.3,1-0.9,1s-0.8-0.3-0.8-0.8c0-0.6,0.4-1,0.9-1S4.1,12.1,4.1,12.5z"}))},backup:e=>{let{opacity:t=1,size:n,color:r}=e;return React.createElement(l,{size:n,opacity:t,color:r},React.createElement(o.Path,{d:"M2.1,5.8c0-0.1,0-0.1,0-0.2c0-0.2,0.1-0.5,0.1-0.7c0.1-0.4,0.4-0.6,0.7-0.8l8.3-2.9c0.1-0.1,0.3-0.1,0.4-0.1l0.5,0.1 l8.3,2.9c0.3,0.2,0.5,0.4,0.7,0.7c0.2,0.2,0.2,0.4,0.2,0.7c0,0.1,0,0.1,0,0.2v0.1c-0.1,0.5-0.2,0.9-0.3,1.4 c-0.2,0.4-0.3,1.2-0.7,2.2c-0.3,1-0.7,2.1-1.1,3.1c-0.5,1-1,2.1-1.6,3.3s-1.4,2.3-2.2,3.5c-0.9,1.1-1.8,2.2-2.8,3.1 c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4c-1.2-1.1-2.4-2.4-3.5-4c-1-1.6-1.9-3-2.5-4.3c-0.6-1.3-1.1-2.7-1.6-4 C2.8,8.7,2.5,7.6,2.3,7C2.3,6.5,2.1,6.1,2.1,5.8z M2.9,5.9c0,0.2,0.1,0.4,0.1,0.8C3.1,7,3.2,7.5,3.5,8.2C3.7,9,3.9,9.7,4.2,10.6 c0.3,0.7,0.7,1.7,1.1,2.7c0.4,1,1,2,1.5,2.9c0.5,1,1.2,1.9,1.9,2.9c0.8,1,1.6,1.9,2.4,2.6c0.2,0.2,0.4,0.2,0.5,0.2 c0.2,0,0.4-0.1,0.5-0.2c1.2-1,2.2-2.3,3.2-3.8c1-1.5,1.8-2.8,2.3-4c0.6-1.3,1.1-2.5,1.5-3.9c0.4-1.3,0.7-2.2,0.9-2.8 c0.1-0.5,0.2-1,0.3-1.3c0-0.1,0-0.1,0-0.1c0-0.2,0-0.3-0.1-0.4C20.3,5.2,20.2,5.1,20,5L12,2.1c0,0-0.1,0-0.2,0s-0.1,0-0.1,0h-0.2 l-8,2.8C3.2,5,3.1,5.2,3,5.3C2.9,5.5,2.9,5.6,2.9,5.8C2.9,5.8,2.9,5.8,2.9,5.9z M5.9,6.7h3l2.8,7l2.8-7h3c-0.1,0.1-0.2,0.5-0.3,0.8 C17,7.8,17,8.2,16.8,8.4c-0.1,0.3-0.2,0.5-0.4,0.8c0,0.1-0.1,0.1-0.1,0.1s-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.2,0.1-0.2,0.2c0,0-0.1,0.1-0.1,0.1s-0.1,0.1-0.1,0.1c0,0,0,0.1-0.1,0.2c0,0.1-0.1,0.1-0.1,0.1l-0.4,1.1 c-1.3,3.3-2.1,5.2-2.3,5.8h-2.2l-1-2.4c-0.1-0.3-0.3-0.8-0.5-1.3c-0.1-0.3-0.3-0.8-0.5-1.3L8,10.8c-0.1-0.1-0.1-0.2-0.1-0.4 C7.8,10.2,7.7,10,7.7,9.8C7.6,9.7,7.5,9.5,7.4,9.4C7.3,9.3,7.3,9.3,7.3,9.3c-0.1,0-0.2,0-0.2,0s-0.1,0-0.1,0 C6.6,8.5,6.3,7.6,5.9,6.7z"}))},boost:e=>{let{opacity:t=1,size:n,color:r}=e;return React.createElement(l,{size:n,opacity:t,color:r},React.createElement(o.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.19505 16.2545C4.47368 16.561 4.94802 16.5836 5.25451 16.3049L10.2595 11.7549L14.2842 15.2765L19 10.5607V13.75H20.5V9.5V8.75239V8.7476V8H19.7529H19.7471H19H14.75V9.5H17.9393L14.2158 13.2235L10.2405 9.74507L4.2455 15.195C3.93901 15.4737 3.91642 15.948 4.19505 16.2545Z"}))},crm:e=>{let{opacity:t=1,size:n,color:r}=e;return React.createElement(l,{size:n,opacity:t,color:r},React.createElement(o.Path,{d:"M15.5 9.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm-2.25 6v-2a2.75 2.75 0 0 0-2.75-2.75h-4A2.75 2.75 0 0 0 3.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5Zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0 1 20.25 15ZM9.5 8.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1.5 0a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"}))},extras:e=>{let{opacity:t=1,size:n,color:r}=e;return React.createElement(l,{size:n,opacity:t,color:r},React.createElement(o.Path,{d:"M18.5 5.5V8H20V5.5h2.5V4H20V1.5h-1.5V4H16v1.5h2.5ZM12 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-6h-1.5v6a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h6V4Z"}))},protect:e=>{let{opacity:t=1,size:n,className:r,color:a}=e;return React.createElement(l,{className:r,size:n,opacity:t,color:a},React.createElement(o.Path,{d:"M12 3.17627L18.75 6.24445V10.8183C18.75 14.7173 16.2458 18.4089 12.7147 19.5735C12.2507 19.7265 11.7493 19.7265 11.2853 19.5735C7.75416 18.4089 5.25 14.7173 5.25 10.8183V6.24445L12 3.17627ZM6.75 7.21032V10.8183C6.75 14.1312 8.89514 17.2057 11.7551 18.149C11.914 18.2014 12.086 18.2014 12.2449 18.149C15.1049 17.2057 17.25 14.1312 17.25 10.8183V7.21032L12 4.82396L6.75 7.21032Z"}),React.createElement(o.Path,{d:"M15.5291 10.0315L11.1818 14.358L8.47095 11.66L9.52907 10.5968L11.1818 12.2417L14.4709 8.96826L15.5291 10.0315Z"}))},scan:e=>{let{opacity:t=1,size:n,color:r}=e;return React.createElement(l,{size:n,opacity:t,color:r},React.createElement(o.Path,{d:"m12 3.176 6.75 3.068v4.574c0 3.9-2.504 7.59-6.035 8.755a2.283 2.283 0 0 1-1.43 0c-3.53-1.164-6.035-4.856-6.035-8.755V6.244L12 3.176ZM6.75 7.21v3.608c0 3.313 2.145 6.388 5.005 7.33.159.053.331.053.49 0 2.86-.942 5.005-4.017 5.005-7.33V7.21L12 4.824 6.75 7.21Z"}))},search:e=>{let{opacity:t=1,size:n,color:r}=e;return React.createElement(l,{size:n,opacity:t,color:r},React.createElement(o.Path,{d:"M17.5 11.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm1.5 0a5.5 5.5 0 0 1-9.142 4.121l-3.364 2.943-.988-1.128 3.373-2.952A5.5 5.5 0 1 1 19 11.5Z"}))},social:e=>{let{opacity:t=1,size:n,color:r}=e;return React.createElement(l,{size:n,opacity:t,color:r},React.createElement(o.Path,{d:"M15.5 3.97809V18.0219L7.5 15.5977V20H6V15.1431L3.27498 14.3173C2.22086 13.9979 1.5 13.0262 1.5 11.9248V10.0752C1.5 8.97375 2.22087 8.00207 3.27498 7.68264L15.5 3.97809ZM14 16L7.5 14.0303L7.5 7.96969L14 5.99999V16ZM6 8.42423L6 13.5757L3.70999 12.8818C3.28835 12.754 3 12.3654 3 11.9248V10.0752C3 9.63462 3.28835 9.24595 3.70999 9.11818L6 8.42423ZM17.5 11.75H21.5V10.25H17.5V11.75ZM21.5 16L17.5 15V13.5L21.5 14.5V16ZM17.5 8.5L21.5 7.5V6L17.5 7V8.5Z"}))},star:e=>{let{size:t,className:n=c.Z["star-icon"],color:r}=e;return React.createElement(l,{className:n,size:t,color:r},React.createElement(o.Path,{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"}))},videopress:e=>{let{opacity:t=1,size:n,color:r}=e;return React.createElement(l,{size:n,opacity:t,color:r},React.createElement(o.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.3,6.2c0.8,0,1.6,0.6,1.8,1.4l2.3,7.9c0,0,0,0,0,0l2.7-9.3h1.5h4.2c2.9,0,4.9,1.9,4.9,4.7c0,2.9-2,4.7-5,4.7 h-2h-2.5l-0.5,1.5c-0.4,1.4-1.7,2.3-3.2,2.3c-1.4,0-2.7-0.9-3.2-2.3L2.5,8.7C2.1,7.4,3,6.2,4.3,6.2z M13,12.8h2.9c1.3,0,2-0.7,2-1.9 c0-1.2-0.8-1.8-2-1.8h-1.7L13,12.8z"}))},jetpack:e=>{let{size:t,className:n=c.Z.jetpack,color:r}=e;return React.createElement(l,{className:n,size:t,color:r,viewBox:"0 0 32 32"},React.createElement(o.Path,{className:"jetpack-logo__icon-circle",d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z"}),React.createElement(o.Polygon,{fill:"#fff",points:"15,19 7,19 15,3"}),React.createElement(o.Polygon,{fill:"#fff",points:"17,29 17,13 25,13"}))}},...{facebook:e=>{let{fill:t,size:n,className:r}=e;return React.createElement(u,{fill:t,size:n,className:s()(c.Z.facebook,r)},React.createElement(o.Path,{d:"M12,2C6.5,2,2,6.5,2,12c0,5,3.7,9.1,8.4,9.9v-7H7.9V12h2.5V9.8c0-2.5,1.5-3.9,3.8-3.9c1.1,0,2.2,0.2,2.2,0.2v2.5h-1.3 c-1.2,0-1.6,0.8-1.6,1.6V12h2.8l-0.4,2.9h-2.3v7C18.3,21.1,22,17,22,12C22,6.5,17.5,2,12,2z"}))},instagram:e=>{let{fill:t,size:n,className:r}=e;return React.createElement(u,{fill:t,size:n,className:s()(c.Z.instagram,r)},React.createElement(o.Path,{d:"M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"}))},twitter:e=>{let{fill:t,size:n,className:r}=e;return React.createElement(u,{fill:t,size:n,className:s()(c.Z.twitter,r)},React.createElement(o.Path,{d:"M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"}))},linkedin:e=>{let{fill:t,size:n,className:r}=e;return React.createElement(u,{fill:t,size:n,className:s()(c.Z.linkedin,r)},React.createElement(o.Path,{d:"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"}))},tumblr:e=>{let{fill:t,size:n,className:r,invert:a}=e;return React.createElement(u,{fill:t,size:n,className:s()(c.Z.tumblr,r)},a?React.createElement(o.Path,{d:"M19 3H5c-1.105 0-2 .895-2 2v14c0 1.105.895 2 2 2h14c1.105 0 2-.895 2-2V5c0-1.105-.895-2-2-2zm-5.57 14.265c-2.445.042-3.37-1.742-3.37-2.998V10.6H8.922V9.15c1.703-.615 2.113-2.15 2.21-3.026.006-.06.053-.084.08-.084h1.645V8.9h2.246v1.7H12.85v3.495c.008.476.182 1.13 1.08 1.107.3-.008.698-.094.907-.194l.54 1.6c-.205.297-1.12.642-1.946.657z"}):React.createElement(o.Path,{d:"M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"}))},google:e=>{let{fill:t,size:n,className:r}=e;return React.createElement(u,{fill:t,size:n,className:s()(c.Z.google,r)},React.createElement(o.Path,{d:"M12.02 10.18v3.73h5.51c-.26 1.57-1.67 4.22-5.5 4.22-3.31 0-6.01-2.75-6.01-6.12s2.7-6.12 6.01-6.12c1.87 0 3.13.8 3.85 1.48l2.84-2.76C16.99 2.99 14.73 2 12.03 2c-5.52 0-10 4.48-10 10s4.48 10 10 10c5.77 0 9.6-4.06 9.6-9.77 0-.83-.11-1.42-.25-2.05h-9.36z"}))},mastodon:e=>{let{fill:t,size:n,className:r}=e;return React.createElement(u,{fill:t,size:n,className:s()(c.Z.mastodon,r)},React.createElement(o.Path,{d:"M 19.997205,6.2868955 C 19.729197,4.3162778 17.992912,2.7633017 15.93468,2.4623753 15.587434,2.4115195 14.271759,2.2264681 11.224008,2.2264681 h -0.02277 c -3.0485688,0 -3.7026204,0.1850577 -4.0498676,0.2359072 C 5.1504449,2.7549655 3.3231548,4.1503966 2.879815,6.1443318 2.6665754,7.1263038 2.6438193,8.2149794 2.6834329,9.2136207 c 0.056471,1.4321143 0.067433,2.8617113 0.1989115,4.2879943 0.090908,0.947406 0.2494696,1.887266 0.4745239,2.812521 0.4214237,1.708868 2.1273496,3.130966 3.7987144,3.71116 1.7894479,0.605052 3.7138403,0.705478 5.5577463,0.290088 0.202828,-0.04667 0.403445,-0.100873 0.601781,-0.162549 0.447558,-0.140863 0.972662,-0.298434 1.358683,-0.575188 0.0052,-0.004 0.0097,-0.0089 0.01266,-0.01471 0.0031,-0.0056 0.0047,-0.01218 0.005,-0.01866 v -1.382076 c -9.4e-5,-0.006 -0.0016,-0.01202 -0.0043,-0.01754 -0.0027,-0.0054 -0.0067,-0.01028 -0.01155,-0.01392 -0.0049,-0.0038 -0.01044,-0.0063 -0.01648,-0.0078 -0.006,-0.0013 -0.01218,-0.0013 -0.01825,7.1e-5 -1.181368,0.279106 -2.391962,0.419012 -3.606552,0.416801 -2.0902554,0 -2.6524392,-0.981126 -2.8134375,-1.3896 -0.1293933,-0.353009 -0.2115739,-0.721231 -0.2444221,-1.095331 -3.29e-4,-0.0063 8.463e-4,-0.0125 0.00348,-0.01832 0.00253,-0.0056 0.00649,-0.01077 0.011389,-0.01471 0.0049,-0.004 0.010755,-0.0068 0.016957,-0.0081 0.00617,-0.0014 0.012655,-0.0012 0.018808,3.52e-4 1.1616831,0.277201 2.3525266,0.417106 3.5475526,0.416801 0.287408,0 0.573966,0 0.861395,-0.0074 1.201893,-0.03335 2.468685,-0.0942 3.6512,-0.322606 0.02952,-0.0058 0.059,-0.01091 0.0843,-0.01833 1.865209,-0.354279 3.640245,-1.466278 3.820617,-4.282163 0.0068,-0.110869 0.0236,-1.161191 0.0236,-1.276219 8.46e-4,-0.390958 0.127273,-2.7733487 -0.01856,-4.2371335 z m -2.87074,7.0263315 H 15.165179 V 8.5617567 c 0,-1.0003116 -0.421434,-1.5104614 -1.278618,-1.5104614 -0.942305,0 -1.414292,0.6035217 -1.414292,1.7955379 V 11.44764 H 10.522764 V 8.8468332 c 0,-1.1920162 -0.472832,-1.7955379 -1.4151372,-1.7955379 -0.8521293,0 -1.2777701,0.5101498 -1.2786179,1.5104614 V 13.313227 H 5.8693944 V 8.4175496 c 0,-1.0003133 0.2582014,-1.7949986 0.7745804,-2.3840846 0.5326766,-0.587672 1.2314038,-0.8894211 2.0986981,-0.8894211 1.003817,0 1.7623841,0.3817657 2.2680911,1.1445204 l 0.488023,0.8102521 0.488846,-0.8102521 c 0.505705,-0.7627547 1.264275,-1.1445204 2.26642,-1.1445204 0.866449,0 1.565152,0.3017491 2.099521,0.8894211 0.516404,0.5885211 0.774583,1.3832066 0.774583,2.3840846 z"}))}}};const p=e=>{let{serviceName:t,className:n,invert:r}=e;const a=d[o=t]?d[o]:null;var o;return a?React.createElement(a,{className:n,invert:r}):null}},78868:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(65736),i=n(65235),s=n.n(i),c=n(99196),l=n.n(c);const __=o.__;t.Z=e=>{let{logoColor:t="#069e08",showText:n=!0,className:r,height:o=32,...i}=e;const c=n?"0 0 118 32":"0 0 32 32";return l().createElement("svg",a()({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:c,className:s()("jetpack-logo",r),"aria-labelledby":"jetpack-logo-title",height:o},i),l().createElement("desc",{id:"jetpack-logo-title"},__("Jetpack Logo","jetpack")),l().createElement("path",{fill:t,d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"}),n&&l().createElement(l().Fragment,null,l().createElement("path",{d:"M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z"}),l().createElement("path",{d:"M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z"}),l().createElement("path",{d:"M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z"}),l().createElement("path",{d:"M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z"}),l().createElement("path",{d:"M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5V13 c-0.8-0.3-2-0.6-3.2-0.6c-1.7,0-3.2,0.9-3.2,3.6c0,2.9,1.5,3.8,3.3,3.8c0.9,0,1.9-0.2,3.2-0.7V21.3z"}),l().createElement("path",{d:"M110,15.2c0.2-0.3,0.2-0.8,3.8-5.2h3.7l-4.6,5.7l5,6.3h-3.7l-4.2-5.8V22h-3V6h3V15.2z"}),l().createElement("path",{d:"M58.5,21.3c-1.5,0.5-2.7,0.6-4.2,0.6c-3.6,0-5.8-1.8-5.8-6c0-3.1,1.9-5.9,5.5-5.9s4.9,2.5,4.9,4.9c0,0.8,0,1.5-0.1,2h-7.3 c0.1,2.5,1.5,2.8,3.6,2.8c1.1,0,2.2-0.3,3.4-0.7C58.5,19,58.5,21.3,58.5,21.3z M56,15c0-1.4-0.5-2.9-2-2.9c-1.4,0-2.3,1.3-2.4,2.9 C51.6,15,56,15,56,15z"})))}},32054:function(e,t,n){"use strict";var r=n(94333),a=n(49710);const o=["sm","md","lg"];t.Z=(e,t)=>{const n=Array.isArray(e)?e:[e],i=Array.isArray(t)?t:[t],[s,c,l]=o,u={sm:(0,r.useMediaQuery)(a.Z[s]),md:(0,r.useMediaQuery)(a.Z[c]),lg:(0,r.useMediaQuery)(a.Z[l])};return n.map(((e,t)=>{const n=i[t];return n?((e,t,n)=>{const r=o.indexOf(e),a=r+1,i=t.includes("=");let s=[];return t.startsWith("<")&&(s=o.slice(0,i?a:r)),t.startsWith(">")&&(s=o.slice(i?r:a)),s?.length?s.some((e=>n[e])):n[e]})(e,n,u):u[e]}))}},22636:function(e,t,n){"use strict";var r=n(65235),a=n.n(r),o=n(99196),i=n.n(o),s=n(46409);t.Z=e=>{let{children:t=null,width:n=null,height:r=null,className:o=""}=e;return i().createElement("div",{className:a()(s.Z.placeholder,o),style:{width:n,height:r}},t)}},52947:function(e,t,n){"use strict";var r=n(98709);t.Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(0,r.X)();return new Intl.NumberFormat(n,t).format(e)}},49777:function(e,t,n){"use strict";var r=n(28918);t.Z=e=>{let{value:t="https://jetpack.com",bgColor:n,fgColor:a,level:o,includeMargin:i,imageSettings:s,renderAs:c="canvas",size:l=248}=e;return React.createElement(r.ZP,{value:t,size:l,bgColor:n,fgColor:a,level:o,includeMargin:i,imageSettings:s,renderAs:c})}},45033:function(e,t,n){"use strict";var r=n(25162),a=n.n(r),o=n(99196),i=n.n(o);n(48026);const s=e=>{const t=e.className+" jp-components-spinner",n={width:e.size,height:e.size,fontSize:e.size,borderTopColor:e.color},r={borderTopColor:e.color,borderRightColor:e.color};return i().createElement("div",{className:t},i().createElement("div",{className:"jp-components-spinner__outer",style:n},i().createElement("div",{className:"jp-components-spinner__inner",style:r})))};s.propTypes={color:a().string,className:a().string,size:a().number},s.defaultProps={color:"#FFFFFF",className:"",size:20},t.Z=s},88275:function(e,t,n){"use strict";var r=n(99196),a=n.n(r),o=n(93468);const i={"--font-headline-medium":"48px","--font-headline-small":"36px","--font-title-medium":"24px","--font-title-small":"20px","--font-body":"16px","--font-body-small":"14px","--font-body-extra-small":"12px","--font-title-large":"var(--font-headline-small)","--font-label":"var(--font-body-extra-small)"},s={"--jp-black":"#000000","--jp-black-80":"#2c3338","--jp-white":"#ffffff","--jp-white-off":"#f9f9f6","--jp-gray":"#dcdcde","--jp-gray-0":"#F6F7F7","--jp-gray-10":"#C3C4C7","--jp-gray-20":"#A7AAAD","--jp-gray-40":"#787C82","--jp-gray-50":"#646970","--jp-gray-60":"#50575E","--jp-gray-70":"#3C434A","--jp-gray-80":"#2C3338","--jp-gray-90":"#1d2327","--jp-gray-off":"#e2e2df","--jp-red-0":"#F7EBEC","--jp-red-5":"#FACFD2","--jp-red-40":"#E65054","--jp-red-50":"#D63638","--jp-red-60":"#B32D2E","--jp-red-70":"#8A2424","--jp-red-80":"#691C1C","--jp-red":"#d63639","--jp-yellow-5":"#F5E6B3","--jp-yellow-10":"#F2CF75","--jp-yellow-20":"#F0C930","--jp-yellow-30":"#DEB100","--jp-yellow-40":"#C08C00","--jp-yellow-50":"#9D6E00","--jp-yellow-60":"#7D5600","--jp-blue-20":"#68B3E8","--jp-blue-40":"#1689DB","--jp-pink":"#C9356E","--jp-green-0":"#f0f2eb","--jp-green-5":"#d0e6b8","--jp-green-10":"#9dd977","--jp-green-20":"#64ca43","--jp-green-30":"#2fb41f","--jp-green-40":"#069e08","--jp-green-50":"#008710","--jp-green-60":"#007117","--jp-green-70":"#005b18","--jp-green-80":"#004515","--jp-green-90":"#003010","--jp-green-100":"#001c09","--jp-green":"#069e08","--jp-green-primary":"var( --jp-green-40 )","--jp-green-secondary":"var( --jp-green-30 )"},c={"--jp-border-radius":"4px","--jp-menu-border-height":"1px","--jp-underline-thickness":"2px"},l={"--spacing-base":"8px"},u={},d=(e,t,n)=>{const r={...i,...s,...c,...l};for(const t in r)e.style.setProperty(t,r[t]);n&&e.classList.add(o.Z.global),t&&(u[t]={provided:!0,root:e})};t.ZP=e=>{let{children:t=null,targetDom:n,id:o,withGlobalStyles:i=!0}=e;const s=(0,r.useRef)(),c=u?.[o]?.provided;return(0,r.useLayoutEffect)((()=>{if(!c)return n?d(n,o,i):void(s?.current&&d(s.current,o,i))}),[n,s,c,o,i]),n?t:a().createElement("div",{ref:s},t)}},98709:function(e,t,n){"use strict";n.d(t,{X:function(){return a}});var r=n(69771);const a=()=>{const{l10n:{locale:e}}=(0,r.getSettings)();if(e)return(e=>{const t=e.match(/^([a-z]{2,3})(_[a-z]{2}|_[a-z][a-z0-9]{4,7})?(?:_.*)?$/i);return t?`${t[1]}${t[2]?t[2]:""}`.replace("_","-"):"en-US"})(e);return window?.window?.navigator?.language??"en-US"}},6895:function(e,t,n){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={};let r;if("undefined"!=typeof window&&(r=window?.JP_CONNECTION_INITIAL_STATE?.calypsoEnv),0===e.search("https://")){const t=new URL(e);e=`https://${t.host}${t.pathname}`,n.url=encodeURIComponent(e)}else n.source=encodeURIComponent(e);for(const e in t)n[e]=encodeURIComponent(t[e]);!Object.keys(n).includes("site")&&"undefined"!=typeof jetpack_redirects&&jetpack_redirects.hasOwnProperty("currentSiteRawUrl")&&(n.site=jetpack_redirects.currentSiteRawUrl),r&&(n.calypso_env=r);return"https://jetpack.com/redirect/?"+Object.keys(n).map((e=>e+"="+n[e])).join("&")}n.d(t,{Z:function(){return r}})},61132:function(e,t,n){let r={};try{r=n(92787)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),r={missingConfig:!0}}const a=e=>r.hasOwnProperty(e);e.exports={jetpackConfigHas:a,jetpackConfigGet:e=>{if(!a(e))throw'This app requires the "'+e+'" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';return r[e]}}},31294:function(e,t,n){"use strict";var r=n(64743),a=n(9818),o=n(99196),i=n(80428);const s=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};t.Z=function(){let{registrationNonce:e=s.registrationNonce,apiRoot:t=s.apiRoot,apiNonce:n=s.apiNonce,redirectUri:c,autoTrigger:l,from:u,skipUserConnection:d}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{registerSite:p,connectUser:m,refreshConnectedPlugins:h}=(0,a.useDispatch)(i.t),g=(0,a.useSelect)((e=>e(i.t).getRegistrationError())),{siteIsRegistering:f,userIsConnecting:b,userConnectionData:v,connectedPlugins:k,connectionErrors:y,isRegistered:w,isUserConnected:E,hasConnectedOwner:_,isOfflineMode:C}=(0,a.useSelect)((e=>({siteIsRegistering:e(i.t).getSiteIsRegistering(),userIsConnecting:e(i.t).getUserIsConnecting(),userConnectionData:e(i.t).getUserConnectionData(),connectedPlugins:e(i.t).getConnectedPlugins(),connectionErrors:e(i.t).getConnectionErrors(),isOfflineMode:e(i.t).getIsOfflineMode(),...e(i.t).getConnectionStatus()}))),j=()=>d?c?(window.location=c,Promise.resolve(c)):Promise.resolve():m({from:u,redirectUri:c}),S=t=>(t&&t.preventDefault(),w?j():p({registrationNonce:e,redirectUri:c}).then((()=>j())));return(0,o.useEffect)((()=>{r.ZP.setApiRoot(t),r.ZP.setApiNonce(n)}),[t,n]),(0,o.useEffect)((()=>{!l||f||b||S()}),[]),{handleRegisterSite:S,handleConnectUser:j,refreshConnectedPlugins:h,isRegistered:w,isUserConnected:E,siteIsRegistering:f,userIsConnecting:b,registrationError:g,userConnectionData:v,hasConnectedOwner:_,connectedPlugins:k,connectionErrors:y,isOfflineMode:C}}},27523:function(e,t,n){"use strict";n.d(t,{LI:function(){return o},N4:function(){return s},Qo:function(){return d},T1:function(){return l},TS:function(){return u},ZP:function(){return E},b5:function(){return m},i6:function(){return a},qJ:function(){return h},qV:function(){return c},r7:function(){return i},wQ:function(){return p}});var r=n(64743);const a="SET_CONNECTION_STATUS",o="SET_CONNECTION_STATUS_IS_FETCHING",i="SET_SITE_IS_REGISTERING",s="SET_USER_IS_CONNECTING",c="SET_REGISTRATION_ERROR",l="CLEAR_REGISTRATION_ERROR",u="SET_AUTHORIZATION_URL",d="DISCONNECT_USER_SUCCESS",p="SET_CONNECTED_PLUGINS",m="SET_CONNECTION_ERRORS",h="SET_IS_OFFLINE_MODE",g=e=>({type:a,connectionStatus:e}),f=e=>({type:i,isRegistering:e}),b=e=>({type:s,isConnecting:e}),v=e=>({type:c,registrationError:e}),k=()=>({type:l}),y=e=>({type:u,authorizationUrl:e}),w=e=>({type:p,connectedPlugins:e});const E={setConnectionStatus:g,setConnectionStatusIsFetching:e=>({type:o,isFetching:e}),fetchConnectionStatus:()=>({type:"FETCH_CONNECTION_STATUS"}),fetchAuthorizationUrl:e=>({type:"FETCH_AUTHORIZATION_URL",redirectUri:e}),setSiteIsRegistering:f,setUserIsConnecting:b,setRegistrationError:v,clearRegistrationError:k,setAuthorizationUrl:y,registerSite:function(e){let{registrationNonce:t,redirectUri:n}=e;return function*(){yield k(),yield f(!0);try{const e=yield{type:"REGISTER_SITE",registrationNonce:t,redirectUri:n};return yield g({isRegistered:!0}),yield y(e.authorizeUrl),yield f(!1),Promise.resolve(e)}catch(e){return yield v(e),yield f(!1),Promise.reject(e)}}()},connectUser:function(){let{from:e,redirectFunc:t,redirectUri:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){yield b(!0),yield{type:"CONNECT_USER",from:e,redirectFunc:t,redirectUri:n}}()},disconnectUserSuccess:()=>({type:d}),setConnectedPlugins:w,refreshConnectedPlugins:()=>async e=>{let{dispatch:t}=e;return await new Promise((e=>r.ZP.fetchConnectedPlugins().then((n=>{t(w(n)),e(n)}))))},setConnectionErrors:e=>({type:m,connectionErrors:e}),setIsOfflineMode:e=>({type:h,isOfflineMode:e})}},31432:function(e,t,n){"use strict";var r=n(64743),a=n(9818),o=n(27057);const i=(0,a.createRegistryControl)((e=>{let{resolveSelect:t}=e;return function(){let{from:e,redirectFunc:n,redirectUri:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(((a,i)=>{t(o.Z).getAuthorizationUrl(r).then((t=>{const r=n||(e=>window.location.assign(e)),o=new URL(t);e&&o.searchParams.set("from",encodeURIComponent(e));const i=o.toString();r(i),a(i)})).catch((e=>{i(e)}))}))}}));t.Z={FETCH_AUTHORIZATION_URL:e=>{let{redirectUri:t}=e;return r.ZP.fetchAuthorizationUrl(t)},REGISTER_SITE:e=>{let{registrationNonce:t,redirectUri:n}=e;return r.ZP.registerSite(t,n)},CONNECT_USER:i}},41479:function(e,t,n){"use strict";var r=n(9818),a=n(27523);const o=(0,r.combineReducers)({connectionStatus:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case a.i6:return{...e,...t.connectionStatus};case a.Qo:return{...e,isUserConnected:!1}}return e},connectionStatusIsFetching:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===a.LI?t.isFetching:e},siteIsRegistering:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===a.r7?t.isRegistering:e},userIsConnecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===a.N4?t.isConnecting:e},registrationError:(e,t)=>{switch(t.type){case a.T1:return!1;case a.qV:return t.registrationError;default:return e}},authorizationUrl:(e,t)=>t.type===a.TS?t.authorizationUrl:e,userConnectionData:(e,t)=>(t.type,e),connectedPlugins:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===a.wQ?t.connectedPlugins:e},connectionErrors:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===a.b5?t.connectionErrors:e},isOfflineMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===a.qJ?t.isConnecting:e}});t.Z=o},77728:function(e,t,n){"use strict";var r=n(9818),a=n(27523),o=n(27057);const i={getAuthorizationUrl:{isFulfilled:function(e){const t=Boolean(e.authorizationUrl);for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;ie.connectionStatus||{},getConnectionStatusIsFetching:()=>!1,getSiteIsRegistering:e=>e.siteIsRegistering||!1,getUserIsConnecting:e=>e.userIsConnecting||!1,getRegistrationError:e=>e.registrationError||!1,getAuthorizationUrl:e=>e.authorizationUrl||!1,getUserConnectionData:e=>e.userConnectionData||!1,getConnectedPlugins:e=>e.connectedPlugins||[],getConnectionErrors:e=>e.connectionErrors||[],getIsOfflineMode:e=>e.isOfflineMode||!1,getWpcomUser:e=>e?.userConnectionData?.currentUser?.wpcomUser,getBlogId:e=>e?.userConnectionData?.currentUser?.blogId}};t.Z=n},13535:function(e,t,n){"use strict";var r=n(9818);class a{static store=null;static mayBeInit(e,t){null===a.store&&(a.store=(0,r.createReduxStore)(e,t),(0,r.register)(a.store))}}t.Z=a},27057:function(e,t){"use strict";t.Z="jetpack-connection"},80428:function(e,t,n){"use strict";n.d(t,{t:function(){return l.Z}});var r=n(27523),a=n(31432),o=n(41479),i=n(77728),s=n(82725),c=n(13535),l=n(27057);const u=window.JP_CONNECTION_INITIAL_STATE;u||console.error("Jetpack Connection package: Initial state is missing. Check documentation to see how to use the Connection composer package to set up the initial state."),c.Z.mayBeInit(l.Z,{__experimentalUseThunks:!0,reducer:o.Z,actions:r.ZP,selectors:s.Z,resolvers:i.Z,controls:a.Z,initialState:u||{}})},74356:function(e,t,n){"use strict";n.d(t,{$R:function(){return c.Z},$S:function(){return s.Z},Nh:function(){return u.Z},i$:function(){return i.Z},iS:function(){return r.ZP},mJ:function(){return o.Z},oL:function(){return l.Z},pD:function(){return a.Z}});n(77771),n(23177),n(4277),n(49021),n(95788);var r=n(68407),a=(n(63609),n(8454)),o=n(74140),i=n(54005),s=(n(8350),n(76848),n(92116),n(79631),n(8714)),c=(n(19649),n(52403)),l=n(37568),u=(n(48751),n(14085));n(45579),n(75323),n(91474),n(86419)},92116:function(e,t,n){"use strict";n(9818),n(69307),n(99196),n(23177)},85761:function(e,t,n){"use strict";var r=n(3396),a=n(69307),o=n(65235),i=n.n(o),s=n(25162),c=n.n(s);const l=e=>{const{checked:t,serviceName:n,label:o,onClick:s,profilePicture:c}=e,[l,u]=(0,a.useState)(!!c),d=(0,a.useCallback)((()=>u(!1)),[]),p=(0,a.useCallback)((e=>{13===e.keyCode&&s()}),[s]);return React.createElement("div",{onClick:s,onKeyDown:p,role:"switch","aria-checked":t,tabIndex:"0",className:i()("components-connection-icon",{"components-connection-icon__picture":l})},l&&React.createElement("img",{src:c,alt:o,onError:d}),React.createElement(r.av,{alt:o,serviceName:"instagram-business"===n?"instagram":n,className:"jetpack-publicize-gutenberg-social-icon",invert:"tumblr"===n}))};l.propTypes={serviceName:c().string,label:c().string,profilePicture:c().string},t.Z=l},24479:function(e,t,n){"use strict";var r=n(65235),a=n.n(r),o=n(25162),i=n.n(o),s=n(85761);const c=e=>{const{checked:t,disabled:n,onChange:r,serviceName:o,label:i,profilePicture:c}=e,l=a()("components-connection-toggle",{"is-not-checked":!t,"is-disabled":n});return React.createElement("div",{className:l,title:i},React.createElement(s.Z,{checked:t,label:i,onClick:r,serviceName:o,profilePicture:c}))};c.propTypes={className:i().string,checked:i().bool,id:i().string.isRequired,disabled:i().bool,onChange:i().func,serviceName:i().string,label:i().string,profilePicture:i().string},t.Z=c},49021:function(e,t,n){"use strict";var r=n(55609),a=n(94333),o=n(9818),i=n(69307),s=n(65736);const __=s.__;class c extends i.Component{componentDidMount(){this.props.refreshConnections()}refreshConnectionClick=e=>{const{href:t,title:n}=e.target;e.preventDefault();const r=window.open(t,n,""),a=window.setInterval((()=>{!1!==r.closed&&(window.clearInterval(a),this.props.refreshConnections())}),500)};renderRefreshableConnections(){const{failedConnections:e}=this.props,t=e.filter((e=>e.can_refresh));return t.length?React.createElement(r.Notice,{className:"jetpack-publicize-notice",isDismissible:!1,status:"error"},React.createElement("p",null,__("Before you hit Publish, please refresh the following connection(s) to make sure we can share your post:","jetpack")),t.map((e=>React.createElement(r.Button,{href:e.refresh_url,isSmall:!0,key:e.id,onClick:this.refreshConnectionClick,title:e.refresh_text},e.refresh_text)))):null}renderNonRefreshableConnections(){const{failedConnections:e}=this.props,t=e.filter((e=>!e.can_refresh));return t.length?t.map((e=>React.createElement(r.Notice,{className:"jetpack-publicize-notice",isDismissible:!1,status:"error"},React.createElement("p",null,e.test_message)))):null}render(){return React.createElement(i.Fragment,null,this.renderRefreshableConnections(),this.renderNonRefreshableConnections())}}t.Z=(0,a.compose)([(0,o.withSelect)((e=>({failedConnections:e("jetpack/publicize").getFailedConnections()}))),(0,o.withDispatch)((e=>({refreshConnections:e("jetpack/publicize").refreshConnectionTestResults})))])(c)},4277:function(e,t,n){"use strict";var r=n(13419),a=n(55609),o=n(9818),i=n(69307),s=n(65736),c=n(92819),l=n(24479),u=n(28161),d=n(91853);const __=s.__;class p extends i.Component{maybeDisplayLinkedInNotice=()=>this.connectionNeedsReauth()&&React.createElement(a.Notice,{className:u.Z["publicize-notice"],isDismissible:!1,status:"error"},React.createElement("p",null,__("Your LinkedIn connection needs to be reauthenticated to continue working – head to Sharing to take care of it.","jetpack")),React.createElement(a.ExternalLink,{href:`https://wordpress.com/marketing/connections/${(0,r.lQ)()}`},__("Go to Sharing settings","jetpack")));connectionNeedsReauth=()=>(0,c.includes)(this.props.mustReauthConnections,this.props.name);onConnectionChange=()=>{const{id:e}=this.props;this.props.toggleConnection(e)};connectionIsFailing(){const{failedConnections:e,name:t}=this.props;return e.some((e=>e.service_name===t))}render(){const{disabled:e,enabled:t,id:n,label:r,name:a,profilePicture:o}=this.props,i="connection-"+a+"-"+n,s=a.replace("_","-"),c=React.createElement(l.Z,{id:i,className:d.Z["connection-toggle"],checked:t,onChange:this.onConnectionChange,disabled:e||this.connectionIsFailing()||this.connectionNeedsReauth(),serviceName:s,label:r,profilePicture:o});return React.createElement("li",null,this.maybeDisplayLinkedInNotice(),React.createElement("div",{className:d.Z["connection-container"]},c))}}t.Z=(0,o.withSelect)((e=>({failedConnections:e("jetpack/publicize").getFailedConnections(),mustReauthConnections:e("jetpack/publicize").getMustReauthConnections()})))(p)},95788:function(e,t,n){"use strict";n.d(t,{Z:function(){return P}});var r=n(6895),a=n(13419),o=n(55609),i=n(9818),s=n(69307),c=n(65736),l=n(88219),u=n(75323),d=n(39118),p=n(75263),m=n(98811),h=n(46791),g=n(6230),f=n(37568),b=n(48751),v=n(23177),k=n(4277),y=n(29753),w=n(71961),E=n(62578),_=n(69709),C=n(75631);const _n=c._n,__=c.__,j="jetpack/publicize",S=2592e3,x=(e,t)=>!1===e.is_healthy&&t===(e.error_code??"broken");function P(e){let{isPublicizeEnabled:t,isPublicizeDisabledBySitePlan:n,numberOfSharesRemaining:P=null,isEnhancedPublishingEnabled:N=!1,shouldShowAdvancedPlanNudge:L=!1,isSocialImageGeneratorAvailable:T=!1,jetpackSharingSettingsUrl:A,connectionsAdminUrl:R,adminUrl:I}=e;const{connections:M,toggleById:Z,hasConnections:B,enabledConnections:D}=(0,f.Z)(),{message:F,updateMessage:z,maxLength:O}=(0,b.Z)(),{isEnabled:U}=(0,p.Z)(),{dismissNotice:H,shouldShowNotice:V,NOTICES:G}=(0,u.Z)(),{isInstagramConnectionSupported:$}=(0,i.useSelect)((e=>({isInstagramConnectionSupported:e(j).isInstagramConnectionSupported()}))),q=!M.some((e=>"instagram-business"===e.service_name))&&$&&V(G.instagram),W=(0,s.useCallback)((()=>{H(G.instagram)}),[H,G]),J=T&&U,K=n?o.Disabled:s.Fragment,X=M.filter((e=>x(e,"broken"))),Y=M.filter((e=>x(e,"unsupported"))),Q=null!==P&&P<=D.length,{isEditedPostDirty:ee}=(0,i.useSelect)("core/editor"),{autosave:te}=(0,i.useDispatch)("core/editor"),ne=(0,s.useCallback)((async e=>{const t=e.target.getAttribute("target");ee()&&!t&&(e.preventDefault(),await te(),window.location.href=e.target.href),t&&(e.preventDefault(),window.open(e.target.href,t,"noreferrer"))}),[te,ee]),re=(0,s.useCallback)((()=>H(G.advancedUpgradeEditor,3*S)),[H,G]),ae=(0,s.useCallback)((()=>H(G.autoConversion)),[H,G]),oe=(0,i.useSelect)((e=>e(v.E).isAutoConversionEnabled()),[]),{attachedMedia:ie,shouldUploadAttachedMedia:se}=(0,l.Z)(),ce=(0,d.Z)(),le=ie[0]?.id||ce,{validationErrors:ue,isConvertible:de}=(0,h.ZP)(M,(0,m.Z)(le)[0],{isSocialImageGeneratorEnabledForPost:U,shouldUploadAttachedMedia:se}),pe=oe&&de,me=(0,s.useMemo)((()=>Object.keys(ue)),[ue]),he=0!==P&&me.length>0,ge=(0,s.useCallback)((e=>{let{enabled:t,is_healthy:r=!0,connection_id:a}=e;return t&&!n&&!1!==r&&(!ue[a]||pe)&&ue[a]!==h.rs}),[n,ue,pe]),{refreshAutoConversionSettings:fe}=(0,g.Z)();pe&&he&&le&&V(G.autoConversion)&&fe();return React.createElement(K,null,B&&React.createElement(React.Fragment,null,React.createElement(o.PanelRow,null,React.createElement("ul",{className:C.Z["connections-list"]},M.map((e=>{const{display_name:n,enabled:r,id:a,service_name:o,toggleable:i,profile_picture:s,is_healthy:c,connection_id:l}=e,u=l||a;return React.createElement(k.Z,{disabled:!t||!r&&i&&Q||!1===c||void 0!==ue[u]&&!pe||ue[u]===h.rs,enabled:ge(e),key:u,id:u,label:n,name:o,toggleConnection:Z,profilePicture:s})})),React.createElement("li",null,React.createElement(_.Z,null)))),null!==P&&React.createElement(o.PanelRow,null,React.createElement(E.Z,{type:PUpgrade now to share more.","You have %d shares remaining in the next 30 days. Upgrade now to share more.",P,"jetpack"),P),{upgradeLink:React.createElement("a",{className:C.Z["upgrade-link"],href:(0,r.Z)("jetpack-social-basic-plan-block-editor",{site:(0,a.lQ)(),query:"redirect_to="+encodeURIComponent(window.location.href)}),onClick:ne})}),React.createElement("br",null),React.createElement("a",{className:C.Z["more-link"],href:(0,r.Z)("jetpack-social-block-editor-more-info",{site:(0,a.lQ)(),...I?{query:"redirect_to="+encodeURIComponent(I)}:{}}),target:"_blank",rel:"noopener noreferrer",onClick:ne},__("More about Jetpack Social.","jetpack"))))),React.createElement(React.Fragment,null,X.length>0&&React.createElement(E.Z,{type:"error"},(0,s.createInterpolateElement)(_n("One of your social connections is broken. Reconnect them on the connection management page.","Some of your social connections are broken. Reconnect them on the connection management page.",X.length,"jetpack"),{fixLink:React.createElement(o.ExternalLink,{href:R})})),Y.length>0&&React.createElement(E.Z,{type:"error"},(0,s.createInterpolateElement)(__("Twitter is not supported anymore. Learn more here.","jetpack"),{moreInfo:React.createElement(o.ExternalLink,{href:R})})),pe&&he&&le&&V(G.autoConversion)&&React.createElement(E.Z,{type:"warning",actions:[React.createElement(o.Button,{onClick:ae,key:"dismiss",variant:"primary"},__("Got it","jetpack")),React.createElement(o.Button,{className:C.Z["change-settings-button"],key:"change-settings",href:I||A,target:"_blank",rel:"noreferrer noopener"},__("Change settings","jetpack"))]},__("When your post is published, the selected image will be converted for maximum compatibility across your connected social networks.","jetpack"))),he&&(Object.values(ue).includes(h.rs)?N?React.createElement(E.Z,{type:"warning"},__("To share to Instagram, add an image/video, or enable Social Image Generator.","jetpack"),React.createElement("br",null),React.createElement(o.ExternalLink,{href:(0,r.Z)("jetpack-social-media-support-information")},__("Learn more","jetpack"))):React.createElement(E.Z,{type:"warning"},__("You need a featured image to share to Instagram.","jetpack"),React.createElement("br",null),React.createElement(o.ExternalLink,{href:(0,r.Z)("jetpack-social-media-support-information")},__("Learn more","jetpack"))):pe?null:React.createElement(E.Z,{type:"warning"},React.createElement("p",null,me.length===M.length?_n("The selected media cannot be shared to this platform.","The selected media cannot be shared to any of these platforms.",M.length,"jetpack"):_n("The selected media cannot be shared to one of these platforms.","The selected media cannot be shared to some of these platforms.",me.length,"jetpack")),React.createElement(o.ExternalLink,{href:(0,r.Z)("jetpack-social-media-support-information")},__("Troubleshooting tips","jetpack"))))),!n&&React.createElement(s.Fragment,null,q&&React.createElement(E.Z,{onDismiss:W,type:"highlight",actions:[React.createElement(o.Button,{key:"connect",href:R,target:"_blank",rel:"noreferrer noopener",variant:"primary"},__("Connect now","jetpack")),React.createElement(o.Button,{key:"learn-more",href:(0,r.Z)("jetpack-social-connecting-to-social-networks"),target:"_blank",rel:"noreferrer noopener"},__("Learn more","jetpack"))]},__("You can now share directly to your Instagram account!","jetpack")),t&&M.some((e=>e.enabled))&&React.createElement(React.Fragment,null,React.createElement(w.Z,{maxLength:O,onChange:z,message:F})),L&&V(G.advancedUpgradeEditor)&&React.createElement(E.Z,{onDismiss:re,type:"highlight"},(0,s.createInterpolateElement)(__("Need more reach? Unlock custom media sharing with the Advanced Plan","jetpack"),{upgradeLink:React.createElement(o.ExternalLink,{href:(0,r.Z)("jetpack-social-advanced-site-checkout",{site:(0,a.lQ)(),query:"redirect_to="+encodeURIComponent(window.location.href)})})})),N&&React.createElement(y.Z,{disabled:J,socialPostDisabled:!le&&!U,connections:M,disabledNoticeMessage:J?__("It is not possible to add an image or video when Social Image Generator is enabled.","jetpack"):null})))}},9888:function(e,t,n){"use strict";n.d(t,{ZP:function(){return k}});var r=n(88275),a=n(86989),o=n.n(a),i=n(55609),s=n(9818),c=n(12238),l=n(65736),u=n(65235),d=n.n(u),p=n(99196),m=n.n(p),h=n(75263),g=n(58487),f=n(90785);const __=l.__,_x=l._x,b="featured-image-still-loading",v=(e,t,n,r)=>{if("none"===e||"custom"===e&&!t||"featured"===(e??"featured")&&!n)return null;const a=r("custom"===e?t:n);return a?(e=>e?.media_details?.sizes?.large?.source_url||e?.source_url)(a):b};function k(e){let{shouldDebounce:t=!0,...n}=e;const[a,l]=(0,p.useState)(null),[u,k]=(0,p.useState)(!0),{customText:y,imageType:w,imageId:E,template:_,setToken:C}={...(0,h.Z)(),...n},{title:j,imageUrl:S}=(0,s.useSelect)((e=>{const t=e(c.store).getEditedPostAttribute("featured_media");return{title:e(c.store).getEditedPostAttribute("title"),imageUrl:v(w,E,t,e("core").getMedia)}})),x=(0,p.useMemo)((()=>y||j||" "),[y,j]),P=(0,p.useRef)(x),N=(0,p.useRef)(a);(0,p.useEffect)((()=>{N.current=a})),(0,p.useEffect)((()=>{const e=setTimeout((async()=>{if(k(!0),S===b)return;const e=await o()({path:"/jetpack/v4/social-image-generator/generate-preview-token",method:"POST",data:{text:x,image_url:S,template:_}});C?.(e);const t=(0,f.t)(e);t!==N.current?l(t):k(!1)}),x!==P.current&&t?1500:0);return()=>{clearTimeout(e),P.current=x}}),[x,_,S]);const L=(0,p.useCallback)((()=>{k(!1)}),[]);return m().createElement(r.ZP,null,m().createElement(i.BaseControl,{label:_x("Preview","Heading for the generated preview image","jetpack")},m().createElement("div",{className:g.Z.container},m().createElement("img",{className:d()({[g.Z.hidden]:u}),src:a,alt:__("Generated preview","jetpack"),onLoad:L}),u&&m().createElement(i.Spinner,{"data-testid":"spinner"}))))}},90785:function(e,t,n){"use strict";n.d(t,{t:function(){return a}});var r=n(6895);function a(e){return e?(0,r.Z)("sigenerate",{query:`t=${e}`}):""}},88649:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(90526),a=n(88275),o=n(52175),i=n(55609),s=n(69307),c=n(65736),l=n(61074),u=n(6163),d=n(65235),p=n.n(d),m=n(46791),h=n(1795),g=n(13858),f=n(69339);const __=c.__,b=e=>t=>{t.currentTarget.focus(),e()};function v(e){let{buttonLabel:t,subTitle:n,mediaId:c=null,mediaDetails:d={},onChange:v,wrapperClassName:k}=e;const{mediaData:{width:y,height:w,sourceUrl:E}={},metaData:{mime:_,length:C=null}={}}=d,j=!(E&&y&&w&&_),S=(0,s.useCallback)((()=>v(null)),[v]),x=(0,s.useCallback)((e=>{v(e)}),[v]),P=(0,s.useCallback)((e=>{const t=(0,m.Wv)(_);return t&&!C?null:React.createElement("div",{className:p()(f.Z["preview-wrapper"],k)},React.createElement("button",{className:f.Z.remove,onClick:S},React.createElement(i.VisuallyHidden,null,__("Remove media","jetpack")),React.createElement(l.Z,{icon:u.Z})),React.createElement("button",{className:f.Z.preview,onClick:b(e),"data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},t?React.createElement(g.Z,{sourceUrl:E,mime:_,duration:C}):React.createElement(i.ResponsiveWrapper,{naturalWidth:y,naturalHeight:w,isInline:!0},React.createElement("img",{src:E,alt:"",className:f.Z["preview-image"]}))))}),[w,C,_,S,E,y,k]),N=(0,s.useCallback)((e=>React.createElement("div",{className:f.Z.container},c?React.createElement(React.Fragment,null,React.createElement("button",{className:f.Z["remove-loading"],onClick:S},React.createElement(i.VisuallyHidden,null,__("Remove media","jetpack")),React.createElement(l.Z,{icon:u.Z})),React.createElement(i.Spinner,{"data-testid":"spinner"})):React.createElement(React.Fragment,null,React.createElement(r.Z,{variant:"secondary",size:"small",className:f.Z.preview,onClick:b(e),"data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},t),n&&React.createElement("span",null,n)))),[t,c,S,n]),L=(0,s.useCallback)((e=>{let{open:t}=e;return c&&!j?P(t):N(t)}),[c,j,P,N]);return React.createElement(a.ZP,null,React.createElement(o.MediaUploadCheck,null,React.createElement(o.MediaUpload,{allowedTypes:h.fl,title:t,onSelect:x,render:L,value:c})))}},29753:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(88275),a=n(6895),o=n(55609),i=n(69307),s=n(65736),c=n(99196),l=n.n(c),u=n(88219),d=n(98811),p=n(88649),m=n(53513),h=n(45811);const __=s.__,g=__("Choose Media","jetpack");function f(e){let{disabled:t=!1,disabledNoticeMessage:n="",CustomNotice:s=null,socialPostDisabled:f=!1}=e;const{attachedMedia:b,updateAttachedMedia:v}=(0,u.Z)(),[k]=(0,d.Z)(b[0]?.id),y=(0,i.useCallback)((e=>{if(e){const{id:t,url:n}=e;v([{id:t,url:n}])}else v([])}),[v]),w=t?o.Disabled:c.Fragment,E=t?{className:h.Z.disabled,"data-testid":"disabled"}:{};return l().createElement(r.ZP,null,l().createElement(o.BaseControl,{label:__("Media","jetpack"),className:h.Z.wrapper},s||(n?l().createElement(o.Notice,{className:h.Z.notice,isDismissible:!1,status:"warning"},l().createElement("p",{"data-testid":"notice"},n)):l().createElement("p",{className:h.Z.subtitle},__("Choose a visual to accompany your post.","jetpack"))),l().createElement(w,E,l().createElement(p.Z,{buttonLabel:g,subTitle:__("Add an image or video","jetpack"),mediaId:b[0]?.id,mediaDetails:k,onChange:y}),l().createElement(o.ExternalLink,{href:(0,a.Z)("jetpack-social-media-support-information")},__("Learn photo and video best practices","jetpack")))),l().createElement(m.Z,{disabled:f}))}},71961:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(55609),a=n(65736);const __=a.__,_n=a._n;function o(e){let{message:t="",onChange:n,disabled:o,maxLength:i}=e;const s=i-t.length;return React.createElement(r.TextareaControl,{value:t,label:__("Message","jetpack"),onChange:n,disabled:o,maxLength:i,placeholder:__("Write a message for your audience here.","jetpack"),rows:4,help:(0,a.sprintf)(/* translators: placeholder is a number. */ _n("%d character remaining","%d characters remaining",s,"jetpack"),s)})}},62578:function(e,t,n){"use strict";var r=n(55609),a=n(65736),o=n(61074),i=n(6163),s=n(65235),c=n.n(s),l=n(25162),u=n.n(l),d=n(82283);const __=a.__,p=e=>{let{children:t,type:n="default",actions:a=[],onDismiss:s}=e;const l=c()(d.Z.notice,d.Z[`notice--${n}`]);return React.createElement("div",{className:l},React.createElement("div",{className:d.Z.content}," ",t," "),s&&React.createElement("button",{className:d.Z.dismiss,onClick:s},React.createElement(r.VisuallyHidden,null,__("Dismiss notice","jetpack")),React.createElement(o.Z,{icon:i.Z})),a&&a.length>0&&React.createElement("div",{className:d.Z.actions},a.map((e=>e))))};p.propTypes={children:u().node.isRequired,type:u().oneOf(["default","highlight","warning","error"]),actions:u().arrayOf(u().element),onDismiss:u().func},t.Z=p},8714:function(e,t,n){"use strict";var r=n(55609),a=n(9818),o=n(12238),i=n(69307),s=n(65736),c=n(14085),l=n(86419),u=n(37568),d=n(49021),p=n(95788),m=n(91474),h=n(63609);const __=s.__;t.Z=e=>{let{prePublish:t,enableTweetStorm:n,children:s}=e;const{refresh:g,hasConnections:f,hasEnabledConnections:b}=(0,u.Z)(),v=(0,a.useSelect)((e=>e(o.store).isCurrentPostPublished()),[]),{isPublicizeEnabled:k,hidePublicizeFeature:y,isPublicizeDisabledBySitePlan:w,togglePublicizeFeature:E,isShareLimitEnabled:_,numberOfSharesRemaining:C,hasPaidPlan:j,connectionsAdminUrl:S,adminUrl:x,isEnhancedPublishingEnabled:P,isSocialImageGeneratorAvailable:N,shouldShowAdvancedPlanNudge:L,jetpackSharingSettingsUrl:T}=(0,c.Z)();(0,l.M1)((function(){b&&g()}),[b,g]);const A=t?i.Fragment:r.PanelBody,R=t?{}:{title:__("Share this post","jetpack")};return React.createElement(A,R,s,!y&&React.createElement(i.Fragment,null,!v&&React.createElement(r.ToggleControl,{label:k?__("Share when publishing","jetpack"):__("Sharing is disabled","jetpack",0),onChange:E,checked:k,disabled:!f}),React.createElement(d.Z,null),React.createElement(p.Z,{isPublicizeEnabled:k,isPublicizeDisabledBySitePlan:w,connectionsAdminUrl:S,numberOfSharesRemaining:_&&!j?C:null,isEnhancedPublishingEnabled:P,isSocialImageGeneratorAvailable:N,adminUrl:x,shouldShowAdvancedPlanNudge:L,jetpackSharingSettingsUrl:T}),n&&k&&React.createElement(h.Z,{prePublish:t}),React.createElement(m.o,null)))}},52403:function(e,t,n){"use strict";var r=n(6895),a=n(13419),o=n(86989),i=n.n(o),s=n(72067),c=n(69307),l=n(14085),u=n(86419),d=n(37568),p=n(19649);t.Z=()=>{const[e,t]=(0,c.useState)((0,a.Pb)()?.social?.reviewRequestDismissed??!0),[n,o]=(0,c.useState)(!1),{hasEnabledConnections:m}=(0,d.Z)(),{isPublicizeEnabled:h,isPostAlreadyShared:g}=(0,l.Z)();(0,u.e3)((()=>{o(!g&&h&&m)}),[g,m,h]);const f=(0,c.useCallback)((()=>{const e=(0,a.Pb)()?.social?.dismissReviewRequestPath??null;i()({path:e,method:"POST",data:{dismissed:!0}}).catch((e=>{throw e})),t(!0)}),[]);return e||!n?null:React.createElement(s.PluginPostPublishPanel,{id:"publicize-title"},React.createElement(p.Z,{href:(0,r.Z)("jetpack-social-plugin-reviews"),onClose:f}))}},19649:function(e,t,n){"use strict";var r=n(88275),a=n(90526),o=n(13419),i=n(65736),s=n(99196),c=n(2097);const __=i.__;t.Z=e=>{let{href:t,onClose:n}=e;const{recordEvent:l}=(0,o.z$)({pageViewEventName:"social_plugin_review_prompt",pageViewNamespace:"jetpack",pageViewSuffix:"view"}),u=(0,s.useCallback)((()=>{l("jetpack_social_plugin_review_prompt_new_review_click")}),[l]),d=(0,s.useCallback)((()=>{l("jetpack_social_plugin_review_prompt_dismiss_click"),n()}),[l,n]);return React.createElement(r.ZP,null,React.createElement("div",{className:c.Z.prompt},React.createElement("h2",{className:c.Z.header},/* translators: %s is the celebration emoji */ (0,i.sprintf)(__("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:c.Z.buttons},React.createElement(a.Z,{onClick:u,isExternalLink:!0,href:t,className:c.Z.button},__("Leave a Review","jetpack")),React.createElement(a.Z,{onClick:d,variant:"link",className:c.Z.button},__("Dismiss","jetpack")))))}},69709:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(65736),a=n(92819),o=n(90105),i=n(14085),s=n(37568),c=n(78619);const __=r.__,l=2e3;function u(){const{refresh:e}=(0,s.Z)(),t=(0,a.debounce)((function(t){t&&e()}),l),{connectionsAdminUrl:n}=(0,i.Z)();return React.createElement(o.Z,{onChange:t},React.createElement("a",{className:c.Z["settings-link"],href:n,target:"_blank",rel:"noreferrer",title:__("Connect an account","jetpack")},React.createElement("svg",{width:"24",height:"24",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("rect",{x:"0.375",y:"0.375",width:"27.25",height:"27.25",rx:"1.125",fill:"#F6F7F7"}),React.createElement("path",{d:"M19 13.3333H14.6667V9H13.3333V13.3333H9V14.6667H13.3333V19H14.6667V14.6667H19V13.3333Z",fill:"black"}),React.createElement("rect",{x:"0.375",y:"0.375",width:"27.25",height:"27.25",rx:"1.125",stroke:"#A7AAAD",strokeWidth:"0.75",strokeDasharray:"2 2"}))))}},91474:function(e,t,n){"use strict";n.d(t,{o:function(){return h}});var r=n(55609),a=n(9818),o=n(12238),i=n(69307),s=n(65736),c=n(53961),l=n(14085),u=n(45579),d=n(37568);const __=s.__;function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:__("Unable to share the Post","jetpack");const{createErrorNotice:t}=(0,a.dispatch)(c.store);t(e,{id:"publicize-post-share-message"})}function m(){const{hasEnabledConnections:e}=(0,d.Z)(),{isPublicizeEnabled:t}=(0,l.Z)(),{isFetching:n,isError:s,isSuccess:m,doPublicize:h}=(0,u.Z)(),g=(0,a.useSelect)((e=>e(o.store).isCurrentPostPublished()),[]);(0,i.useEffect)((()=>{if(!n)return s?p():void(m&&function(){const{createSuccessNotice:e}=(0,a.dispatch)(c.store);e(__("Post shared","jetpack"),{id:"publicize-post-share-message",type:"snackbar"})}())}),[n,s,m]);const f=!t||!e||!g||n,b=(0,i.useCallback)((()=>{if(!g)return p(__("You must publish your post before you can share it.","jetpack"));(0,a.dispatch)(c.store).removeNotice("publicize-post-share-message"),h()}),[h,g]);return React.createElement(r.Button,{variant:"secondary",onClick:b,disabled:f,isBusy:n},__("Share post","jetpack"))}function h(){const{isRePublicizeUpgradableViaUpsell:e}=(0,l.Z)();return(0,a.useSelect)((e=>e(o.store).isCurrentPostPublished()),[])?e?null:React.createElement(r.PanelRow,null,React.createElement(m,null)):null}},54005:function(e,t,n){"use strict";var r=n(55609),a=n(69307),o=n(65736),i=n(75263),s=n(9888),c=n(81469);const __=o.__;t.Z=e=>{let{prePublish:t=!1}=e;const n=t?a.Fragment:r.PanelBody,o=t?{}:{title:__("Social Image Generator","jetpack")},{isEnabled:l,setIsEnabled:u}=(0,i.Z)(),[d,p]=(0,a.useState)(!1),m=(0,a.useCallback)((()=>p(!0)),[]),h=(0,a.useCallback)((()=>p(!1)),[]);return React.createElement(n,o,d&&React.createElement(c.Z,{onClose:h}),React.createElement(r.ToggleControl,{label:__("Enable Social Image","jetpack"),help:l?"":__("Social Image is disabled for this post.","jetpack"),checked:l,onChange:u}),l&&React.createElement(React.Fragment,null,React.createElement("hr",null),React.createElement(s.ZP,{shouldDebounce:!1}),React.createElement("hr",null),React.createElement(r.Button,{variant:"secondary",onClick:m,label:__("Open the Social Image Generator settings","jetpack")},__("Settings","jetpack"))))}},81469:function(e,t,n){"use strict";var r=n(88275),a=n(55609),o=n(69307),i=n(65736),s=n(75263),c=n(98811),l=n(9888),u=n(88649),d=n(39356),p=n(40088);const __=i.__,m=["image/jpeg","image/png"],h=__("Choose Image","jetpack");t.Z=e=>{let{onClose:t}=e;const{customText:n,imageType:i,imageId:g,template:f,updateSettings:b}=(0,s.Z)(),[v,k]=(0,o.useState)(g),[y,w]=(0,o.useState)(i||"featured"),[E,_]=(0,o.useState)(n),[C,j]=(0,o.useState)(f),[S]=(0,c.Z)(v),x=(0,o.useCallback)((()=>{b({template:C,image_type:y,custom_text:E||"",..."custom"===y&&{image_id:v}}),t()}),[b,C,y,v,E,t]),P=(0,o.useCallback)((e=>{k(e?.id)}),[k]);return React.createElement(r.ZP,{targetDom:document.body},React.createElement(a.Modal,{onRequestClose:t},React.createElement(l.ZP,{className:p.Z.preview,imageId:v,customText:E,imageType:y,template:C}),React.createElement(a.SelectControl,{label:__("Image Type","jetpack"),value:y||"featured",options:[{label:__("Featured Image","jetpack"),value:"featured"},{label:__("Custom Image","jetpack"),value:"custom"},{label:__("No Image","jetpack"),value:"none"}],onChange:w}),"custom"===y&&React.createElement(u.Z,{buttonLabel:h,subTitle:__("Add a custom image","jetpack"),mediaId:v,mediaDetails:S,onChange:P,allowedMediaTypes:m,wrapperClassName:p.Z.mediaPicker}),React.createElement(a.TextControl,{className:p.Z.customText,value:E||"",onChange:_,label:__("Custom Header","jetpack"),help:__("By default the post title is used for the image. You can use this field to set your own text.","jetpack")}),React.createElement(a.BaseControl,{label:__("Templates","jetpack"),className:p.Z.templateControl},React.createElement(d.Z,{value:C,onTemplateSelected:j})),React.createElement(a.Button,{onClick:t,variant:"tertiary"},__("Cancel","jetpack")),React.createElement(a.Button,{onClick:x,variant:"primary"},__("Save","jetpack"))))}},79631:function(e,t,n){"use strict";n(9818),n(69307),n(65736),n(99196),n(23177),n(8350)},8350:function(e,t,n){"use strict";n(55609),n(69307),n(65736),n(39356),n(15214)},39356:function(e,t,n){"use strict";var r=n(69307),a=n(65736),o=n(65235),i=n.n(o),s=n(47320),c=n(57227);const __=a.__;t.Z=e=>{let{value:t=null,onTemplateSelected:n=null}=e;const o=(0,r.useCallback)((e=>{const t=e.target.id;n?.(t)}),[n]);return React.createElement("div",{className:s.Z.templates},c.Z.map((e=>React.createElement("button",{onClick:o,id:e.name,key:e.name,className:i()(s.Z.template,{[s.Z["template--active"]]:e.name===t})},React.createElement("img",{src:e.image,alt:e.label}),React.createElement("span",{className:"screen-reader-text"},/* translators: %s is the name of the template */ (0,a.sprintf)(__("Pick the %s template","jetpack"),e.label))))))}},57227:function(e,t,n){"use strict";var r=n(30253),a=n(91948),o=n(5353);const i=[{name:"highway",label:"Highway",image:n(27956)},{name:"dois",label:"Dois",image:r},{name:"edge",label:"Edge",image:a},{name:"fullscreen",label:"Fullscreen",image:o}];t.Z=i},76848:function(e,t,n){"use strict";n(9818),n(69307),n(99196),n(23177)},53513:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(88275),a=n(55609),o=n(69307),i=n(65736),s=n(88219),c=n(89696);const __=i.__,l=__("You need a featured image or media attached to your post to be able to share as a social post.","jetpack"),u=__("By default, the image and text appear on social media as a link preview. To optimize engagement, share as a social post.","jetpack");function d(e){let{disabled:t=!1}=e;const{shouldUploadAttachedMedia:n,updateShouldUploadAttachedMedia:i}=(0,s.Z)(),d=(0,o.useCallback)((e=>{i(e)}),[i]),p=t?a.Disabled:o.Fragment,m=t?{className:c.Z.disabled}:{};return React.createElement(r.ZP,null,React.createElement(p,m,React.createElement(a.CheckboxControl,{className:c.Z.checkbox,checked:n,onChange:d,label:__("Share as a social post","jetpack"),help:t?l:u})))}},63855:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(13477),i=n(9818),s=n(37568),c=n(48751);t.Z=(0,i.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{excerpt:t("excerpt"),content:t("content").split("\x3c!--more")[0]}}))((e=>{const{connections:t}=(0,s.Z)(),{message:n}=(0,c.Z)(),{title:r,excerpt:i,content:l}=e,u=t?.find((e=>"facebook"===e.service_name));let d;return u&&(d={displayName:u.display_name,avatarUrl:u.profile_picture}),React.createElement(o.S,a()({},e,{type:"article",user:d,customText:n||i||l||r}))}))},83704:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(17915),i=n(9818),s=n(22629),c=n(99196),l=n.n(c);t.Z=function(e){const t=(0,i.useSelect)((e=>{const{getEntityRecord:t}=e("core");return(0,s.decodeEntities)(t("root","site").title)}));return l().createElement(o.X,a()({},e,{siteTitle:t}))}},4124:function(e,t,n){"use strict";n.d(t,{m:function(){return c}});var r=n(4049),a=n(99196),o=n.n(a),i=n(48751),s=n(34074);function c(e){const{title:t,image:n,media:a}=e,{name:c,profileImage:l}=(0,s.getInstagramDetails)(),{message:u}=(0,i.Z)(),d=u||t;return o().createElement(r.V,{image:n,media:a,name:c,profileImage:l,caption:d})}},27725:function(e,t,n){"use strict";n.d(t,{y:function(){return l}});var r=n(93453),a=n(65736),o=n(99196),i=n.n(o),s=n(48751),c=n(34074);const __=a.__;function l(e){const{title:t,url:n,image:a,media:o}=e,{name:l,profileImage:u}=(0,c.getLinkedInDetails)(),{message:d}=(0,s.Z)(),p=`${d||t} ${o.length?n:""}`.trim();return i().createElement(r.S,{jobTitle:__("Job Title (Company Name)","jetpack"),image:a,name:l,profileImage:u,title:t,description:p,url:n,media:o})}},28586:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(60312),i=n(9818),s=n(22629),c=n(37568),l=n(48751),u=n(34074);t.Z=e=>{const{connections:t}=(0,c.Z)(),{message:n}=(0,l.Z)(),{content:r,siteName:d}=(0,i.useSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getSite:n}=e("core");return{content:t("content").split("\x3c!--more")[0],siteName:(0,s.decodeEntities)(n().title)}})),p=(0,u.shouldUploadAttachedMedia)(),m=t?.find((e=>"mastodon"===e.service_name));let h;m&&(h={displayName:m.display_name,avatarUrl:m.profile_picture,address:m.username});const g=e.media?.[0],f=g?.type.startsWith("image/")?g.url:null;return React.createElement(o.I,a()({},e,{siteName:d,user:h,description:r,customText:n,customImage:f,isSocialPost:p}))}},8454:function(e,t,n){"use strict";var r=n(55609),a=n(9818),o=n(65736),i=n(39517),s=n(34074),c=n(90785),l=n(81694),u=n(25399);const __=o.__;t.Z=(0,a.withSelect)((e=>{const{getMedia:t}=e("core"),{getEditedPostAttribute:n}=e("core/editor"),{isTweetStorm:r}=e("jetpack/publicize"),a=n("featured_media");let o=a?(0,u.i)(t(a)):"";const i=(0,s.getImageGeneratorPostSettings)(),l=i.enabled?(0,c.t)(i.token):"",d=(0,s.getAttachedMedia)();if(l)o=l;else if(d?.[0]?.id){const[e]=d;!!e.id&&t(e.id)?.mime_type?.startsWith("image/")&&e.url&&(o=e.url)}const p=[];if((0,s.shouldUploadAttachedMedia)())if(l)p.push({type:"image/jpeg",url:l,alt:""});else{const e=e=>{const n=t(e);return n?{type:n.mime_type,url:(0,u.i)(n),alt:n.alt_text}:null};for(const{id:t}of d){const n=e(t);n&&p.push(n)}0===p.length&&a&&p.push(e(a))}return{title:n("meta")?.jetpack_seo_html_title||n("title"),description:n("meta")?.advanced_seo_description||n("excerpt")||n("content").split("\x3c!--more")[0]||__("Visit the post for more.","jetpack"),url:n("link"),image:o,media:p,initialTabName:r()?"twitter":null}}))((function(e){let{onClose:t,image:n,media:a,title:o,description:s,url:c,initialTabName:u}=e;const d=(0,l.P)();return React.createElement(r.Modal,{onRequestClose:t,className:"jetpack-social-previews__modal",__experimentalHideHeader:!0},React.createElement(r.Button,{className:"jetpack-social-previews__modal--close-btn",onClick:t,icon:i.Z,label:__("Close","jetpack")}),React.createElement(r.TabPanel,{className:"jetpack-social-previews__modal-previews",tabs:d,initialTabName:u},(e=>React.createElement("div",null,React.createElement(e.preview,{title:o,description:s,url:c,image:n,media:a})))))}))},74140:function(e,t,n){"use strict";var r=n(55609),a=n(65736),o=n(81694);const __=a.__,_x=a._x;t.Z=e=>{let{openModal:t}=e;const n=(0,o.P)();return React.createElement("div",{className:"jetpack-social-previews__panel"},React.createElement("p",null,__("Preview what this will look like on social networks and Google search.","jetpack")),React.createElement("div",{className:"jetpack-gutenberg-social-icons"},n.map((e=>React.createElement(e.icon,{key:e.name,className:"jetpack-social-previews__icon"})))),React.createElement(r.Button,{variant:"secondary",onClick:t,label:__("Open Social Previews","jetpack")},_x("Preview","Button label that opens the social previews modal","jetpack")))}},94714:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(1044),i=n(9818),s=n(37568),c=n(48751);t.Z=e=>{const{content:t,author:n}=(0,i.useSelect)((e=>{const{getUser:t}=e("core"),{getEditedPostAttribute:n}=e("core/editor"),r=n("author"),a=r&&t(r);return{content:n("content").split("\x3c!--more")[0],author:a?.name}})),{connections:r}=(0,s.Z)(),{message:l}=(0,c.Z)(),u=r?.find((e=>"tumblr"===e.service_name));let d;return u&&(d={displayName:u.display_name||n,avatarUrl:u.profile_picture}),React.createElement(o.b,a()({},e,{user:d,description:t,customText:l}))}},24766:function(e,t,n){"use strict";var r=n(835),a=n(9818),o=n(99196),i=n.n(o);t.Z=(0,a.withSelect)(((e,t)=>{let{title:n,description:r,image:a,url:o,media:i}=t;const{getTweetTemplate:s,getTweetStorm:c,getShareMessage:l,isTweetStorm:u}=e("jetpack/publicize");let d=[];return u()?d=c():d.push({...s(),text:l()+(i.length?` ${o}`:""),cardType:a?"summary_large_image":"summary",title:n,description:r,image:a,media:i,url:o}),{tweets:d}}))((function(e){let{tweets:t}=e;return i().createElement(r.c,{tweets:t,hidePostPreview:!0})}))},81694:function(e,t,n){"use strict";n.d(t,{P:function(){return b}});var r=n(82674),a=n.n(r),o=n(3396),i=n(9818),s=n(65736),c=n(99196),l=n.n(c),u=n(63855),d=n(83704),p=n(4124),m=n(27725),h=n(28586),g=n(94714),f=n(24766);const __=s.__;function b(){const{isInstagramSupported:e,isMastodonSupported:t}=(0,i.useSelect)((e=>{const t=e("jetpack/publicize");return{isInstagramSupported:t.isInstagramConnectionSupported(),isMastodonSupported:t.isMastodonConnectionSupported()}}));return(0,c.useMemo)((()=>[{title:__("Google Search","jetpack"),icon:e=>l().createElement(o.av,a()({serviceName:"google"},e)),name:"google",preview:d.Z},{title:__("Twitter","jetpack"),icon:e=>l().createElement(o.av,a()({serviceName:"twitter"},e)),name:"twitter",preview:f.Z},{title:__("Facebook","jetpack"),icon:e=>l().createElement(o.av,a()({serviceName:"facebook"},e)),name:"facebook",preview:u.Z},e?{title:__("Instagram","jetpack"),icon:e=>l().createElement(o.av,a()({serviceName:"instagram"},e)),name:"instagram",preview:p.m}:null,{title:__("LinkedIn","jetpack"),icon:e=>l().createElement(o.av,a()({serviceName:"linkedin"},e)),name:"linkedin",preview:m.y},{title:__("Tumblr","jetpack"),icon:e=>l().createElement(o.av,a()({serviceName:"tumblr"},e)),name:"tumblr",preview:g.Z},t?{title:__("Mastodon","jetpack"),icon:e=>l().createElement(o.av,a()({serviceName:"mastodon"},e)),name:"mastodon",preview:h.Z}:null].filter(Boolean)),[e,t])}},25399:function(e,t,n){"use strict";function r(e){return e?e.media_details?.sizes?.large?.source_url||e.source_url:null}n.d(t,{i:function(){return r}})},68407:function(e,t,n){"use strict";n.d(t,{H8:function(){return c},nE:function(){return s}});var r=n(94333),a=n(9818),o=n(92694),i=n(36797);const s={"core/gallery":{contentAttributes:["images"]},"core/heading":{contentAttributes:["content"]},"core/image":{contentAttributes:["alt","url"]},"core/list":{contentAttributes:["values"]},"core/paragraph":{contentAttributes:["content"]},"core/quote":{contentAttributes:["value","citation"]},"core/separator":{contentAttributes:[]},"core/spacer":{contentAttributes:[]},"core/verse":{contentAttributes:["content"]},"core/video":{contentAttributes:["src"]},"core/embed":{contentAttributes:["url"]},"jetpack/gif":{contentAttributes:["giphyUrl"]}},c=["core/column","core/columns","core/group"];(0,o.addFilter)("blocks.registerBlockType","jetpack/publishing-tweetstorms",(e=>{const{edit:t}=e;return{...e,edit:e=>React.createElement(i.Z,{ChildEdit:t,childProps:e})}}));t.ZP=(0,r.compose)([(0,a.withSelect)((e=>({isTweetStorm:e("jetpack/publicize").isTweetStorm(),isTyping:e("core/block-editor").isTyping()})))])((e=>{let{isTweetStorm:t,isTyping:n}=e;return t?document.body.classList.add("jetpack-tweetstorm"):document.body.classList.remove("jetpack-tweetstorm"),t&&n?document.body.classList.add("jetpack-tweetstorm-is-typing"):document.body.classList.remove("jetpack-tweetstorm-is-typing"),null}))},63609:function(e,t,n){"use strict";var r=n(55609),a=n(94333),o=n(9818),i=n(69307),s=n(65736);n(42998);const __=s.__;t.Z=(0,a.compose)([(0,o.withSelect)((e=>{const{isTweetStorm:t,getTweetStorm:n}=e("jetpack/publicize");return{connections:e("core/editor").getEditedPostAttribute("jetpack_publicize_connections"),isTweetStorm:t(),tweetStormLength:n().length}})),(0,o.withDispatch)((e=>({setTweetstorm:t=>{e("core/editor").editPost({meta:{jetpack_is_tweetstorm:t}}),t?e("jetpack/publicize").refreshTweets():(e("core/annotations").__experimentalRemoveAnnotationsBySource("jetpack-tweetstorm"),e("core/annotations").__experimentalRemoveAnnotationsBySource("jetpack-tweetstorm-line-break"))}})))])((e=>{let{connections:t,isTweetStorm:n,tweetStormLength:a,setTweetstorm:o,prePublish:s}=e;const c=(0,i.useCallback)((e=>{o("tweetstorm"===e)}),[o]);if(!t?.some((e=>"twitter"===e.service_name&&e.enabled&&!1!==e.is_healthy)))return null;const l=(e,t)=>React.createElement(React.Fragment,null,React.createElement("strong",null,e),React.createElement("br",null),t),u=[];return a>=102?u.push({id:"jetpack-publicize-twitter-tweetstorm-too-long",status:"error",content:__("Only the first 100 tweets of this post will be published in the Twitter thread.","jetpack"),isDismissible:!1}):a>=22?u.push({id:"jetpack-publicize-twitter-tweetstorm-a-bit-long",status:"warning",content:__("This post will create a Twitter thread more than 20 tweets long.","jetpack"),isDismissible:!1}):s&&a<=2&&u.push({id:"jetpack-publicize-twitter-tweetstorm-too-short",status:"warning",content:__("None of the content in this post could be transformed into tweets, it may be better to share as a single tweet.","jetpack"),isDismissible:!1}),React.createElement(r.PanelRow,null,React.createElement(r.RadioControl,{label:__("Twitter settings","jetpack"),selected:n?"tweetstorm":"single",options:[{label:l(__("Single Tweet","jetpack"),__("Share a link to this post to Twitter.","jetpack")),value:"single"},{label:l(__("Twitter Thread","jetpack"),__("Share the content of this post as a Twitter thread.","jetpack")),value:"tweetstorm"}],onChange:c}),n&&React.createElement(r.NoticeList,{className:"jetpack-publicize-twitter-options__notices",notices:u}))}))},36797:function(e,t,n){"use strict";var r=n(3396),a=n(55609),o=n(94333),i=n(9818),s=n(69307),c=n(92819);n(42998);class l extends s.Component{componentDidMount(){const{isTweetStorm:e,updateTweets:t}=this.props;e&&t()}componentDidUpdate(e){const{boundaries:t,childProps:n,currentAnnotations:r,isTweetStorm:a,updateAnnotations:o,updateTweets:i,supportedBlockType:s,contentAttributesChanged:l}=this.props;a&&s&&(l(e.childProps,n)&&i(),r.length===t.filter((e=>["normal","line-break"].includes(e.type))).length&&(0,c.isEqual)(e.boundaries,t)||o())}render(){const{ChildEdit:e,childProps:t,isTweetStorm:n,isSelectedTweetBoundary:o,boundaryStylesSelectors:i,popoverWarnings:s}=this.props;return n?React.createElement(React.Fragment,null,React.createElement(e,t),o&&React.createElement("div",{className:"jetpack-publicize-twitter__tweet-divider"},React.createElement("div",{className:"jetpack-publicize-twitter__tweet-divider-icon"},React.createElement(r.av,{serviceName:"twitter"})),s.length>0&&React.createElement(a.Popover,{className:"jetpack-publicize-twitter__tweet-divider-popover",focusOnMount:!1,position:"bottom center"},React.createElement("ol",null,s.map(((e,t)=>React.createElement("li",{key:`jetpack-publicize-twitter__tweet-divider-popover-warning-${t}`},e)))))),i&&React.createElement("style",{type:"text/css"},i.map((e=>`${e}::after {\n\t\t\t\t\t\t\t\tcontent: "";\n\t\t\t\t\t\t\t\tbackground: #0009;\n\t\t\t\t\t\t\t\twidth: 3px;\n\t\t\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\t\t\tmargin: 0 1px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.is-dark-theme ${e}::after {\n\t\t\t\t\t\t\t\tbackground: #fff9;\n\t\t\t\t\t\t\t}`)))):React.createElement(e,t)}}t.Z=(0,o.compose)([(0,i.withSelect)(((e,t)=>{let{childProps:n}=t;const{isTweetStorm:r,getPopoverWarnings:a,getBoundariesForBlock:o,getBoundaryStyleSelectors:i,isSelectedTweetBoundary:s,getSupportedBlockType:c,contentAttributesChanged:l}=e("jetpack/publicize"),u=e("core/annotations").__experimentalGetAllAnnotationsForBlock(n.clientId);return{isTweetStorm:r(),isSelectedTweetBoundary:s(n),boundaries:o(n.clientId),boundaryStylesSelectors:i(n.clientId),popoverWarnings:a(n),currentAnnotations:u,supportedBlockType:c(n.name),contentAttributesChanged:l}})),(0,i.withDispatch)(((e,t,n)=>{let{childProps:r}=t,{select:a}=n;return{updateTweets:()=>e("jetpack/publicize").refreshTweets(),updateAnnotations:()=>{const{contentAttributesChanged:t,getTweetsForBlock:n}=a("jetpack/publicize"),o=n(r.clientId);if(!o||0===o.length)return;if(t(o.reduce(((e,t)=>e||t.blocks.find((e=>e.clientId===r.clientId))),!1),r))return;a("core/annotations").__experimentalGetAllAnnotationsForBlock(r.clientId).forEach((t=>{["jetpack-tweetstorm","jetpack-tweetstorm-line-break"].includes(t.source)&&e("core/annotations").__experimentalRemoveAnnotation(t.id)}));o.filter((e=>e.boundary)).map((e=>e.boundary)).forEach((t=>{const{container:n,type:a,start:o,end:i}=t;"normal"===a?e("core/annotations").__experimentalAddAnnotation({blockClientId:r.clientId,source:"jetpack-tweetstorm",richTextIdentifier:n,range:{start:o,end:i}}):"line-break"===a&&e("core/annotations").__experimentalAddAnnotation({blockClientId:r.clientId,source:"jetpack-tweetstorm-line-break",richTextIdentifier:n,range:{start:o,end:i}})}))}}}))])(l)},13858:function(e,t,n){"use strict";var r=n(69307),a=n(87728);t.Z=e=>{let{sourceUrl:t,mime:n,duration:o}=e;const[i,s]=(0,r.useState)(!1),[c,l]=(0,r.useState)(0),u=(0,r.useRef)(null),d=(0,r.useRef)(null),p=(0,r.useRef)(null);(0,r.useEffect)((()=>{u.current?.load()}),[t]);const m=(0,r.useCallback)((()=>{u.current.pause(),u.current.currentTime=0,clearInterval(d.current),clearTimeout(p.current),l(0),s(!1)}),[]),h=(0,r.useCallback)((()=>{p.current=setTimeout((()=>{i||(u.current.play(),s(!0),d.current=setInterval((()=>{l((e=>e+1))}),1e3))}),500)}),[i]),g=()=>{const e=o-c,t=Math.floor(e/60),n=String(Math.floor(e%60)).padStart(2,"0");return React.createElement("div",{className:a.Z.progress},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"8",fill:"none"},React.createElement("path",{fill:"#fff",d:"M5.25 3.567a.5.5 0 0 1 0 .866L.75 7.031A.5.5 0 0 1 0 6.598V1.402A.5.5 0 0 1 .75.969l4.5 2.598Z"})),React.createElement("span",{className:a.Z.duration},`${t}:${n}`))};return React.createElement("div",{className:a.Z.wrapper,onMouseEnter:h,onMouseLeave:m},React.createElement("video",{ref:u,onEnded:m,muted:!0},React.createElement("source",{src:t,type:n})),React.createElement(g,null))}},88219:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(9818),a=n(12238),o=n(69307);const i="jetpack/publicize";function s(){const{editPost:e}=(0,r.useDispatch)(a.store),{shouldUploadAttachedMedia:t,attachedMedia:n,currentOptions:s}=(0,r.useSelect)((e=>({shouldUploadAttachedMedia:e(i).shouldUploadAttachedMedia(),attachedMedia:e(i).getAttachedMedia(),currentOptions:e(i).getJetpackSocialOptions()}))),c=(0,o.useCallback)(((t,n)=>{e({meta:{jetpack_social_options:{...s,[t]:n}}})}),[s,e]);return{attachedMedia:n,shouldUploadAttachedMedia:t,updateAttachedMedia:e=>c("attached_media",e),updateShouldUploadAttachedMedia:e=>c("should_upload_attached_media",e)}}},75323:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(13419),a=n(86989),o=n.n(a),i=n(69307);const s={instagram:"instagram",advancedUpgradeEditor:"advanced-upgrade-nudge-editor",advancedUpgradeAdmin:"advanced-upgrade-nudge-admin",autoConversion:"auto-conversion-editor-notice"},c=e=>-1===e?0:new Date(Date.now()+1e3*e).getTime();function l(){const[e,t]=(0,i.useState)((()=>(0,r.Pb)()?.social?.dismissedNotices??window?.jetpackSocialInitialState?.jetpackSettings?.dismissedNotices??{})),n=(0,i.useCallback)((function(e){const n=c(arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1);t((t=>({...t,[e]:n}))),o()({path:"jetpack/v4/social/dismiss-notice",method:"POST",data:{notice:e,reappearance_time:n}})}),[]),a=(0,i.useCallback)((t=>{const n=e[t];return!(0===n||n>Date.now())}),[e]);return(0,i.useMemo)((()=>({dismissedNotices:e,shouldShowNotice:a,dismissNotice:n,NOTICES:s})),[e,a,n])}},39118:function(e,t,n){"use strict";var r=n(9818),a=n(12238);t.Z=()=>(0,r.useSelect)((e=>e(a.store).getEditedPostAttribute("featured_media")))},75263:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(9818),a=n(12238),o=n(69307);const i="jetpack/publicize",s=(e,t)=>({isEnabled:e?.enabled??!t,customText:e?.custom_text??null,imageType:e?.image_type??null,imageId:e?.image_id??null,template:e?.template??null,token:e?.token??null});function c(){const{editPost:e}=(0,r.useDispatch)(a.store),{postSettings:t,currentOptions:n}=(0,r.useSelect)((e=>({postSettings:e(i).getImageGeneratorPostSettings(),currentOptions:e(i).getJetpackSocialOptions()}))),{isPostPublished:c}=(0,r.useSelect)((e=>({isPostPublished:e(a.store).isCurrentPostPublished()}))),l=(0,o.useCallback)((t=>{e({meta:{jetpack_social_options:{...n,image_generator_settings:t}}})}),[n,e]),u=(0,o.useCallback)(((e,n)=>{const r={...t,[e]:n};l(r)}),[t,l]),d=(0,o.useCallback)((e=>{const n={...t,...e};l(n)}),[t,l]);return{...s(n?.image_generator_settings,c),setIsEnabled:e=>u("enabled",e),setToken:e=>u("token",e),updateSettings:d}}},98811:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9818),a=n(69307);const o=async e=>{if(!e)return{};let t={mime:e.mime_type,fileSize:e.media_details.filesize,length:e.media_details?.length};"video/videopress"===e.mime_type&&(t=await(async e=>{if(!e?.media_details?.videopress?.original||!e?.media_details?.videopress?.duration)return{};const t=await fetch(e?.media_details?.videopress?.original,{method:"HEAD"}),n=t.headers.get("content-length"),r=t.headers.get("content-type");return n&&r?{mime:r,fileSize:n,length:Math.round(e.media_details.videopress.duration/1e3)}:{}})(e));const n=e?.media_details?.sizes??{};if(0===Object.keys(n).length)return{mediaData:{width:e.media_details.width,height:e.media_details.height,sourceUrl:e.source_url},metaData:t};const r=n.large||n.thumbnail;return{mediaData:{width:r.width,height:r.height,sourceUrl:r.source_url},metaData:t}};function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const[t,n]=(0,a.useState)([{}]),i=(0,r.useSelect)((t=>t("core").getMedia(e,{context:"view"})),[e]),s=(0,a.useCallback)((async()=>{try{const e=await o(i);n([e??{}])}catch{n([{}])}}),[i]);return(0,a.useEffect)((()=>{s()}),[s]),t}},46791:function(e,t,n){"use strict";n.d(t,{Wv:function(){return s},rs:function(){return o}});var r=n(69307),a=n(1795);const o="NO_MEDIA_ERROR",i="FILE_SIZE_ERROR";function s(e){return"video"===e.split("/")[0]}const c=e=>{if(!e?.mime||!e?.fileSize)return!1;const{mime:t,fileSize:n}=e;if(s(t))return!1;if(!a.bD.includes(t))return!1;return!((n?n/Math.pow(1e3,2):null)>=55)},l=(e,t,n,r)=>{const c=a.$8[n]??a.ay;if(!e||0===Object.keys(e).length)return c.requiresMedia?o:null;if(!c.requiresMedia&&!r)return null;const{mime:l,fileSize:u}=e;if(!l||!c.allowedMediaTypes.includes(l.toLowerCase()))return"FILE_TYPE_ERROR";const d=u?u/Math.pow(1e3,2):null;return s(l)?((e,t,n,r,o)=>{const{minSize:s=0,maxSize:c=a.zc,minLength:l=0,maxLength:u=a.zc,maxWidth:d=a.zc,aspectRatio:p=a.ay.video.aspectRatio}=o;if(!e||e>c||eu)return"VIDEO_LENGTH_TOO_LONG_ERROR";const m=n/r;return mp.max||n>d?"DIMENSION_ERROR":null})(d,e.length,t?.width,t?.height,c.video):((e,t)=>!e||e>t?i:null)(d,c.image.maxSize)};t.ZP=(e,t,n)=>{let{isSocialImageGeneratorEnabledForPost:a,shouldUploadAttachedMedia:o}=n;const i=(0,r.useRef)({});return(0,r.useMemo)((()=>{const n=a?{}:e.reduce(((e,n)=>{let{connection_id:r,service_name:a}=n;const i=l(t.metaData,t.mediaData,a,o);return i&&(e[r]=i),e}),{});return JSON.stringify(n)!==JSON.stringify(i.current)&&(i.current=n),{validationErrors:i.current,isConvertible:c(t.metaData)}}),[a,e,t.metaData,t.mediaData,o])}},1795:function(e,t,n){"use strict";n.d(t,{$8:function(){return d},ay:function(){return u},bD:function(){return p},fl:function(){return m},zc:function(){return l}});const r="video/mp4",a="video/mov",o="video/videopress",i=["image/jpeg","image/jpg","image/png"],s=i.concat(["image/gif","image/bmp"]),c=i.concat(["image/gif","image/heic","image/heif","image/webp","image/avif"]),l=1e5,u={requiresMedia:!1,allowedMediaTypes:i.concat([r,o,a]),image:{maxSize:4},video:{minLength:0,minSize:0,maxSize:l,maxLength:l,maxWidth:l,aspectRatio:{min:0,max:l}}},d={twitter:{allowedMediaTypes:i.concat([r,o]),image:{maxSize:5},video:{maxSize:512,maxLength:140}},facebook:{allowedMediaTypes:s.concat([o,"video/3g2","video/3gp","video/3gpp","video/asf","video/avi","video/dat","video/divx","video/dv","video/f4v","video/flv","video/gif","video/m2ts","video/m4v","video/mkv","video/mod","video/mov","video/mp4","video/mpe","video/mpeg","video/mpeg4","video/mpg","video/mts","video/nsv","video/ogm","video/ogv","video/qt","video/tod","video/ts","video/vob","video/wmv"]),image:{maxSize:8},video:{maxSize:1e4,maxLength:14400}},tumblr:{allowedMediaTypes:i.concat([r,a,o]),image:{maxSize:20},video:{maxSize:500,maxLength:600}},linkedin:{allowedMediaTypes:i.concat([r,o]),image:{maxSize:20},video:{minSize:.075,maxSize:200,maxLength:600,minLength:3}},"instagram-business":{requiresMedia:!0,allowedMediaTypes:["image/jpg","image/jpeg",r,a,o],image:{maxSize:8},video:{maxLength:90,minLength:3,maxSize:1e3,maxWidth:1920,aspectRatio:{min:.01,max:10}}},mastodon:{allowedMediaTypes:c.concat(["video/webm","video/quicktime","video/ogg",r,o]),image:{maxSize:10},video:{maxSize:40}}},p=["image/png","image/jpeg","image/jpg","image/heic","image/heif","image/webp"],m=[...new Set([...i,...s,...c,...p])]},14085:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(13419),a=n(9818),o=n(12238);const i="republicize";function s(){const{togglePublicizeFeature:e}=(0,a.useDispatch)("jetpack/publicize"),t=(0,r.Pb)()?.social?.sharesData??{},n=t.is_share_limit_enabled,s=(0,r.OZ)(i)?.available||n,c=(0,a.useSelect)((e=>e(o.store).isCurrentPostPublished()),[]),l=(0,a.useSelect)((e=>e("jetpack/publicize").getJetpackSocialPostAlreadyShared()),[]),u=(0,r.Pb)()?.social?.publicizeConnectionsUrl??"https://wordpress.com/marketing/connections/",d=(0,a.useSelect)((e=>e("jetpack/publicize").getFeatureEnableState()),[]),p=(0,r.X1)(i)&&!s,m=c?s:d,h=c&&p,g=c&&!s,f=!!(0,r.Pb)()?.social?.hasPaidPlan,b=!!(0,r.Pb)()?.social?.isEnhancedPublishingEnabled,v=!!(0,r.Pb)()?.social?.isAutoConversionEnabled;return{isPublicizeEnabledMeta:d,isPublicizeEnabled:m,togglePublicizeFeature:e,isPublicizeDisabledBySitePlan:h,isRePublicizeFeatureAvailable:s,isRePublicizeUpgradableViaUpsell:p,hidePublicizeFeature:g,isShareLimitEnabled:n,isPostAlreadyShared:l,numberOfSharesRemaining:t.shares_remaining,shouldShowAdvancedPlanNudge:t.show_advanced_plan_upgrade_nudge,hasPaidPlan:f,isEnhancedPublishingEnabled:b,isSocialImageGeneratorAvailable:!!(0,r.Pb)()?.social?.isSocialImageGeneratorAvailable,isSocialImageGeneratorEnabled:!!(0,r.Pb)()?.social?.isSocialImageGeneratorEnabled,connectionsAdminUrl:u+(0,r.lQ)(),adminUrl:(0,r.Pb)()?.social?.adminUrl,isAutoConversionEnabled:v,jetpackSharingSettingsUrl:(0,r.Pb)()?.social?.jetpackSharingSettingsUrl}}},6230:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(9818),a=n(69307),o=n(22552),i=n(23177);function s(){const e=(0,o.Z)(),t=(0,a.useRef)(!1),n=(0,r.useDispatch)(i.E).refreshAutoConversionSettings;return{refreshAutoConversionSettings:()=>{e||(t.current=!0),e&&t.current&&(n(),t.current=!1)}}}},86419:function(e,t,n){"use strict";n.d(t,{M1:function(){return s},e3:function(){return c}});var r=n(94333),a=n(9818),o=n(12238),i=n(69307);function s(e,t){const n=(0,a.useSelect)((e=>e(o.store).isPublishingPost()),[]),s=(0,r.usePrevious)(n);(0,i.useEffect)((()=>{s&&!n&&e()}),[n,s,e,t])}function c(e,t){const n=(0,a.useSelect)((e=>e(o.store).isPublishingPost()),[]),s=(0,r.usePrevious)(n);(0,i.useEffect)((()=>{!s&&n&&e()}),[n,s,e,t])}},45579:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(13419),a=n(86989),o=n.n(a),i=n(9818),s=n(12238),c=n(69307),l=n(65736),u=n(37568),d=n(48751);const __=l.__;function p(e){const t=e?.code,n=e?.errors?.length;if(!t&&!n)return!1;let r="";return t&&(r=__("Unable to share the Post","jetpack")),n&&(r=__("Unable to share the Post","jetpack")),{message:r,result:e}}function m(e){const{message:t}=(0,d.Z)(),{skippedConnections:n}=(0,u.Z)(),a=(0,i.useSelect)((e=>e(s.store).getCurrentPostId()),[]);e=e||a;const[l,m]=(0,c.useState)({data:[],error:{}}),h=((0,r.Pb)()?.social?.resharePath??"/wpcom/v2/posts/{postId}/publicize").replace("{postId}",e),g=(0,c.useCallback)((function(){const r={isFetching:!1,isError:!1,isSuccess:!1,data:[],error:{},postId:e};if(!l.isFetching)return m({...r,isFetching:!0}),o()({path:h,method:"POST",data:{message:t,skipped_connections:n}}).then((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=p(e);if(t)return m((e=>({...e,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:t})));m((t=>({...t,isFetching:!1,isSuccess:!0,isError:!1,data:e?.results,error:{}})))})).catch((e=>{m((t=>({...t,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:p(e)})))})),function(){m(r)}}),[e,t,n,l.isFetching,h]);return{...l,doPublicize:g}}},37568:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9818);function a(){const{refreshConnectionTestResults:e,toggleConnectionById:t}=(0,r.useDispatch)("jetpack/publicize"),n=(0,r.useSelect)((e=>e("jetpack/publicize").getConnections()),[]),a=n.filter((e=>!e.enabled)).map((e=>e.id)),o=n.filter((e=>e.enabled));return{connections:n,hasConnections:n.length>0,hasEnabledConnections:n&&n.some((e=>e.enabled)),skippedConnections:a,enabledConnections:o,toggleById:t,refresh:e}}},48751:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9818),a=n(12238);function o(){const{editPost:e}=(0,r.useDispatch)(a.store),{message:t,maxLength:n}=(0,r.useSelect)((e=>({message:e("jetpack/publicize").getShareMessage(),maxLength:e("jetpack/publicize").getShareMessageMaxLength()})),[]);return{message:t,maxLength:n,updateMessage:function(t){e({meta:{jetpack_publicize_message:t}})}}}},21052:function(e,t,n){"use strict";n.d(t,{Wh:function(){return s},wO:function(){return i}});var r=n(9818),a=n(23177),o=n(4957);const i="SET_AUTO_CONVERSION_SETTINGS";function s(e){return{type:i,options:e}}t.ZP={updateAutoConversionSettings:function*(e){try{yield s({isUpdating:!0}),yield s(e),yield(0,o.Fl)(e);const t=yield(0,o.wi)();return yield s(t),!0}catch(e){const t=(0,r.select)(a.E).getAutoConversionSettings();return yield s(t),!1}finally{yield s({isUpdating:!1})}},setAutoConversionSettings:s,refreshAutoConversionSettings:function*(){try{const e=yield(0,o.wi)();return yield s(e),!0}catch(e){return!1}}}},54725:function(e,t,n){"use strict";var r=n(21052),a=n(371),o=n(4462);const i={...a.ZP,...o.ZP,...r.ZP};t.Z=i},371:function(e,t,n){"use strict";n.d(t,{dz:function(){return i},ff:function(){return s}});var r=n(9818),a=n(23177),o=n(4957);const i="SET_JETPACK_SETTINGS";function s(e){return{type:i,options:e}}t.ZP={updateJetpackSettings:function*(e){try{yield s({is_updating:!0}),yield s(e),yield(0,o.RF)(e);const t=yield(0,o.es)();return yield s(t),!0}catch(e){const t=(0,r.select)(a.E).getJetpackSettings();return yield s(t),!1}finally{yield s({is_updating:!1})}},setJetpackSettings:s}},4462:function(e,t,n){"use strict";n.d(t,{ch:function(){return s},kg:function(){return i}});var r=n(9818),a=n(23177),o=n(4957);const i="SET_SOCIAL_IMAGE_GENERATOR_SETTINGS";function s(e){return{type:i,options:e}}t.ZP={updateSocialImageGeneratorSettings:function*(e){try{yield s({isUpdating:!0}),yield s(e),yield(0,o.Ux)(e);const t=yield(0,o.oB)();return yield s(t),!0}catch(e){const t=(0,r.select)(a.E).getSocialImageGeneratorSettings();return yield s(t),!1}finally{yield s({isUpdating:!1})}},setSocialImageGeneratorSettings:s}},4957:function(e,t,n){"use strict";n.d(t,{Fl:function(){return f},RF:function(){return p},Ux:function(){return h},es:function(){return d},oB:function(){return m},wi:function(){return g}});var r=n(86989),a=n.n(r);const o="FETCH_JETPACK_SETTINGS",i="UPDATE_JETPACK_SETTINGS",s="FETCH_SOCIAL_IMAGE_GENERATOR_SETTINGS",c="UPDATE_SOCIAL_IMAGE_GENERATOR_SETTINGS",l="FETCH_AUTO_CONVERSION_SETTINGS",u="UPDATE_AUTO_CONVERSION_SETTINGS",d=()=>({type:o}),p=e=>({type:i,settings:e}),m=()=>({type:s}),h=e=>({type:c,settings:e}),g=()=>({type:l}),f=e=>({type:u,settings:e});t.ZP={[o]:function(){return a()({path:"/jetpack/v4/social/settings"})},[i]:function(e){return a()({path:"/jetpack/v4/social/settings",method:"POST",data:e.settings})},[s]:function(){return a()({path:"/jetpack/v4/social-image-generator/settings"})},[c]:function(e){return a()({path:"/jetpack/v4/social-image-generator/settings",method:"POST",data:e.settings})},[l]:function(){return a()({path:"/jetpack/v4/auto-conversion/settings"})},[u]:function(e){return a()({path:"/jetpack/v4/auto-conversion/settings",method:"POST",data:e.settings})}}},23177:function(e,t,n){"use strict";n.d(t,{E:function(){return l}});var r=n(9818),a=n(54725),o=n(4957),i=n(45272),s=n(15781),c=n(22987);const l="jetpack-social-plugin",u={reducer:i.Z,actions:a.Z,selectors:c.Z,resolvers:s.ZP,controls:o.ZP,initialState:window?.jetpackSocialInitialState||window?.Initial_State?.socialInitialState||window?.Jetpack_Editor_Initial_State?.social||{}},d=(0,r.createReduxStore)(l,u);(0,r.register)(d)},20750:function(e,t,n){"use strict";var r=n(21052);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===r.wO?{...e,...t.options}:e}},71837:function(e,t){"use strict";t.Z=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}},45272:function(e,t,n){"use strict";var r=n(9818),a=n(20750),o=n(71837),i=n(80697),s=n(35652),c=n(28696),l=n(54489);const u=(0,r.combineReducers)({sharesData:s.Z,siteData:c.Z,connectionData:o.Z,jetpackSettings:i.Z,socialImageGeneratorSettings:l.Z,autoConversionSettings:a.Z});t.Z=u},80697:function(e,t,n){"use strict";var r=n(371);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===r.dz?{...e,...t.options}:e}},35652:function(e,t){"use strict";t.Z=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}},28696:function(e,t){"use strict";t.Z=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}},54489:function(e,t,n){"use strict";var r=n(4462);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===r.kg?{...e,...t.options}:e}},15781:function(e,t,n){"use strict";var r=n(21052),a=n(371),o=n(4462),i=n(4957);t.ZP={getJetpackSettings:function*(){try{const e=yield(0,i.es)();if(e)return(0,a.ff)(e)}catch(e){console.log(e)}},getSocialImageGeneratorSettings:function*(){try{const e=yield(0,i.oB)();if(e)return(0,o.ch)(e)}catch(e){console.log(e)}},getAutoConversionSettings:function*(){try{const e=yield(0,i.wi)();if(e)return(0,r.Wh)(e)}catch(e){console.log(e)}}}},68113:function(e,t){"use strict";t.Z={getAutoConversionSettings:e=>e.autoConversionSettings,isAutoConversionAvailable:e=>e.autoConversionSettings.available,isAutoConversionEnabled:e=>e.autoConversionSettings.image,isAutoConversionSettingsUpdating:e=>e.autoConversionSettings.isUpdating}},43354:function(e,t){"use strict";const n=e=>e.connectionData?.connections??{},r={getConnections:n,getConnectionsAdminUrl:e=>e.connectionData?.adminUrl??null,hasConnections:e=>Object.keys(n(e)).length>0};t.Z=r},22987:function(e,t,n){"use strict";var r=n(68113),a=n(43354),o=n(82836),i=n(66450),s=n(85675),c=n(45073);const l={...s.Z,...a.Z,...o.Z,...i.Z,...c.Z,...r.Z};t.Z=l},82836:function(e,t){"use strict";t.Z={getJetpackSettings:e=>e.jetpackSettings,isModuleEnabled:e=>e.jetpackSettings.publicize_active,showPricingPage:e=>e.jetpackSettings.show_pricing_page,isUpdatingJetpackSettings:e=>e.jetpackSettings.is_updating,hasPaidPlan:e=>!(e.jetpackSettings?.showNudge??1),isEnhancedPublishingEnabled:e=>e.jetpackSettings?.isEnhancedPublishingEnabled??!1,getDismissedNotices:e=>e.jetpackSettings?.dismissedNotices,isInstagramConnectionSupported:e=>e.jetpackSettings?.isInstagramConnectionSupported,isMastodonConnectionSupported:e=>e.jetpackSettings?.isMastodonConnectionSupported}},66450:function(e,t){"use strict";t.Z={getSharesCount:e=>(e.sharesData?.publicized_count??0)+(e.sharesData?.to_be_publicized_count??0),getPostsCount:e=>e.sharesData?.shared_posts_count??0,isShareLimitEnabled:e=>e.sharesData?.is_share_limit_enabled??!1,numberOfSharesRemaining:e=>e.sharesData?.shares_remaining??null,shouldShowAdvancedPlanNudge:e=>e.sharesData?.show_advanced_plan_upgrade_nudge??!1}},85675:function(e,t){"use strict";t.Z={getAdminUrl:e=>e.siteData?.adminUrl??null,getAPIRootUrl:e=>e.siteData?.apiRoot??null,getAPINonce:e=>e.siteData?.apiNonce??null,getRegistrationNonce:e=>e.siteData?.registrationNonce??null,getSiteSuffix:e=>e.siteData?.siteSuffix??null,getPluginVersion:e=>e.siteData?.pluginVersion??null}},45073:function(e,t){"use strict";t.Z={getSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings,isSocialImageGeneratorAvailable:e=>e.socialImageGeneratorSettings.available,isSocialImageGeneratorEnabled:e=>e.socialImageGeneratorSettings.enabled,isUpdatingSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings.isUpdating,getSocialImageGeneratorDefaultTemplate:e=>e.socialImageGeneratorSettings.defaultTemplate}},13530:function(e,t,n){"use strict";n.r(t),n.d(t,{fetchFromAPI:function(){return s},getTwitterCards:function(){return u},refreshConnectionTestResults:function(){return a},refreshTweets:function(){return c},setTweets:function(){return l},setTwitterCards:function(){return d},toggleConnectionById:function(){return o},togglePublicizeFeature:function(){return i}});var r=n(9818);function a(){return{type:"REFRESH_CONNECTION_TEST_RESULTS"}}function o(e){return{type:"TOGGLE_CONNECTION_BY_ID",connectionId:e}}function i(){return{type:"TOGGLE_PUBLICIZE_FEATURE"}}function s(e){return{type:"FETCH_FROM_API",path:e}}function c(){return{type:"REFRESH_TWEETS"}}function l(e){return{type:"SET_TWEETS",tweets:e}}function u(e){const{twitterCardIsCached:t}=(0,r.select)("jetpack/publicize");return{type:"GET_TWITTER_CARDS",urls:e.filter((e=>!t(e)))}}function d(e){return{type:"SET_TWITTER_CARDS",cards:e}}},99376:function(e,t,n){"use strict";var r=n(86989),a=n.n(r);t.Z={FETCH_FROM_API:e=>{let{path:t}=e;return a()({path:t})}}},43785:function(e,t,n){"use strict";var r=n(13419),a=n(86989),o=n.n(a),i=n(4981),s=n(9818),c=n(12238),l=n(92819),u=n(68407);const d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{getSupportedBlockType:t}=(0,s.select)("jetpack/publicize");return(0,l.flatMap)(e,(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(e.name)||e.name.startsWith("core-embed/")?e:u.H8.includes(e.name)?d(e.innerBlocks):[]}))};const p=(0,l.throttle)((async function(){const e=(0,s.select)("core/block-editor").getBlocks(),t=d(e);try{const e=await o()({path:"/wpcom/v2/tweetstorm/parse",data:{blocks:t.map((e=>({attributes:e.attributes,block:(0,i.serialize)(e),clientId:e.clientId})))},method:"POST"}),n=(0,l.flatMap)(e,(e=>e.urls));return(0,s.dispatch)("jetpack/publicize").getTwitterCards(n),(0,s.dispatch)("jetpack/publicize").setTweets(e)}catch(e){}}),2e3,{leading:!0,trailing:!0});t.ZP={REFRESH_CONNECTION_TEST_RESULTS:async function(){try{const e=(0,r.Pb)()?.social||{},t=e.connectionRefreshPath??"/wpcom/v2/publicize/connection-test-results",n=await o()({path:t}),a=(0,s.select)("jetpack/publicize").getConnections(),i=n,l=[],u={done:!1,enabled:Boolean(e.sharesData?.shares_remaining),toggleable:!0};for(const e of i){const t=a.find((t=>t.connection_id?t.connection_id===e.connection_id:t.id===e.id)),{done:n,enabled:r,toggleable:o}=t??u,i={display_name:e.display_name,username:e.username,service_name:e.service_name,id:e.id,profile_picture:e.profile_picture,done:n,enabled:r,toggleable:o,is_healthy:e.test_success,error_code:e.error_code,connection_id:e.connection_id};l.push(i)}return(0,s.dispatch)(c.store).editPost({jetpack_publicize_connections:l})}catch(e){}},TOGGLE_CONNECTION_BY_ID:async function(e){let{connectionId:t}=e;const n=(0,s.select)("jetpack/publicize").getConnections().map((e=>({...e,enabled:(e.connection_id?e.connection_id===t:e.id===t)?!e.enabled:e.enabled})));return(0,s.dispatch)(c.store).editPost({jetpack_publicize_connections:n})},TOGGLE_PUBLICIZE_FEATURE:async function(){const e=(0,s.select)("jetpack/publicize").getFeatureEnableState();return(0,s.dispatch)(c.store).editPost({meta:{jetpack_publicize_feature_enabled:!e}})},REFRESH_TWEETS:p,GET_TWITTER_CARDS:async function(e){if(0===e.urls.length)return(0,s.dispatch)("jetpack/publicize").setTwitterCards([]);try{const t=await o()({path:"/wpcom/v2/tweetstorm/generate-cards",data:{urls:e.urls},method:"POST"});return(0,s.dispatch)("jetpack/publicize").setTwitterCards(t)}catch(e){}}}},77771:function(e,t,n){"use strict";var r=n(9818),a=n(13530),o=n(99376),i=n(92479),s=n(82726),c=n(34074);const l=(0,r.registerStore)("jetpack/publicize",{actions:a,controls:o.Z,reducer:s.Z,selectors:c});(0,i.Z)(l)},92479:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(92819),a=n(24274),o=n.n(a),i=n(43785);function s(e){const t=[o()(i.ZP)];let n=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},a=[];const s={getState:e.getState,dispatch:function(){return n(...arguments)}};return a=t.map((e=>e(s))),n=(0,r.flowRight)(...a)(e.dispatch),e.dispatch=n,e}},82726:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});const r={tweets:[],twitterCards:[]};function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REFRESH_CONNECTION_TEST_RESULTS":case"TOGGLE_CONNECTION_BY_ID":case"TOGGLE_PUBLICIZE_FEATURE":return e;case"SET_TWEETS":return{...e,tweets:t.tweets};case"GET_TWITTER_CARDS":{const n={};return t.urls.forEach((e=>n[e]={error:"loading"})),{...e,twitterCards:{...e.twitterCards,...n}}}case"SET_TWITTER_CARDS":return{...e,twitterCards:{...e.twitterCards,...t.cards}}}return e}},34074:function(e,t,n){"use strict";n.r(t),n.d(t,{checkForTagsInContentAttributes:function(){return L},contentAttributesChanged:function(){return R},getAttachedMedia:function(){return D},getBoundariesForBlock:function(){return x},getBoundaryStyleSelectors:function(){return N},getConnections:function(){return I},getFailedConnections:function(){return p},getFeatureEnableState:function(){return M},getFirstTweet:function(){return v},getImageGeneratorPostSettings:function(){return z},getInstagramDetails:function(){return g},getJetpackSocialOptions:function(){return Z},getJetpackSocialPostAlreadyShared:function(){return B},getLastTweet:function(){return k},getLinkedInDetails:function(){return h},getMustReauthConnections:function(){return m},getPopoverWarnings:function(){return T},getShareMessage:function(){return C},getShareMessageMaxLength:function(){return j},getSupportedBlockType:function(){return y},getTweetStorm:function(){return b},getTweetTemplate:function(){return f},getTweetsForBlock:function(){return w},getTwitterCardForURLs:function(){return E},isInstagramConnectionSupported:function(){return O},isMastodonConnectionSupported:function(){return U},isSelectedTweetBoundary:function(){return A},isTweetStorm:function(){return S},shouldUploadAttachedMedia:function(){return F},twitterCardIsCached:function(){return _}});var r=n(13419),a=n(9818),o=n(12238),i=n(65736),s=n(92819),c=n(96524),l=n(68407);const __=i.__,u=255,d="\n\n"+__("A thread ⬇️","jetpack");function p(){return I().filter((e=>!1===e.test_success))}function m(){return I().filter((e=>"must_reauth"===e.test_success)).map((e=>e.service_name))}function h(){let{forceDefaults:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e){const e=I().find((e=>{let{service_name:t}=e;return"linkedin"===t}));if(e)return{name:e.display_name,profileImage:e.profile_picture}}return{name:"",profileImage:""}}function g(){const e=I().find((e=>{let{service_name:t}=e;return"instagram-business"===t}));return e?{name:e.username,profileImage:e.profile_picture}:{name:"username",profileImage:""}}function f(e){const t=e.connections||I(),n=t?.find((e=>"twitter"===e.service_name));return{name:n?.profile_display_name,profileImage:n?.profile_picture,screenName:n?.display_name}}function b(e){const t=f(e),n=[v(e),...e.tweets.slice(0,100).map((n=>({...t,text:n.text,media:n.media,tweet:n.tweet,urls:n.urls,...E(e,n.urls)})))];return n.length>1&&n.push(k(e)),n}function v(e){if(!(0,a.select)("core"))return;const t=f(e),{getMedia:n}=(0,a.select)("core"),{getEditedPostAttribute:r}=(0,a.select)("core/editor"),o=r("featured_media"),i=r("link"),s=o&&n(o),c=s?.media_details?.sizes?.large?.source_url||s?.source_url;return{...t,text:C()+` ${i}`,urls:[i],title:r("title"),description:r("meta")?.advanced_seo_description||r("excerpt")||r("content").split("\x3c!--more")[0]||__("Visit the post for more.","jetpack"),url:i,image:c,cardType:c?"summary_large_image":"summary"}}function k(e){if(!(0,a.select)("core/editor"))return;const{getEditedPostAttribute:t}=(0,a.select)("core/editor"),n=t("link"),r=e.tweets.length>100?__("The rest of this thread can be read here:","jetpack"):__("This thread can be read here:","jetpack");return{...v(e),text:`${r} ${n}`}}function y(e,t){if(l.nE[t])return l.nE[t]}const w=(0,c.Z)(((e,t)=>e.tweets.filter((e=>!!e.blocks.find((e=>e.clientId===t))))),(e=>[e.tweets]));function E(e,t){if(t)return t.reduce(((t,n)=>t||(e.twitterCards[n]&&!e.twitterCards[n].error?{url:n,...e.twitterCards[n]}:void 0)),void 0)}function _(e,t){return!!e.twitterCards[t]}function C(){const{getEditedPostAttribute:e}=(0,a.select)("core/editor"),t=e("meta"),n=e("title"),r=(0,s.get)(t,["jetpack_publicize_message"],"");return r?r.substr(0,j()):S()&&n?n.substr(0,j())+d:""}function j(){return S()?u-d.length:u}function S(){return!!(0,a.select)("core/editor").getEditedPostAttribute("meta")?.jetpack_is_tweetstorm}const x=(0,c.Z)(((e,t)=>{if(!S())return[];const n=w(e,t);return n&&0!==n.length?n.filter((e=>e.boundary)).map((e=>e.boundary)):[]}),(e=>[e.tweets]));function P(e,t){if(`block-${t}`===e.id)return`#block-${t}`;const n=e.parentNode,r=Array.prototype.indexOf.call(n.children,e);return P(n,t)+` > :nth-child( ${r+1} )`}const N=(0,c.Z)(((e,t)=>{const n=x(e,t),r=document.getElementById(`block-${t}`);return n.filter((e=>"end-of-line"===e.type)).map((e=>{if(!r)return!1;const n=r.getElementsByTagName("li").item(e.line);return!!n&&P(n,t)})).filter((e=>!!e))}),(e=>[e.tweets]));function L(e,t,n){if(0===n.length)return!1;if(!y(0,t.name)?.contentAttributes)return!1;const r=new RegExp(`<(${n.join("|")})( |>|/>)`,"gi");return y(0,t.name).contentAttributes.reduce(((e,n)=>!!e||r.test(t.attributes[n])),!1)}const T=(0,c.Z)(((e,t)=>{const{isTyping:n,isDraggingBlocks:r,isMultiSelecting:o,hasMultiSelection:i,isCaretWithinFormattedText:s}=(0,a.select)("core/block-editor");if(!S())return[];if(n()||r()||o()||i()||s())return[];const c=[];return y(0,t.name)||l.H8[t.name]?("core/gallery"===t.name&&t.attributes.images.length>4&&c.push(__("Twitter displays the first four images.","jetpack")),L(0,t,["strong","bold","em","i","sup","sub","span","s"])&&c.push(__("Twitter removes all text formatting.","jetpack")),L(0,t,["a"])&&c.push(__("Links will be posted seperately.","jetpack"))):c.push(__("This block is not exportable to Twitter","jetpack")),c}),(e=>[e.tweets]));function A(e,t){const{isBlockSelected:n}=(0,a.select)("core/block-editor");if(!S())return!1;const r=y(0,t.name),o=w(e,t.clientId);if(!o||0===o.length)return!1;const i=o[o.length-1];return n(t.clientId)&&!r||i.blocks[i.blocks.length-1].clientId===t.clientId&&o.some((e=>e.blocks.some((e=>n(e.clientId)))))}function R(e,t,n){const r=y(0,n.name);if(!r)return!1;const a=r.contentAttributes;return!(0,s.isEqual)(a.map((e=>({attribute:e,content:t.attributes[e]}))),a.map((e=>({attribute:e,content:n.attributes[e]}))))}function I(){return(0,a.select)(o.store).getEditedPostAttribute("jetpack_publicize_connections")||[]}function M(){const{getEditedPostAttribute:e}=(0,a.select)(o.store),t=e("meta");return(0,s.get)(t,["jetpack_publicize_feature_enabled"],!0)}function Z(){const{getEditedPostAttribute:e}=(0,a.select)(o.store),t=e("meta");return(0,s.get)(t,["jetpack_social_options"],{})}function B(){const{getEditedPostAttribute:e}=(0,a.select)(o.store),t=e("meta");return(0,s.get)(t,["jetpack_social_post_already_shared"],{})}function D(){return(0,s.get)(Z(),["attached_media"],[])}function F(){return Z()?.should_upload_attached_media??!1}function z(){return Z()?.image_generator_settings??{}}function O(){return!!(0,r.Pb)()?.social?.isInstagramConnectionSupported}function U(){return!!(0,r.Pb)()?.social?.isMastodonConnectionSupported}},13419:function(e,t,n){"use strict";n.d(t,{Dp:function(){return u.Z},FK:function(){return l.FK},HD:function(){return l.HD},M6:function(){return o.M6},OZ:function(){return i.Z},Pb:function(){return r.Z},Pm:function(){return m.Z},Qq:function(){return l.Qq},Rl:function(){return l.Rl},T:function(){return c.Z},Ug:function(){return o.Ug},Wp:function(){return o.Wp},X1:function(){return l.X1},_D:function(){return l._D},aQ:function(){return o.aQ},dM:function(){return h.d},el:function(){return p.Z},lQ:function(){return a.Z},lt:function(){return h.l},m3:function(){return l.m3},o_:function(){return s.Z},z$:function(){return d.Z}});var r=n(50148),a=n(35004),o=n(99505),i=n(48052),s=n(76714),c=n(80354),l=n(75404),u=n(68586),d=n(61053),p=n(11380),m=n(6342),h=n(96959)},6342:function(e,t,n){"use strict";var r=n(78868),a=n(99196),o=n.n(a);t.Z=()=>o().createElement(r.Z,{className:"jetpack-editor-panel-logo",height:16,logoColor:"#1E1E1E",showText:!1})},96959:function(e,t,n){"use strict";n.d(t,{d:function(){return o},l:function(){return i}});var r=n(69307),a=n(12953);function o(e){const t={};let n="span",a=e.icon;const o=document.createElement("div");o.innerHTML=e.icon;const i=o.querySelector("svg");return i&&(n="svg",a=i.innerHTML,Array.from(i.attributes).forEach((e=>{let{nodeName:n,nodeValue:r}=e;return t[n]=r}))),(0,r.createElement)(n,{...t,dangerouslySetInnerHTML:{__html:a||""}})}function i(e){return{src:o(e),foreground:(0,a.Z)()}}},12953:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(99505);const a="#069e08";function o(){return(0,r.Ug)()||(0,r.Wp)()?null:a}},50148:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});const r="Jetpack_Editor_Initial_State";function a(){return"object"==typeof window?window?.[r]??null:null}},48052:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(50148);function a(e){const t=(0,r.Z)(),n=t?.available_blocks?.[e]?.available??!1,a=t?.available_blocks?.[e]?.unavailable_reason??"unknown";return{available:n,...!n&&{details:t?.available_blocks?.[e]?.details??[],unavailableReason:a}}}},35004:function(e,t,n){"use strict";function r(){return window&&window.Jetpack_Editor_Initial_State&&window.Jetpack_Editor_Initial_State.siteFragment?window.Jetpack_Editor_Initial_State.siteFragment:null}n.d(t,{Z:function(){return r}})},61053:function(e,t,n){"use strict";var r=n(6975),a=n(31294),o=n(69307);const{tracks:i}=r.Z,{recordEvent:s}=i;t.Z=function(){let{pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:c={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[l,u]=(0,o.useState)(!1),{isUserConnected:d,isRegistered:p,userConnectionData:m={}}=(0,a.Z)(),{wpcomUser:{login:h,ID:g}={},blogId:f}=m.currentUser||{},b=(0,o.useCallback)((async function(e){d&&g&&h&&s(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}),[d,g,h]);return(0,o.useEffect)((()=>{d&&g&&h&&f&&r.Z.initialize(g,h,{blog_id:f})}),[f,g,h,d]),(0,o.useEffect)((()=>{const r=e?`${t}_${e}_${n}`:null;p&&r&&(l||(b(r,c),u(!0)))}),[l,t,e,n,p,c,b]),{recordEvent:b,tracks:i}}},11380:function(e,t,n){"use strict";var r=n(86989),a=n.n(r),o=n(69307),i=n(99505);async function s(e){if((0,i.Wp)())return!0;try{const t=await async function(){try{return await a()({path:"/jetpack/v4/module/all",method:"GET"})}catch(e){return e.message}}();return!(!t||!t.hasOwnProperty(e))&&!!t[e].activated}catch(e){return!1}}t.Z=e=>{const[t,n]=(0,o.useState)(Boolean(e)),[r,i]=(0,o.useState)(!1),[c,l]=(0,o.useState)(!1);(0,o.useEffect)((()=>{e&&(n(!0),s(e).then((e=>{l(e),n(!1)})))}),[e]);const u=(0,o.useCallback)((t=>{e&&c!==t&&(i(!0),async function(e,t){return await a()({path:`/jetpack/v4/module/${e}/active`,method:"POST",data:{active:t}})}(e,t).then((()=>{l(t),i(!1)})).catch((()=>{i(!1)})))}),[e,c]);return(0,o.useMemo)((()=>({isLoadingModules:t,isChangingStatus:r,isModuleActive:c,changeStatus:u})),[t,r,c,u])}},68586:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(50148);function a(){return(0,r.Z)()?.jetpack?.is_current_user_connected??!1}},75404:function(e,t,n){"use strict";n.d(t,{FK:function(){return g},HD:function(){return f},Qq:function(){return u},Rl:function(){return m},X1:function(){return d},_D:function(){return p},m3:function(){return b}});var r=n(65736),a=n(96483),o=n(92819),i=n(50148),s=n(48052),c=n(35004),l=n(99505);const __=r.__;function u(e){let{planSlug:t,plan:n,postId:r,postType:i}=e;const s=(0,o.startsWith)(t,"jetpack_")?t:(0,o.get)(n,["path_slug"]),u=(void 0===i?()=>{const e=new URLSearchParams(window.location.search);return(0,a.addQueryArgs)(window.location.protocol+`//${(0,c.Z)().replace("::","/")}/wp-admin/site-editor.php`,{postId:e.get("postId"),postType:e.get("postType"),plan_upgraded:1})}:()=>{const e=["page","post"].includes(i)?"":"edit";return(0,l.Wp)()?(0,a.addQueryArgs)("/"+(0,o.compact)([e,i,(0,c.Z)(),r]).join("/"),{plan_upgraded:1}):(0,a.addQueryArgs)(window.location.protocol+`//${(0,c.Z)().replace("::","/")}/wp-admin/post.php`,{action:"edit",post:r,plan_upgraded:1})})();return(0,l.Ug)()?(0,a.addQueryArgs)(`https://wordpress.com/plans/${(0,c.Z)()}`,{redirect_to:u,customerType:"business"}):s&&(0,a.addQueryArgs)(`https://wordpress.com/checkout/${(0,c.Z)()}/${s}`,{redirect_to:u})}function d(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{available:n,unavailableReason:r}=(0,s.Z)(t);return!n&&"missing_plan"===r}function p(e,t){return"missing_plan"===e&&t.required_plan}function m(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{details:n,unavailableReason:r}=(0,s.Z)(t);return p(r,n)}const h=[{name:"core/cover",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"video",description:__("Upgrade your plan to use video covers","jetpack")},{name:"core/audio",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"audio",description:__("Upgrade your plan to upload audio","jetpack")}];function g(){return(0,o.get)((0,i.Z)(),"jetpack.enable_upgrade_nudge",!1)}const f=e=>(0,o.map)(h,"name").includes(e),b=e=>(0,o.head)((0,o.filter)(h,(t=>{let{name:n}=t;return n===e})))},76714:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(98817),a=n(48052);function o(e,t){const{available:n,unavailableReason:o}=(0,a.Z)(e);return!!n&&(0,r.registerPlugin)(`jetpack-${e}`,t)}},99505:function(e,t,n){"use strict";n.d(t,{M6:function(){return s},Ug:function(){return i},Wp:function(){return o},aQ:function(){return c}});var r=n(50148);function a(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function o(){return"simple"===a()}function i(){return"atomic"===a()}function s(){const e=(0,r.Z)();return e?.jetpack?.is_private_site??!1}function c(){const e=(0,r.Z)();return e?.jetpack?.is_coming_soon??!1}},80354:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(94333);t.Z=e=>(0,o.createHigherOrderComponent)((t=>n=>React.createElement(t,a()({},n,{className:n.name===e?"has-warning is-interactive":n.className}))),"withHasWarningIsInteractiveClassNames")},84005:function(e,t){"use strict";t.Z={content:{type:"string"},originalContent:{type:"string"},promptType:{type:"string"},originalMessages:{type:"array",default:[]},messages:{type:"array",default:[]},useGutenbergSyntax:{type:"boolean",default:!1},useGpt4:{type:"boolean",default:!1},customSystemPrompt:{type:"string",default:""}}},83059:function(e,t,n){"use strict";n.d(t,{B3:function(){return y},ZP:function(){return E}});var r=n(51806),a=n(36222),o=n(55609),i=n(65736),s=n(586),c=n(3639),l=n(92710),u=n(58532),d=n(65235),p=n.n(d),m=(n(99196),n(63634)),h=n(81612),g=n(27298);const __=i.__,f="correct-spelling",b="simplify",v="summarize",k="make-longer",y="ask-ai-assistant",w=[{name:__("Correct spelling and grammar","jetpack"),key:f,aiSuggestion:m.Hd,icon:s.Z},{name:__("Simplify","jetpack"),key:b,aiSuggestion:m.hI,icon:c.Z},{name:__("Summarize","jetpack"),key:v,aiSuggestion:m.Lq,icon:l.Z},{name:__("Expand","jetpack"),key:k,aiSuggestion:m.TV,icon:u.Z}];function E(e){let{key:t,label:n,exclude:i=[],requestingState:s,disabled:c,onChange:l,onReplace:u}=e;const d=w.filter((e=>!i.includes(e.key))),f="suggesting"===s?null:n||__("AI Assistant","jetpack");return(0,r.createElement)(o.Dropdown,{popoverProps:{variant:"toolbar"},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,r.createElement)(o.ToolbarButton,{className:p()("jetpack-ai-assistant__button",{[`is-${s}`]:!0}),showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,label:f,icon:a.u_,disabled:c})},renderContent:e=>{let{onClose:s}=e;return(0,r.createElement)(o.MenuGroup,{label:n},!i.includes(y)&&(0,r.createElement)(o.MenuItem,{icon:a.u_,iconPosition:"left",key:"key-ai-assistant",onClick:u,isSelected:"key-ai-assistant"===t},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},__("Ask AI Assistant","jetpack"))),d.map((e=>(0,r.createElement)(o.MenuItem,{icon:e?.icon,iconPosition:"left",key:`key-${e.key}`,onClick:()=>{l(e.aiSuggestion),s()},isSelected:t===e.key},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},e.name)))),(0,r.createElement)(g.IP,{onChange:e=>{l(m.Lg,{tone:e}),s()}}),(0,r.createElement)(h.xK,{onChange:e=>{l(m.Nw,{language:e}),s()}}))}})}},3180:function(e,t,n){"use strict";var r=n(51806),a=n(65736),o=n(26546),i=n(46867);const __=a.__;t.Z=()=>{const e=`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/connection`,{autosaveAndRedirect:t,isRedirecting:n}=(0,i.Z)(e);return(0,r.createElement)(o.p,{buttonText:__("Reconnect Jetpack","jetpack"),checkoutUrl:e,className:"jetpack-ai-connect-banner",description:__("Your account is not connected to Jetpack at the moment.","jetpack"),goToCheckoutPage:e=>{t(e)},isRedirecting:n,visible:!0,align:null,title:null,context:null})}},81612:function(e,t,n){"use strict";n.d(t,{ZP:function(){return g},xK:function(){return f}});var r=n(51806),a=n(55609),o=n(65736),i=n(61074),s=n(46936),c=n(43618);n(99196);const __=o.__,l=["en","es","fr","de","it","pt","ru","zh","ja","ar","hi","ko"],u=window?.Jetpack_Editor_Initial_State?.siteLocale||navigator?.language,d=__("Translate","jetpack"),p=u?.split("-")[0]||"en",m=(u?.split("-"),{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")},id:{label:__("Indonesian","jetpack")},tl:{label:__("Filipino","jetpack")},vi:{label:__("Vietnamese","jetpack")}}),h=e=>{let{value:t,onChange:n}=e;const o=[...l.filter((e=>e!==p))];return l.includes(p)&&o.unshift(p),(0,r.createElement)(a.MenuGroup,{label:__("Select language","jetpack")},o.map((e=>(0,r.createElement)(a.MenuItem,{key:`key-${e}`,onClick:()=>n(e+" ("+m[e].label+")"),isSelected:t===e},m[e].label))))};function g(e){let{value:t=p,label:n=d,onChange:o}=e;return(0,r.createElement)(a.ToolbarDropdownMenu,{icon:c.Z,label:n,popoverProps:{variant:"toolbar"}},(()=>(0,r.createElement)(h,{value:t,onChange:o})))}function f(e){let{value:t=p,label:n=d,disabled:o=!1,onChange:l}=e;return(0,r.createElement)(a.DropdownMenu,{className:"ai-assistant__i18n-dropdown",icon:c.Z,label:n,disabled:o,toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__i18n-dropdown__toggle-label"},n),(0,r.createElement)(i.Z,{icon:s.Z}))}},(e=>{let{onClose:n}=e;return(0,r.createElement)(h,{onChange:e=>{l(e),n()},value:t})}))}},50297:function(e,t,n){"use strict";var r=n(51806),a=n(55609),o=n(65736);const __=o.__;t.Z=e=>{let{image:t,inModal:n=!1,saveImage:o,setImageModal:i}=e;return(0,r.createElement)(a.Flex,{direction:"column"},n&&(0,r.createElement)(a.FlexItem,{style:{textAlign:"center"}},(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>o(t)},__("Use this image","jetpack"))),(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)("input",{type:"image",className:"wp-block-ai-image-image",src:t,alt:"",onClick:()=>i(t)})),!n&&(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)(a.Flex,{direction:"column",style:{alignItems:"center"}},(0,r.createElement)(a.FlexItem,null,(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>o(t)},__("Use this image","jetpack"))))))}},24404:function(e,t,n){"use strict";n.d(t,{ZP:function(){return h}});var r=n(51806),a=n(55609),o=n(65736),i=n(77840);n(99196);const __=o.__,s="make-longer",c="makeLonger",l="make-shorter",u="makeShorter",d="summarize",p="summarize",m=[{name:__("Summarize","jetpack"),key:d,aiSuggestion:p},{name:__("Make longer","jetpack"),key:s,aiSuggestion:c},{name:__("Make shorter","jetpack"),key:l,aiSuggestion:u}];function h(e){let{key:t,label:n,exclude:o=[],onChange:s}=e;return(0,r.createElement)(a.ToolbarDropdownMenu,{icon:i.Z,label:n||__("Improve","jetpack"),popoverProps:{variant:"toolbar"}},(()=>{const e=m.filter((e=>!o.includes(e.key)));return(0,r.createElement)(a.MenuGroup,{label:n},e.map((e=>(0,r.createElement)(a.MenuItem,{key:`key-${e.key}`,onClick:()=>s(e.aiSuggestion,{contentType:"generated"}),isSelected:t===e.key},e.name))))}))}},85642:function(e,t,n){"use strict";n.d(t,{Ie:function(){return p},ZP:function(){return m}});var r=n(51806),a=n(55609),o=n(65736),i=n(58532),s=n(586),c=n(3639),l=n(92710),u=n(32677),d=n(77840);n(99196);const __=o.__,p=[{label:__("Post about…","jetpack"),description:{original:"Write a post about ",translated:__("Write a post about ","jetpack")}},{label:__("Informative article on…","jetpack"),description:{original:"Craft an informative article explaining ",translated:__("Craft an informative article explaining ","jetpack")}},{label:__("Step-by-step tutorial on…","jetpack"),description:{original:"Write a step-by-step tutorial on ",translated:__("Write a step-by-step tutorial on ","jetpack")}},{label:__("Motivational post on…","jetpack"),description:{original:"Create a motivational post on ",translated:__("Create a motivational post on ","jetpack")}}];function m(e){let{hasContentBefore:t,hasContent:n,hasPostTitle:o,onPromptSelect:m,onSuggestionSelect:h}=e;const g=__("Write with AI…","jetpack");return(0,r.createElement)(a.ToolbarDropdownMenu,{className:"jetpack-ai-assistant__templates-control",icon:null,label:g,text:g},(e=>{let{onClose:g}=e;return(0,r.createElement)(r.Fragment,null,t&&(0,r.createElement)(a.MenuGroup,{label:__("Based on preceding content…","jetpack")},(0,r.createElement)(a.MenuItem,{icon:i.Z,iconPosition:"left",onClick:()=>h("continue")},__("Continue writing","jetpack")),(0,r.createElement)(a.MenuItem,{icon:s.Z,iconPosition:"left",onClick:()=>h("correctSpelling")},__("Correct spelling and grammar","jetpack")),(0,r.createElement)(a.MenuItem,{icon:c.Z,iconPosition:"left",onClick:()=>h("simplify")},__("Simplify","jetpack"))),n&&(0,r.createElement)(a.MenuGroup,{label:__("Based on entire content…","jetpack")},n&&(0,r.createElement)(a.MenuItem,{icon:l.Z,iconPosition:"left",onClick:()=>h("summarize")},__("Summarize","jetpack")),n&&(0,r.createElement)(a.MenuItem,{icon:u.Z,iconPosition:"left",onClick:()=>h("generateTitle")},__("Generate a post title","jetpack"))),(0,r.createElement)(a.MenuGroup,{label:__("Write…","jetpack")},o&&(0,r.createElement)(a.MenuItem,{icon:d.Z,iconPosition:"left",onClick:()=>h("titleSummary")},__("Summary based on title","jetpack")),p.map(((e,t)=>(0,r.createElement)(a.MenuItem,{icon:d.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{g(),m(e.description)}},e.label)))))}))}},27298:function(e,t,n){"use strict";n.d(t,{IP:function(){return p},Nj:function(){return l},ZP:function(){return m}});var r=n(51806),a=n(36222),o=n(55609),i=n(65736),s=n(46936);n(99196);const __=i.__,c=["formal","informal","optimistic","humorous","serious","skeptical","empathetic","confident","passionate","provocative"],l="formal",u={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:"🔥"}},d=e=>{let{value:t,onChange:n}=e;return(0,r.createElement)(o.MenuGroup,{label:__("Select tone","jetpack")},c.map((e=>(0,r.createElement)(o.MenuItem,{key:`key-${e}`,onClick:()=>n(e),isSelected:t===e},`${u[e].emoji} ${u[e].label}`))))};function p(e){let{label:t=__("Change tone","jetpack"),value:n=l,onChange:i}=e;return(0,r.createElement)(o.DropdownMenu,{icon:a.v_,label:t,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"},t),(0,r.createElement)(o.Icon,{icon:s.Z}))}},(e=>{let{onClose:t}=e;return(0,r.createElement)(d,{value:n,onChange:e=>{i(e),t()}})}))}function m(e){let{value:t=l,onChange:n}=e;return(0,r.createElement)(o.ToolbarDropdownMenu,{icon:a.v_,label:__("Change tone","jetpack"),popoverProps:{variant:"toolbar"}},(()=>(0,r.createElement)(d,{value:t,onChange:n})))}},4965:function(e,t,n){"use strict";var r=n(51806),a=n(52175),o=n(55609),i=n(65736),s=n(79201),c=n(48381),l=(n(75022),n(63634)),u=n(81612),d=n(24404),p=n(85642),m=n(27298);const __=i.__;t.Z=e=>{let{contentIsLoaded:t,getSuggestionFromOpenAI:n,retryRequest:i,handleAcceptContent:h,handleImageRequest:g,handleTryAgain:f,showRetry:b,contentBefore:v,hasPostTitle:k,wholeContent:y,setUserPrompt:w,recordEvent:E,isGeneratingTitle:_}=e;return(0,r.createElement)(r.Fragment,null,t&&(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(m.ZP,{value:"neutral",onChange:e=>{E("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:l.Lg}),n(l.Lg,{tone:e,contentType:"generated"})},disabled:t}),(0,r.createElement)(u.ZP,{value:"en",onChange:e=>{E("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:l.Nw}),n(l.Nw,{language:e,contentType:"generated"})},disabled:t}),(0,r.createElement)(d.ZP,{onChange:n,exclude:_?["summarize"]:[]})),(0,r.createElement)(a.BlockControls,null,!b&&!t&&(0,r.createElement)(p.ZP,{hasContentBefore:!!v?.length,hasContent:!!y?.length,hasPostTitle:k,onPromptSelect:e=>{E("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"prompt-template",prompt:e.original}),w(e.translated)},onSuggestionSelect:e=>{E("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:e}),n(e)}}),(0,r.createElement)(o.ToolbarGroup,null,!b&&t&&(0,r.createElement)(o.ToolbarButton,{onClick:f},__("Try Again","jetpack")),!b&&!t&&!!y?.length&&(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(m.ZP,{value:"neutral",onChange:e=>{E("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:l.Lg}),n(l.Lg,{tone:e})}}),(0,r.createElement)(u.ZP,{value:"en",label:__("Translate","jetpack"),onChange:e=>{E("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:l.Nw}),n(l.Nw,{language:e})}})),b&&t&&(0,r.createElement)(o.ToolbarButton,{icon:s.Z,onClick:h},__("Accept","jetpack")),b&&(0,r.createElement)(o.ToolbarButton,{icon:c.Z,onClick:i},__("Retry","jetpack"))),false))}},5246:function(e,t,n){"use strict";var r=n(51806),a=n(69307),o=n(65736),i=(n(99196),n(26546)),s=n(63206),c=n(18135),l=n(71449);const __=o.__;t.Z=()=>{const{upgradeType:e}=(0,c.ZP)();return"vip"===e?(0,r.createElement)(i.p,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:(0,a.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. Please reach out to your VIP account team.","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:null,isRedirecting:null,visible:!0,align:null,title:null,context:null}):(()=>{const{checkoutUrl:e,autosaveAndRedirect:t,isRedirecting:n}=(0,s.Z)();return(0,l.d)()?(0,r.createElement)(i.p,{buttonText:"Upgrade",checkoutUrl:e,className:"jetpack-ai-upgrade-banner",description:(0,a.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit!
    Upgrade now to keep using it.","jetpack"),{br:(0,r.createElement)("br",null),strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:t,isRedirecting:n,visible:!0,align:null,title:null,context:null}):(0,r.createElement)(i.p,{showButton:!1,className:"jetpack-ai-upgrade-banner",description:(0,a.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit!
    Reach out to the site administrator to upgrade and keep using Jetpack AI.","jetpack"),{br:(0,r.createElement)("br",null),strong:(0,r.createElement)("strong",null)}),visible:!0,align:null,title:null,context:null})})()}},45624:function(e,t,n){"use strict";n.d(t,{Z:function(){return I}});var r=n(82674),a=n.n(r),o=n(51806),i=n(36222),s=n(13419),c=n(52175),l=n(4981),u=n(55609),d=n(94333),p=n(9818),m=n(69307),h=n(65736),g=n(65235),f=n.n(g),b=n(10185),v=n.n(b),k=n(99196),y=n(3180),w=n(50297),E=n(85642),_=n(4965),C=n(5246),j=n(49259),S=n(18135),x=n(60751),P=n(71449),N=n(3687),L=n(63634);const __=h.__,T=new(v())({breaks:!0}),A="post"===window?.Jetpack_Editor_Initial_State?.screenBase,R=window?.Jetpack_Editor_Initial_State?.["ai-assistant"]?.["is-playground-visible"];function I(e){let{attributes:t,setAttributes:n,clientId:r}=e;const[h,g]=(0,m.useState)(),[b,v]=(0,m.useState)({}),[I,M]=(0,m.useState)(!1),[Z,B]=(0,m.useState)([]),[D,F]=(0,m.useState)(null),[z,O]=(0,m.useState)(null),{tracks:U}=(0,s.z$)(),H=(0,p.useSelect)((e=>e("core/editor").getCurrentPostId())),V=(0,p.useSelect)((e=>()=>e("core/block-editor").getBlock(r)),[r]),G=(0,k.useRef)(null),$=(0,k.useRef)(null),{replaceBlocks:q,replaceBlock:W,removeBlock:J}=(0,p.useDispatch)("core/block-editor"),{editPost:K}=(0,p.useDispatch)("core/editor"),{mediaUpload:X}=(0,p.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return{mediaUpload:t().mediaUpload}}),[]),Y=()=>{setTimeout((()=>{G.current?.focus?.()}),100)},Q=(0,d.useViewportMatch)("medium","<"),{requireUpgrade:ee,refresh:te}=(0,S.ZP)(),ne=ee||"error_quota_exceeded"===b?.code,{isLoadingCategories:re,isLoadingCompletion:ae,wasCompletionJustRequested:oe,getSuggestionFromOpenAI:ie,stopSuggestion:se,showRetry:ce,contentBefore:le,postTitle:ue,retryRequest:de,wholeContent:pe,requestingState:me}=(0,x.Z)({onSuggestionDone:Y,onUnclearPrompt:Y,onModeration:Y,attributes:t,clientId:r,content:t.content,setError:v,tracks:U,userPrompt:h,refreshFeatureData:te,requireUpgrade:ne}),he=(0,P.b)(),ge=(0,j.$M)(r);(0,k.useEffect)((()=>{if(!ge)return;const e=JSON.parse(localStorage.getItem(ge));if(!e)return;const{type:t,options:n}=e;localStorage.removeItem(ge),ie(t,n)}),[ge,ie]),(0,k.useEffect)((()=>{b&&O(!1)}),[b]);const fe=(0,k.useRef)(t?.content);(0,k.useEffect)((()=>{if(!t?.useGutenbergSyntax)return;if(!fe?.current?.length)return;const e=V();if(e?.innerBlocks?.length)return;const n=(0,l.parse)(fe.current);n?.length&&q(r,n)}),[fe,r,q,V,t?.useGutenbergSyntax]);const[be,ve]=(0,m.useState)(""),[ke,ye]=(0,m.useState)(0);(0,k.useEffect)((()=>{const e=setInterval((()=>{kee+1))):(clearInterval(e),ve(__("Ask Jetpack AI","jetpack")))}),1600);return()=>clearInterval(e)}),[be,ke]);const we=async e=>{if(I)return;M(!0),v({});const n=await fetch(e),a=await n.blob(),o=new File([a],"jetpack_ai_image.png",{type:"image/png"});X({filesList:[o],onFileChange:e=>{let[n]=e;n.id&&W(r,(0,l.createBlock)("core/image",{url:n.url,caption:t.requestedPrompt,alt:t.requestedPrompt}))},allowedTypes:["image"],onError:e=>{console.error(e),M(!1)}}),U.recordEvent("jetpack_ai_dalle_generation_upload",{post_id:H})},Ee=t?.useGutenbergSyntax,_e=ae||re,Ce=!!t.content,je="generateTitle"===t.promptType,Se=__("Accept","jetpack"),xe=__("Accept title","jetpack"),Pe=je?xe:Se,Ne=function(){ie(...arguments),setTimeout((()=>{$.current?.focus?.()}),100)},Le=async()=>{let e=[];if(Ee)e=V(),e=e?.innerBlocks||[];else{const n=T.render(t.content).replace(/
  • \s+

    /g,"

  • ").replace(/<\/p>\s+<\/li>/g,"
  • ");e=(0,l.rawHandler)({HTML:n})}await q(r,e);const n=(e=>{let t=null;return e.forEach((e=>{const n=document.querySelector(`.wp-block[data-block="${e.clientId}"]`);if(!n)return;"true"===n.contentEditable&&(t=n);const r=n.querySelectorAll("[contenteditable=true]");t=r.length?r[r.length-1]:t})),t})(e);n&&(e=>{const t=window.getSelection();t.selectAllChildren(e),t.collapseToEnd(),e.focus()})(n)},Te=()=>{A?(K({title:t.content.trim()}),J(r)):Le()},Ae=()=>{se()};(0,d.useKeyboardShortcut)("esc",(e=>{e.stopImmediatePropagation(),Ae(),Y()}),{target:$});const[Re,Ie]=(0,m.useState)(!1),Me=()=>{Ie(!Re)},Ze=(0,c.useBlockProps)({ref:$,className:f()({"is-waiting-response":oe})}),Be=(0,c.useInnerBlocksProps)(Ze);return(0,o.createElement)("div",Ze,b?.message&&!z&&"error_quota_exceeded"!==b?.code&&(0,o.createElement)(u.Notice,{status:b.status,isDismissible:!1,className:"jetpack-ai-assistant__error"},b.message),Ce&&!Ee&&(0,o.createElement)("div",{className:"jetpack-ai-assistant__content"},(0,o.createElement)(m.RawHTML,null,T.render(t.content))),Ce&&Ee&&(0,o.createElement)("div",a()({className:"jetpack-ai-assistant__content is-layout-building-mode"},Be)),R&&(0,o.createElement)(c.InspectorControls,null,(0,o.createElement)(u.PanelBody,{title:__("AI Playground","jetpack"),initialOpen:!0},(0,o.createElement)(u.PanelRow,null,(0,o.createElement)(u.ToggleControl,{label:__("Gutenberg Syntax","jetpack"),onChange:e=>n({useGutenbergSyntax:e}),checked:t.useGutenbergSyntax})),(0,o.createElement)(u.PanelRow,null,(0,o.createElement)(u.ToggleControl,{label:__("GPT-4","jetpack"),onChange:e=>n({useGpt4:e}),checked:t.useGpt4})),(0,o.createElement)(u.PanelRow,null,Re&&(0,o.createElement)(u.Modal,{title:__("Custom System Prompt","jetpack"),onRequestClose:Me},(0,o.createElement)(u.TextareaControl,{rows:20,label:__("Set up the custom system prompt ","jetpack"),onChange:e=>n({customSystemPrompt:e}),className:"jetpack-ai-assistant__custom-prompt",value:t.customSystemPrompt||(0,L.t4)({useGutenbergSyntax:t.useGutenbergSyntax,useGpt4:t.useGpt4})?.content}),(0,o.createElement)("div",{className:"jetpack-ai-assistant__custom-prompt__footer"},(0,o.createElement)(u.Button,{onClick:()=>n({customSystemPrompt:""}),variant:"secondary"},__("Restore the prompt","jetpack")),(0,o.createElement)(u.Button,{onClick:Me,variant:"secondary"},__("Close","jetpack")))),(0,o.createElement)(u.Button,{onClick:Me,variant:"secondary"},__("Set system custom prompt","jetpack"))))),ne&&(0,o.createElement)(C.Z,null),!he&&(0,o.createElement)(y.Z,null),!_e&&he&&!ne&&(0,o.createElement)(_.Z,{isWaitingState:_e,contentIsLoaded:Ce,getSuggestionFromOpenAI:ie,retryRequest:de,handleAcceptContent:Le,handleAcceptTitle:Te,handleGetSuggestion:Ne,handleImageRequest:()=>{B([]),v({}),(0,N.b)(""===h.trim()?__("What would you like to see?","jetpack"):h,n,M,B,v,H),U.recordEvent("jetpack_ai_dalle_generation",{post_id:H})},handleTryAgain:()=>{n({content:t?.originalContent,promptType:void 0,messages:t?.originalMessages})},showRetry:ce,contentBefore:le,hasPostTitle:!!ue?.length,wholeContent:pe,promptType:t.promptType,setUserPrompt:e=>{if(!G?.current)return;G.current.focus();for(let t=0;t{g(e.slice(0,t+1))}),25*t)},recordEvent:U.recordEvent,isGeneratingTitle:je}),(0,o.createElement)(i.tK,{ref:G,disabled:ne||!he,value:h,placeholder:be||__("Ask Jetpack AI","jetpack"),onChange:e=>{O(!0),g(e)},onSend:()=>{Ne("userPrompt")},onStop:Ae,onAccept:()=>{je?Te():Le()},state:me,isTransparent:ne||!he,showButtonLabels:!Q,showAccept:Ce&&!_e,acceptLabel:Pe,showClearButton:!_e,showGuideLine:Ce}),!I&&Z.length>0&&(0,o.createElement)(u.Flex,{direction:"column",style:{width:"100%"}},(0,o.createElement)(u.FlexBlock,{style:{textAlign:"center",margin:"12px",fontStyle:"italic",width:"100%"}},t.requestedPrompt),(0,o.createElement)(u.FlexBlock,{style:{fontSize:"20px",lineHeight:"38px"}},__("Please choose your image","jetpack")),(0,o.createElement)(u.Flex,{direction:"row",wrap:!0},Z.map((e=>(0,o.createElement)(w.Z,{setImageModal:F,saveImage:we,image:e,key:e}))))),!I&&D&&(0,o.createElement)(u.Modal,{onRequestClose:()=>F(null)},(0,o.createElement)(w.Z,{saveImage:we,setImageModal:F,image:D,inModal:!0})))}},27559:function(e,t,n){"use strict";var r=n(31985),a=n(29137);(0,r.Z)(a.u2,a.Xd)},54765:function(e,t,n){"use strict";n.d(t,{J7:function(){return d},NP:function(){return l}});var r=n(4981),a=n(9818),o=n(92694),i=n(29137),s=n(18135),c=n(71449);const l=["core/paragraph","core/heading","core/list"],u=window?.Jetpack_Editor_Initial_State.available_blocks?.["ai-assistant-support"];function d(){if(!(0,r.getBlockType)(i.pG))return!1;if(!u)return!1;if(!(0,c.b)())return!1;if(s.fb.errorCode)return!1;const{getHiddenBlockTypes:e}=(0,a.select)("core/edit-post")||{};return!(e?.()||[]).includes(i.pG)}(0,o.addFilter)("blocks.registerBlockType","jetpack/ai-assistant-support",(function(e,t){return l.includes(t)&&d()?{...e,supports:{...e.supports,"jetpack/ai":{assistant:!0}}}:e}),100)},49259:function(e,t,n){"use strict";n.d(t,{$M:function(){return m}});var r=n(51806),a=n(13419),o=n(52175),i=n(94333),s=n(9818),c=n(69307),l=(n(99196),n(83059)),u=n(15064),d=n(854),p=n(6747);function m(e){return`ai-assistant-block-${e}`}const h=(0,i.createHigherOrderComponent)((e=>t=>{const{name:n}=t,{removeBlocks:i,replaceBlock:h}=(0,s.useDispatch)("core/block-editor"),{content:g,clientIds:f,blocks:b}=(0,u.Z)(),{tracks:v}=(0,a.z$)(),k=[];"core/list-item"===n&&k.push(l.B3);const y=(0,c.useCallback)(((e,t)=>{const[r]=b,[a,...o]=f,s={...r?.attributes||{},content:g},c=(0,p.b)(n,s),l={clientId:a,type:e,options:{...t,contentType:"generated"}};localStorage.setItem(m(c.clientId),JSON.stringify(l)),h(a,c),i(o)}),[b,f,g,n,h,i]),w=(0,c.useCallback)(((e,t)=>{v.recordEvent("jetpack_editor_ai_assistant_extension_toolbar_button_click",{suggestion:e,block_type:n}),y(e,t)}),[v,y,n]),E=(0,c.useCallback)((()=>{const[e,...t]=f,[r]=b,a={...r?.attributes||{},content:g};h(e,(0,p.b)(n,a)),i(t)}),[b,n,g,h,f,i]),_=(0,d.t$)(g);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(o.BlockControls,{group:"block"},(0,r.createElement)(l.ZP,{disabled:!_?.length,onChange:w,onReplace:E,exclude:k})))}),"withAIAssistant");t.ZP=h},79191:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(51806),a=n(36222),o=n(4981),i=n(94333),s=n(9818),c=n(69307),l=n(65736),u=n(53961),d=n(65235),p=n.n(d),m=n(5246),h=n(18135),g=n(63634),f=n(79817),b=n(44110);const __=l.__,v={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480};function k(e){if(!e?.length)return"";const t=(0,s.select)("core/block-editor").getBlock(e);if(!t)return"";const{innerBlocks:n}=t;return n?.length?n.reduce(((e,t)=>e+(0,o.serialize)(t)+"\n\n"),""):""}function y(e){let{clientId:t,className:n=""}=e;const o=(0,c.useRef)(null),l=(0,c.useRef)(null),{inputValue:d,setInputValue:y,isVisible:w,assistantAnchor:E}=(0,c.useContext)(f.D),{requestSuggestion:_,requestingState:C,stopSuggestion:j,requestingError:S}=(0,a.X_)({onDone:()=>{setTimeout((()=>{l.current?.focus?.()}),10)}}),{requireUpgrade:x}=(0,h.ZP)(),P=S?.code===a.$L||x,N="requesting"===C||"suggesting"===C,L="suggesting"===C||"done"===C,T=__("Ask Jetpack AI to create your form","jetpack"),A=__("Creating your form. Please wait a few moments.","jetpack"),{removeNotice:R}=(0,s.useDispatch)(u.store),I=(0,c.useCallback)((()=>{if(!d?.length)return;R(b.uu);const e=(0,g.r1)(g.Re,{request:d,content:k(t)});_(e,{feature:"jetpack-form-ai-extension"})}),[t,d,R,_]),M=(0,i.useViewportMatch)("medium","<"),Z=M&&E,B=(0,c.useRef)(null),D=(0,c.useRef)(M),[F,z]=(0,c.useState)(M);if((0,c.useEffect)((()=>{const e=o?.current;if(e)return B?.current||(B.current=new ResizeObserver((e=>{if(!w)return;if(Z)return;const t=e[0].contentRect.width{B?.current?.disconnect()}}),[Z,w]),(0,c.useEffect)((()=>{const e=setTimeout((()=>{w&&l?.current&&l.current.focus()}),300);return function(){clearTimeout(e)}}),[]),!w)return null;const O=(0,r.createElement)("div",{ref:o,className:p()("jetpack-ai-assistant__bar",{[n]:n,"is-fixed":Z,"is-mobile-mode":F})},P&&(0,r.createElement)(m.Z,null),(0,r.createElement)(a.tK,{ref:l,disabled:P,value:N?void 0:d,placeholder:N?A:T,onChange:y,onSend:I,onStop:j,state:C,isTransparent:P,showButtonLabels:!F,showGuideLine:L}));return Z?(0,c.createPortal)(O,E):O}},81732:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(51806),a=n(36222),o=n(55609),i=n(94333),s=n(69307),c=n(65736),l=n(99196),u=n(79817),d=n(44110);const __=c.__,p="jetpack-ai-assistant-bar__slot";function m(e){let{jetpackFormClientId:t}=e;const{isVisible:n,toggle:c,setAnchor:m,assistantAnchor:h}=(0,s.useContext)(u.D),{requestingState:g}=(0,a.X_)(),f=(0,s.useRef)(null),b=(0,i.useViewportMatch)("medium","<");(0,l.useEffect)((()=>{if(!f.current)return;const e=f.current.closest(".block-editor-block-contextual-toolbar");if(!e)return;let t=e.parentElement?.querySelector(`.${p}`);if(t)return m(t);t=document.createElement("div"),t.setAttribute("role","toolbar"),t.setAttribute("aria-label",__("AI Assistant","jetpack")),t.setAttribute("aria-orientation","horizontal"),t.className=p,e.after(t);const n=e.offsetHeight;t.style.top=`${n}px`,m(t)}),[m]),(0,l.useEffect)((()=>{b||h?.remove()}),[b,h]);const v=(0,s.useCallback)((()=>{if(!t)return c();(0,d.Vl)(t,c)}),[t,c]),k="requesting"===g||"suggesting"===g;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{"mod+/":c}}),(0,r.createElement)(o.ToolbarButton,{ref:f,showTooltip:!0,onClick:v,"aria-haspopup":"true","aria-expanded":n,label:__("Ask AI Assistant","jetpack"),icon:a.u_,disabled:k}))}},59090:function(e,t,n){"use strict";n.d(t,{aE:function(){return r},nB:function(){return a}});const r=window?.Jetpack_Editor_Initial_State.available_blocks?.["ai-assistant-form-support"]?.available,a=["jetpack/field-name","jetpack/field-email","jetpack/field-text","jetpack/field-textarea","jetpack/field-checkbox","jetpack/field-date","jetpack/field-telephone","jetpack/field-url","jetpack/field-checkbox-multiple","jetpack/field-radio","jetpack/field-select","jetpack/field-consent","jetpack/button"]},94662:function(e,t,n){"use strict";n.d(t,{V:function(){return b}});var r=n(51806),a=n(36222),o=n(52175),i=n(4981),s=n(94333),c=n(9818),l=n(69307),u=n(92694),d=n(18135),p=n(71449),m=n(79191),h=n(81732),g=n(59090),f=n(44110);function b(e){let{checkChildrenBlocks:t=!1,clientId:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{clientId:""};if(!(0,i.getBlockType)("jetpack/ai-assistant"))return!1;if(!g.aE)return!1;if(!n?.length)return!1;const{getBlockParentsByBlockName:r}=(0,c.select)("core/block-editor");if(r(n,"core/query")?.length>0)return!1;if(t){if(!g.nB.includes(e))return!1}else if("jetpack/contact-form"!==e)return!1;if(!(0,p.b)())return!1;if(d.fb.errorCode)return!1;const{getHiddenBlockTypes:a}=(0,c.select)("core/edit-post")||{};return!(a?.()||[]).includes(e)}const v=(0,s.createHigherOrderComponent)((e=>t=>{if(!b(t?.name,{clientId:t.clientId}))return(0,r.createElement)(e,t);const{eventSource:n}=(0,a.X_)(),i=(0,l.useCallback)((()=>{n&&n?.close()}),[n]);(0,l.useEffect)((()=>()=>{i()}),[i]);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(m.Z,{clientId:t.clientId}),(0,r.createElement)(o.BlockControls,{group:"block"},(0,r.createElement)(h.Z,null)))}),"withAiAssistantComponents");(0,u.addFilter)("editor.BlockEdit","jetpack/jetpack-form-block-edit",v,100);const k=(0,s.createHigherOrderComponent)((e=>t=>{const n=(0,c.useSelect)((e=>{const{getBlockParentsByBlockName:n}=e("core/block-editor");return n(t.clientId,"jetpack/contact-form")?.[0]}),[t.clientId]);if(!b(t?.name,{checkChildrenBlocks:!0,clientId:n}))return(0,r.createElement)(e,t);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(o.BlockControls,{group:"parent"},(0,r.createElement)(h.Z,{jetpackFormClientId:n})))}),"withAiToolbarButton");(0,u.addFilter)("editor.BlockEdit","jetpack/jetpack-form-block-edit",k),(0,u.addFilter)("editor.BlockListBlock","jetpack/ai-assistant-support",f.ZP,100),(0,u.addFilter)("editor.BlockListBlock","jetpack/ai-assistant-block-list",(0,a.w$)({blocks:"jetpack/contact-form"}),110)},79817:function(e,t,n){"use strict";n.d(t,{D:function(){return o},v:function(){return i}});var r=n(51806),a=n(69307);const o=(0,a.createContext)({}),i=e=>{let{value:t,children:n}=e;return(0,r.createElement)(o.Provider,{value:t,children:n})}},44110:function(e,t,n){"use strict";n.d(t,{Vl:function(){return b},uu:function(){return f}});var r=n(51806),a=n(36222),o=n(4981),i=n(55609),s=n(94333),c=n(9818),l=n(69307),u=n(65736),d=n(53961),p=(n(99196),n(94662)),m=n(5863),h=n(56359),g=n(79817);const __=u.__,f="ai-assistant";function b(e,t){(0,c.dispatch)("core/block-editor").selectBlock(e).then(t)}const v=(0,s.createHigherOrderComponent)((e=>t=>{const{clientId:n,isSelected:s}=t,{replaceInnerBlocks:u}=(0,c.useDispatch)("core/block-editor"),v=(0,c.useSelect)((e=>e("core/editor")),[]),k=(0,c.useSelect)((e=>e("core/block-editor")),[]),y=v.getCurrentPostId(),w=k.getBlock(n),[E,_]=(0,l.useState)(""),C="jetpack/contact-form"===w?.name&&0===w?.innerBlocks?.length,[j,S]=(0,l.useState)(C),[x,P]=(0,l.useState)(!1),[N,L]=(0,l.useState)(null),T=(0,l.useRef)([]),A=(0,l.useCallback)((()=>{S(!0)}),[]),R=(0,l.useCallback)((()=>{S(!1)}),[]),I=(0,l.useCallback)((()=>{S(!j)}),[j]),M=(0,l.useCallback)((e=>{L(e)}),[]),{createNotice:Z}=(0,c.useDispatch)(d.store),B=(0,l.useCallback)((e=>{let{severity:t,message:n,code:r}=e;r!==a.$L&&Z(t,n,{isDismissible:!0,id:f})}),[Z]);(0,l.useEffect)((()=>{s||R()}),[s,R]);const D=(0,l.useMemo)((()=>({inputValue:E,setInputValue:_,isVisible:j,show:A,hide:R,toggle:I,isFixed:x,setAssistantFixed:P,assistantAnchor:N,setAnchor:M})),[E,j,A,R,I,x,N,M]),F=(0,l.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=e.replace(//g,""),a=(0,h.J)(r),i=(0,o.parse)(a).filter((e=>e.isValid&&!["core/freeform","core/missing","core/html"].includes(e.name)));let s=!1;if(i.length0){const e=i[i.length-1],t=T.current[i.length-1];s=!(0,m.c)(e,t)}if(i.length>0&&(i.length!==T.current.length||s)&&(u(n,i),T.current=i),t){const e=i.filter((e=>"jetpack/button"===e.name));if(T.current=T.current||[],e.length>1){let t=0;T.current=T.current.filter((n=>"jetpack/button"!==n.name||(t++,t===e.length))),u(n,T.current)}else 0===e.length&&u(n,[...T.current,(0,o.createBlock)("jetpack/button",{label:__("Submit","jetpack"),element:"button",text:__("Submit","jetpack"),borderRadius:8,lock:{remove:!0}})]);T.current=[]}}),[n,u]);return(0,a.X_)({askQuestionOptions:{postId:y},onDone:e=>{F(e,!0),_("")},onSuggestion:F,onError:B}),(0,p.V)(t.name,{clientId:t.clientId})?(0,r.createElement)(g.v,{value:D},(0,r.createElement)(i.KeyboardShortcuts,{shortcuts:{"mod+/":()=>b(n,A)}},(0,r.createElement)(e,t))):(0,r.createElement)(e,t)}),"withUiHandlerDataProvider");t.ZP=v},63206:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(6895),a=n(13419),o=n(46867);function i(){const e=(0,r.Z)("jetpack-ai-monthly-plan-ai-assistant-block-banner",{site:(0,a.lQ)()}),t=(0,a.Ug)()||(0,a.Wp)()?e:`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/add-jetpack-ai`,{autosaveAndRedirect:n,isRedirecting:i}=(0,o.Z)(t);return{checkoutUrl:t,autosaveAndRedirect:n,isRedirecting:i}}},18135:function(e,t,n){"use strict";n.d(t,{ZP:function(){return l},fb:function(){return s}});var r=n(86989),a=n.n(r),o=n(69307);const i=window?.Jetpack_Editor_Initial_State?.["ai-assistant"],s={hasFeature:!!i?.["has-feature"],isOverLimit:!!i?.["is-over-limit"],requestsCount:i?.["requests-count"]||0,requestsLimit:i?.["requests-limit"]||20,requireUpgrade:!!i?.["site-require-upgrade"],errorMessage:i?.["error-message"]||"",errorCode:i?.["error-code"],upgradeType:i?.["upgrade-type"]||"default"};async function c(){const e=await a()({path:"/wpcom/v2/jetpack-ai/ai-assistant-feature"});try{return{hasFeature:!!e["has-feature"],isOverLimit:!!e["is-over-limit"],requestsCount:e["requests-count"],requestsLimit:e["requests-limit"],requireUpgrade:!!e["site-require-upgrade"],errorMessage:e["error-message"],errorCode:e["error-code"],upgradeType:e["upgrade-type"]}}catch(e){console.error(e)}}function l(){const[e,t]=(0,o.useState)(s);return(0,o.useEffect)((()=>{c().then(t)}),[]),{...e,refresh:()=>c().then(t)}}},63010:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9818);function a(){const e=(0,r.useSelect)((e=>e("core/block-editor").getSelectedBlockClientIds()),[]),t=(0,r.useSelect)((t=>t("core/block-editor").getBlocksByClientId(e)),[e]),n={count:0,clientIds:[],blocks:[]};return e?.length&&t?.length?{count:t.length,clientIds:e,blocks:t}:n}},60751:function(e,t,n){"use strict";var r=n(36222),a=n(4981),o=n(9818),i=n(69307),s=n(65736),c=n(51128),l=n.n(c),u=n(27298),d=n(63634),p=n(854);const __=s.__,m=l()("jetpack-ai-assistant:event"),h=l()("jetpack-ai-assistant:prompt");t.Z=e=>{let{attributes:t,clientId:n,content:s,setError:c,tracks:l,userPrompt:g,onSuggestionDone:f,onUnclearPrompt:b,onModeration:v,refreshFeatureData:k,requireUpgrade:y}=e;const[w,E]=(0,i.useState)(!1),[_,C]=(0,i.useState)(!1),[j,S]=(0,i.useState)(!1),[x,P]=(0,i.useState)(!1),[N,L]=(0,i.useState)(""),{updateBlockAttributes:T}=(0,o.useDispatch)("core/block-editor"),[A,R]=(0,i.useState)("init"),I=(0,i.useRef)(),M=(0,o.useSelect)((e=>e("core/editor").getEditedPostAttribute("title")));let Z=!1;const B=(0,o.useSelect)((e=>e("core/editor").getEditedPostAttribute("categories")))||[],D=(0,o.useSelect)((e=>B.map((t=>{const n=e("core").getEntityRecord("taxonomy","category",t);if(n)return n;Z=!0})).filter(Boolean)),[B]),F=(0,o.useSelect)((e=>e("core/editor").getEditedPostAttribute("tags")),[])||[],z=(0,o.useSelect)((e=>F.map((t=>{const n=e("core").getEntityRecord("taxonomy","post_tag",t);if(n)return n;Z=!0})).filter(Boolean)),[F]);(0,i.useEffect)((()=>(E(Z),()=>{I?.current&&(m("Cleaning things up..."),I?.current?.close())})),[Z,I]);const O=(0,o.useSelect)((e=>e("core/editor").getCurrentPostId())),U=(D.filter((e=>1!==e.id)).map((e=>{let{name:t}=e;return t})).join(", "),z.map((e=>{let{name:t}=e;return t})).join(", "),async function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const f=i?.functions?.reduce(((e,t)=>{let{name:n,implementation:r}=t;return{...e,[n]:r}}),{});if(y)return R("error"),C(!1),S(!1),P(!1),void c({code:"error_quota_exceeded",message:__("You have reached the limit of requests for this site.","jetpack"),status:"info"});if(i={retryRequest:!1,tone:u.Nj,...i},_)return;P(!1),c({});let w=N;l.recordEvent("jetpack_ai_chat_completion",{post_id:O});const E=[...t.messages]??[];let j={};if(i.retryRequest)j=w[w.length-1];else{const r=t?.isLayoutBuldingModeEnable?(0,p.WN)(n):(0,p.xN)();w=(0,d.Iq)({generatedContent:s,allPostContent:r,postContentAbove:(0,p.h7)(n),currentPostTitle:M,options:i,userPrompt:g,type:e,isGeneratingTitle:"generateTitle"===t.promptType,useGutenbergSyntax:!!t?.useGutenbergSyntax,customSystemPrompt:t?.customSystemPrompt}),j=w.pop(),w=[...w,...E],w.push(j),L(w),"generateTitle"!==t.promptType&&T(n,{promptType:e})}try{C(!0),S(!0),w.forEach(((e,t)=>{let{role:n,content:r}=e;return h("(%s/%s) %o\n%s",t+1,w.length,`[${n}]`,r)})),R("requesting"),I.current=await(0,r.jt)(w,{postId:O,requireUpgrade:y,feature:t?.useGpt4?"ai-assistant-experimental":"ai-assistant",functions:i?.functions}),R("suggesting")}catch(e){e.message?c({message:e.message,code:e?.code||"unknown",status:"error"}):c({message:__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack"),code:"unknown",status:"error"}),P(!0),C(!1),S(!1)}const x=async e=>{const{detail:n}=e,a={role:"assistant",content:null,function_call:n},o=await(f[n.name]?.(JSON.parse(n.arguments))),s={role:"function",name:n?.name,content:JSON.stringify(o)};w=[...w,a,s],I?.current?.removeEventListener("function_done",x),I?.current?.removeEventListener("done",A),I?.current?.removeEventListener("error_unclear_prompt",Z),I?.current?.removeEventListener("error_network",D),I?.current?.removeEventListener("error_context_too_large",B),I?.current?.removeEventListener("error_service_unavailable",F),I?.current?.removeEventListener("error_quota_exceeded",z),I?.current?.removeEventListener("error_moderation",U),I?.current?.removeEventListener("suggestion",V),I.current=await(0,r.jt)(w,{postId:O,requireUpgrade:y,feature:t?.useGpt4?"ai-assistant-experimental":null,functions:i.functions}),I?.current?.addEventListener("function_done",x),I?.current?.addEventListener("done",A),I?.current?.addEventListener("error_unclear_prompt",Z),I?.current?.addEventListener("error_network",D),I?.current?.addEventListener("error_context_too_large",B),I?.current?.addEventListener("error_service_unavailable",F),I?.current?.addEventListener("error_quota_exceeded",z),I?.current?.addEventListener("error_moderation",U),I?.current?.addEventListener("suggestion",V)},A=e=>{const{detail:r}=e;R("done");const i=r.replaceAll(d._W,""),s={role:"assistant",content:i};E.push(j,s),h("Add %o\n%s",`[${j.role}]`,j.content),h("Add %o\n%s",`[${s.role}]`,s.content),E.length>20&&E.splice(0,E.length-20),H();const c=t?.useGutenbergSyntax;if(T(n,{content:i,messages:E}),!c)return;const{replaceInnerBlocks:l}=(0,o.dispatch)("core/block-editor"),u=(0,a.parse)(r).filter((e=>e.isValid));l(n,u),k()},Z=()=>{R("error"),I?.current?.close(),C(!1),S(!1),c({code:"error_unclear_prompt",message:__("Your request was unclear. Mind trying again?","jetpack"),status:"info"}),b?.()},B=()=>{R("error"),I?.current?.close(),C(!1),S(!1),P(!1),c({code:"error_context_too_large",message:__("The content is too large to be processed all at once. Please try to shorten it or divide it into smaller parts.","jetpack"),status:"info"})},D=r=>{let{detail:a}=r;R("error");const{name:o,message:l}=a;"TypeError"===o&&"Failed to fetch"===l&&(E.splice(0,8),T(n,{messages:E}),w=(0,d.Iq)({generatedContent:s,allPostContent:(0,p.xN)(),postContentAbove:(0,p.h7)(n),currentPostTitle:M,options:i,userPrompt:g,type:e,isGeneratingTitle:"generateTitle"===t.promptType,useGutenbergSyntax:!!t?.useGutenbergSyntax,customSystemPrompt:t?.customSystemPrompt}),L([...w,...E,j])),I?.current?.close(),C(!1),S(!1),P(!0),c({code:"error_network",message:__("It was not possible to process your request. Mind trying again?","jetpack"),status:"info"})},F=()=>{R("error"),I?.current?.close(),C(!1),S(!1),P(!0),c({code:"error_service_unavailable",message:__("Jetpack AI services are currently unavailable. Sorry for the inconvenience.","jetpack"),status:"info"})},z=()=>{R("error"),I?.current?.close(),C(!1),S(!1),P(!1),c({code:"error_quota_exceeded",message:__("You have reached the limit of requests for this site.","jetpack"),status:"info"})},U=()=>{R("error"),I?.current?.close(),C(!1),S(!1),P(!1),c({code:"error_moderation",message:__("This request has been flagged by our moderation system. Please try to rephrase it and try again.","jetpack"),status:"info"}),v?.()},V=e=>{S(!1),m("(suggestion)",e?.detail),T(n,{content:e?.detail?.replaceAll(d._W,"")})};return I?.current?.addEventListener("function_done",x),I?.current?.addEventListener("done",A),I?.current?.addEventListener("error_unclear_prompt",Z),I?.current?.addEventListener("error_network",D),I?.current?.addEventListener("error_context_too_large",B),I?.current?.addEventListener("error_service_unavailable",F),I?.current?.addEventListener("error_quota_exceeded",z),I?.current?.addEventListener("error_moderation",U),I?.current?.addEventListener("suggestion",V),I?.current});function H(){I?.current&&(I?.current?.close(),C(!1),S(!1),f?.(),R("done"))}return{isLoadingCategories:w,isLoadingCompletion:_,wasCompletionJustRequested:j,setIsLoadingCategories:E,setShowRetry:P,showRetry:x,postTitle:M,contentBefore:(0,p.h7)(n),wholeContent:(0,p.xN)(),requestingState:A,getSuggestionFromOpenAI:U,stopSuggestion:H,retryRequest:()=>U("",{retryRequest:!0})}}},15064:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(854),a=n(63010);function o(){const e=(0,a.Z)();return{...e,content:e.blocks?e.blocks.filter((e=>null!=e)).map((e=>(0,r.op)(e.clientId))).join("\n\n"):""}}},29137:function(e,t,n){"use strict";n.d(t,{Xd:function(){return g},pG:function(){return h},u2:function(){return m}});var r=n(51806),a=n(36222),o=n(6895),i=n(55609),s=n(69307),c=n(65736),l=n(70355),u=n(84005),d=n(45624),p=n(6747);n(81765),n(54765),n(94662);const __=c.__,_x=c._x,m="ai-assistant",h=`jetpack/${m}`,g={apiVersion:2,title:__("AI Assistant (Experimental)","jetpack"),description:(0,r.createElement)(s.Fragment,null,(0,r.createElement)("p",null,__("Automatically generate and modify content, powered by AI magic.","jetpack")),(0,r.createElement)("p",null,__("The AI Assistant can be imprecise with information about people, places, or facts.","jetpack")),(0,r.createElement)("p",null,__("We are experimenting with this feature and can tweak or remove it at any point.","jetpack")),(0,r.createElement)("p",null,(0,r.createElement)(i.ExternalLink,{href:"https://automattic.com/ai-guidelines"},__("AI guidelines.","jetpack"))),(0,r.createElement)(i.ExternalLink,{href:(0,o.Z)("jetpack_ai_feedback")},__("Share your feedback.","jetpack"))),icon:{src:a.u_,foreground:(0,l.m)()},category:"text",keywords:[_x("AI","block search term","jetpack"),_x("GPT","block search term","jetpack"),_x("AL","block search term","jetpack"),_x("Magic","block search term","jetpack"),_x("help","block search term","jetpack"),_x("assistant","block search term","jetpack")],supports:{html:!1,multiple:!0,reusable:!1},edit:d.Z,save:()=>null,attributes:u.Z,transforms:p.Z,example:{attributes:{content:__("With **Jetpack AI Assistant**, you can provide a prompt, and it will generate high-quality blog posts, informative pages, well-organized lists, and thorough tables that meet your specific requirements.\n\nTo start using the **Jetpack AI Assistant**, type `/AI` in the block editor.","jetpack")}}}},71449:function(e,t,n){"use strict";n.d(t,{b:function(){return u},d:function(){return d}});var r=n(13419),a=n(51128),o=n.n(a);const i=window?.JP_CONNECTION_INITIAL_STATE,s=o()("jetpack-ai-assistant:connection");let c=!1;const l=e=>{c||(s(e),c=!0)};function u(){return(0,r.Wp)()?(l("Simple site connected ✅"),!0):(0,r.Ug)()?(l("Atomic site connected ✅"),!0):i?.connectionStatus?.isUserConnected?(l("Jetpack user is connected ✅"),!0):(l("User is not connected ❌"),!1)}function d(){if((0,r.Wp)())return!0;return!1==!(i?.userConnectionData?.currentUser?.permissions??{}).manage_options}},3687:function(e,t,n){"use strict";n.d(t,{b:function(){return i}});var r=n(86989),a=n.n(r),o=n(65736);const __=o.__;function i(e,t,n,r,o,i){n(!0),o(null),t({requestedPrompt:e}),a()({path:"/wpcom/v2/jetpack-ai/images/generations",method:"POST",data:{prompt:e,post_id:i}}).then((e=>{n(!1);const t=e.data.map((e=>"data:image/png;base64,"+e.b64_json));r(t)})).catch((e=>{e.message?o(e.message):o(__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack")),n(!1)}))}},63634:function(e,t,n){"use strict";n.d(t,{Hd:function(){return s},Iq:function(){return P},Lg:function(){return d},Lq:function(){return p},Nw:function(){return m},Re:function(){return g},TV:function(){return l},_W:function(){return b},hI:function(){return i},r1:function(){return N},t4:function(){return v}});var r=n(51128);const a="titleSummary",o="continue",i="simplify",s="correctSpelling",c="generateTitle",l="makeLonger",u="makeShorter",d="changeTone",p="summarize",m="changeLanguage",h="userPrompt",g="jetpackFormCustomPrompt",f=n.n(r)()("jetpack-ai-assistant:prompt"),b="````";function v(e){let{context:t="You are an advanced polyglot ghostwriter. Your task is to generate and modify content based on user requests. This functionality is integrated into the Jetpack product developed by Automattic. Users interact with you through a Gutenberg block, you are inside the WordPress editor",rules:n,useGutenbergSyntax:r=!1,useMarkdown:a=!0,customSystemPrompt:o=null}=e,i="";n?.length&&(i=n.map((e=>`- ${e}.`)).join("\n")+"\n");let s=`${t}. Strictly follow these rules:\n\n${i}${a?"- Format your responses in Markdown syntax, ready to be published.":""}\n- Execute the request without any acknowledgement to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n`;return r&&(s=`${t}. Strictly follow these rules:\n\t\n${i}- Format your responses in Gutenberg HTML format including HTML comments for WordPress blocks. All responses must be valid Gutenberg HTML.\n- Use only WordPress core blocks\n- Execute the request without any acknowledgement to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n`),o&&(s=o),{role:"system",content:s}}function k(e){return`${b}${e.replaceAll(b,"")}${b}`}function y(e){let{content:t,role:n="user"}=e;return[{role:n,content:`Repeat the text delimited with ${b}, without the delimiter, correcting any spelling and grammar mistakes directly in the text without providing feedback about the corrections, keeping the language of the text: ${k(t)}`}]}function w(e){let{content:t,role:n="user"}=e;return[{role:n,content:`Simplify the text delimited with ${b}, using words and phrases that are easier to understand and keeping the language of the text: ${k(t)}`}]}function E(e){let{content:t,role:n="user"}=e;return[{role:n,content:`Summarize the text delimited with ${b}, keeping the language of the text: ${k(t)}`}]}function _(e){let{content:t,role:n="user"}=e;return[{role:n,content:`Expand the text delimited with ${b} to about double its size, keeping the language of the text: ${k(t)}`}]}function C(e){let{content:t,language:n,role:r="user"}=e;return[{role:r,content:`Translate the text delimited with ${b} to ${n}, preserving the same core meaning and tone: ${k(t)}`}]}function j(e){let{content:t,tone:n,role:r="user"}=e;return[{role:r,content:`Rewrite the text delimited with ${b}, with a ${n} tone, keeping the language of the text: ${k(t)}`}]}function S(e){let{content:t,request:n}=e;if(!n)throw new Error("You must provide a custom prompt for the Jetpack Form Custom Prompt");return[{role:"jetpack-ai",context:{type:"form-ai-extension",content:t,request:n}}]}const x=e=>{let{rules:t=[],request:n=null,relevantContent:r=null,isContentGenerated:a=!1,isGeneratingTitle:o=!1,useGutenbergSyntax:i=!1,customSystemPrompt:s=null}=e;if(!n&&!r)throw new Error("You must provide either a request or content");const c=[v({rules:t,useGutenbergSyntax:i,customSystemPrompt:s})];if(null!=r&&r?.length){const e=r.replaceAll(b,"");a||c.push({role:"user",content:`The specific relevant content for this request, if necessary, delimited with ${b} characters: ${b}${e}${b}`})}const l={role:"user",content:n};return o&&(l.content+=" Only output a title, do not generate body content."),c.push(l),c.forEach((e=>{f(`Role: ${e?.role}.\nMessage: ${e?.content}\n---`)})),c};function P(e){let{generatedContent:t,allPostContent:n,postContentAbove:r,currentPostTitle:g,options:f,type:b,userPrompt:v,isGeneratingTitle:k,useGutenbergSyntax:y,customSystemPrompt:w}=e;const E="generated"===f?.contentType,_=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const r="generated"===n?.contentType;let h="the title";t||(h=r?"your last answer":"the content");const g=`. Ensure that your response is in the same language as ${t?"the title":"the post content"}. Do not switch to any language other than the language of ${h} in your response`;switch(e){case a:return{request:`Write a short piece for a blog post based on ${h}, keeping the same language`};case o:return{request:`Continue writing from ${h}${g}.`,rules:r?[]:["Only output the continuation of the content, without repeating it"]};case i:return{request:`Simplify ${h}${g}.`,rules:["Use words and phrases that are easier to understand for non-technical people","Use as much of the original language as possible"]};case s:return{request:`Repeat ${h}, correcting any spelling and grammar mistakes, and do not add new content${g}.`};case c:return{request:"Generate a new title for this blog post and only output the title.",rules:["Only output the raw title, without any prefix or quotes"]};case l:return{request:`Make ${h} longer${g}.`};case u:return{request:`Make ${h} shorter${g}.`};case d:return{request:`Rewrite ${h} with ${/^[aeiou]/i.test(n.tone)?"an":"a"} ${n.tone} tone${g}.`};case p:return{request:`Summarize ${h}${g}.`};case m:return{request:`Translate ${h} to the following language: ${n.language}.`};default:return null}}(b,k,f);if(b!==h){let e;switch(b){case a:e=g;break;case o:case i:case s:e=r;break;case c:e=n;break;case l:case u:e=t;break;case d:case p:case m:e=E?t:n}return x({..._,relevantContent:e,isContentGenerated:E,isGeneratingTitle:k,useGutenbergSyntax:y,customSystemPrompt:w})}return x({request:v,relevantContent:t||n,isContentGenerated:!!t?.length,isGeneratingTitle:k,useGutenbergSyntax:y,customSystemPrompt:w})}function N(e,t){f("Addressing prompt type: %o %o",e,t);const{prevMessages:n=[]}=t,r={role:"system",content:"You are an advanced polyglot ghostwriter. Your task is to help the user create and modify content based on their requests.\nWriting rules:\n- Execute the request without any acknowledgment or explanation to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n"},a=[...n];switch(a.push(r),e){case s:return[...a,...y(t)];case i:return[...a,...w(t)];case p:return[...a,...E(t)];case l:return[...a,..._(t)];case m:return[...a,...C(t)];case d:return[...a,...j(t)];case g:return[...n,...S(t)];default:throw new Error(`Unknown prompt type: ${e}`)}}},854:function(e,t,n){"use strict";n.d(t,{WN:function(){return c},h7:function(){return i},op:function(){return l},t$:function(){return u},xN:function(){return s}});var r=n(4981),a=n(9818);const o=new(n(92213).Z);function i(e){if(!e)return"";const t=(0,a.select)("core/block-editor"),n=t.getBlockIndex(e),i=t.getBlocks().slice(0,n)??[];return i?.length?o.turndown((0,r.serialize)(i)):""}function s(){const e=(0,a.select)("core/block-editor").getBlocks();return e?.length?o.turndown((0,r.serialize)(e)):""}function c(e){const t=(0,a.select)("core/block-editor").getBlock(e);return t?.innerBlocks?.length?t.innerBlocks.filter((e=>null!=e)).map((e=>l(e.clientId))).join("\n\n"):""}function l(e){if(!e)return"";const t=(0,a.select)("core/block-editor").getBlock(e);return t?(0,r.getBlockContent)(t):""}function u(e){if(!e?.replace(/\s+/,"").length)return"";const t=document.createElement("div");t.innerHTML=e;const{textContent:n,innerText:r}=t;return n&&!n.replace(/\s+/,"").length||r&&!r.replace(/\s+/,"").length?"":t.textContent||t.innerText||""}},5863:function(e,t,n){"use strict";n.d(t,{c:function(){return o}});const r=e=>{delete e.clientId;for(const t of e.innerBlocks??[])r(t);return e},a=e=>r((e=>JSON.parse(JSON.stringify(e)))(e));function o(e,t){const n=a(e),r=a(t);return JSON.stringify(n)===JSON.stringify(r)}},56359:function(e,t,n){"use strict";function r(e){const t=document.createElement("div");return t.innerHTML=e,t.innerHTML}n.d(t,{J:function(){return r}})},81765:function(e,t,n){"use strict";var r=n(4981),a=n(92694),o=n(54765),i=n(49259);(0,a.addFilter)("blocks.registerBlockType","jetpack/handle-jetpack-ai-supports",(function(e){const t=(0,r.getBlockSupport)(e,"jetpack/ai");return t&&t?.assistant&&(0,o.J7)()?{...e,edit:(0,i.ZP)(e.edit)}:e}),100)},6747:function(e,t,n){"use strict";n.d(t,{b:function(){return l}});var r=n(4981),a=n(92213),o=n(29137),i=n(54765);const s=new a.Z({emDelimiter:"_",headingStyle:"atx"}),c=[];function l(e,t){const{content:n,...a}=t;let i=n;"core/heading"===e&&t?.level&&(i=i.replace(/<(\/?)h\d([^>]*)>/g,`<$1h${t.level}$2>`));const c=s.turndown(i),l=[{role:"user",content:"Tell me some content for this block, please."},{role:"assistant",content:c}];return(0,r.createBlock)(o.pG,{...a,content:c,originalContent:c,messages:l,originalMessages:l})}for(const e of i.NP)c.push({type:"block",blocks:[e],isMatch:()=>(0,i.J7)(),transform:(t,n)=>{const a=(0,r.getSaveContent)(e,t,n);return l(e,{...t,content:a})}});t.Z={from:c}},14511:function(e,t){"use strict";t.Z={answersLink:{type:"string",source:"attribute",attribute:"href",selector:".jetpack-blogging-prompt__answers-link"},answersLinkText:{type:"string",source:"html",selector:".jetpack-blogging-prompt__answers-link"},gravatars:{type:"array",source:"query",selector:".jetpack-blogging-prompt__answers-gravatar",query:{url:{type:"string",source:"attribute",attribute:"src"}}},promptLabel:{type:"string",source:"html",selector:".jetpack-blogging-prompt__label"},promptText:{type:"string",source:"html",selector:".jetpack-blogging-prompt__text"},promptFetched:{type:"boolean",default:!1},promptId:{type:"number"},showResponses:{type:"boolean",default:!0},showLabel:{type:"boolean",default:!0},tagsAdded:{type:"boolean",default:!1}}},14303:function(e,t,n){"use strict";var r=n(51806),a=n(86989),o=n.n(a),i=n(52175),s=n(55609),c=n(9818),l=n(69307),u=n(65736),d=n(96483),p=n(44266);const __=u.__,_x=u._x;t.Z=(0,s.withNotices)((function(e){let{attributes:t,noticeOperations:n,noticeUI:a,setAttributes:m}=e;const h=(0,l.useRef)(!1),{answersLink:g,answersLinkText:f,gravatars:b,promptFetched:v,promptId:k,promptLabel:y,promptText:w,showLabel:E,showResponses:_,tagsAdded:C}=t,j=(0,i.useBlockProps)({className:"jetpack-blogging-prompt"});(0,p.n)(k,C,(e=>m({tagsAdded:e})));const S=(0,c.useSelect)((e=>{const{getEntityRecord:t,hasFinishedResolution:n}=e("core"),r=t("root","site")?.language||"en_US";return n("getEntityRecord",["root","site"])?r:null}),[]);(0,l.useEffect)((()=>{if(!S||h.current||v)return;const e=()=>{m({promptFetched:!1,promptId:null,tagsAdded:!1}),h.current=!1,n.removeAllNotices()};let t="/wpcom/v3/blogging-prompts";if(k)t+="/"+encodeURIComponent(k);else{const e=new Date;t+=`?after=--${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}&order=desc`}t=(0,d.addQueryArgs)(t,{_locale:S}),h.current=!0,o()({path:t}).then((e=>{const t=k?e:e[0];m({answersLink:t.answered_link,answersLinkText:t.answered_link_text,gravatars:t.answered_users_sample.map((e=>{let{avatar:t}=e;return{url:t}})),promptFetched:!0,promptLabel:t.label,promptText:t.text,promptId:t.id})})).catch((t=>{m({promptFetched:!0});const a="rest_post_invalid_id"===t.code&&k?(o=k,(0,r.createElement)(r.Fragment,null,(0,u.sprintf)(/* translators: %d is the prompt id. */ __("Prompt with id %d not found.","jetpack"),o)," ",(0,r.createElement)(s.Button,{variant:"link",onClick:e},__("Reset prompt","jetpack")))):(t=>(0,r.createElement)(r.Fragment,null,(0,u.sprintf)(/* translators: %s is the error message. */ __("Error while fetching prompt: %s","jetpack"),t)," ",(0,r.createElement)(s.Button,{variant:"link",onClick:e},__("Retry","jetpack"))))(t.message);var o;n.removeAllNotices(),n.createErrorNotice(a)}))}),[h,n,v,k,m,S]);const x=e=>{m({showLabel:e})},P=e=>{m({showResponses:e})};return(0,r.createElement)("div",j,a,(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.InspectorControls,null,(0,r.createElement)(s.PanelBody,{title:_x("Settings","title of block settings sidebar section","jetpack")},(0,r.createElement)(s.ToggleControl,{label:__("Show daily prompt label","jetpack"),checked:E,onChange:x}),(0,r.createElement)(s.ToggleControl,{label:__("Show other responses","jetpack"),checked:_,onChange:P})))),v?(0,r.createElement)(r.Fragment,null,E&&(0,r.createElement)("div",{className:"jetpack-blogging-prompt__label"},y),(0,r.createElement)("div",{className:"jetpack-blogging-prompt__text"},w),_&&k&&(0,r.createElement)("div",{className:"jetpack-blogging-prompt__answers"},b&&b.slice(0,3).map((e=>{let{url:t}=e;return t&&(0,r.createElement)("img",{className:"jetpack-blogging-prompt__answers-gravatar",src:t,key:t})})),(0,r.createElement)("a",{className:"jetpack-blogging-prompt__answers-link",href:g,target:"_blank",rel:"external noreferrer noopener"},f))):(0,r.createElement)("div",{className:"jetpack-blogging-prompt__spinner"},(0,r.createElement)(s.Spinner,null)))}))},35681:function(e,t,n){"use strict";var r=n(4981),a=n(9818),o=n(31985),i=n(46185),s=n(50187);(0,o.Z)(s.u2,s.Xd),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.U)();const{insertBlocks:t}=(0,a.dispatch)("core/block-editor");t([(0,r.createBlock)(`jetpack/${s.u2}`,{promptFetched:!1,promptId:e,tagsAdded:!0}),(0,r.createBlock)("core/paragraph")],0,void 0,!1)}(n)}()},50187:function(e,t,n){"use strict";n.d(t,{Xd:function(){return h},u2:function(){return m}});var r=n(65736),a=n(70355),o=n(5820),i=n(14511),s=n(14303),c=n(19597),l=n(65783),u=n(43807),d=n(45416),p=n(2275);const __=r.__,_x=r._x,m="blogging-prompt",h={apiVersion:2,title:__("Writing Prompt","jetpack"),description:__("Answer a new and inspiring writing prompt each day.","jetpack"),icon:{src:d.Z,foreground:(0,a.m)()},category:(0,o.Z)("text"),keywords:[_x("writing","block search term","jetpack"),_x("blogging","block search term","jetpack")],supports:{align:!1,alignWide:!1,anchor:!1,className:!0,color:{background:!0,gradients:!0,link:!0,text:!0},customClassName:!0,html:!1,inserter:!0,multiple:!1,reusable:!0,spacing:{margin:["top","bottom"],padding:!0,blockGap:!1}},edit:s.Z,save:p.Z,attributes:i.Z,styles:[{name:"block",label:__("Block","jetpack"),isDefault:!0},{name:"quote",label:__("Quote","jetpack")}],example:{attributes:{answersLink:"https://wordpress.com/tag/dailyprompt",answersLinkText:__("View all responses","jetpack"),gravatars:[{url:c},{url:l},{url:u}],promptLabel:__("Daily writing prompt","jetpack"),promptText:__("What's your favorite place to visit?","jetpack"),promptFetched:!0,promptId:1234,showResponses:!0,showLabel:!0,tagsAdded:!0}}}},2275:function(e,t,n){"use strict";var r=n(51806),a=n(52175);t.Z=function(e){let{attributes:t}=e;const{answersLink:n,answersLinkText:o,gravatars:i,promptId:s,promptLabel:c,promptText:l,showLabel:u,showResponses:d}=t,p=a.useBlockProps.save({className:"jetpack-blogging-prompt"});return(0,r.createElement)("div",p,u&&(0,r.createElement)("div",{className:"jetpack-blogging-prompt__label"},c),(0,r.createElement)("div",{className:"jetpack-blogging-prompt__text"},l),d&&s&&(0,r.createElement)("div",{className:"jetpack-blogging-prompt__answers"},i.map((e=>{let{url:t}=e;return t&&(0,r.createElement)("img",{className:"jetpack-blogging-prompt__answers-gravatar","aria-hidden":"true",src:t,key:t})})),(0,r.createElement)("a",{className:"jetpack-blogging-prompt__answers-link",href:n,target:"_blank",rel:"external noreferrer noopener"},o)))}},44266:function(e,t,n){"use strict";n.d(t,{n:function(){return l}});var r=n(86989),a=n.n(r),o=n(9818),i=n(69307),s=n(81975);function c(e){const t=(0,s.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 l(e,t,n){const{editPost:r}=(0,o.useDispatch)("core/editor"),a=(0,i.useRef)("not-started"),{postType:s,postsSupportTags:l,tags:u,tagIds:d,tagsHaveResolved:p}=(0,o.useSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getEntityRecords:n,getPostType:r,hasFinishedResolution:a}=e("core"),o=t("tags"),i={_fields:"id,name",context:"view",include:o?.join(","),per_page:-1};return{postType:t("type"),postsSupportTags:r("post")?.taxonomies.includes("post_tag"),tagIds:o||[],tags:o&&o.length?n("taxonomy","post_tag",i):[],tagsHaveResolved:!o||!o.length||a("getEntityRecords",["taxonomy","post_tag",i])}}),[]);(0,i.useEffect)((()=>{"post"===s&&l&&!t&&p&&e&&Array.isArray(u)&&("not-started"===a.current&&(u.some((e=>e.name&&"dailyprompt"===e.name))&&u.some((t=>t.name&&t.name===`dailyprompt-${e}`))?a.current="fulfilled":(a.current="pending",Promise.all([c("dailyprompt"),c(`dailyprompt-${e}`)]).then((e=>{const t=e.map((e=>e.id));r({tags:[...d,...t]}),a.current="fulfilled"})).catch((e=>{console.error(e),a.current="rejected"})))),"fulfilled"===a.current&&n(!0))}),[r,l,s,e,a,n,u,d,t,p])}},50756:function(e,t,n){"use strict";var r=n(51806),a=n(55609),o=n(69307),i=n(65736),s=n(65235),c=n.n(s),l=n(92819);const __=i.__,u="09:00",d="17:00";class p extends o.Component{renderInterval=(e,t)=>{const{day:n}=this.props,{opening:i,closing:s}=e;return(0,r.createElement)(o.Fragment,{key:t},(0,r.createElement)("div",{className:"business-hours__row"},(0,r.createElement)("div",{className:c()(n.name,"business-hours__day")},0===t&&this.renderDayToggle()),(0,r.createElement)("div",{className:c()(n.name,"business-hours__hours")},(0,r.createElement)(a.TextControl,{type:"time",label:__("Opening","jetpack"),value:i,className:"business-hours__open",placeholder:u,onChange:e=>{this.setHour(e,"opening",t)}}),(0,r.createElement)(a.TextControl,{type:"time",label:__("Closing","jetpack"),value:s,className:"business-hours__close",placeholder:d,onChange:e=>{this.setHour(e,"closing",t)}})),(0,r.createElement)("div",{className:"business-hours__remove"},n.hours.length>1&&(0,r.createElement)(a.Button,{isSmall:!0,variant:"link",icon:"trash",label:__("Remove Hours","jetpack"),onClick:()=>{this.removeInterval(t)}}))),t===n.hours.length-1&&(0,r.createElement)("div",{className:"business-hours__row business-hours-row__add"},(0,r.createElement)("div",{className:c()(n.name,"business-hours__day")}," "),(0,r.createElement)("div",{className:c()(n.name,"business-hours__hours")},(0,r.createElement)(a.Button,{variant:"link",label:__("Add Hours","jetpack"),onClick:this.addInterval},__("Add Hours","jetpack"))),(0,r.createElement)("div",{className:"business-hours__remove"}," ")))};setHour=(e,t,n)=>{const{day:r,attributes:a,setAttributes:o}=this.props,{days:i}=a;o({days:i.map((a=>a.name===r.name?{...a,hours:a.hours.map(((r,a)=>a===n?{...r,[t]:e}:r))}:a))})};toggleClosed=e=>{const{day:t,attributes:n,setAttributes:r}=this.props,{days:a}=n;r({days:a.map((n=>{if(n.name===t.name){const t=e?[{opening:u,closing:d}]:[];return{...n,hours:t}}return n}))})};addInterval=()=>{const{day:e,attributes:t,setAttributes:n}=this.props,{days:r}=t;e.hours.push({opening:"",closing:""}),n({days:r.map((t=>t.name===e.name?{...t,hours:e.hours}:t))})};removeInterval=e=>{const{day:t,attributes:n,setAttributes:r}=this.props,{days:a}=n;r({days:a.map((n=>t.name===n.name?{...n,hours:n.hours.filter(((t,n)=>e!==n))}:n))})};isClosed(){const{day:e}=this.props;return(0,l.isEmpty)(e.hours)}renderDayToggle(){const{day:e,localization:t}=this.props;return(0,r.createElement)(o.Fragment,null,(0,r.createElement)("span",{className:"business-hours__day-name"},t.days[e.name]),(0,r.createElement)(a.ToggleControl,{label:this.isClosed()?__("Closed","jetpack"):__("Open","jetpack"),checked:!this.isClosed(),onChange:this.toggleClosed}))}renderClosed(){const{day:e}=this.props;return(0,r.createElement)("div",{className:"business-hours__row business-hours-row__closed"},(0,r.createElement)("div",{className:c()(e.name,"business-hours__day")},this.renderDayToggle()),(0,r.createElement)("div",{className:c()(e.name,"closed","business-hours__hours")}," "),(0,r.createElement)("div",{className:"business-hours__remove"}," "))}render(){const{day:e}=this.props;return this.isClosed()?this.renderClosed():e.hours.map(this.renderInterval)}}t.Z=p},80190:function(e,t,n){"use strict";var r=n(51806),a=n(69771),o=n(69307),i=n(65736),s=n(92819);const _x=i._x;class c extends o.Component{formatTime(e){const{timeFormat:t}=this.props,[n,r]=e.split(":"),o=new Date;return!(!n||!r)&&(o.setHours(n),o.setMinutes(r),(0,a.date)(t,o))}renderInterval=(e,t)=>{const{day:n}=this.props,a=n.hours;return(0,r.createElement)("span",{key:t},(0,i.sprintf)("%1$s - %2$s",this.formatTime(e.opening),this.formatTime(e.closing)),a.length>1+t&&(0,r.createElement)("span",null,", "))};render(){const{day:e,localization:t}=this.props,n=e.hours.filter((e=>this.formatTime(e.opening)&&this.formatTime(e.closing)));return(0,r.createElement)("div",{className:"jetpack-business-hours__item"},(0,r.createElement)("dt",{className:e.name},t.days[e.name]),(0,r.createElement)("dd",null,(0,s.isEmpty)(n)?_x("Closed","business is closed on a full day","jetpack"):n.map(this.renderInterval),(0,r.createElement)("br",null)))}}t.Z=c},86162:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(51806),i=n(13419),s=n(86989),c=n.n(s),l=n(55609),u=n(69771),d=n(69307),p=n(65736),m=n(65235),h=n.n(m),g=n(22023),f=n(50756),b=n(80190);const __=p.__,v=(0,i.dM)(g),k={days:{Sun:__("Sunday","jetpack"),Mon:__("Monday","jetpack"),Tue:__("Tuesday","jetpack"),Wed:__("Wednesday","jetpack"),Thu:__("Thursday","jetpack"),Fri:__("Friday","jetpack"),Sat:__("Saturday","jetpack")},startOfWeek:0};class y extends d.Component{state={localization:k,hasFetched:!1};componentDidMount(){this.apiFetch()}apiFetch(){this.setState({data:k},(()=>{c()({path:"/wpcom/v2/business-hours/localized-week"}).then((e=>{this.setState({localization:e,hasFetched:!0})}),(()=>{this.setState({localization:k,hasFetched:!0})}))}))}render(){const{attributes:e,className:t,isSelected:n}=this.props,{days:r}=e,{localization:i,hasFetched:s}=this.state,{startOfWeek:c}=i,d=r.concat(r.slice(0,c)).slice(c);if(!s)return(0,o.createElement)(l.Placeholder,{icon:v,label:__("Loading business hours","jetpack")});if(!n){const e=(0,u.getSettings)(),{formats:{time:n}}=e;return(0,o.createElement)("dl",{className:h()(t,"jetpack-business-hours")},d.map(((e,t)=>(0,o.createElement)(b.Z,{key:t,day:e,localization:i,timeFormat:n}))))}return(0,o.createElement)("div",{className:h()(t,"is-edit")},d.map(((e,t)=>(0,o.createElement)(f.Z,a()({key:t,day:e,localization:i},this.props)))))}}t.Z=y},60866:function(e,t,n){"use strict";var r=n(51806),a=n(31985),o=n(22023),i=n(86162);(0,a.S)(o,{edit:e=>(0,r.createElement)(i.Z,e),save:()=>null})},98625:function(e,t,n){"use strict";var r=n(55609),a=n(92819);const o=(0,r.withFallbackStyles)(((e,t)=>{const{backgroundColor:n,textColor:r}=t,o=(0,a.get)(n,"color"),i=!(0,a.get)(r,"color")&&e?e.querySelector('[contenteditable="true"]'):null;return{fallbackBackgroundColor:o||!e?void 0:getComputedStyle(e).backgroundColor,fallbackTextColor:r||!i?void 0:getComputedStyle(i).color}}));t.Z=o},70424:function(e,t,n){"use strict";var r=n(24381);t.Z={element:{type:"string",enum:["a","button","input"]},saveInPostContent:{type:"boolean",default:!1},uniqueId:{type:"string"},passthroughAttributes:{type:"object"},text:{type:"string"},placeholder:{type:"string"},url:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string",validator:r.Z},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:r.Z},gradient:{type:"string"},customGradient:{type:"string"},borderRadius:{type:"number"},width:{type:"string"}}},43043:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(51806),a=n(55609),o=n(69307),i=n(65736),s=n(90446);const __=i.__;function c(e){let{borderRadius:t="",setAttributes:n}=e;const i=(0,o.useCallback)((e=>n({borderRadius:e})),[n]);return(0,r.createElement)(a.PanelBody,{title:__("Border Settings","jetpack")},(0,r.createElement)(a.RangeControl,{allowReset:!0,initialPosition:s.pg,label:__("Border radius","jetpack"),max:s.Gp,min:s.G0,onChange:i,value:t}))}},36953:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(51806),a=n(52175),o=n(65736);const __=o.__;function i(e){let{isGradientAvailable:t,backgroundColor:n,fallbackBackgroundColor:o,fallbackTextColor:i,gradientValue:s,setBackgroundColor:c,setGradient:l,setTextColor:u,textColor:d}=e;const p=(0,r.createElement)(a.ContrastChecker,{backgroundColor:n.color,fallbackBackgroundColor:o,fallbackTextColor:i,isLargeText:!1,textColor:d.color});return t?(0,r.createElement)(a.__experimentalPanelColorGradientSettings,{settings:[{colorValue:d.color,label:__("Text Color","jetpack"),onColorChange:u},{colorValue:n.color,gradientValue:s,label:__("Background","jetpack"),onColorChange:c,onGradientChange:l}],title:__("Background & Text Color","jetpack")},p):(0,r.createElement)(a.PanelColorSettings,{colorSettings:[{value:d.color,onChange:u,label:__("Text Color","jetpack")},{value:n.color,onChange:c,label:__("Background","jetpack")}],title:__("Background & Text Color","jetpack")},p)}},90446:function(e,t,n){"use strict";n.d(t,{DA:function(){return a},G0:function(){return s},Gp:function(){return i},pg:function(){return o}});var r=n(52175);const a=!!r.__experimentalUseGradient,o=5,i=50,s=0},29343:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(51806),a=n(9818),o=n(30429),i=n(43043),s=n(36953);function c(e){let{attributes:t,backgroundColor:n,clientId:c,context:l,fallbackBackgroundColor:u,fallbackTextColor:d,setAttributes:p,setBackgroundColor:m,setTextColor:h,textColor:g,gradientValue:f,setGradient:b,isGradientAvailable:v}=e;const{align:k,borderRadius:y}=t,w="jetpack/parentBlockWidth"in l,E=w?l["jetpack/parentBlockWidth"]:t.width,_=(0,a.useSelect)((e=>{const{getBlock:t,getBlockRootClientId:n}=e("core/block-editor");return t(n(c))})),{updateBlockAttributes:C}=(0,a.useDispatch)("core/block-editor");return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.Z,{backgroundColor:n,fallbackBackgroundColor:u,fallbackTextColor:d,gradientValue:f,setBackgroundColor:m,setGradient:b,setTextColor:h,textColor:g,isGradientAvailable:v}),(0,r.createElement)(i.Z,{borderRadius:y,setAttributes:p}),(0,r.createElement)(o.G,{align:k,width:E,onChange:e=>{w?C(_.clientId,{width:e}):p({width:e})}}))}},5501:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(51806),i=n(52175),s=n(94333),c=n(65736),l=n(65235),u=n.n(l),d=n(81673),p=n(98625),m=n(90446),h=n(29343),g=n(16969);const __=c.__;t.Z=(0,s.compose)((0,i.withColors)({backgroundColor:"background-color"},{textColor:"color"}),p.Z)((function(e){const{attributes:t,backgroundColor:n,className:r,clientId:s,context:c,setAttributes:l,textColor:p}=e,{borderRadius:f,element:b,placeholder:v,text:k,width:y,fontSize:w}=t,E="jetpack/parentBlockWidth"in c;(0,g.Z)({attributes:t,clientId:s,setAttributes:l}),(0,d.Z)({attributes:t,disableEffects:E,setAttributes:l});const{gradientClass:_,gradientValue:C,setGradient:j}=m.DA?(0,i.__experimentalUseGradient)({gradientAttribute:"gradient",customGradientAttribute:"customGradient"}):{},S=u()("wp-block-button",r),x=u()("wp-block-button__link",{"has-background":n.color||C,[n.class]:!C&&n.class,"has-text-color":p.color,[p.class]:p.class,[_]:_,"no-border-radius":0===f,"has-custom-width":!!y,[`has-${w}-font-size`]:!!w,"has-custom-font-size":!!w}),P={...!n.color&&C?{background:C}:{backgroundColor:n.color},fontSize:t.style?.typography?.fontSize,color:p.color,borderRadius:f?f+"px":void 0,width:y};return(0,o.createElement)("div",{className:S},(0,o.createElement)(i.RichText,{allowedFormats:"input"===b?[]:void 0,className:x,disableLineBreaks:"input"===b,onChange:e=>l({text:e}),placeholder:v||__("Add text…","jetpack"),style:P,value:k,withoutInteractiveFormatting:!0}),(0,o.createElement)(i.InspectorControls,null,(0,o.createElement)(h.Z,a()({gradientValue:C,setGradient:j,isGradientAvailable:m.DA},e))))}))},48887:function(e,t,n){"use strict";var r=n(31985),a=n(77123);(0,r.Z)(a.u,a.X)},26361:function(e,t,n){"use strict";var r=n(51806),a=n(55609);t.Z=(0,r.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z"}))},77123:function(e,t,n){"use strict";n.d(t,{X:function(){return u},u:function(){return l}});var r=n(65736),a=n(5820),o=n(70424),i=n(5501),s=n(26361),c=n(29586);const __=r.__,l="button",u={title:__("Button","jetpack"),icon:s.Z,category:(0,a.Z)("design","layout"),keywords:[],supports:{html:!1,inserter:!1,align:["left","center","right"],typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}},styles:[{name:"fill",label:__("Fill","jetpack"),isDefault:!0},{name:"outline",label:__("Outline","jetpack")}],attributes:o.Z,edit:i.Z,save:c.Z,usesContext:["jetpack/parentBlockWidth"]}},29586:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(51806),a=n(52175),o=n(65235),i=n.n(o),s=n(90446);function c(e){let{attributes:t,blockName:n,uniqueId:o}=e;const{backgroundColor:c,borderRadius:l,className:u,customBackgroundColor:d,customGradient:p,customTextColor:m,gradient:h,saveInPostContent:g,text:f,textColor:b,url:v,width:k,fontSize:y}=t;if(!g)return null;const w=(0,a.getColorClassName)("background-color",c),E=s.DA?(0,a.__experimentalGetGradientClass)(h):void 0,_=(0,a.getColorClassName)("color",b),C=i()("wp-block-button","jetpack-submit-button",u,{[`wp-block-jetpack-${n}`]:n}),j=i()("wp-block-button__link",{"has-text-color":b||m,[_]:_,"has-background":c||h||d||p,[w]:w,[E]:E,"no-border-radius":0===l,"has-custom-width":!!k,[`has-${y}-font-size`]:!!y,"has-custom-font-size":!!y}),S={background:p||void 0,backgroundColor:w||p||h?void 0:d,fontSize:t.style?.typography?.fontSize,color:_?void 0:m,borderRadius:l?l+"px":void 0,width:k};return(0,r.createElement)("div",{className:C},(0,r.createElement)(a.RichText.Content,{className:j,"data-id-attr":o||"placeholder",href:v,id:o,rel:"noopener noreferrer",role:"button",style:S,tagName:"a",target:"_blank",value:f}))}},16969:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9818),a=n(69307),o=n(92819);function i(e){let{attributes:t,clientId:n,setAttributes:i}=e;const{passthroughAttributes:s}=t,{attributesToSync:c}=(0,r.useSelect)((e=>{const{getBlockAttributes:r,getBlockRootClientId:a}=e("core/block-editor"),i=r(a(n))||{},c=(0,o.mapValues)(s,(e=>i[e]));return{attributesToSync:(0,o.pickBy)(c,((e,n)=>e!==t[n]))}}));(0,a.useEffect)((()=>{(0,o.isEmpty)(c)||i(c)}),[c,i])}},81340:function(e,t,n){"use strict";var r=n(24381);t.Z={backgroundColor:{type:"string",default:"ffffff",validator:r.Z},hideEventTypeDetails:{type:"boolean",default:!1},primaryColor:{type:"string",default:"00A2FF",validator:r.Z},textColor:{type:"string",default:"4D5055",validator:r.Z},style:{type:"string",default:"inline",validValues:["inline","link"]},url:{type:"string",validator:e=>!e||e.startsWith("https://calendly.com/")}}},60153:function(e,t,n){"use strict";var r=n(51806),a=n(13419),o=n(52175),i=n(55609),s=n(65736),c=n(57538);const __=s.__,_x=s._x,l=e=>{let{onEditClick:t}=e;return(0,r.createElement)(i.ToolbarGroup,null,(0,r.createElement)(i.ToolbarButton,{onClick:()=>t(!0)},__("Edit","jetpack")))},u=e=>{const{attributes:{hideEventTypeDetails:t,url:n},defaultClassName:o,embedCode:s,parseEmbedCode:c,setAttributes:l,setEmbedCode:u}=e;let d=null;return n&&(d=(0,a.Ug)()||(0,a.Wp)()?"https://wordpress.com/support/wordpress-editor/blocks/calendly-block/#customize-the-calendly-block":"https://jetpack.com/support/jetpack-blocks/calendly-block/#customizing-a-calendly-block"),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.PanelBody,{PanelBody:!0,title:__("Calendar settings","jetpack"),initialOpen:!1},(0,r.createElement)("form",{onSubmit:c,className:`${o}-embed-form-sidebar`},(0,r.createElement)("input",{type:"text",id:"embedCode",onChange:e=>u(e.target.value),placeholder:__("Calendly web address or embed code…","jetpack"),value:s||"",className:"components-placeholder__input"}),(0,r.createElement)("div",null,(0,r.createElement)(i.Button,{variant:"secondary",type:"submit"},_x("Embed","button label","jetpack")))),(0,r.createElement)(i.ToggleControl,{label:__("Hide event type details","jetpack"),checked:t,onChange:()=>l({hideEventTypeDetails:!t})})),d&&(0,r.createElement)(i.Notice,{className:`${o}-color-notice`,isDismissible:!1},(0,r.createElement)(i.ExternalLink,{href:d},__("Explore more customization options.","jetpack"))))};t.ZP=e=>{const{attributes:t,clientId:n,isEditingUrl:a,setAttributes:i,setIsEditingUrl:s}=e,{style:d,url:p}=t,m=[{value:"inline",label:__("Inline","jetpack")},{value:"link",label:__("Link","jetpack")}];return(0,r.createElement)(r.Fragment,null,p&&!a&&(0,r.createElement)(o.BlockControls,null,(0,r.createElement)(l,{onEditClick:s})),p&&(0,r.createElement)(c.Z,{clientId:n,styleOptions:m,onSelectStyle:i,activeStyle:d,attributes:t,viewportWidth:500}),(0,r.createElement)(o.InspectorControls,null,(0,r.createElement)(u,e)))}},83830:function(e,t,n){"use strict";var r=n(51806),a=n(4981),o=n(65736),i=n(24381);const __=o.__;t.Z={attributes:{backgroundColor:{type:"string",default:"ffffff",validator:i.Z},submitButtonText:{type:"string",default:__("Schedule time with me","jetpack")},submitButtonTextColor:{type:"string"},submitButtonBackgroundColor:{type:"string"},submitButtonClasses:{type:"string"},hideEventTypeDetails:{type:"boolean",default:!1},primaryColor:{type:"string",default:"00A2FF",validator:i.Z},textColor:{type:"string",default:"4D5055",validator:i.Z},style:{type:"string",default:"inline",validValues:["inline","link"]},url:{type:"string",validator:e=>!e||e.startsWith("https://calendly.com/")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string",validator:i.Z},customTextButtonColor:{type:"string",validator:i.Z}},migrate:e=>{const{submitButtonText:t,submitButtonTextColor:n,submitButtonBackgroundColor:r,submitButtonClasses:o,backgroundButtonColor:i,textButtonColor:s,customBackgroundButtonColor:c,customTextButtonColor:l,...u}=e,d={text:(p=e).submitButtonText||__("Schedule time with me","jetpack"),textColor:p.submitButtonTextColor||p.textButtonColor,customTextColor:p.customTextButtonColor,backgroundColor:p.submitButtonBackgroundColor||p.backgroundButtonColor,customBackgroundColor:p.customBackgroundButtonColor,url:p.url};var p;return[u,[(0,a.createBlock)("jetpack/button",{element:"a",uniqueId:"calendly-widget-id",...d})]]},save:e=>{let{attributes:{url:t}}=e;return(0,r.createElement)("a",{href:t},t)}}},29415:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(51806),i=n(52175),s=n(4981),c=n(55609),l=n(9818),u=n(69307),d=n(65736),p=n(92819),m=n(4554),h=n(23621),g=n(81340),f=n(60153),b=n(70176),v=n(4867),k=n(50785);const __=d.__,_x=d._x;t.Z=(0,c.withNotices)((function(e){const{attributes:t,className:n,clientId:r,name:d,noticeOperations:y,noticeUI:w,setAttributes:E}=e,_=(0,s.getBlockDefaultClassName)(d),C=(0,m.S)(g.Z,t);(0,p.isEqual)(C,t)||E(C);const{backgroundColor:j,hideEventTypeDetails:S,primaryColor:x,textColor:P,style:N,url:L}=C,[T,A]=(0,u.useState)(L),[R,I]=(0,u.useState)(!1),[M,Z]=(0,u.useState)(!1),[B,D]=(0,u.useState)({}),F=()=>{y.removeAllNotices(),y.createErrorNotice(__("Your calendar couldn't be embedded. Please double check your URL or code.","jetpack"))};(0,u.useEffect)((()=>{L&&k.lR!==L&&"link"!==N&&(0,h.Z)(L,Z).catch((()=>{E({url:void 0}),F()}))}),[]);const z=e=>{if(!e)return void F();e.preventDefault();const t=(0,v.CC)(T);if(t){if(t.buttonAttributes&&"link"===t.style){const e=(0,l.select)("core/editor").getBlocksByClientId(r);e.length&&e[0].innerBlocks.forEach((e=>{(0,l.dispatch)("core/editor").updateBlockAttributes(e.clientId,t.buttonAttributes)})),D(t.buttonAttributes)}(0,h.Z)(t.url,Z).then((()=>{const e=(0,m.S)(g.Z,t);E(e),I(!1),y.removeAllNotices()})).catch((()=>{E({url:void 0}),F()}))}else F()},O=(0,o.createElement)("div",{className:"wp-block-embed is-loading"},(0,o.createElement)(c.Spinner,null),(0,o.createElement)("p",null,__("Embedding…","jetpack"))),U=(0,o.createElement)(c.Placeholder,{label:__("Calendly","jetpack"),instructions:__("Enter your Calendly web address or embed code below.","jetpack"),icon:b.Z,notices:w},(0,o.createElement)("form",{onSubmit:z},(0,o.createElement)("input",{type:"text",id:"embedCode",onChange:e=>A(e.target.value),placeholder:__("Calendly web address or embed code…","jetpack"),value:T||"",className:"components-placeholder__input"}),(0,o.createElement)("div",null,(0,o.createElement)(c.Button,{variant:"secondary",type:"submit"},_x("Embed","button label","jetpack")))),(0,o.createElement)("div",{className:`${_}-learn-more`},(0,o.createElement)(c.ExternalLink,{href:"https://help.calendly.com/hc/en-us/articles/223147027-Embed-options-overview"},__("Need help finding your embed code?","jetpack")))),H=(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:`${_}-overlay`}),(0,o.createElement)("iframe",{src:(()=>{const e=new URLSearchParams({embed_domain:"wordpress.com",embed_type:"Inline",hide_event_type_details:S?1:0,background_color:j,primary_color:x,text_color:P});return`${L}?${e}`})(),width:"100%",height:"100%",frameBorder:"0","data-origwidth":"100%","data-origheight":"100%",title:"Calendly"})),V=(0,o.createElement)(i.InnerBlocks,{template:[[k.Ss.name,{...k.Ss.attributes,...B,passthroughAttributes:{url:"url"}}]],templateLock:"all"});if(M)return O;let G=n;return L&&!R&&(G+=` calendly-style-${N}`),(0,o.createElement)("div",{className:G},(0,o.createElement)(f.ZP,a()({},e,{defaultClassName:_,embedCode:T,isEditingUrl:R,parseEmbedCode:z,setEmbedCode:A,setIsEditingUrl:I})),L&&!R?"inline"===N?H:V:U)}))},52020:function(e,t,n){"use strict";var r=n(31985),a=n(50785);(0,r.Z)(a.u2,a.Xd)},70176:function(e,t,n){"use strict";var r=n(51806),a=n(55609);t.Z=(0,r.createElement)(a.SVG,{height:"24",viewBox:"0 0 23 24",width:"23",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M19,1h-2.3v0c0-0.6-0.4-1-1-1c-0.6,0-1,0.4-1,1v0H8.6v0c0-0.6-0.4-1-1-1c-0.6,0-1,0.4-1,1v0H4C1.8,1,0,2.8,0,5 v15c0,2.2,1.8,4,4,4h15c2.2,0,4-1.8,4-4V5C23,2.8,21.2,1,19,1z M21,20c0,1.1-0.9,2-2,2H4c-1.1,0-2-0.9-2-2V5c0-1.1,0.9-2,2-2h2.6 v0.8c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1V3h6.1v0.8c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1V3H19c1.1,0,2,0.9,2,2V20z M13.9,14.8l1.4,1.4 c-0.9,0.9-2.1,1.3-3.5,1.3c-2.4,0-4.5-2.1-4.5-4.7s2.1-4.7,4.5-4.7c1.4,0,2.5,0.4,3.4,1.1L14,10.9c-0.5-0.4-1.2-0.6-2.1-0.6 c-1.2,0-2.5,1.1-2.5,2.7c0,1.6,1.3,2.7,2.5,2.7C12.7,15.5,13.4,15.3,13.9,14.8z"}))},50785:function(e,t,n){"use strict";n.d(t,{Ss:function(){return m},Xd:function(){return g},lR:function(){return p},u2:function(){return h}});var r=n(4981),a=n(65736),o=n(70355),i=n(81340),s=n(83830),c=n(29415),l=n(70176),u=n(15816),d=n(4867);const __=a.__,_x=a._x,p="https://calendly.com/wpcom/jetpack-block-example",m={name:"jetpack/button",attributes:{element:"a",text:__("Schedule time with me","jetpack"),uniqueId:"calendly-widget-id",url:p}},h="calendly",g={title:__("Calendly","jetpack"),description:__("Embed a calendar for customers to schedule appointments","jetpack"),icon:{src:l.Z,foreground:(0,o.m)()},category:"grow",keywords:[_x("calendar","block search term","jetpack"),_x("schedule","block search term","jetpack"),_x("appointments","block search term","jetpack"),_x("events","block search term","jetpack"),_x("dates","block search term","jetpack")],supports:{align:!0,alignWide:!1,html:!1},edit:c.Z,save:u.Z,attributes:i.Z,example:{attributes:{hideEventTypeDetails:!1,style:"inline",url:p},innerBlocks:[m]},transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&d.mL.test(e.textContent),transform:e=>{const t=(0,d.CC)(e.textContent);return(0,r.createBlock)("jetpack/calendly",t)}}]},deprecated:[s.Z]}},15816:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(51806),a=n(52175);function o(){return(0,r.createElement)("div",null,(0,r.createElement)(a.InnerBlocks.Content,null))}},4867:function(e,t,n){"use strict";n.d(t,{CC:function(){return a},mL:function(){return r}});const r=/(^|\/\/)(calendly\.com[^"']*)/i,a=e=>{if(!e)return;const t=(e=>{const t=e.match(r);if(t)return"https://"+t[2]})(e);if(!t)return;const n=(e=>{const t={},n=new URL(e);if(t.url=n.origin+n.pathname,!n.search)return t;const r=new URLSearchParams(n.search),a=r.get("background_color"),o=r.get("primary_color"),i=r.get("text_color"),s=/^[A-Za-z0-9]{6}$/;return r.get("hide_event_type_details")&&(t.hideEventTypeDetails=r.get("hide_event_type_details")),a&&a.match(s)&&(t.backgroundColor=a),o&&o.match(s)&&(t.primaryColor=o),i&&i.match(s)&&(t.textColor=i),t})(t),a=(e=>e.indexOf("data-url")>0?"inline":e.indexOf("initPopupWidget")>0||e.indexOf("initBadgeWidget")>0?"link":void 0)(e);if(a&&(n.style=a),"link"===a){n.buttonAttributes={};const t=(e=>{let t=e.match(/false;">([^<]+)<\//);return t?t[1]:(t=e.match(/text: '([^']*?)'/),t?t[1]:void 0)})(e);t&&(n.buttonAttributes.text=t);const r=(e=>{const t=e.match(/textColor: '([^']*?)'/);if(t)return t[1]})(e);r&&(n.buttonAttributes.textColor=void 0,n.buttonAttributes.customTextColor=r);const a=(e=>{const t=e.match(/color: '([^']*?)'/);if(t)return t[1]})(e);a&&(n.buttonAttributes.backgroundColor=void 0,n.buttonAttributes.customBackgroundColor=a)}return n}},36553:function(e,t,n){"use strict";var r=n(51806),a=n(52175),o=n(55609),i=n(69307),s=n(65736),c=n(65235),l=n.n(c),u=n(35208);const __=s.__;class d extends i.Component{constructor(){super(...arguments),this.preventEnterKey=this.preventEnterKey.bind(this)}preventEnterKey(e){"Enter"!==e.key||e.preventDefault()}render(){const{attributes:{address:e,addressLine2:t,addressLine3:n,city:s,region:c,postal:d,country:p,linkToGoogleMaps:m},isSelected:h,setAttributes:g}=this.props,f=[e,t,n,s,c,d,p].some((e=>""!==e)),b=l()({"jetpack-address-block":!0,"is-selected":h}),v=(0,r.createElement)(o.ToggleControl,{label:__("Link address to Google Maps","jetpack"),checked:m,onChange:e=>g({linkToGoogleMaps:e})});return(0,r.createElement)("div",{className:b},!h&&f&&(0,u.Z)(this.props),(h||!f)&&(0,r.createElement)(i.Fragment,null,(0,r.createElement)(a.PlainText,{value:e,placeholder:__("Street Address","jetpack"),"aria-label":__("Street Address","jetpack"),onChange:e=>g({address:e}),onKeyDown:this.preventEnterKey}),(0,r.createElement)(a.PlainText,{value:t,placeholder:__("Address Line 2","jetpack"),"aria-label":__("Address Line 2","jetpack"),onChange:e=>g({addressLine2:e}),onKeyDown:this.preventEnterKey}),(0,r.createElement)(a.PlainText,{value:n,placeholder:__("Address Line 3","jetpack"),"aria-label":__("Address Line 3","jetpack"),onChange:e=>g({addressLine3:e}),onKeyDown:this.preventEnterKey}),(0,r.createElement)(a.PlainText,{value:s,placeholder:__("City","jetpack"),"aria-label":__("City","jetpack"),onChange:e=>g({city:e}),onKeyDown:this.preventEnterKey}),(0,r.createElement)(a.PlainText,{value:c,placeholder:__("State/Province/Region","jetpack"),"aria-label":__("State/Province/Region","jetpack"),onChange:e=>g({region:e}),onKeyDown:this.preventEnterKey}),(0,r.createElement)(a.PlainText,{value:d,placeholder:__("Postal/Zip Code","jetpack"),"aria-label":__("Postal/Zip Code","jetpack"),onChange:e=>g({postal:e}),onKeyDown:this.preventEnterKey}),(0,r.createElement)(a.PlainText,{value:p,placeholder:__("Country","jetpack"),"aria-label":__("Country","jetpack"),onChange:e=>g({country:e}),onKeyDown:this.preventEnterKey}),v))}}t.Z=d},11005:function(e,t,n){"use strict";n.d(t,{X:function(){return d},u:function(){return u}});var r=n(51806),a=n(55609),o=n(69307),i=n(65736),s=n(36598),c=n(36553),l=n(35208);const __=i.__,_x=i._x,u="address",d={title:__("Address","jetpack"),description:__("Lets you add a physical address with Schema markup.","jetpack"),keywords:[_x("location","block search term","jetpack"),_x("direction","block search term","jetpack"),_x("place","block search term","jetpack")],icon:(0,s.Z)((0,r.createElement)(o.Fragment,null,(0,r.createElement)(a.Path,{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z"}),(0,r.createElement)(a.Circle,{cx:"12",cy:"9",r:"2.5"}))),category:"grow",attributes:{address:{type:"string",default:""},addressLine2:{type:"string",default:""},addressLine3:{type:"string",default:""},city:{type:"string",default:""},region:{type:"string",default:""},postal:{type:"string",default:""},country:{type:"string",default:""},linkToGoogleMaps:{type:"boolean",default:!1}},parent:["jetpack/contact-info"],edit:c.Z,save:l.Z}},35208:function(e,t,n){"use strict";var r=n(51806),a=n(69307),o=n(65736);const __=o.__,i=e=>{let{attributes:{address:t,addressLine2:n,addressLine3:o,city:i,region:s,postal:c,country:l}}=e;return(0,r.createElement)(a.Fragment,null,t&&(0,r.createElement)("div",{className:"jetpack-address__address jetpack-address__address1"},t),n&&(0,r.createElement)("div",{className:"jetpack-address__address jetpack-address__address2"},n),o&&(0,r.createElement)("div",{className:"jetpack-address__address jetpack-address__address3"},o),i&&!(s||c)&&(0,r.createElement)("div",{className:"jetpack-address__city"},i),i&&(s||c)&&(0,r.createElement)("div",null,(0,r.createElement)("span",{className:"jetpack-address__city"},i),", ",(0,r.createElement)("span",{className:"jetpack-address__region"},s)," ",(0,r.createElement)("span",{className:"jetpack-address__postal"},c)),!i&&(s||c)&&(0,r.createElement)("div",null,(0,r.createElement)("span",{className:"jetpack-address__region"},s)," ",(0,r.createElement)("span",{className:"jetpack-address__postal"},c)),l&&(0,r.createElement)("div",{className:"jetpack-address__country"},l))},s=e=>{let{attributes:{address:t,addressLine2:n,addressLine3:r,city:a,region:o,postal:i,country:s}}=e;let c=o?`+${o},`:"";c=i?`${c}+${i}`:c;return`https://www.google.com/maps/search/${t?`${t},`:""}${n?`${n},`:""}${r?`${r},`:""}${a?`+${a},`:""}${c}${s?`+${s}`:""}`.replace(" ","+")};t.Z=e=>(e=>{let{address:t,addressLine2:n,addressLine3:r,city:a,region:o,postal:i,country:s}=e;return[t,n,r,a,o,i,s].some((e=>""!==e))})(e.attributes)&&(0,r.createElement)("div",{className:e.className},e.attributes.linkToGoogleMaps&&(0,r.createElement)("a",{href:s(e),target:"_blank",rel:"noopener noreferrer",title:__("Open address in Google Maps","jetpack")},(0,r.createElement)(i,e)),!e.attributes.linkToGoogleMaps&&(0,r.createElement)(i,e))},83238:function(e,t,n){"use strict";var r=n(51806),a=n(52175),o=n(65235),i=n.n(o);const s=["jetpack/markdown","jetpack/address","jetpack/email","jetpack/phone","jetpack/map","jetpack/business-hours","core/paragraph","core/image","core/heading","core/gallery","core/list","core/quote","core/shortcode","core/audio","core/code","core/cover","core/html","core/separator","core/spacer","core/subhead","core/video"],c=[["jetpack/email"],["jetpack/phone"],["jetpack/address"]];t.Z=e=>{const{isSelected:t}=e;return(0,r.createElement)("div",{className:i()({"jetpack-contact-info-block":!0,"is-selected":t})},(0,r.createElement)(a.InnerBlocks,{allowedBlocks:s,templateLock:!1,template:c}))}},82566:function(e,t,n){"use strict";var r=n(31985),a=n(64446);(0,r.Z)(a.u2,a.Xd,a.Nk)},31336:function(e,t,n){"use strict";var r=n(65736),a=n(66425),o=n(90458);const __=r.__;t.Z=e=>{const{setAttributes:t}=e;return(0,a.Z)("email",e,__("Email","jetpack"),o.Z,(e=>t({email:e})))}},99804:function(e,t,n){"use strict";n.d(t,{X:function(){return u},u:function(){return l}});var r=n(51806),a=n(55609),o=n(65736),i=n(36598),s=n(31336),c=n(90458);const __=o.__,_x=o._x,l="email",u={title:__("Email Address","jetpack"),description:__("Lets you add an email address with an automatically generated click-to-email link.","jetpack"),keywords:["e-mail","email",_x("message","block search term","jetpack")],icon:(0,i.Z)((0,r.createElement)(a.Path,{d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"})),category:"grow",attributes:{email:{type:"string",default:""}},edit:s.Z,save:c.Z,parent:["jetpack/contact-info"]}},90458:function(e,t,n){"use strict";var r=n(51806),a=n(69307),o=n(92384);t.Z=e=>{let{attributes:{email:t},className:n}=e;return t&&(0,r.createElement)("div",{className:n},t.split(/(\s+)/).map(((e,t)=>{const n=e.replace(/([.,/#!$%^&*;:{}=\-_`~()\][])+$/g,"");return e.indexOf("@")&&o.validate(n)?e===n?(0,r.createElement)("a",{href:`mailto:${e}`,key:t},e):(0,r.createElement)(a.Fragment,{key:t},(0,r.createElement)("a",{href:`mailto:${e}`,key:t},n),(0,r.createElement)(a.Fragment,null,e.slice(-(e.length-n.length)))):(0,r.createElement)(a.Fragment,{key:t},e)})))}},64446:function(e,t,n){"use strict";n.d(t,{Nk:function(){return b},Xd:function(){return f},u2:function(){return h}});var r=n(51806),a=n(52175),o=n(4981),i=n(55609),s=n(65736),c=n(70355),l=n(36598),u=n(11005),d=n(83238),p=n(99804),m=n(52398);const __=s.__,_x=s._x,h="contact-info",g=(0,l.Z)((0,r.createElement)(i.Path,{d:"M19 5v14H5V5h14m0-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 9c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3zm0-4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm6 10H6v-1.53c0-2.5 3.97-3.58 6-3.58s6 1.08 6 3.58V18zm-9.69-2h7.38c-.69-.56-2.38-1.12-3.69-1.12s-3.01.56-3.69 1.12z"})),f={title:__("Contact Info","jetpack"),description:__("Lets you add an email address, phone number, and physical address with improved markup for better SEO results.","jetpack"),keywords:[_x("email","block search term","jetpack"),_x("phone","block search term","jetpack"),_x("address","block search term","jetpack")],icon:{src:g,foreground:(0,c.m)()},category:"grow",supports:{align:["wide","full"],html:!1,color:{link:!0,gradients:!0},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:n}=e;return!!n?.raw&&"widget_contact_info"===t},transform:e=>{let{instance:t}=e,n=[(0,o.createBlock)("core/heading",{content:t.raw.title}),(0,o.createBlock)("jetpack/email",{email:t.raw.email}),(0,o.createBlock)("jetpack/phone",{phone:t.raw.phone}),(0,o.createBlock)("jetpack/address",{address:t.raw.address})];return t.raw.hours&&(n=[...n,(0,o.createBlock)("core/paragraph",{content:t.raw.hours})]),t.raw.showmap&&t.raw.address&&(n=[...n,(0,o.createBlock)("jetpack/map",{address:t.raw.address})]),(0,o.createBlock)("jetpack/contact-info",{},n)}}]},attributes:{},edit:d.Z,save:e=>{let{className:t}=e;return(0,r.createElement)("div",{className:t},(0,r.createElement)(a.InnerBlocks.Content,null))},example:{attributes:{},innerBlocks:[{name:"jetpack/email",attributes:{email:"hello@yourjetpack.blog"}},{name:"jetpack/phone",attributes:{phone:"123-456-7890"}},{name:"jetpack/address",attributes:{address:"987 Photon Drive",city:"Speedyville",region:"CA",postal:"12345",country:"USA"}}]}},b=[{name:u.u,settings:u.X},{name:p.u,settings:p.X},{name:m.u,settings:m.X}]},70835:function(e,t,n){"use strict";var r=n(65736),a=n(66425),o=n(21621);const __=r.__;t.Z=e=>{const{setAttributes:t}=e;return(0,a.Z)("phone",e,__("Phone number","jetpack"),o.Z,(e=>t({phone:e})))}},52398:function(e,t,n){"use strict";n.d(t,{X:function(){return u},u:function(){return l}});var r=n(51806),a=n(55609),o=n(65736),i=n(36598),s=n(70835),c=n(21621);const __=o.__,_x=o._x,l="phone",u={title:__("Phone Number","jetpack"),description:__("Lets you add a phone number with an automatically generated click-to-call link.","jetpack"),keywords:[_x("mobile","block search term","jetpack"),_x("telephone","block search term","jetpack"),_x("cell","block search term","jetpack")],icon:(0,i.Z)((0,r.createElement)(a.Path,{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79h1.51m9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19M7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1z"})),category:"grow",attributes:{phone:{type:"string",default:""}},parent:["jetpack/contact-info"],edit:s.Z,save:c.Z}},21621:function(e,t,n){"use strict";var r=n(51806);t.Z=e=>{let{attributes:{phone:t},className:n}=e;return t&&(0,r.createElement)("div",{className:n},function(e){const t=e.match(/\d+\.\d+|\d+\b|\d+(?=\w)/g);if(!t)return e;const n=e.indexOf(t[0]);let a=n?e.substring(n-1):e,o=n?e.substring(0,n):"",i=a.replace(/\D/g,"");return/[0-9/+/(]/.test(a[0])?(o=o.slice(0,-1),"+"===a[0]&&(i="+"+i)):a=a.substring(1),[o.trim()?(0,r.createElement)("span",{key:"phonePrefix",className:"phone-prefix"},o):null,(0,r.createElement)("a",{key:"phoneNumber",href:`tel:${i}`},a)]}(t))}},1699:function(e,t,n){"use strict";var r=n(65736);const __=r.__;t.Z={text:{type:"string",source:"html",selector:"p",default:__('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: Cookie Policy.',"jetpack")},style:{type:"object",default:{color:{text:"var(--wp--preset--color--contrast)",background:"var(--wp--preset--color--tertiary)",link:"var(--wp--preset--color--contrast)"},spacing:{padding:{top:"1em",right:"1em",bottom:"1em",left:"1em"}}}},align:{type:"string",default:"wide"},consentExpiryDays:{type:"integer",default:365},showOverlay:{type:"boolean",default:!1}}},20598:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(51806),i=n(52175),s=n(55609),c=n(65736),l=n(89626);const __=c.__;t.Z=function(e){let{clientId:t,attributes:n,setAttributes:r}=e;const{consentExpiryDays:u,align:d,text:p}=n;(0,l.N)(t);const m=(0,i.useBlockProps)({className:`wp-block-jetpack-cookie-consent align${d}`});return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(i.InspectorControls,null,(0,o.createElement)(s.PanelBody,{title:__("Block Settings","jetpack")},(0,o.createElement)(s.SelectControl,{label:__("Alignment","jetpack"),value:d,options:[{label:(0,c.isRTL)()?__("Right","jetpack"):__("Left","jetpack"),value:"left"},{label:__("Full","jetpack"),value:"full"},{label:__("Wide","jetpack"),value:"wide"},{label:(0,c.isRTL)()?__("Left","jetpack"):__("Right","jetpack"),value:"right"}],onChange:e=>function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};r({...t,align:e})}(e)}),(0,o.createElement)(s.TextControl,{label:__("Consent Expiry Time (in days)","jetpack"),value:u,type:"number",min:"1",max:"365",onChange:e=>r({consentExpiryDays:parseInt(e)})}),(0,o.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,o.createElement)("div",a()({},m,{style:m.style}),(0,o.createElement)(i.RichText,{tagName:"p",value:p,onChange:e=>r({text:e})}),(0,o.createElement)(i.InnerBlocks,{allowedBlocks:["core/button"],template:[["core/button",{text:__("Accept","jetpack")}]],templateLock:"all"})))}},54271:function(e,t,n){"use strict";var r=n(31985),a=n(68830);(0,r.Z)(a.u2,a.Xd)},16449:function(e,t,n){"use strict";var r=n(51806),a=n(55609);t.Z=(0,r.createElement)(a.SVG,{height:"24",viewBox:"0 0 25 25",width:"24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{stroke:"currentColor",fill:"white",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4.419 12c0-6.4 5.358-8 8.037-8h1.005v4h3.014v3h4.019v1c0 6.4-5.024 8-8.038 8-3.014 0-8.037-1.6-8.037-8zm5.023-4h.001m-2.01 4h0m5.023 1h.001m-2.01 3h0m6.028-1h0"}))},68830:function(e,t,n){"use strict";n.d(t,{Xd:function(){return u},u2:function(){return l}});var r=n(65736),a=n(70355),o=n(1699),i=n(20598),s=n(16449),c=n(92097);const __=r.__,l="cookie-consent",u={title:__("Cookie Consent","jetpack"),description:__("Displays a customizable cookie consent banner. To display this block on all pages of your site, please add it inside a Template Part that is present on all your templates, like a Header or a Footer.","jetpack"),icon:{src:s.Z,foreground:(0,a.m)()},category:"grow",keywords:["cookie","consent","privacy","GDPR","EU",__("cookies","jetpack"),__("privacy","jetpack"),__("EU","jetpack")],supports:{align:["left","right","wide","full"],alignWide:!0,anchor:!1,color:{gradients:!0,link:!0},spacing:{padding:!0},customClassName:!0,className:!0,html:!1,lock:!1,multiple:!1,reusable:!1},edit:i.Z,save:c.Z,attributes:o.Z,example:{attributes:{}}}},92097:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(82674),a=n.n(r),o=n(51806),i=n(52175);function s(e){let{attributes:t}=e;const n=i.useBlockProps.save();return(0,o.createElement)("div",a()({},n,{style:n.style,role:"dialog","aria-modal":"true"}),(0,o.createElement)(i.RichText.Content,{tagName:"p",value:t.text}),(0,o.createElement)(i.InnerBlocks.Content,null),(0,o.createElement)("span",null,t.consentExpiryDays))}},89626:function(e,t,n){"use strict";n.d(t,{N:function(){return c}});var r=n(4981),a=n(94333),o=n(37798),i=n(9818),s=n(69307);function c(e){const t=(0,i.useSelect)((e=>{const{isSavingPost:t,isSavingNonPostEntityChanges:n}=e("core/editor");return t()||n()}),[]),n=!(!(0,a.usePrevious)(t)||t),[,c]=(0,o.useEntityProp)("root","site","cookie_consent_template"),{saveEditedEntityRecord:l}=(0,i.useDispatch)(o.store),[u,d]=(0,s.useState)(!1),p=(0,i.useSelect)((e=>{const{getBlock:t}=e("core/block-editor");return t})),m=(0,s.useCallback)((e=>{d(!0),c(e),l("root","site",void 0,{cookie_consent_template:e}).finally((()=>{d(!1)}))}),[d,c,l]);(0,s.useEffect)((()=>()=>{p(e)||m(null)}),[]),(0,s.useEffect)((()=>{n&&!u&&m((0,r.serialize)([p(e)]))}),[n,u,m,p,e])}},10764:function(e,t,n){"use strict";var r=n(51806),a=n(25607),o=n(43317),i=n(52175),s=n(69307),c=n(65235),l=n.n(c),u=n(79162);t.Z=e=>{let{className:t=null,currency:n=null,defaultValue:c=null,disabled:d=!1,label:p="",onChange:m=null,value:h=""}=e;const[g,f]=(0,s.useState)((0,a.ZP)(h,n,{symbol:""})),[b,v]=(0,s.useState)(!1),[k,y]=(0,s.useState)(!1),w=(0,s.useRef)(null),E=(0,s.useCallback)((e=>{if(f(e),!m)return;const t=(0,u.Vm)(e,n);t&&t>=(0,u.hj)(n)?(m(t),y(!1)):y(!0)}),[n,m]),_=()=>{w.current&&(w.current.focus(),v(!0))};return(0,s.useEffect)((()=>{if(!w.current)return;const e=w.current,t=()=>{v(!1),g||E((0,a.ZP)(c,n,{symbol:""}))};return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[n,c,g,w,E]),(0,s.useEffect)((()=>{b||k||f((0,a.ZP)(h,n,{symbol:""}))}),[n,b,k,E,h]),(0,s.useEffect)((()=>{E((0,a.ZP)(h,n,{symbol:""}))}),[h]),(0,r.createElement)("div",{className:l()("donations__amount",t,{"has-focus":b,"has-error":k}),role:"button",tabIndex:0,onClick:_,onKeyDown:_},o.M[n].symbol,d?(0,r.createElement)("div",{className:"donations__amount-value"},(0,a.ZP)(h||c,n,{symbol:""})):(0,r.createElement)(i.RichText,{allowedFormats:[],"aria-label":p,multiline:!1,onChange:e=>E(e),placeholder:(0,a.ZP)(c,n,{symbol:""}),ref:w,value:g,withoutInteractiveFormatting:!0}))}},82275:function(e,t,n){"use strict";var r=n(51806),a=n(43317),o=n(13419),i=n(52175),s=n(55609),c=n(65736),l=n(39630),u=n(79162);const __=c.__;t.Z=e=>{const{attributes:t,setAttributes:n}=e,{currency:c,oneTimeDonation:d,monthlyDonation:p,annualDonation:m,showCustomAmount:h}=t,g=(e,r)=>{const a={"1 month":"monthlyDonation","1 year":"annualDonation"}[e],o=t[a];n({[a]:{...o,show:r}})};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.BlockControls,null,(0,r.createElement)(s.ToolbarGroup,null,(0,r.createElement)(s.ToolbarItem,null,(()=>(0,r.createElement)(s.Dropdown,{contentClassName:"jetpack-donations__currency-popover",renderToggle:e=>{let{onToggle:t,isOpen:n}=e;return(0,r.createElement)(s.Button,{className:"jetpack-donations__currency-toggle",icon:(0,r.createElement)(r.Fragment,null,c+" - "+a.M[c].symbol,(0,r.createElement)(s.Dashicon,{icon:"arrow-down"})),label:__("Change currency","jetpack"),onClick:t,onKeyDown:e=>{n||e.keyCode!==l.DOWN||(e.preventDefault(),e.stopPropagation(),t())}})},renderContent:e=>{let{onClose:t}=e;return(0,r.createElement)(s.MenuGroup,null,Object.keys(u.ck).map((e=>(0,r.createElement)(s.MenuItem,{isSelected:e===c,icon:e===c?"yes":"",onClick:()=>{(e=>{const t=(0,u.li)(e);n({currency:e,oneTimeDonation:{...d,amounts:t},monthlyDonation:{...p,amounts:t},annualDonation:{...m,amounts:t}})})(e),t()},key:`jetpack-donations-currency-${e}`},e+" - "+a.M[e].symbol))))}}))))),(0,r.createElement)(i.InspectorControls,null,(0,r.createElement)(s.PanelBody,{title:__("Settings","jetpack")},(0,r.createElement)(s.ToggleControl,{checked:p.show,onChange:e=>g("1 month",e),label:__("Show monthly donations","jetpack")}),(0,r.createElement)(s.ToggleControl,{checked:m.show,onChange:e=>g("1 year",e),label:__("Show annual donations","jetpack")}),(0,r.createElement)(s.ToggleControl,{checked:h,onChange:e=>n({showCustomAmount:e}),label:__("Show custom amount option","jetpack")}),(0,r.createElement)(s.ExternalLink,{href:`https://wordpress.com/earn/payments/${(0,o.lQ)()}`},__("View donation earnings","jetpack")))))}},853:function(e,t,n){"use strict";var r=n(51806),a=n(25607),o=n(43317),i=n(52175),s=n(65736),c=n(79162);const __=s.__;t.Z={attributes:{currency:{type:"string",default:"USD"},oneTimeDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:__("Make a one-time donation","jetpack"),extraText:__("Your contribution is appreciated.","jetpack"),buttonText:__("Donate","jetpack")}},monthlyDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:__("Make a monthly donation","jetpack"),extraText:__("Your contribution is appreciated.","jetpack"),buttonText:__("Donate monthly","jetpack")}},annualDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:__("Make a yearly donation","jetpack"),extraText:__("Your contribution is appreciated.","jetpack"),buttonText:__("Donate yearly","jetpack")}},showCustomAmount:{type:"boolean",default:!0},chooseAmountText:{type:"string",default:__("Choose an amount","jetpack")},customAmountText:{type:"string",default:__("Or enter a custom amount","jetpack")}},supports:{html:!1},save:e=>{let{attributes:t}=e;const{currency:n,oneTimeDonation:s,monthlyDonation:l,annualDonation:u,showCustomAmount:d,chooseAmountText:p,customAmountText:m}=t;if(!s||!s.show||-1===s.planId)return null;const h={"one-time":{title:__("One-Time","jetpack")},...l.show&&{"1 month":{title:__("Monthly","jetpack")}},...u.show&&{"1 year":{title:__("Yearly","jetpack")}}};return(0,r.createElement)("div",null,(0,r.createElement)("div",{className:"donations__container"},Object.keys(h).length>1&&(0,r.createElement)("div",{className:"donations__nav"},Object.entries(h).map((e=>{let[t,{title:n}]=e;return(0,r.createElement)("div",{role:"button",tabIndex:0,className:"donations__nav-item",key:`jetpack-donations-nav-item-${t} `,"data-interval":t},n)}))),(0,r.createElement)("div",{className:"donations__content"},(0,r.createElement)("div",{className:"donations__tab"},(0,r.createElement)(i.RichText.Content,{tagName:"h4",className:"donations__one-time-item",value:s.heading}),l.show&&(0,r.createElement)(i.RichText.Content,{tagName:"h4",className:"donations__monthly-item",value:l.heading}),u.show&&(0,r.createElement)(i.RichText.Content,{tagName:"h4",className:"donations__annual-item",value:u.heading}),(0,r.createElement)(i.RichText.Content,{tagName:"p",value:p}),(0,r.createElement)("div",{className:"donations__amounts donations__one-time-item"},s.amounts.map((e=>(0,r.createElement)("div",{className:"donations__amount","data-amount":e},(0,a.ZP)(e,n))))),l.show&&(0,r.createElement)("div",{className:"donations__amounts donations__monthly-item"},l.amounts.map((e=>(0,r.createElement)("div",{className:"donations__amount","data-amount":e},(0,a.ZP)(e,n))))),u.show&&(0,r.createElement)("div",{className:"donations__amounts donations__annual-item"},u.amounts.map((e=>(0,r.createElement)("div",{className:"donations__amount","data-amount":e},(0,a.ZP)(e,n))))),d&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.RichText.Content,{tagName:"p",value:m}),(0,r.createElement)("div",{className:"donations__amount donations__custom-amount"},o.M[n].symbol,(0,r.createElement)("div",{className:"donations__amount-value","data-currency":n,"data-empty-text":(0,a.ZP)(100*(0,c.hj)(n),n,{symbol:""})}))),(0,r.createElement)("div",{className:"donations__separator"},"——"),(0,r.createElement)(i.RichText.Content,{tagName:"p",className:"donations__one-time-item",value:s.extraText}),l.show&&(0,r.createElement)(i.RichText.Content,{tagName:"p",className:"donations__monthly-item",value:l.extraText}),u.show&&(0,r.createElement)(i.RichText.Content,{tagName:"p",className:"donations__annual-item",value:u.extraText}),(0,r.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__one-time-item"},(0,r.createElement)(i.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__one-time-item",value:s.buttonText})),l.show&&(0,r.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__monthly-item"},(0,r.createElement)(i.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__monthly-item",value:l.buttonText})),u.show&&(0,r.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__annual-item"},(0,r.createElement)(i.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__annual-item",value:u.buttonText}))))))}}},86245:function(e,t,n){"use strict";var r=n(82674),a=n.n(r),o=n(51806),i=n(45033),s=n(9818),c=n(69307),l=n(65736),u=n(79162),d=n(74251),p=n(23267),m=n(21789),h=n(85731),g=n(24177),f=n(72833);const __=l.__;t.Z=e=>{const{attributes:t,className:n,setAttributes:r}=e,{currency:l}=t,[b,v]=(0,c.useState)(""),[k,y]=(0,c.useState)([]),{lockPostSaving:w,unlockPostSaving:E}=(0,s.useDispatch)("core/editor"),_=(0,s.useSelect)((e=>e("core/editor").getCurrentPost()),[]),{setConnectUrl:C,setConnectedAccountDefaultCurrency:j}=(0,s.useDispatch)(p.G4);(0,c.useEffect)((()=>{r({fallbackLinkUrl:_.link})}),[_.link,r]);const S=(0,s.useSelect)((e=>e(p.G4).getConnectedAccountDefaultCurrency()));if(!l&&S){const e=S.toUpperCase(),t=!!u.ck[e];r(t?{currency:e}:{currency:"USD"})}const x=e=>{v(e)};return(0,c.useEffect)((()=>{w("donations");const e=e=>e.reduce(((e,t)=>{let{id:n,currency:r,type:a,interval:o}=t;return r===l&&"donation"===a&&(e[o]=n),e}),{});(0,h.Z)("donation").then((t=>{if(!t&&"object"!=typeof t||t.errors)return E("donations"),void v(__("Could not load data from WordPress.com.","jetpack"));C((0,d.Z)(_.id,t.connect_url)),j(t?.connected_account_default_currency?.toUpperCase());const n=e(t.products);return(e=>{const t=Object.keys(e);return t.includes("one-time")&&t.includes("1 month")&&t.includes("1 year")})(n)?(y(n),void E("donations")):t.connect_url?(y({"one-time":-1,"1 month":-1,"1 year":-1}),void E("donations")):void(l&&(0,m.Z)(l).then((t=>{y(e(t)),E("donations")}),x))}),x)}),[w,l,_.id,C,j,E]),b?(0,o.createElement)(g.Z,{className:n,error:b}):l?(0,o.createElement)(f.Z,a()({},e,{products:k})):(0,o.createElement)(i.Z,null)}},67140:function(e,t,n){"use strict";var r=n(31985),a=n(29800);(0,r.Z)(a.u2,a.Xd)},21789:function(e,t,n){"use strict";var r=n(86989),a=n.n(r);t.Z=async e=>{try{return await a()({path:"/wpcom/v2/memberships/products",method:"POST",data:{type:"donation",currency:e,is_editable:!1}})}catch(e){return Promise.reject(e.message)}}},85731:function(e,t,n){"use strict";var r=n(86989),a=n.n(r),o=n(96483);t.Z=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=new URLSearchParams(window.location.search),n=(0,o.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===t.get("origin")?"gutenberg-wpcom":"gutenberg",...e&&{type:e},is_editable:!1});try{return await a()({path:n,method:"GET"})}catch(e){return Promise.reject(e.message)}}},29800:function(e,t,n){"use strict";n.d(t,{Xd:function(){return l},u2:function(){return c}});var r=n(65736),a=n(81427),o=n(853),i=n(86245),s=n(75314);const __=r.__,_x=r._x,c="donations",l={title:__("Donations Form","jetpack"),description:__("Collect one-time, monthly, or annually recurring donations.","jetpack"),icon:a.K9,category:"earn",keywords:[_x("charity","block search term","jetpack"),_x("contribution","block search term","jetpack"),_x("credit card","block search term","jetpack"),_x("debit card","block search term","jetpack"),_x("donate","block search term","jetpack"),_x("earn","block search term","jetpack"),_x("ecommerce","block search term","jetpack"),_x("fundraising","block search term","jetpack"),_x("fundraiser","block search term","jetpack"),"gofundme",_x("money","block search term","jetpack"),_x("nonprofit","block search term","jetpack"),_x("non-profit","block search term","jetpack"),_x("paid","block search term","jetpack"),"patreon",_x("pay","block search term","jetpack"),_x("payments","block search term","jetpack"),_x("recurring","block search term","jetpack"),"stripe",_x("sponsor","block search term","jetpack"),"square",_x("tipping","block search term","jetpack"),"venmo"],supports:{html:!1},edit:i.Z,save:s.Z,example:{},deprecated:[o.Z]}},24177:function(e,t,n){"use strict";var r=n(51806),a=n(55609),o=n(65736);const __=o.__;t.Z=e=>{let{className:t,error:n}=e;return(0,r.createElement)(a.Placeholder,{icon:"lock",label:__("Donations","jetpack"),instructions:n,className:t})}},75314:function(e,t,n){"use strict";var r=n(51806),a=n(52175);t.Z=e=>{let{attributes:t}=e;const{fallbackLinkUrl:n,oneTimeDonation:o,monthlyDonation:i,annualDonation:s}=t;return o&&o.show&&o.planId&&-1!==o.planId?(0,r.createElement)("div",null,(0,r.createElement)(a.RichText.Content,{tagName:"h4",value:o.heading}),(0,r.createElement)(a.RichText.Content,{tagName:"p",value:o.extraText}),(0,r.createElement)(a.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:n,rel:"noopener noreferrer noamphtml",target:"_blank",value:o.buttonText}),i.show&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("hr",{className:"donations__separator"}),(0,r.createElement)(a.RichText.Content,{tagName:"h4",value:i.heading}),(0,r.createElement)(a.RichText.Content,{tagName:"p",value:i.extraText}),(0,r.createElement)(a.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:n,rel:"noopener noreferrer noamphtml",target:"_blank",value:i.buttonText})),s.show&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("hr",{className:"donations__separator"}),(0,r.createElement)(a.RichText.Content,{tagName:"h4",value:s.heading}),(0,r.createElement)(a.RichText.Content,{tagName:"p",value:s.extraText}),(0,r.createElement)(a.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:n,rel:"noopener noreferrer noamphtml",target:"_blank",value:s.buttonText}))):null}},91757:function(e,t,n){"use strict";var r=n(51806),a=n(52175),o=n(9818),i=n(65736),s=n(79162),c=n(10764);const __=i.__;t.Z=e=>{let{activeTab:t,attributes:n,setAttributes:l}=e;const{currency:u,oneTimeDonation:d,monthlyDonation:p,annualDonation:m,showCustomAmount:h,chooseAmountText:g,customAmountText:f}=n,b={"one-time":"oneTimeDonation","1 month":"monthlyDonation","1 year":"annualDonation"},v=e=>n[b[t]][e],k=(e,r)=>{const a=b[t],o=n[a];l({[a]:{...o,[e]:r}})},y=(0,s.li)(u),w=v("amounts"),E=(0,o.useSelect)((e=>e("core/rich-text").getFormatTypes()),[]).map((e=>e.name)).filter((e=>"core/link"!==e));return(0,r.createElement)("div",{className:"donations__tab"},(0,r.createElement)(a.RichText,{tagName:"h4",placeholder:__("Write a message…","jetpack"),value:v("heading"),onChange:e=>k("heading",e)}),(0,r.createElement)(a.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:g,onChange:e=>l({chooseAmountText:e})}),(0,r.createElement)("div",{className:"donations__amounts"},w.map(((e,t)=>(0,r.createElement)(c.Z,{currency:u,defaultValue:y[t],label:(0,i.sprintf)( // translators: %d: Tier level e.g: "1", "2", "3" __("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=>l({customAmountText:e})}),(0,r.createElement)(c.Z,{currency:u,label:__("Custom amount","jetpack"),defaultValue:100*(0,s.hj)(u),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"),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"),onChange:e=>{return t=e,void l({oneTimeDonation:{...d,buttonText:t},monthlyDonation:{...p,buttonText:t},annualDonation:{...m,buttonText:t}});var t},allowedFormats:E})))}},72833:function(e,t,n){"use strict";var r=n(51806),a=n(69307),o=n(65736),i=n(65235),s=n.n(i),c=n(16367),l=n(82275),u=n(91757);const __=o.__;t.Z=e=>{const{attributes:t,className:n,products:o,setAttributes:i}=e,{oneTimeDonation:d,monthlyDonation:p,annualDonation:m}=t,[h,g]=(0,a.useState)("one-time"),f=(0,a.useCallback)((e=>h===e),[h]),b={"one-time":{title:__("One-Time","jetpack")},...p.show&&{"1 month":{title:__("Monthly","jetpack")}},...m.show&&{"1 year":{title:__("Yearly","jetpack")}}};return(0,a.useEffect)((()=>{d.planId===o["one-time"]&&p.planId===o["1 month"]&&m.planId===o["1 year"]||i({...o["one-time"]&&{oneTimeDonation:{...d,planId:o["one-time"]}},...o["1 month"]&&{monthlyDonation:{...p,planId:o["1 month"]}},...o["1 year"]&&{annualDonation:{...m,planId:o["1 year"]}}})}),[d,p,m,i,o]),(0,a.useEffect)((()=>{!p.show&&f("1 month")&&g("one-time"),!m.show&&f("1 year")&&g("one-time")}),[p,m,g,f]),(0,r.createElement)("div",{className:n},(0,r.createElement)(c.U,{blockName:"donations"}),(0,r.createElement)("div",{className:"donations__container"},Object.keys(b).length>1&&(0,r.createElement)("div",{className:"donations__nav"},Object.entries(b).map((e=>{let[t,{title:n}]=e;return(0,r.createElement)("div",{role:"button",tabIndex:0,className:s()("donations__nav-item",{"is-active":f(t)}),onClick:()=>g(t),onKeyDown:()=>g(t),key:`jetpack-donations-nav-item-${t} `},n)}))),(0,r.createElement)("div",{className:"donations__content"},(0,r.createElement)(u.Z,{activeTab:h,attributes:t,setAttributes:i}))),(0,r.createElement)(l.Z,e))}},2785:function(e,t){"use strict";t.Z={url:{type:"string",validator:e=>!e||e.startsWith("http")},eventId:{type:"number"},style:{type:"string",default:"inline"}}},6949:function(e,t,n){"use strict";n.d(t,{J:function(){return i}});var r=n(51806),a=n(55609),o=n(65736);const __=o.__,i=e=>{let{setEditingUrl:t}=e;return(0,r.createElement)(a.ToolbarGroup,null,(0,r.createElement)(a.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>t(!0)}))}},1344:function(e,t,n){"use strict";var r=n(24717);t.Z=[r.Z]},24717:function(e,t,n){"use strict";var r=n(51806),a=n(52175),o=n(4981),i=n(65736),s=n(65235),c=n.n(s),l=n(92819);const _x=i._x,u=["text","backgroundColor","textColor","customBackgroundColor","customTextColor","borderRadius"];t.Z={attributes:{url:{type:"string",validator:e=>!e||e.startsWith("http")},eventId:{type:"number"},useModal:{type:"boolean"},style:{type:"string"},text:{type:"string",default:_x("Register","verb: e.g. register for an event.","jetpack")},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},borderRadius:{type:"number"}},migrate:e=>{const{className:t,style:n}=e;let r=n;r||(r=e.useModal?"modal":"inline");const a={...(0,l.omit)(e,["useModal",...u]),className:t&&t.replace("is-style-outline",""),style:r},i=(0,l.pick)(e,u);return[a,[(0,o.createBlock)("jetpack/button",{element:"a",text:i.text||_x("Register","verb: e.g. register for an event.","jetpack"),...i,uniqueId:"eventbrite-widget-id",className:t&&-1!==t.indexOf("is-style-outline")?"is-style-outline":""})]]},save:function(e){let{attributes:t}=e;const{eventId:n,useModal:o,url:i,style:s}=t;if(n)return o||"modal"===s?function(e){const{backgroundColor:t,borderRadius:n,customBackgroundColor:o,customTextColor:i,eventId:s,text:l,textColor:u,url:d}=e,p=(0,a.getColorClassName)("color",u),m=(0,a.getColorClassName)("background-color",t),h=c()("wp-block-button__link",{"has-text-color":u||i,[p]:p,"has-background":t||o,[m]:m,"no-border-radius":0===n}),g={backgroundColor:m?void 0:o,color:p?void 0:i,borderRadius:n?n+"px":void 0};return(0,r.createElement)("div",{className:"wp-block-button"},(0,r.createElement)(a.RichText.Content,{className:h,href:d,id:`eventbrite-widget-${s}`,rel:"noopener noreferrer",role:"button",style:g,tagName:"a",target:"_blank",value:l}))}(t):i&&(0,r.createElement)("a",{className:"eventbrite__direct-link",href:i},i)},isEligible:(e,t)=>("modal"===e.style||e.useModal)&&((0,l.isEmpty)(t)||(0,l.some)((0,l.pick)(e,u),Boolean))}},16078:function(e,t,n){"use strict";var r=n(51806),a=n(13419),o=n(52175),i=n(55609),s=n(69307),c=n(65736),l=n(57538),u=n(4554),d=n(23621),p=n(2785),m=n(6949),h=n(8964),g=n(77825),f=n(75334);const __=c.__,_x=c._x;class b extends s.Component{state={editedUrl:this.props.attributes.url||"",editingUrl:!1,isResolvingUrl:!1};componentDidMount(){const{url:e}=this.props.attributes;this.setUrl(e)}setUrl=e=>{const{attributes:t,noticeOperations:n,setAttributes:r}=this.props,{style:a}=t;if(!e||f.Q7===e||"modal"===a)return;const o=(0,g.Ve)(e);if(o){const t={eventId:o,url:e};(0,d.Z)(t.url,this.setIsResolvingUrl).then((e=>{const a=(0,u.S)(p.Z,{...t,url:e});r(a),this.setState({editedUrl:e}),n.removeAllNotices()})).catch((()=>{r({eventId:void 0,url:void 0}),this.setErrorNotice()}))}else this.setErrorNotice()};setIsResolvingUrl=e=>this.setState({isResolvingUrl:e});setEditingUrl=e=>this.setState({editingUrl:e});setErrorNotice=()=>{const{noticeOperations:e,onReplace:t}=this.props,{editedUrl:n}=this.state;e.removeAllNotices(),e.createErrorNotice((0,r.createElement)(r.Fragment,null,__("Sorry, this content could not be embedded.","jetpack")," ",(0,r.createElement)(i.Button,{variant:"link",onClick:()=>(0,g.N3)(n,t)},_x("Convert block to link","button label","jetpack"))))};submitForm=e=>{e&&e.preventDefault(),this.setUrl((0,g.qq)(this.state.editedUrl)),this.setState({editingUrl:!1})};cannotEmbed=()=>{const{url:e}=this.props.attributes,{isResolvingUrl:t}=this.state;return!t&&e&&!f.Wh.test(e)};renderLoading(){return(0,r.createElement)("div",{className:"wp-block-embed is-loading"},(0,r.createElement)(i.Spinner,null),(0,r.createElement)("p",null,__("Embedding…","jetpack")))}renderInspectorControls(){const{style:e}=this.props.attributes,{attributes:t,clientId:n,setAttributes:a}=this.props,o=[{value:"inline",label:__("In-page Embed","jetpack"),preview:(0,r.createElement)("div",{className:"block-editor-block-preview__container"},(0,r.createElement)("img",{src:h,alt:__("In page Eventbrite checkout example","jetpack")}))},{value:"modal",label:__("Button & Modal","jetpack")}];return(0,r.createElement)(l.Z,{title:_x("Embed Type","option for how the embed displays on a page, e.g. inline or as a modal","jetpack"),clientId:n,styleOptions:o,onSelectStyle:a,activeStyle:e,attributes:t,viewportWidth:130})}renderEditEmbed(){const{className:e,noticeUI:t}=this.props,{editedUrl:n}=this.state,o=(0,a.Wp)()||(0,a.Ug)()?"http://support.wordpress.com/wordpress-editor/blocks/eventbrite-block/":"https://jetpack.com/support/jetpack-blocks/eventbrite-block/";return(0,r.createElement)("div",{className:e},(0,r.createElement)(i.Placeholder,{label:__("Eventbrite Checkout","jetpack"),instructions:__("Paste a link to an Eventbrite event to embed ticket checkout.","jetpack"),icon:f.qv,notices:t},(0,r.createElement)("form",{onSubmit:this.submitForm},(0,r.createElement)("input",{type:"url",value:n,className:"components-placeholder__input","aria-label":__("Eventbrite URL","jetpack"),placeholder:__("Enter an event URL to embed here…","jetpack"),onChange:e=>this.setState({editedUrl:e.target.value})}),(0,r.createElement)(i.Button,{variant:"secondary",type:"submit"},_x("Embed","submit button label","jetpack"))),(0,r.createElement)("div",{className:"components-placeholder__learn-more"},(0,r.createElement)(i.ExternalLink,{href:o},__("Learn more about Eventbrite embeds","jetpack")))))}renderInlinePreview(){const{className:e}=this.props,{eventId:t}=this.props.attributes;if(!t)return;const n=`eventbrite-widget-${t}`,a=`\n\t\t\t