<<<<<<< HEAD "use strict";(self.webpackChunkast_block_templates=self.webpackChunkast_block_templates||[]).push([[191],{6191:function(e,t,r){r.r(t),r.d(t,{default:function(){return _}});var o=r(5711),s=r(5940),n=r(7363),a=r(7009),l=r(1392),c=r(5302),i=r(8096),u=r(10),p=n.forwardRef((function({title:e,titleId:t,...r},o){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},r),e?n.createElement("title",{id:t},e):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"}))})),d=r(6486),g=r(2154),m=r(972);function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{getFilterBlocksByCategory:t,getFilterBlocksPagesByCategory:r}=e("ast-block-templates");return{filterBlocksByCategory:t(),filterBlocksPagesByCategory:r()}})),(0,i.Z)((e=>{const{setFavorites:t,setFilterBlocksByCategory:r,setFilterBlocksPagesByCategory:o}=e("ast-block-templates");return{setFavorites:t,setFilterBlocksByCategory:r,setFilterBlocksPagesByCategory:o}})))((e=>{let{item:t,className:r,setFavorites:o,setFilterBlocksByCategory:s,filterBlocksByCategory:l,filterBlocksPagesByCategory:i,setFilterBlocksPagesByCategory:b,...h}=e;const{favorites:v,currentScreen:k}=(0,c.Z)((e=>{const{getFavorites:t,getCurrentScreen:r}=e("ast-block-templates");return{favorites:t(),currentScreen:r()}})),w="all-blocks-grid"===k?"block":"page",[E,_]=(0,n.useState)(v[w]?.includes(+t.ID));return React.createElement("button",y({className:(0,a.AK)("flex items-center justify-center rounded-full p-2 bg-white cursor-pointer focus:outline-none border border-solid border-border-primary",E?"":"text-icon-secondary",r),onClick:async e=>{e?.preventDefault(),e?.stopPropagation();try{await(0,u.Z)({path:`${f}/wp-json/gutenberg-templates/v1/favorite`,data:{type:t.type,block_id:t.ID,status:!E},method:"POST",headers:{"X-WP-Nonce":ast_block_template_vars.rest_api_nonce,"content-type":"application/json"}})}catch(e){console.error(e)}let r={...v};r=E?{...v,[w]:v[w].filter((e=>e!==(0,d.parseInt)(t.ID)))}:{...v,[w]:[...new Set([...v[w],(0,d.parseInt)(t.ID)])]},_(!E),o(r),r[w].length||"favorite"!==l&&"favorite"!==i||("block"===w&&s(""),"page"===w&&b(""),g.Z.emit("reset-list-count"))}},h),React.createElement(m.Z,{content:!E&&"Add to favorites"},React.createElement(p,{className:(0,a.AK)("w-5 h-5 transition-colors ease-out duration-150",E?"fill-favorite text-favorite":"hover:fill-favorite hover:text-favorite")})))}));const h=e=>{const t=["skip","logo","fav-icon"];for(const r of t)if(e.includes(r))return!0;return!1},v={linearTween(e,t,r,o){return r*e/o+t},easeInQuad(e,t,r,o){return r*(e/=o)*e+t},easeOutQuad(e,t,r,o){return-r*(e/=o)*(e-2)+t},easeInOutQuad(e,t,r,o){return(e/=o/2)<1?r/2*e*e+t:-r/2*(--e*(e-2)-1)+t},easeInCubic(e,t,r,o){return r*(e/=o)*e*e+t},easeOutCubic(e,t,r,o){return e/=o,r*(--e*e*e+1)+t},easeInOutCubic(e,t,r,o){return(e/=o/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}};Object.seal(v);var k=v;const{spectra_common_styles:w}=ast_block_template_vars,E="visible";var _=(0,o.Z)((0,s.Z)((e=>{const{getDisableAi:t,getDisablePreview:r,getTogglePopup:o}=e("ast-block-templates");return{disableAi:t(),disablePreview:r(),togglePopup:o()}})))((0,n.memo)((e=>{let{item:t,content:r,stylesheet:o,astraCustomizer:s,globalStylesheet:c,colorPalette:i,dynamicContent:u,selectedImages:p,disableAi:d,togglePopup:g,email:m,phone:y,address:f}=e;const v=(0,n.useRef)(null),_=(0,n.useRef)(null),C=t["thumbnail-image-url"]||"",B=t["featured-image-url"]||"";let x=0,P=0,R=0;const[O,I]=(0,n.useState)({importing:!1}),[$,N]=(0,n.useState)(`${ast_block_template_vars.uri}dist/placeholder_200_200.png`),[S,j]=(0,n.useState)(`${ast_block_template_vars.uri}dist/placeholder_200_200.png`);function A(){const e=v?.current,t=_?.current;if(!e||!t)return;const r=e.parentNode.offsetWidth/1200,o=r*t.offsetHeight;e.style.transform=`scale(${r})`,e.style.height=`${o}px`}(0,n.useLayoutEffect)((()=>{let e=!0;const n={landscape:[],portrait:[]};p?.forEach((e=>{"landscape"===e.orientation?n.landscape.push(e):n.portrait.push(e)}));const a=n,l=new Image;l.src=C;const g=new Image;g.src=B;const b=_.current;function v(t,r){e&&(t.onload=()=>{r(t.src)})}v(l,N),v(g,j);const k=document.getElementById("astra-wp-editor-styles-inline-css")?.textContent.replace(/:root/g,".block-container").replace(/body/g,".block-container"),O=document.getElementById("astra-block-editor-styles-inline-css")?.textContent.replace(/:root/g,".block-container").replace(/body/g,".block-container");let I="";var $,S,Z;if(o&&($=o,S=a?.landscape,o=d?$:0!==Object.keys(u).length&&u.hasOwnProperty(t.category)?S&&0===S.length?$:$.replace(/background-image\s*:\s*url\(['"]?([^'")]+)['"]?\)/g,(function(e,t){if(h(t))return e;if(!S[R]?.url)return"";const r=S[R]?.url;return R++,R%=S.length,'background-image: url("'+r+'")'})):$),I+=s?``:"",I+=``,I=o?`${I} `:I,c&&(I+=``),k&&(I+=``),O&&(I+=``),b&&r){let e=b.shadowRoot;if(null===e&&(e=b.attachShadow({mode:"open"})),null===e)return;let o=r;if(!d){const e=u?u[t.category]:[];e&&Object.keys(e)?.length>0&&Object.keys(e).forEach((t=>{o=null!==e[t]?o.replace(t,e[t]):o})),Object.keys(u).length>0&&u.hasOwnProperty(t.category)&&(Z=o,m&&(Z=Z.replace("contact@example.com",m)),y&&(Z=Z.replace("202-555-0188",y)),f&&(Z=Z.replace("2360 Hood Avenue, San Diego, CA, 92123",f)),o=Z,o=F(o))}e.innerHTML=I+'
'+o+"
",i.forEach(((t,r)=>{e?.host.style.setProperty(`--ast-global-color-${r}`,t)}));const s=b.shadowRoot.querySelectorAll("img");e&&(s.forEach((e=>{h(e.src)||d||0===a.landscape.length||0===a.portrait.length||0===Object.keys(u).length||!u.hasOwnProperty(t.category)||T(e,"hidden")})),A(),((e,r)=>{if(d)return;if(0===Object.keys(u).length||!u.hasOwnProperty(t.category))return;const o=r.landscape?r.landscape:[],s=r.portrait?r.portrait:[];0!==o.length&&0!==s.length&&e?.forEach((function(e,t){h(e.src)||(e.onload=()=>{const r=e.getAttribute("src")||"";if(r.includes("unsplash")||r.includes("pexels")||r.includes("pixabay"))return void T(e,E);const n=(e=>{const t=new Image;return t.src=e,t.width>t.height?"landscape":"portrait"})(e.src);let a;if(x=t%o.length,P=t%s.length,a="landscape"===n?o[x]:s[P],void 0!==a)if(a.url.includes("unsplash")||a.url.includes("pexels")||a.url.includes("pixabay")){if("landscape"===n?(x++,x%=o.length):(P++,P%=s.length),"PICTURE"===e.parentNode.nodeName)e.parentNode.querySelectorAll("source").forEach((e=>{e.setAttribute("srcset",a.optimized_url)})),e.parentNode.querySelector("img").setAttribute("src",a.optimized_url);else{const t=document.createElement("img");t.src=a.optimized_url,e.parentNode.replaceChild(t,e)}T(e,E)}else T(e,E);else T(e,E)},e.onerror=()=>{T(e,E)})}))})(s,a))}return()=>{e=!1}}),[t,d,u,p]),(0,n.useEffect)((()=>{const e=new ResizeObserver(A);return e.observe(document.documentElement),()=>{e&&e.disconnect()}}),[]),(0,n.useEffect)((()=>{const e=document.querySelector("#ast-block-templates-modal-wrap");if(!e)return;const t=new MutationObserver(A);return t.observe(e,{childList:!0,attributes:!0,subtree:!0}),()=>{t&&t.disconnect()}}),[]),(0,n.useEffect)((()=>{const e=_?.current;if(e){const t=e.shadowRoot;i.forEach(((e,r)=>{null!==t&&t.host.style.setProperty(`--ast-global-color-${r}`,e)}))}}),[i]);const T=(e,t)=>{e&&(e.style.visibility=t)},F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return f?e.replace(/(]+src="https:\/\/maps\.google\.com\/maps\?q=)([^&]+)(&z=\d+&hl=en&t=m&output=embed&iwloc=near"[^>]*><\/iframe>)/g,`$1${encodeURIComponent(f)}$3`):e};let Z=0,z=0;const D=(e,t,r)=>{const o=e.scrollTop,s=t-o;let n=0;const a=function(){n+=20;const t=k.linearTween(n,o,s,r);e.scrollTop=t,n{g||(x=0,P=0,R=0)}),[g]),React.createElement("div",{className:(0,a.AK)("w-full h-fit p-5",!0===O.importing?"importing":"")},React.createElement("div",{className:"cursor-pointer relative border border-solid border-border-primary hover:border-accent-spectra transition duration-150 ease-in-out overflow-hidden group"},React.createElement("div",{className:"thumbnail left-0 m-0 min-h-[auto] overflow-visible text-left top-0 origin-top-left relative pointer-events-none",ref:v},React.createElement("div",{className:"absolute w-[1200px] pointer-events-none max-h-[1600px] overflow-hidden",ref:_},!r&&React.createElement("img",{srcSet:`${S}, ${$}`,src:$,alt:"Preview"}),React.createElement("div",{className:"preview"},React.createElement("span",{className:"ast-block-templates-icon ast-block-templates-icon-search"})))),React.createElement("div",{className:"absolute inset-0 grid grid-cols-1 grid-rows-1 place-items-end",onMouseEnter:()=>{if("page"!==t.type)return;const e=_.current;Z&&clearTimeout(Z),z=setTimeout((()=>{D(e,e.scrollHeight,4e3)}),1e3)},onMouseLeave:()=>{z&&clearTimeout(z);const e=_.current;Z&&clearTimeout(Z),D(e,0,1500)}},React.createElement("div",{className:(0,a.AK)("opacity-0 group-hover:opacity-100 w-full flex items-center justify-between px-3 py-2 backdrop-blur-sm bg-white/[0.85] shadow-action-buttons transition-all duration-150 ease-in-out",!0===O.importing?"opacity-100":"")},React.createElement(l.Z,{title:"Insert",liveRequest:!0,item:t,importing:O.importing,onClick:()=>{I({...O,importing:!0})},onBlockImport:()=>{I({...O,importing:!1})}}),React.createElement(b,{item:t})))))})))}}]); ======= <<<<<<< HEAD "use strict";(self.webpackChunkast_block_templates=self.webpackChunkast_block_templates||[]).push([[191],{6191:function(e,t,r){r.r(t),r.d(t,{default:function(){return C}});var o=r(5711),s=r(5940),n=r(7363),a=r(7009),l=r(5806),c=r(5302),i=r(8096),u=r(10),p=n.forwardRef((function({title:e,titleId:t,...r},o){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},r),e?n.createElement("title",{id:t},e):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"}))})),d=r(6486),g=r(2154),m=r(972);function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{getFilterBlocksByCategory:t,getFilterBlocksPagesByCategory:r}=e("ast-block-templates");return{filterBlocksByCategory:t(),filterBlocksPagesByCategory:r()}})),(0,i.Z)((e=>{const{setFavorites:t,setFilterBlocksByCategory:r,setFilterBlocksPagesByCategory:o}=e("ast-block-templates");return{setFavorites:t,setFilterBlocksByCategory:r,setFilterBlocksPagesByCategory:o}})))((e=>{let{item:t,className:r,setFavorites:o,setFilterBlocksByCategory:s,filterBlocksByCategory:l,filterBlocksPagesByCategory:i,setFilterBlocksPagesByCategory:b,...h}=e;const{favorites:v,currentScreen:k}=(0,c.Z)((e=>{const{getFavorites:t,getCurrentScreen:r}=e("ast-block-templates");return{favorites:t(),currentScreen:r()}})),w="all-blocks-grid"===k?"block":"page",[E,_]=(0,n.useState)(v[w]?.includes(+t.ID));return React.createElement("button",y({className:(0,a.AK)("flex items-center justify-center rounded-full p-2 bg-white cursor-pointer border border-solid border-border-primary focus:outline-none",E?"":"text-icon-secondary",r),onClick:async e=>{e?.preventDefault(),e?.stopPropagation();try{await(0,u.Z)({path:`${f}/wp-json/gutenberg-templates/v1/favorite`,data:{type:t.type,block_id:t.ID,status:!E},method:"POST",headers:{"X-WP-Nonce":ast_block_template_vars.rest_api_nonce,"content-type":"application/json"}})}catch(e){console.error(e)}let r={...v};r=E?{...v,[w]:v[w].filter((e=>e!==(0,d.parseInt)(t.ID)))}:{...v,[w]:[...new Set([...v[w],(0,d.parseInt)(t.ID)])]},_(!E),o(r),r[w].length||"favorite"!==l&&"favorite"!==i||("block"===w&&s(""),"page"===w&&b(""),g.Z.emit("reset-list-count"))}},h),React.createElement(m.Z,{content:E?"Remove from favorites":"Add to favorites"},React.createElement(p,{className:(0,a.AK)("w-5 h-5 transition-colors ease-out duration-150",E?"fill-favorite text-favorite":"hover:fill-favorite hover:text-favorite")})))}));const h=e=>{const t=["skip","logo","fav-icon"];for(const r of t)if(e.includes(r))return!0;return!1},v={linearTween(e,t,r,o){return r*e/o+t},easeInQuad(e,t,r,o){return r*(e/=o)*e+t},easeOutQuad(e,t,r,o){return-r*(e/=o)*(e-2)+t},easeInOutQuad(e,t,r,o){return(e/=o/2)<1?r/2*e*e+t:-r/2*(--e*(e-2)-1)+t},easeInCubic(e,t,r,o){return r*(e/=o)*e*e+t},easeOutCubic(e,t,r,o){return e/=o,r*(--e*e*e+1)+t},easeInOutCubic(e,t,r,o){return(e/=o/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}};Object.seal(v);var k=v;const{spectra_common_styles:w,is_rtl:E}=ast_block_template_vars,_="visible";var C=(0,o.Z)((0,s.Z)((e=>{const{getDisableAi:t,getDisablePreview:r,getTogglePopup:o}=e("ast-block-templates");return{disableAi:t(),disablePreview:r(),togglePopup:o()}})))((0,n.memo)((e=>{let{item:t,content:r,stylesheet:o,astraCustomizer:s,globalStylesheet:c,colorPalette:i,dynamicContent:u,selectedImages:p,disableAi:d,togglePopup:g,email:m,phone:y,address:f}=e;const v=(0,n.useRef)(null),C=(0,n.useRef)(null),B=t["thumbnail-image-url"]||"",x=t["featured-image-url"]||"";let R=0,P=0,O=0;const[I,$]=(0,n.useState)({importing:!1}),[N,S]=(0,n.useState)(`${ast_block_template_vars.uri}dist/placeholder_200_200.png`),[j,A]=(0,n.useState)(`${ast_block_template_vars.uri}dist/placeholder_200_200.png`);function T(){const e=v?.current,t=C?.current;if(!e||!t)return;const r=e.parentNode.offsetWidth/1200,o=r*t.offsetHeight;e.style.transform=`scale(${r})`,e.style.height=`${o}px`}(0,n.useLayoutEffect)((()=>{let e=!0;const n={landscape:[],portrait:[]};p?.forEach((e=>{"landscape"===e.orientation?n.landscape.push(e):n.portrait.push(e)}));const a=n,l=new Image;l.src=B;const g=new Image;g.src=x;const b=C.current;function v(t,r){e&&(t.onload=()=>{r(t.src)})}v(l,S),v(g,A);const k=document.getElementById("astra-wp-editor-styles-inline-css")?.textContent.replace(/:root/g,".block-container").replace(/body/g,".block-container"),E=document.getElementById("astra-block-editor-styles-inline-css")?.textContent.replace(/:root/g,".block-container").replace(/body/g,".block-container");let I="";var $,N,j;if(o&&($=o,N=a?.landscape,o=d?$:0!==Object.keys(u).length&&u.hasOwnProperty(t.category)?N&&0===N.length?$:$.replace(/background-image\s*:\s*url\(['"]?([^'")]+)['"]?\)/g,(function(e,t){if(h(t))return e;if(!N[O]?.url)return"";const r=N[O]?.url;return O++,O%=N.length,'background-image: url("'+r+'")'})):$),I+=s?``:"",I+=``,I=o?`${I} `:I,c&&(I+=``),k&&(I+=``),E&&(I+=``),b&&r){let e=b.shadowRoot;if(null===e&&(e=b.attachShadow({mode:"open"})),null===e)return;let o=r;if(!d){const e=u?u[t.category]:[];e&&Object.keys(e)?.length>0&&Object.keys(e).forEach((t=>{o=null!==e[t]?o.replace(t,e[t]):o})),Object.keys(u).length>0&&u.hasOwnProperty(t.category)&&(j=o,m&&(j=j.replace("contact@example.com",m)),y&&(j=j.replace("202-555-0188",y)),f&&(j=j.replace("2360 Hood Avenue, San Diego, CA, 92123",f)),o=j,o=Z(o))}e.innerHTML=I+'
'+o+"
",i.forEach(((t,r)=>{e?.host.style.setProperty(`--ast-global-color-${r}`,t)}));const s=b.shadowRoot.querySelectorAll("img");e&&(s.forEach((e=>{h(e.src)||d||0===a.landscape.length||0===a.portrait.length||0===Object.keys(u).length||!u.hasOwnProperty(t.category)||F(e,"hidden")})),T(),((e,r)=>{if(d)return;if(0===Object.keys(u).length||!u.hasOwnProperty(t.category))return;const o=r.landscape?r.landscape:[],s=r.portrait?r.portrait:[];0!==o.length&&0!==s.length&&e?.forEach((function(e,t){h(e.src)||(e.onload=()=>{const r=e.getAttribute("src")||"";if(r.includes("unsplash")||r.includes("pexels")||r.includes("pixabay"))return void F(e,_);const n=(e=>{const t=new Image;return t.src=e,t.width>t.height?"landscape":"portrait"})(e.src);let a;if(R=t%o.length,P=t%s.length,a="landscape"===n?o[R]:s[P],void 0!==a)if(a.url.includes("unsplash")||a.url.includes("pexels")||a.url.includes("pixabay")){if("landscape"===n?(R++,R%=o.length):(P++,P%=s.length),"PICTURE"===e.parentNode.nodeName)e.parentNode.querySelectorAll("source").forEach((e=>{e.setAttribute("srcset",a.optimized_url)})),e.parentNode.querySelector("img").setAttribute("src",a.optimized_url);else{const t=document.createElement("img");t.src=a.optimized_url,e.parentNode.replaceChild(t,e)}F(e,_)}else F(e,_);else F(e,_)},e.onerror=()=>{F(e,_)})}))})(s,a))}return()=>{e=!1}}),[t,d,u,p]),(0,n.useEffect)((()=>{const e=new ResizeObserver(T);return e.observe(document.documentElement),()=>{e&&e.disconnect()}}),[]),(0,n.useEffect)((()=>{const e=document.querySelector("#ast-block-templates-modal-wrap");if(!e)return;const t=new MutationObserver(T);return t.observe(e,{childList:!0,attributes:!0,subtree:!0}),()=>{t&&t.disconnect()}}),[]),(0,n.useEffect)((()=>{const e=C?.current;if(e){const t=e.shadowRoot;i.forEach(((e,r)=>{null!==t&&t.host.style.setProperty(`--ast-global-color-${r}`,e)}))}}),[i]);const F=(e,t)=>{e&&(e.style.visibility=t)},Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return f?e.replace(/(]+src="https:\/\/maps\.google\.com\/maps\?q=)([^&]+)(&z=\d+&hl=en&t=m&output=embed&iwloc=near"[^>]*><\/iframe>)/g,`$1${encodeURIComponent(f)}$3`):e};let z=0,D=0;const q=(e,t,r)=>{const o=e.scrollTop,s=t-o;let n=0;const a=function(){n+=20;const t=k.linearTween(n,o,s,r);e.scrollTop=t,n{g||(R=0,P=0,O=0)}),[g]);const L=E?"origin-top-right":"origin-top-left";return React.createElement("div",{className:(0,a.AK)("w-full h-fit p-5",!0===I.importing?"importing":"")},React.createElement("div",{className:"cursor-pointer relative border border-solid border-border-primary hover:border-accent-spectra transition duration-150 ease-in-out overflow-hidden group"},React.createElement("div",{className:`thumbnail left-0 m-0 min-h-[auto] overflow-visible text-left top-0 ${L} relative pointer-events-none`,ref:v},React.createElement("div",{className:"absolute w-[1200px] pointer-events-none max-h-[1600px] overflow-hidden",ref:C},!r&&React.createElement("img",{srcSet:`${j}, ${N}`,src:N,alt:"Preview"}),React.createElement("div",{className:"preview"},React.createElement("span",{className:"ast-block-templates-icon ast-block-templates-icon-search"})))),React.createElement("div",{className:"absolute inset-0 grid grid-cols-1 grid-rows-1 place-items-end",onMouseEnter:()=>{if("page"!==t.type)return;const e=C.current;z&&clearTimeout(z),D=setTimeout((()=>{q(e,e.scrollHeight,4e3)}),1e3)},onMouseLeave:()=>{D&&clearTimeout(D);const e=C.current;z&&clearTimeout(z),q(e,0,1500)}},React.createElement("div",{className:(0,a.AK)("opacity-0 group-hover:opacity-100 w-full flex items-center justify-between px-3 py-2 backdrop-blur-sm bg-white/[0.85] shadow-action-buttons transition-all duration-150 ease-in-out",!0===I.importing?"opacity-100":"")},React.createElement(l.Z,{title:"Insert",liveRequest:!0,item:t,importing:I.importing,onClick:()=>{$({...I,importing:!0})},onBlockImport:()=>{$({...I,importing:!1})}}),React.createElement(b,{item:t})))))})))}}]); ======= "use strict";(self.webpackChunkast_block_templates=self.webpackChunkast_block_templates||[]).push([[191],{6191:function(e,t,r){r.r(t),r.d(t,{default:function(){return C}});var o=r(5711),s=r(5940),n=r(7363),a=r(7009),l=r(5806),c=r(5302),i=r(8096),u=r(10),p=n.forwardRef((function({title:e,titleId:t,...r},o){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},r),e?n.createElement("title",{id:t},e):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"}))})),d=r(6486),g=r(2154),m=r(972);function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{getFilterBlocksByCategory:t,getFilterBlocksPagesByCategory:r}=e("ast-block-templates");return{filterBlocksByCategory:t(),filterBlocksPagesByCategory:r()}})),(0,i.Z)((e=>{const{setFavorites:t,setFilterBlocksByCategory:r,setFilterBlocksPagesByCategory:o}=e("ast-block-templates");return{setFavorites:t,setFilterBlocksByCategory:r,setFilterBlocksPagesByCategory:o}})))((e=>{let{item:t,className:r,setFavorites:o,setFilterBlocksByCategory:s,filterBlocksByCategory:l,filterBlocksPagesByCategory:i,setFilterBlocksPagesByCategory:b,...h}=e;const{favorites:v,currentScreen:k}=(0,c.Z)((e=>{const{getFavorites:t,getCurrentScreen:r}=e("ast-block-templates");return{favorites:t(),currentScreen:r()}})),w="all-blocks-grid"===k?"block":"page",[E,_]=(0,n.useState)(v[w]?.includes(+t.ID));return React.createElement("button",y({className:(0,a.AK)("flex items-center justify-center rounded-full p-2 bg-white cursor-pointer border border-solid border-border-primary focus:outline-none",E?"":"text-icon-secondary",r),onClick:async e=>{e?.preventDefault(),e?.stopPropagation();try{await(0,u.Z)({path:`${f}/wp-json/gutenberg-templates/v1/favorite`,data:{type:t.type,block_id:t.ID,status:!E},method:"POST",headers:{"X-WP-Nonce":ast_block_template_vars.rest_api_nonce,"content-type":"application/json"}})}catch(e){console.error(e)}let r={...v};r=E?{...v,[w]:v[w].filter((e=>e!==(0,d.parseInt)(t.ID)))}:{...v,[w]:[...new Set([...v[w],(0,d.parseInt)(t.ID)])]},_(!E),o(r),r[w].length||"favorite"!==l&&"favorite"!==i||("block"===w&&s(""),"page"===w&&b(""),g.Z.emit("reset-list-count"))}},h),React.createElement(m.Z,{content:E?"Remove from favorites":"Add to favorites"},React.createElement(p,{className:(0,a.AK)("w-5 h-5 transition-colors ease-out duration-150",E?"fill-favorite text-favorite":"hover:fill-favorite hover:text-favorite")})))}));const h=e=>{const t=["skip","logo","fav-icon"];for(const r of t)if(e.includes(r))return!0;return!1},v={linearTween(e,t,r,o){return r*e/o+t},easeInQuad(e,t,r,o){return r*(e/=o)*e+t},easeOutQuad(e,t,r,o){return-r*(e/=o)*(e-2)+t},easeInOutQuad(e,t,r,o){return(e/=o/2)<1?r/2*e*e+t:-r/2*(--e*(e-2)-1)+t},easeInCubic(e,t,r,o){return r*(e/=o)*e*e+t},easeOutCubic(e,t,r,o){return e/=o,r*(--e*e*e+1)+t},easeInOutCubic(e,t,r,o){return(e/=o/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}};Object.seal(v);var k=v;const{spectra_common_styles:w,is_rtl:E}=ast_block_template_vars,_="visible";var C=(0,o.Z)((0,s.Z)((e=>{const{getDisableAi:t,getDisablePreview:r,getTogglePopup:o}=e("ast-block-templates");return{disableAi:t(),disablePreview:r(),togglePopup:o()}})))((0,n.memo)((e=>{let{item:t,content:r,stylesheet:o,astraCustomizer:s,globalStylesheet:c,colorPalette:i,dynamicContent:u,selectedImages:p,disableAi:d,togglePopup:g,email:m,phone:y,address:f}=e;const v=(0,n.useRef)(null),C=(0,n.useRef)(null),B=t["thumbnail-image-url"]||"",x=t["featured-image-url"]||"";let R=0,P=0,O=0;const[I,$]=(0,n.useState)({importing:!1}),[N,S]=(0,n.useState)(`${ast_block_template_vars.uri}dist/placeholder_200_200.png`),[j,A]=(0,n.useState)(`${ast_block_template_vars.uri}dist/placeholder_200_200.png`);function T(){const e=v?.current,t=C?.current;if(!e||!t)return;const r=e.parentNode.offsetWidth/1200,o=r*t.offsetHeight;e.style.transform=`scale(${r})`,e.style.height=`${o}px`}(0,n.useLayoutEffect)((()=>{let e=!0;const n={landscape:[],portrait:[]};p?.forEach((e=>{"landscape"===e.orientation?n.landscape.push(e):n.portrait.push(e)}));const a=n,l=new Image;l.src=B;const g=new Image;g.src=x;const b=C.current;function v(t,r){e&&(t.onload=()=>{r(t.src)})}v(l,S),v(g,A);const k=document.getElementById("astra-wp-editor-styles-inline-css")?.textContent.replace(/:root/g,".block-container").replace(/body/g,".block-container"),E=document.getElementById("astra-block-editor-styles-inline-css")?.textContent.replace(/:root/g,".block-container").replace(/body/g,".block-container");let I="";var $,N,j;if(o&&($=o,N=a?.landscape,o=d?$:0!==Object.keys(u).length&&u.hasOwnProperty(t.category)?N&&0===N.length?$:$.replace(/background-image\s*:\s*url\(['"]?([^'")]+)['"]?\)/g,(function(e,t){if(h(t))return e;if(!N[O]?.url)return"";const r=N[O]?.url;return O++,O%=N.length,'background-image: url("'+r+'")'})):$),I+=s?``:"",I+=``,I=o?`${I} `:I,c&&(I+=``),k&&(I+=``),E&&(I+=``),b&&r){let e=b.shadowRoot;if(null===e&&(e=b.attachShadow({mode:"open"})),null===e)return;let o=r;if(!d){const e=u?u[t.category]:[];e&&Object.keys(e)?.length>0&&Object.keys(e).forEach((t=>{o=null!==e[t]?o.replace(t,e[t]):o})),Object.keys(u).length>0&&u.hasOwnProperty(t.category)&&(j=o,m&&(j=j.replace("contact@example.com",m)),y&&(j=j.replace("202-555-0188",y)),f&&(j=j.replace("2360 Hood Avenue, San Diego, CA, 92123",f)),o=j,o=Z(o))}e.innerHTML=I+'
'+o+"
",i.forEach(((t,r)=>{e?.host.style.setProperty(`--ast-global-color-${r}`,t)}));const s=b.shadowRoot.querySelectorAll("img");e&&(s.forEach((e=>{h(e.src)||d||0===a.landscape.length||0===a.portrait.length||0===Object.keys(u).length||!u.hasOwnProperty(t.category)||F(e,"hidden")})),T(),((e,r)=>{if(d)return;if(0===Object.keys(u).length||!u.hasOwnProperty(t.category))return;const o=r.landscape?r.landscape:[],s=r.portrait?r.portrait:[];0!==o.length&&0!==s.length&&e?.forEach((function(e,t){h(e.src)||(e.onload=()=>{const r=e.getAttribute("src")||"";if(r.includes("unsplash")||r.includes("pexels")||r.includes("pixabay"))return void F(e,_);const n=(e=>{const t=new Image;return t.src=e,t.width>t.height?"landscape":"portrait"})(e.src);let a;if(R=t%o.length,P=t%s.length,a="landscape"===n?o[R]:s[P],void 0!==a)if(a.url.includes("unsplash")||a.url.includes("pexels")||a.url.includes("pixabay")){if("landscape"===n?(R++,R%=o.length):(P++,P%=s.length),"PICTURE"===e.parentNode.nodeName)e.parentNode.querySelectorAll("source").forEach((e=>{e.setAttribute("srcset",a.optimized_url)})),e.parentNode.querySelector("img").setAttribute("src",a.optimized_url);else{const t=document.createElement("img");t.src=a.optimized_url,e.parentNode.replaceChild(t,e)}F(e,_)}else F(e,_);else F(e,_)},e.onerror=()=>{F(e,_)})}))})(s,a))}return()=>{e=!1}}),[t,d,u,p]),(0,n.useEffect)((()=>{const e=new ResizeObserver(T);return e.observe(document.documentElement),()=>{e&&e.disconnect()}}),[]),(0,n.useEffect)((()=>{const e=document.querySelector("#ast-block-templates-modal-wrap");if(!e)return;const t=new MutationObserver(T);return t.observe(e,{childList:!0,attributes:!0,subtree:!0}),()=>{t&&t.disconnect()}}),[]),(0,n.useEffect)((()=>{const e=C?.current;if(e){const t=e.shadowRoot;i.forEach(((e,r)=>{null!==t&&t.host.style.setProperty(`--ast-global-color-${r}`,e)}))}}),[i]);const F=(e,t)=>{e&&(e.style.visibility=t)},Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return f?e.replace(/(]+src="https:\/\/maps\.google\.com\/maps\?q=)([^&]+)(&z=\d+&hl=en&t=m&output=embed&iwloc=near"[^>]*><\/iframe>)/g,`$1${encodeURIComponent(f)}$3`):e};let z=0,D=0;const q=(e,t,r)=>{const o=e.scrollTop,s=t-o;let n=0;const a=function(){n+=20;const t=k.linearTween(n,o,s,r);e.scrollTop=t,n{g||(R=0,P=0,O=0)}),[g]);const L=E?"origin-top-right":"origin-top-left";return React.createElement("div",{className:(0,a.AK)("w-full h-fit p-5",!0===I.importing?"importing":"")},React.createElement("div",{className:(0,a.AK)("cursor-pointer relative border border-solid border-border-primary hover:border-accent-spectra transition duration-150 ease-in-out overflow-hidden group",I.importing&&"border-accent-spectra")},React.createElement("div",{className:`thumbnail left-0 m-0 min-h-[auto] overflow-visible text-left top-0 ${L} relative pointer-events-none`,ref:v},React.createElement("div",{className:"absolute w-[1200px] pointer-events-none max-h-[1600px] overflow-hidden",ref:C},!r&&React.createElement("img",{srcSet:`${j}, ${N}`,src:N,alt:"Preview"}),React.createElement("div",{className:"preview"},React.createElement("span",{className:"ast-block-templates-icon ast-block-templates-icon-search"})))),React.createElement("div",{className:"absolute inset-0 grid grid-cols-1 grid-rows-1 place-items-end",onMouseEnter:()=>{if("page"!==t.type)return;const e=C.current;z&&clearTimeout(z),D=setTimeout((()=>{q(e,e.scrollHeight,4e3)}),1e3)},onMouseLeave:()=>{D&&clearTimeout(D);const e=C.current;z&&clearTimeout(z),q(e,0,1500)}},React.createElement("div",{className:(0,a.AK)("opacity-0 group-hover:opacity-100 w-full flex items-center justify-between px-3 py-2 backdrop-blur-sm bg-white/[0.85] shadow-action-buttons transition-all duration-150 ease-in-out",!0===I.importing?"opacity-100":"")},React.createElement(l.Z,{title:"Insert",liveRequest:!0,item:t,importing:I.importing,onClick:()=>{$({...I,importing:!0})},onBlockImport:()=>{$({...I,importing:!1})}}),React.createElement(b,{item:t})))))})))}}]); >>>>>>> fcf17d42bb7600ec5e85d14217ba2ab162bd9144 >>>>>>> f21e5eda10b9a665d99089dc46926b4fe7ca33af 1.0Moon Monihttps://moonmoni.comMamnoon ul Hussnainhttps://moonmoni.com/author/moonmoni/Mamnoon ul Hussnain - Moon Monirich600338<blockquote class="wp-embedded-content" data-secret="nOh9DL5Xvx"><a href="https://moonmoni.com/mamnoon-ul-hussnain/">Mamnoon ul Hussnain</a></blockquote><iframe sandbox="allow-scripts" security="restricted" src="https://moonmoni.com/mamnoon-ul-hussnain/embed/#?secret=nOh9DL5Xvx" width="600" height="338" title="“Mamnoon ul Hussnain” — Moon Moni" data-secret="nOh9DL5Xvx" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"></iframe><script> /*! This file is auto-generated */ !function(d,l){"use strict";l.querySelector&&d.addEventListener&&"undefined"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i<o.length;i++)o[i].style.display="none";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute("style"),"height"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):"link"===t.message&&(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document); </script> DJW Coaching Consultancy Ad Creatives Results Healing Tree Crystals Ad Creatives Results Scamps and Champs (Pet Store) Ad Creatives Results Chaise Cycliste Coture Ad Creatives http://moonmoni.com/wp-content/uploads/2021/05/kwaitonew.mov Resultshttp://moonmoni.com/wp-content/uploads/2021/05/5-300x300.jpg