????

Your IP : 3.144.181.40


Current Path : /home/multihiv/www/store/wp-content/plugins/woocommerce/assets/client/blocks/
Upload File :
Current File : /home/multihiv/www/store/wp-content/plugins/woocommerce/assets/client/blocks/product-summary.js

(self.webpackChunkwebpackWcBlocksMainJsonp=self.webpackChunkwebpackWcBlocksMainJsonp||[]).push([[3895],{3591:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>E});var n=o(1609),s=o(7723),r=o(851),l=o(6087),a=o(7674),c=o.n(a);const i=["a","b","em","i","strong","p","br"],u=["target","href","rel","name","download"];var d=o(6004);const m=t=>t.replace(/<\/?[a-z][^>]*?>/gi,""),p=(t,e)=>t.replace(/[\s|\.\,]+$/i,"")+e;var y=o(9446);const f=["a","b","em","i","strong","p","br","ul","ol","li","h1","h2","h3","h4","h5","h6","pre","blockquote","img"],h=["target","href","rel","name","download","src","class","alt","style"],g=({source:t,maxLength:e=15,countType:o="words",className:s="",style:r={}})=>{const a=(0,l.useMemo)((()=>((t,e=15,o="words")=>{const n=(0,d.autop)(t);if((0,y.count)(n,o)<=e)return n;const s=(t=>{const e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)})(n);return(0,y.count)(s,o)<=e?s:"words"===o?((t,e,o="&hellip;",n=!0)=>{const s=m(t),r=s.split(" ").splice(0,e).join(" ");return r===s?n?(0,d.autop)(s):s:n?(0,d.autop)(p(r,o)):p(r,o)})(s,e):((t,e,o=!0,n="&hellip;",s=!0)=>{const r=m(t),l=r.slice(0,e);if(l===r)return s?(0,d.autop)(r):r;if(o)return(0,d.autop)(p(l,n));const a=l.match(/([\s]+)/g),c=a?a.length:0,i=r.slice(0,e+c);return s?(0,d.autop)(p(i,n)):p(i,n)})(s,e,"characters_including_spaces"===o)})(t,e,o)),[t,e,o]);return(0,n.createElement)(l.RawHTML,{style:r,className:s},((t,e)=>{const o=(null==e?void 0:e.tags)||i,n=(null==e?void 0:e.attr)||u;return c().sanitize(t,{ALLOWED_TAGS:o,ALLOWED_ATTR:n})})(a,{tags:f,attr:h}))};var v=o(2516),b=o(3993),k=o(2796),w=o(2150),N=o(1616);o(7766);const x=t=>{const{className:e,showDescriptionIfEmpty:o,summaryLength:l,showLink:a,linkText:c,isDescendantOfAllProducts:i,isDescendentOfSingleProductTemplate:u}=t,{parentClassName:d}=(0,k.useInnerBlockLayoutContext)(),{product:m}=(0,k.useProductDataContext)(),p=(0,w.p)(t),y=(t=>{const{isDescendantOfAllProducts:e,summaryLength:o,showDescriptionIfEmpty:n,showLink:s}=t;return e&&(0,b.isEmpty)(o)&&(0,b.isEmpty)(n)&&(0,b.isEmpty)(s)})(t),f=y?150:l,h=!y&&a,N=((t,e)=>{const{short_description:o,description:n}=t;return o||(e&&n?n:"")})(m,!!y||o),x=f||1/0;return m?u?(0,n.createElement)("p",null,(0,s.__)("This block displays the product summary and all its customizations.","woocommerce")):N?(0,n.createElement)(n.Fragment,null,(0,n.createElement)(g,{className:(0,r.A)(e,p.className,"wc-block-components-product-summary",{[`${d}__product-summary`]:d}),source:N,maxLength:x,countType:v.r7.wordCountType||"words",style:p.style}),i&&h&&c?(0,n.createElement)("a",{href:`${m.permalink}#tab-description`},c):null):i?null:(0,n.createElement)("p",null,(0,s.__)("No product summary to show.","woocommerce")):(0,n.createElement)("div",{className:(0,r.A)(e,"wc-block-components-product-summary",{[`${d}__product-summary`]:d})})},E=t=>t.isDescendentOfSingleProductTemplate?(0,n.createElement)(x,{...t}):(0,N.withProductDataContext)(x)(t)},2150:(t,e,o)=>{"use strict";o.d(e,{p:()=>a});var n=o(851),s=o(3993),r=o(3924),l=o(104);const a=t=>{const e=(t=>{const e=(0,s.isObject)(t)?t:{style:{}};let o=e.style;return(0,s.isString)(o)&&(o=JSON.parse(o)||{}),(0,s.isObject)(o)||(o={}),{...e,style:o}})(t),o=(0,l.BK)(e),a=(0,l.aR)(e),c=(0,l.fo)(e),i=(0,r.x)(e);return{className:(0,n.A)(i.className,o.className,a.className,c.className),style:{...i.style,...o.style,...a.style,...c.style}}}},3924:(t,e,o)=>{"use strict";o.d(e,{x:()=>s});var n=o(3993);const s=t=>{const e=(0,n.isObject)(t.style.typography)?t.style.typography:{},o=(0,n.isString)(e.fontFamily)?e.fontFamily:"";return{className:t.fontFamily?`has-${t.fontFamily}-font-family`:o,style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight,letterSpacing:e.letterSpacing,lineHeight:e.lineHeight,textDecoration:e.textDecoration,textTransform:e.textTransform}}}},104:(t,e,o)=>{"use strict";o.d(e,{BK:()=>i,aR:()=>u,fo:()=>d});var n=o(851),s=o(1194),r=o(9786),l=o(3993);function a(t={}){const e={};return(0,r.getCSSRules)(t,{selector:""}).forEach((t=>{e[t.key]=t.value})),e}function c(t,e){return t&&e?`has-${(0,s.c)(e)}-${t}`:""}function i(t){var e,o,s,r,i,u,d;const{backgroundColor:m,textColor:p,gradient:y,style:f}=t,h=c("background-color",m),g=c("color",p),v=function(t){if(t)return`has-${t}-gradient-background`}(y),b=v||(null==f||null===(e=f.color)||void 0===e?void 0:e.gradient);return{className:(0,n.A)(g,v,{[h]:!b&&!!h,"has-text-color":p||(null==f||null===(o=f.color)||void 0===o?void 0:o.text),"has-background":m||(null==f||null===(s=f.color)||void 0===s?void 0:s.background)||y||(null==f||null===(r=f.color)||void 0===r?void 0:r.gradient),"has-link-color":(0,l.isObject)(null==f||null===(i=f.elements)||void 0===i?void 0:i.link)?null==f||null===(u=f.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:a({color:(null==f?void 0:f.color)||{}})}}function u(t){var e;const o=(null===(e=t.style)||void 0===e?void 0:e.border)||{};return{className:function(t){var e;const{borderColor:o,style:s}=t,r=o?c("border-color",o):"";return(0,n.A)({"has-border-color":!!o||!(null==s||null===(e=s.border)||void 0===e||!e.color),[r]:!!r})}(t),style:a({border:o})}}function d(t){var e;return{className:void 0,style:a({spacing:(null===(e=t.style)||void 0===e?void 0:e.spacing)||{}})}}},7766:()=>{}}]);