1 line
3.4 KiB
JavaScript
1 line
3.4 KiB
JavaScript
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[67],{113:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n(102);var c=n(46);const s=()=>c.m>1},137:function(t,e,n){"use strict";n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return i})),n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return p}));var c=n(72),s=n(113),r=n(52),o=n(20);const a=t=>Object(r.a)(t)?JSON.parse(t)||{}:Object(o.a)(t)?t:{},u=t=>{if(!Object(s.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(o.a)(t)?t:{},n=a(e.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...e,style:n})},i=t=>{const e=Object(o.a)(t)?t:{},n=a(e.style),c=Object(o.a)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:e.fontFamily}}},l=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(o.a)(t)?t:{},n=a(e.style);return Object(c.__experimentalUseColorProps)({...e,style:n})},p=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(o.a)(t)?t:{},n=a(e.style);return Object(c.__experimentalUseBorderProps)({...e,style:n})}},20:function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return s}));const c=t=>!(t=>null===t)(t)&&t instanceof Object&&t.constructor===Object;function s(t,e){return c(t)&&e in t}},291:function(t,e,n){"use strict";var c=n(0),s=n(114),r=n(115);const o=t=>{const e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)},a=t=>t.replace(/<\/?[a-z][^>]*?>/gi,""),u=(t,e)=>t.replace(/[\s|\.\,]+$/i,"")+e,i=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const c=a(t),s=c.split(" ").splice(0,e).join(" ");return Object(r.autop)(u(s,n))},l=function(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const s=a(t),o=s.slice(0,e);if(n)return Object(r.autop)(u(o,c));const i=o.match(/([\s]+)/g),l=i?i.length:0,p=s.slice(0,e+l);return Object(r.autop)(u(p,c))};e.a=t=>{let{source:e,maxLength:n=15,countType:a="words",className:u="",style:p={}}=t;const f=Object(c.useMemo)(()=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const c=Object(r.autop)(t),a=Object(s.count)(c,n);if(a<=e)return c;const u=o(c),p=Object(s.count)(u,n);return p<=e?u:"words"===n?i(u,e):l(u,e,"characters_including_spaces"===n)}(e,n,a),[e,n,a]);return Object(c.createElement)(c.RawHTML,{style:p,className:u},f)}},355:function(t,e){},407:function(t,e,n){"use strict";n.r(e);var c=n(0),s=n(5),r=n.n(s),o=n(291),a=n(46),u=n(45),i=n(120),l=(n(355),n(137));e.default=Object(i.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:n}=Object(u.useInnerBlockLayoutContext)(),{product:s}=Object(u.useProductDataContext)(),i=Object(l.b)(t),p=Object(l.d)(t);if(!s)return Object(c.createElement)("div",{className:r()(e,"wc-block-components-product-summary",{[n+"__product-summary"]:n})});const f=s.short_description?s.short_description:s.description;return f?Object(c.createElement)(o.a,{className:r()(e,i.className,"wc-block-components-product-summary",{[n+"__product-summary"]:n}),source:f,maxLength:150,countType:a.n.wordCountType||"words",style:{...i.style,...p.style}}):null})}}]); |