(()=>{var e={181:(e,t,r)=>{var a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),h=Object.prototype.toString,f=Math.max,d=Math.min,p=function(){return u.Date.now()};function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var r=n.test(e);return r||o.test(e)?s(e.slice(2),r?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,r){var a,i,n,o,s,l,c=0,u=!1,h=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var r=a,n=i;return a=i=void 0,c=t,o=e.apply(n,r)}function b(e){var r=e-l;return void 0===l||r>=t||r<0||h&&e-c>=n}function _(){var e=p();if(b(e))return A(e);s=setTimeout(_,function(e){var r=t-(e-l);return h?d(r,n-(e-c)):r}(e))}function A(e){return s=void 0,y&&a?m(e):(a=i=void 0,o)}function w(){var e=p(),r=b(e);if(a=arguments,i=this,l=e,r){if(void 0===s)return function(e){return c=e,s=setTimeout(_,t),u?m(e):o}(l);if(h)return s=setTimeout(_,t),m(l)}return void 0===s&&(s=setTimeout(_,t)),o}return t=g(t)||0,v(r)&&(u=!!r.leading,n=(h="maxWait"in r)?f(g(r.maxWait)||0,t):n,y="trailing"in r?!!r.trailing:y),w.cancel=function(){void 0!==s&&clearTimeout(s),c=0,a=l=i=s=void 0},w.flush=function(){return void 0===s?o:A(p())},w}},312:(e,t,r)=>{var a;!function(){"use strict";var t="input is invalid type",i="object"==typeof window,n=i?window:{};n.JS_SHA256_NO_WINDOW&&(i=!1);var o=!i&&"object"==typeof self,s=!n.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&"renderer"!=process.type;s?n=r.g:o&&(n=self);var l=!n.JS_SHA256_NO_COMMON_JS&&e.exports,c=r.amdO,u=!n.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),f=[-2147483648,8388608,32768,128],d=[24,16,8,0],p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],v=["hex","array","digest","arrayBuffer"],g=[];!n.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!u||!n.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,t){return function(r){return new w(t,!0).update(r)[e]()}},m=function(e){var t=y("hex",e);s&&(t=b(t,e)),t.create=function(){return new w(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<v.length;++r){var a=v[r];t[a]=y(a,e)}return t},b=function(e,a){var i,o=r(394),s=r(903).Buffer,l=a?"sha224":"sha256";return i=s.from&&!n.JS_SHA256_NO_BUFFER_FROM?s.from:function(e){return new s(e)},function(r){if("string"==typeof r)return o.createHash(l).update(r,"utf8").digest("hex");if(null==r)throw new Error(t);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===s?o.createHash(l).update(i(r)).digest("hex"):e(r)}},_=function(e,t){return function(r,a){return new k(r,t,!0).update(a)[e]()}},A=function(e){var t=_("hex",e);t.create=function(t){return new k(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<v.length;++r){var a=v[r];t[a]=_(a,e)}return t};function w(e,t){t?(g[0]=g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0,this.blocks=g):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function k(e,r,a){var i,n=typeof e;if("string"===n){var o,s=[],l=e.length,c=0;for(i=0;i<l;++i)(o=e.charCodeAt(i))<128?s[c++]=o:o<2048?(s[c++]=192|o>>>6,s[c++]=128|63&o):o<55296||o>=57344?(s[c++]=224|o>>>12,s[c++]=128|o>>>6&63,s[c++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),s[c++]=240|o>>>18,s[c++]=128|o>>>12&63,s[c++]=128|o>>>6&63,s[c++]=128|63&o);e=s}else{if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(t)}e.length>64&&(e=new w(r,!0).update(e).array());var h=[],f=[];for(i=0;i<64;++i){var d=e[i]||0;h[i]=92^d,f[i]=54^d}w.call(this,r,a),this.update(f),this.oKeyPad=h,this.inner=!0,this.sharedMemory=a}w.prototype.update=function(e){if(!this.finalized){var r,a=typeof e;if("string"!==a){if("object"!==a)throw new Error(t);if(null===e)throw new Error(t);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var i,n,o=0,s=e.length,l=this.blocks;o<s;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,this.block=l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),r)for(n=this.start;o<s&&n<64;++o)l[n>>>2]|=e[o]<<d[3&n++];else for(n=this.start;o<s&&n<64;++o)(i=e.charCodeAt(o))<128?l[n>>>2]|=i<<d[3&n++]:i<2048?(l[n>>>2]|=(192|i>>>6)<<d[3&n++],l[n>>>2]|=(128|63&i)<<d[3&n++]):i<55296||i>=57344?(l[n>>>2]|=(224|i>>>12)<<d[3&n++],l[n>>>2]|=(128|i>>>6&63)<<d[3&n++],l[n>>>2]|=(128|63&i)<<d[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),l[n>>>2]|=(240|i>>>18)<<d[3&n++],l[n>>>2]|=(128|i>>>12&63)<<d[3&n++],l[n>>>2]|=(128|i>>>6&63)<<d[3&n++],l[n>>>2]|=(128|63&i)<<d[3&n++]);this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.block=l[16],this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=f[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var e,t,r,a,i,n,o,s,l,c=this.h0,u=this.h1,h=this.h2,f=this.h3,d=this.h4,v=this.h5,g=this.h6,y=this.h7,m=this.blocks;for(e=16;e<64;++e)t=((i=m[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=m[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,m[e]=m[e-16]+t+m[e-7]+r|0;for(l=u&h,e=0;e<64;e+=4)this.first?(this.is224?(n=300032,y=(i=m[0]-1413257819)-150054599|0,f=i+24177077|0):(n=704751109,y=(i=m[0]-210244248)-1521486534|0,f=i+143694565|0),this.first=!1):(t=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),a=(n=c&u)^c&h^l,y=f+(i=y+(r=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&v^~d&g)+p[e]+m[e])|0,f=i+(t+a)|0),t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),a=(o=f&c)^f&u^n,g=h+(i=g+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&d^~y&v)+p[e+1]+m[e+1])|0,t=((h=i+(t+a)|0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),a=(s=h&f)^h&c^o,v=u+(i=v+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&y^~g&d)+p[e+2]+m[e+2])|0,t=((u=i+(t+a)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),a=(l=u&h)^u&f^s,d=c+(i=d+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&g^~v&y)+p[e+3]+m[e+3])|0,c=i+(t+a)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+c|0,this.h1=this.h1+u|0,this.h2=this.h2+h|0,this.h3=this.h3+f|0,this.h4=this.h4+d|0,this.h5=this.h5+v|0,this.h6=this.h6+g|0,this.h7=this.h7+y|0},w.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,a=this.h3,i=this.h4,n=this.h5,o=this.h6,s=this.h7,l=h[e>>>28&15]+h[e>>>24&15]+h[e>>>20&15]+h[e>>>16&15]+h[e>>>12&15]+h[e>>>8&15]+h[e>>>4&15]+h[15&e]+h[t>>>28&15]+h[t>>>24&15]+h[t>>>20&15]+h[t>>>16&15]+h[t>>>12&15]+h[t>>>8&15]+h[t>>>4&15]+h[15&t]+h[r>>>28&15]+h[r>>>24&15]+h[r>>>20&15]+h[r>>>16&15]+h[r>>>12&15]+h[r>>>8&15]+h[r>>>4&15]+h[15&r]+h[a>>>28&15]+h[a>>>24&15]+h[a>>>20&15]+h[a>>>16&15]+h[a>>>12&15]+h[a>>>8&15]+h[a>>>4&15]+h[15&a]+h[i>>>28&15]+h[i>>>24&15]+h[i>>>20&15]+h[i>>>16&15]+h[i>>>12&15]+h[i>>>8&15]+h[i>>>4&15]+h[15&i]+h[n>>>28&15]+h[n>>>24&15]+h[n>>>20&15]+h[n>>>16&15]+h[n>>>12&15]+h[n>>>8&15]+h[n>>>4&15]+h[15&n]+h[o>>>28&15]+h[o>>>24&15]+h[o>>>20&15]+h[o>>>16&15]+h[o>>>12&15]+h[o>>>8&15]+h[o>>>4&15]+h[15&o];return this.is224||(l+=h[s>>>28&15]+h[s>>>24&15]+h[s>>>20&15]+h[s>>>16&15]+h[s>>>12&15]+h[s>>>8&15]+h[s>>>4&15]+h[15&s]),l},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,a=this.h3,i=this.h4,n=this.h5,o=this.h6,s=this.h7,l=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,a>>>24&255,a>>>16&255,a>>>8&255,255&a,i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o];return this.is224||l.push(s>>>24&255,s>>>16&255,s>>>8&255,255&s),l},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},k.prototype=new w,k.prototype.finalize=function(){if(w.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();w.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),w.prototype.finalize.call(this)}};var N=m();N.sha256=N,N.sha224=m(!0),N.sha256.hmac=A(),N.sha224.hmac=A(!0),l?e.exports=N:(n.sha256=N.sha256,n.sha224=N.sha224,c&&(void 0===(a=function(){return N}.call(N,r,N,e))||(e.exports=a)))}()},394:()=>{},903:()=>{}},t={};function r(a){var i=t[a];if(void 0!==i)return i.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,r),n.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.wp.i18n,a=window.wp.blockEditor,i=window.wp.components,n=window.wp.data,o=window.wp.element;var s=r(181),l=r.n(s),c=r(312);function u(e){var t,r,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=u(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}const h=function(){for(var e,t,r=0,a="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=u(e))&&(a&&(a+=" "),a+=t);return a};let f=function(e){return e.DEFAULT="default",e.PORTRAIT="portrait",e.LANDSCAPE="landscape",e.LINE="line",e}({}),d=function(e){return e.AUTHOR="author",e.USER="user",e.EMAIL="email",e}({}),p=function(e){return e.GROUP="gravatar/block-group",e.IMAGE="gravatar/block-image",e.NAME="gravatar/block-name",e.PARAGRAPH="gravatar/block-paragraph",e.LINK="gravatar/block-link",e}({}),v=function(e){return e.AVATAR="avatar",e.DISPLAY_NAME="displayName",e.JOB="job",e.COMPANY="company",e.LOCATION="location",e.DESCRIPTION="description",e.GRAVATAR="gravatar",e.VIEW_PROFILE="viewProfile",e.HEADER="header",e.JOB_COMPANY_LOCATION_WRAPPER="jobCompanyLocationWrapper",e.JOB_COMPANY_WRAPPER="jobCompanyWrapper",e.FOOTER="footer",e.VERIFIED_ACCOUNTS="verifiedAccounts",e}({});const g=window.wp.url;function y(e=[],t=[]){return e.forEach((({name:e,innerBlocks:r,attributes:a})=>{const i=e===p.GROUP&&!r?.length;a.name&&!i&&t.push(a.name),y(r,t)})),t}function m(e,t,r,a,i){if(r[t])return null;let n=[];return Array.isArray(i)&&(n=i.filter(Boolean),!n.length)?null:[e,{name:t,...a},n]}function b(e,t,r,a,i={linkToProfile:!0}){return m(p.IMAGE,v.AVATAR,t,{className:h("gravatar-block-image--avatar",i.className),linkUrl:i.linkToProfile?e.profile_url:"",imageUrl:e.avatar_url||"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTQwIiBoZWlnaHQ9IjU0MCIgdmlld0JveD0iMCAwIDU0MCA1NDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSI1NDAiIGhlaWdodD0iNTQwIiBmaWxsPSIjRTJFMkUyIi8+CjxsaW5lIHgxPSIzLjM1MzU1IiB5MT0iMi42NDY0NSIgeDI9IjUzNy4zNTQiIHkyPSI1MzYuNjQ2IiBzdHJva2U9IiNDOUM5QzkiLz4KPC9zdmc+Cg==",imageWidth:r,imageHeight:a,imageAlt:e.avatar_alt_text||e.display_name})}function _(e,t,r={}){return e.display_name?m(p.NAME,v.DISPLAY_NAME,t,{className:h("gravatar-text-truncate-2-lines",r.className),linkUrl:r.linkToProfile?e.profile_url:"",text:e.display_name}):null}function A(e,t,r={}){return e.job_title?m(p.PARAGRAPH,v.JOB,t,{className:h("gravatar-block-paragraph--job gravatar-text-truncate-1-line",r.className),linkUrl:r.linkToProfile?e.profile_url:"",text:e.job_title}):null}function w(e,t,r={}){return e.company?m(p.PARAGRAPH,v.COMPANY,t,{className:h("gravatar-block-paragraph--company gravatar-text-truncate-1-line",r.className),linkUrl:r.linkToProfile?e.profile_url:"",text:e.company}):null}function k(e,t,r={}){return e.location?m(p.PARAGRAPH,v.LOCATION,t,{className:h("gravatar-block-paragraph--location gravatar-text-truncate-1-line",r.className),linkUrl:r.linkToProfile?e.profile_url:"",text:e.location}):null}function N(e,t,r={}){return e.description?m(p.PARAGRAPH,v.DESCRIPTION,t,{className:h("gravatar-block-paragraph--description gravatar-text-truncate-2-lines",r.className),linkUrl:r.linkToProfile?e.profile_url:"",text:e.description}):null}function E(e,t){return[{url:e.profile_url,service_type:"gravatar",service_icon:"https://secure.gravatar.com/icons/gravatar.svg",service_label:"Gravatar",is_hidden:!1},...e.verified_accounts||[]].map((e=>e.is_hidden?null:m(p.IMAGE,e.service_label,t,{linkUrl:e.url,imageUrl:e.service_icon,imageWidth:32,imageHeight:32,imageAlt:e.service_label})))}function P(e,r,a){return e.profile_url?m(p.LINK,v.VIEW_PROFILE,r,{className:h("gravatar-block-link--align-right",a),linkUrl:e.profile_url,text:(0,t.__)("View profile →","gravatar-enhanced")}):null}window.wp.escapeHtml,window.React;const I=(e,t)=>[m(p.GROUP,v.HEADER,t,{className:"gravatar-block-group--header gravatar-block-group--align-center"},[b(e,t,72,72),m(p.GROUP,v.JOB_COMPANY_LOCATION_WRAPPER,t,{linkUrl:e.profile_url,verticalAlignment:!0},[_(e,t),m(p.GROUP,v.JOB_COMPANY_WRAPPER,t,{className:"gravatar-block-group--comma-separated"},[A(e,t),w(e,t)]),k(e,t)])]),N(e,t),m(p.GROUP,v.FOOTER,t,{className:"gravatar-block-group--footer gravatar-block-group--align-center"},[...E(e,t),P(e,t)])].filter(Boolean),R=(e,t)=>[b(e,t,354,354),_(e,t,{linkToProfile:!0}),A(e,t,{linkToProfile:!0}),k(e,t,{linkToProfile:!0}),N(e,t,{className:"gravatar-text-truncate-3-lines"}),m(p.GROUP,v.VERIFIED_ACCOUNTS,t,{className:"gravatar-block-group--verified-accounts"},E(e,t))].filter(Boolean),O=window.ReactJSXRuntime,x=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gravatar/block","version":"0.5.0","title":"Gravatar Profile","description":"Display user information directly from Gravatar Public Profiles.","category":"widgets","keywords":["gravatar","avatar","profile","card","author","author information","user","user information"],"attributes":{"layout":{"type":"string","default":"default"},"avatarUrlSizeParam":{"type":"number","default":0},"placeholderProfile":{"type":"object","default":{"display_name":"Display Name","job_title":"Job Title","company":"Company","location":"Location","description":"Welcome to Gravatar!"}},"isChildBlockClickable":{"type":"boolean","default":true},"userType":{"type":"string","default":"author"},"userEmail":{"type":"string","default":""},"deletedElements":{"type":"object","default":{}}},"usesContext":["postType","postId"],"supports":{"html":false,"color":{"text":true,"background":true,"gradients":true},"__experimentalBorder":{"color":true,"radius":true},"shadow":true,"spacing":{"margin":true}},"textdomain":"gravatar-enhanced","render":"file:./render.php","editorScript":"file:../block.js","editorStyle":"file:../block.css","viewScript":"file:../block-view.js","viewStyle":"file:../block-view.css"}'),S={...x,icon:function(){return(0,O.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:(0,O.jsx)(i.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})})},title:(0,t.__)("Gravatar Profile","gravatar-enhanced"),description:(0,t.__)("Display user information directly from Gravatar Public Profiles.","gravatar-enhanced"),keywords:[(0,t.__)("gravatar","gravatar-enhanced"),(0,t.__)("profile","gravatar-enhanced"),(0,t.__)("author","gravatar-enhanced"),(0,t.__)("user","gravatar-enhanced"),(0,t.__)("avatar","gravatar-enhanced"),(0,t.__)("card","gravatar-enhanced")],deprecated:[{attributes:{userType:{type:"string",default:"author"},userValue:{type:"string",default:""}},isEligible:({userValue:e})=>!!e?.trim(),migrate:({userType:e,userValue:t})=>({userType:e,userEmail:t,deletedElements:{}}),save:()=>null}],edit:function({context:{postType:r,postId:s},attributes:u,setAttributes:p,clientId:v}){const{layout:m,avatarUrlSizeParam:b,placeholderProfile:_,isChildBlockClickable:A,userType:w,userEmail:k,deletedElements:N}=u,{replaceInnerBlocks:E}=(0,n.useDispatch)("core/block-editor"),[P,x]=(0,o.useState)(k),[S,j]=(0,o.useState)(),[T,U]=(0,o.useState)(""),[B,C]=(0,o.useState)(),M=(0,o.useRef)(null),G=(0,o.useRef)(N);G.current=N;const H=(0,o.useRef)(I);let D=72,L="";switch(m){case f.PORTRAIT:H.current=R,D=354,L="gravatar-block--portrait";break;case f.LANDSCAPE:L="gravatar-block--landscape";break;case f.LINE:L="gravatar-block--line"}const z=(0,a.useBlockProps)(),J=(0,n.useSelect)((e=>{const{getEditedEntityRecord:t,getEntityRecord:a}=e("core"),i=t("postType",r,s)?.author;return i?a("root","user",i)?.email:""}),[r,s]),W=[{label:(0,t.__)("Author","gravatar-enhanced"),value:d.AUTHOR},{label:(0,t.__)("User","gravatar-enhanced"),value:d.USER},{label:(0,t.__)("Custom email","gravatar-enhanced"),value:d.EMAIL}],V=(0,n.useSelect)((e=>e("core").getUsers()||[]),[]),F=V.map((({name:e,nickname:t,email:r})=>({label:`${e} (${t})`,value:r}))),$=F[0]?.value||"";(0,o.useEffect)((()=>{if(w!==d.USER||isNaN(Number(k))||!V.length)return;const e=Number(k),{email:t}=V.find((({id:t})=>t===e))||{};p(t?{userEmail:t}:{userEmail:$})}),[$,p,k,w,V]),(0,n.useSelect)((e=>{if("success"!==S)return void(M.current=null);const{innerBlocks:t=[]}=e("core/block-editor").getBlock(v),r=y(t);if(M.current?.length>r.length){const e={...N};M.current.forEach((t=>{r.includes(t)||(e[t]=!0)})),p({deletedElements:e})}M.current=r}),[S,v,N,p]),(0,o.useEffect)((()=>{j(void 0),C(void 0),U("");const r=w===d.AUTHOR&&J?J.trim():k.trim();r&&(async r=>{if(j("loading"),!function(e){return/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/.test(e)}(r))return j("error"),void U((0,t.__)("Please enter a valid email.","gravatar-enhanced"));const a=(0,c.sha256)(r.toLowerCase()),{errorCode:i,errorMsg:n,data:o}=await async function(e){try{const t="gravatar-block",r=(0,g.addQueryArgs)(`https://api.gravatar.com/v3/profiles/${e}`,{source:t}),a=await fetch(r);if(200!==a.status)throw a.status;const i=await a.json(),n=(0,g.addQueryArgs)(i.profile_url,{utm_source:t});return{data:{...i,profile_url:n}}}catch(e){let r=(0,t.__)("Sorry, we are unable to load this Gravatar profile.","gravatar-enhanced");switch(e){case 404:r=(0,t.__)("Profile not found.","gravatar-enhanced");break;case 429:r=(0,t.__)("Too many requests.","gravatar-enhanced");break;case 500:r=(0,t.__)("Internal server error.","gravatar-enhanced")}return{errorCode:e,errorMsg:r}}}(a);var s,l;i?(j("error"),C(i),U(n)):(j("success"),o.avatar_url=(s=o.avatar_url,l=b||D,(0,g.addQueryArgs)(s,{s:2*l})),E(v,(0,e.createBlocksFromInnerBlocksTemplate)(H.current(o,G.current))))})(r)}),[b,v,D,E,k,J,w]),(0,o.useEffect)((()=>{"success"!==S&&E(v,(0,e.createBlocksFromInnerBlocksTemplate)(H.current(_,N)))}),[S,v,N,_,E]);const Z=(0,o.useCallback)(l()((e=>p({userEmail:e})),500),[]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(a.InspectorControls,{children:(0,O.jsxs)(i.PanelBody,{title:(0,t.__)("Settings","gravatar-enhanced"),children:[(0,O.jsx)(i.SelectControl,{label:(0,t.__)("Select User","gravatar-enhanced"),value:w,options:W,onChange:function(e){let t="";e===d.USER&&(t=$),p({userType:e,userEmail:t}),x("")}}),w===d.USER&&(0,O.jsx)(i.SelectControl,{value:k,options:F,onChange:e=>p({userEmail:e})}),w===d.EMAIL&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(i.TextControl,{type:"email",value:P,onChange:e=>{x(e),Z(e)},placeholder:(0,t.__)("Enter email","gravatar-enhanced")}),404===B&&(0,O.jsx)("a",{href:`mailto:${P}?subject=${encodeURIComponent((0,t.__)("Let’s set up your Gravatar profile","gravatar-enhanced"))}&body=${encodeURIComponent((0,t.sprintf)(
// translators: %1$s = newline
// translators: %1$s = newline
(0,t.__)("Hi there,%1$s%1$sI use Gravatar to create and manage a unified online profile — it’s free, fast to set up, and keeps your presence consistent wherever you interact online.%1$s%1$sSet up your Gravatar profile now: https://gravatar.com%1$s%1$sCheers,","gravatar-enhanced"),"\n"))}`,target:"_blank",rel:"noopener noreferrer",children:(0,t.__)("Invite to join Gravatar","gravatar-enhanced")})]})]})}),(0,O.jsxs)("div",{...z,className:h("gravatar-block",L,z.className,{"gravatar-block--custom-text-color":!!z.style.color,"gravatar-block--child-block-unclickable":w===d.EMAIL&&!k||!A}),children:["error"===S&&(0,O.jsx)("div",{className:"gravatar-block__status",children:T}),"success"===S&&(0,O.jsx)(a.InnerBlocks,{allowedBlocks:[],renderAppender:void 0}),"success"!==S&&(0,O.jsx)(a.InnerBlocks,{allowedBlocks:[],renderAppender:void 0,templateLock:"all",template:H.current(_,N)})]})]})}};(0,e.registerBlockType)(x.name,S)})()})();