PluginProbe
bBlocks – Essential Gutenberg Blocks & Patterns Collection / 2.0.42
bBlocks – Essential Gutenberg Blocks & Patterns Collection v2.0.42
2.1.8 2.1.7 2.1.6 2.1.5 2.1.4 2.1.3 2.1.2 2.1.1 2.1.0 2.0.43 2.0.42 2.0.41 2.0.40 2.0.39 2.0.38 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 1.5.2 1.5.3 All 108 releases
b-blocks / build / whatsapp-chat / view.js

view.js in bBlocks – Essential Gutenberg Blocks & Patterns Collection 2.0.42, at build/whatsapp-chat/view.js

1 lines 9.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";var t={5338:(t,e,n)=>{var o=n(5795);e.H=o.createRoot,o.hydrateRoot},5795:t=>{t.exports=window.ReactDOM}},e={};const n=window.React;var o=function n(o){var r=e[o];if(void 0!==r)return r.exports;var a=e[o]={exports:{}};return t[o](a,a.exports,n),a.exports}(5338);const r="@media only screen and (max-width: 1024px)",a="@media only screen and (max-width: 640px)",s="linear-gradient(135deg, #0040E3, #18D4FD)",l=(t,e,n=!1)=>{return null==(o=e)||""===o||Array.isArray(o)&&0===o.length||"object"==typeof o&&0===Object.keys(o).length||"string"==typeof o&&""===o.trim()||"number"==typeof o&&0===o?"":`${t}: ${e}${n?" !important":""};`;var o},c=(t,e=!0,n=!0,o=!0)=>{const{type:r="solid",color:a="",gradient:c=s,image:i={},position:p="center center",attachment:b="",repeat:d="no-repeat",size:h="",overlayColor:m=""}=t||{};return"gradient"===r&&n?l("background",c):"image"===r&&o?`background: url(${i?.url});\n\t\t\t\t${l("background-color",m)}\n\t\t\t\t${l("background-position",p)}\n\t\t\t\t${l("background-size",h)}\n\t\t\t\t${l("background-repeat",d)}\n\t\t\t\t${l("background-attachment",b)}\n\t\t\t\t${l("background-repeat",d)}\n\t\t\t\tbackground-blend-mode: overlay;`:e&&l("background",a)},i=t=>{if(!t)return"";const e=t=>{const{color:e="#000000",style:n="solid",width:o="0px"}=t;return`${o} ${n} ${e}`};return"object"!=typeof t||Array.isArray(t)?"":t.hasOwnProperty("top")||t.hasOwnProperty("right")||t.hasOwnProperty("bottom")||t.hasOwnProperty("left")?["top","right","bottom","left"].map((n=>t[n]?`border-${n}: ${e(t[n])};`:"")).join(" ").trim():l("border",e(t))},p=(t,e="box")=>{const{hOffset:n="0px",vOffset:o="0px",blur:r="0px",spreed:a="0px",color:s="#7090b0",isInset:l=!1}=t||{},c=`${n} ${o} ${r}`;return("text"===e?`${c} ${s}`:`${c} ${a} ${s} ${l?"inset":""}`)||"none"},b=(t,e,n=!0)=>{const{fontFamily:o="Default",fontCategory:s="sans-serif",fontVariant:c=400,fontWeight:i,isUploadFont:p=!0,fontSize:b={desktop:null,tablet:null,mobile:null},fontStyle:d,textTransform:h,textDecoration:m,lineHeight:$,letterSpace:u}=e||{},g=!n||!o||"Default"===o,w=b?.desktop||b,k=b?.tablet||w,f=b?.mobile||k,y=t=>{const e=String(t);return["px","em","rem","%","vh","vw"].some((t=>e.endsWith(t)))?e:"number"==typeof t?`${e}px`:""},x=`\n\t\t${g?"":`font-family: '${o}', ${s};`}\n\t\t${l("font-weight",i)}\n\t\t${l("font-size",y(w))}\n\t\t${l("font-style",d)}\n\t\t${l("text-transform",h)}\n\t\t${l("text-decoration",m)}\n\t\t${l("line-height",$)}\n\t\t${l("letter-spacing",u)}\n\t`,v=c&&400!==c?"400i"===c?":ital@1":c?.includes("00i")?`: ital, wght@1, ${c?.replace("00i","00")} `:`: wght@${c} `:"",B=g?"":`https://fonts.googleapis.com/css2?family=${o?.split(" ").join("+")}${v.replace(/ /g,"")}&display=swap`;return{googleFontLink:!p||g?"":`@import url(${B});`,styles:`${t}{\n\t\t\t${x}\n\t\t}\n\t\t${r} {\n\t\t\t${t}{\n\t\t\t\t${l("font-size",y(k))}\n\t\t\t}\n\t\t}\n\t\t${a} {\n\t\t\t${t}{\n\t\t\t\t${l("font-size",y(f))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},d=t=>{if(!t)return"";if("string"==typeof t)return t;if("object"==typeof t&&!Array.isArray(t)){const e=["top","right","bottom","left"];return e.map((e=>t[e]||"")).every((t=>!t))?"":e.map((e=>t[e]||"0")).join(" ")}return""},h=({attributes:t,id:e})=>{const{alignment:o,styles:s}=t,{normal:h,hover:m,desktop:$,tablet:u,mobile:g,typo:w}=s,k=`#${e}.wp-block-b-blocks-whatsapp-chat`,f=`${k} .bBlocks-whatsapp-block-wrapper`,y=`${k} .bBlocks-whatsapp-block-btn`,x=`${y}.bBlocks-whatsapp-block-btn--pulse`,v=`${y} .bBlocks-whatsapp-block-btn__text`,B=`${y} .bBlocks-whatsapp-block-btn__icon`,z=`${y} .bBlocks-whatsapp-block-btn__status-dot`;return(0,n.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n\n\t\t${b("",w).googleFontLink}\n\t\t${b(v,w).styles}\n\n\t\t${f}{\n\t\t\t${l("align-items",o)}\n\t\t}\n\n\t\t${x} {\n\t\t\tanimation: bBlocks-whatsapp-block-pulse 2s infinite;\n\t\t}\n\n\t\t@keyframes bBlocks-whatsapp-block-pulse {\n\t\t\t0% {\n\t\t\t\tbox-shadow: 0 0 0 0 ${s.pulseColor};\n\t\t\t}\n\n\t\t\t70% {\n\t\t\t\tbox-shadow: 0 0 0 12px rgba(37, 211, 102, 0);\n\t\t\t}\n\n\t\t\t100% {\n\t\t\t\tbox-shadow: 0 0 0 0 rgba(37, 211, 102, 0);\n\t\t\t}\n\t\t}\n\n\t\t${y}{\n\t\t\t${l("margin",d($.margin))}\n\t\t\t${l("padding",d($.padding))}\n\t\t\t${c(h.bg)}\n\t\t\t${l("color",h.color)}\n\t\t\t${i(h.border)}\n\t\t\t${l("border-radius",d(h.radius))}\n\t\t\t${p(h.shadow)}\n\t\t\ttransition: all ${m.transition}s ease-in-out;\n\t\t}\n\t\t${y}:hover{\n\t\t\t${c(m.bg)}\n\t\t\t${i(m.border)}\n\t\t\t${l("color",m.color)}\n\t\t\t${l("border-radius",d(m.radius))}\n\t\t\t${p(m.shadow)}\n\t\t}\n\n\t\t${v}{\n\t\t\t${l("color",h.color)}\n\t\t}\n\n\t\t${y}:hover .bBlocks-whatsapp-block-btn__text{\n\t\t\t${l("color",m.color)}\n\t\t}\n\n\t\t${B}>svg{\n\t\t\t${l("width",s.icon.size)}\n\t\t\t${l("fill",s.icon.normal.color)}\n\t\t}\n\n\t\t${y}:hover .bBlocks-whatsapp-block-btn__icon>svg{\n\t\t\t${l("fill",s.icon.hover.color)}\n\t\t}\n\t\t\n\t\t${z}{\n\t\t\t${c(s.status.color)}\n\t\t\t${l("width",s.status.size)}\n\t\t\t${l("height",s.status.size)}\n\t\t\t${l("left",s.status.position.x)}\n\t\t\t${l("top",s.status.position.y)}\n\t\t}\n\t\t\n\t\t${r}{\n\t\t\t${y}{\n\t\t\t\t${l("margin",d(u.margin))}\n\t\t\t\t${l("padding",d(u.padding))}\n\t\t\t}\n\t\t}\n\t\t${a}{\n\t\t\t${y}{\n\t\t\t\t${l("margin",d(g.margin))}\n\t\t\t\t${l("padding",d(g.padding))}\n\t\t\t}\n\t\t}\n\t\t\n\t\t`.replace(/\s+/g," ")}})},m=(0,n.createElement)("span",{className:"bBlocks-whatsapp-block-btn__icon","aria-hidden":"true"},(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor"},(0,n.createElement)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"}))),$=((0,n.createElement)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)("path",{d:"M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"})),(0,n.createElement)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)("path",{d:"M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z"})),(0,n.createElement)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)("path",{d:"M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"})),({attributes:t})=>{const{phoneNumber:e,buttonText:o,prefillMessage:r,showIcon:a,showStatusDot:s,tooltipText:l,buttonSize:c,hoverAnimation:i,openInNewTab:p,fullWidth:b,iconPosition:d,shadow:h,pulseAnimation:$}=t,u={small:"bBlocks-whatsapp-block-btn--small",medium:"bBlocks-whatsapp-block-btn--medium",large:"bBlocks-whatsapp-block-btn--large"},g=["bBlocks-whatsapp-block-btn",u[c]||u.medium,b?"bBlocks-whatsapp-block-btn--full":"",i?"bBlocks-whatsapp-block-btn--hover-anim":"",h?"bBlocks-whatsapp-block-btn--shadow":"",$?"bBlocks-whatsapp-block-btn--pulse":""].filter(Boolean).join(" ");let w="https://wa.me/";return e&&(w+=encodeURIComponent(e)),r&&(w+="?text="+encodeURIComponent(r)),(0,n.createElement)("div",null,(0,n.createElement)("span",{className:"bBlocks-whatsapp-block-wrapper"},(0,n.createElement)("a",{href:w,className:g,target:p?"_blank":void 0,rel:p?"noopener noreferrer":void 0,role:"button","aria-label":o,"data-tooltip":l||void 0},a&&"left"===d&&m,(0,n.createElement)("span",{className:"bBlocks-whatsapp-block-btn__text"},o),a&&"right"===d&&m,s&&(0,n.createElement)("span",{className:"bBlocks-whatsapp-block-btn__status-dot","aria-hidden":"true"})),l&&(0,n.createElement)("span",{className:"bBlocks-whatsapp-block-tooltip","aria-hidden":"true"},l)))});document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-whatsapp-chat").forEach((t=>{const e=JSON.parse(t.dataset.attributes);(0,o.H)(t).render((0,n.createElement)(n.Fragment,null,(0,n.createElement)(h,{attributes:e,id:t.id}),(0,n.createElement)($,{attributes:e}))),t?.removeAttribute("data-attributes")}))}))})();